@timber-js/app 0.2.0-alpha.227 → 0.2.0-alpha.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-skill.md +9 -0
- package/dist/_chunks/{actions-B1xSIv32.js → actions-DHum77eH.js} +3 -3
- package/dist/_chunks/{actions-B1xSIv32.js.map → actions-DHum77eH.js.map} +1 -1
- package/dist/_chunks/{cache-api-DsSXA4Sp.js → cache-api-BZJNt01a.js} +4 -4
- package/dist/_chunks/{cache-api-DsSXA4Sp.js.map → cache-api-BZJNt01a.js.map} +1 -1
- package/dist/_chunks/{chains-Dgm3PrMe.js → chains-D-RRc7CM.js} +2 -2
- package/dist/_chunks/{chains-Dgm3PrMe.js.map → chains-D-RRc7CM.js.map} +1 -1
- package/dist/_chunks/chains-KblEfYzm.js +1 -0
- package/dist/_chunks/{classify--_kINHQV.js → classify-_W0RWa5w.js} +2 -2
- package/dist/_chunks/{classify--_kINHQV.js.map → classify-_W0RWa5w.js.map} +1 -1
- package/dist/_chunks/{cli-check-B33yhAPa.js → cli-check-B-JZkpBD.js} +3 -3
- package/dist/_chunks/{cli-check-B33yhAPa.js.map → cli-check-B-JZkpBD.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-DIPurq7X.js → cli-schema-sync-CAllbqRB.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-DIPurq7X.js.map → cli-schema-sync-CAllbqRB.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-uq72EZmD.js → cli-schema-sync-y_8ijmzO.js} +1 -1
- package/dist/_chunks/{client-dep-entries-CP7AkMCM.js → client-dep-entries-C9hv-3k9.js} +2 -2
- package/dist/_chunks/{client-dep-entries-CP7AkMCM.js.map → client-dep-entries-C9hv-3k9.js.map} +1 -1
- package/dist/_chunks/{convention-lint-hZwz5wd4.js → convention-lint-CrDKERHg.js} +4 -13
- package/dist/_chunks/convention-lint-CrDKERHg.js.map +1 -0
- package/dist/_chunks/dev-server-L8biS7Az.js +1 -0
- package/dist/_chunks/{dev-server-B7o4As0l.js → dev-server-Rq659RR1.js} +8 -2
- package/dist/_chunks/dev-server-Rq659RR1.js.map +1 -0
- package/dist/_chunks/{build-manifest-Y4jl7nwU.js → dev-span-_NzMX-au.js} +25 -2
- package/dist/_chunks/dev-span-_NzMX-au.js.map +1 -0
- package/dist/_chunks/{error-boundary-D3YyVVuP.js → error-boundary-OHK1mI99.js} +3 -3
- package/dist/_chunks/{error-boundary-D3YyVVuP.js.map → error-boundary-OHK1mI99.js.map} +1 -1
- package/dist/_chunks/{flight-source-node-0Tp6evlz.js → flight-source-node-BGanuoSS.js} +2 -2
- package/dist/_chunks/{flight-source-node-0Tp6evlz.js.map → flight-source-node-BGanuoSS.js.map} +1 -1
- package/dist/_chunks/{global-context-DbxNWeBP.js → global-context-CFSSysdJ.js} +32 -2
- package/dist/_chunks/global-context-CFSSysdJ.js.map +1 -0
- package/dist/_chunks/{json-lossy-check-DVkLUlfC.js → json-lossy-check-BXM45k8p.js} +2 -2
- package/dist/_chunks/{json-lossy-check-DVkLUlfC.js.map → json-lossy-check-BXM45k8p.js.map} +1 -1
- package/dist/_chunks/{live-graph-BcVjQ1Te.js → live-graph-C7-yA8W9.js} +4 -4
- package/dist/_chunks/{live-graph-BcVjQ1Te.js.map → live-graph-C7-yA8W9.js.map} +1 -1
- package/dist/_chunks/{logger-CWk44DLp.js → logger-YtMSKfft.js} +103 -60
- package/dist/_chunks/logger-YtMSKfft.js.map +1 -0
- package/dist/_chunks/navigation-root-CoGHIMiE.js +239 -0
- package/dist/_chunks/navigation-root-CoGHIMiE.js.map +1 -0
- package/dist/_chunks/{node-response-B9aviPDa.js → node-response-D3hXWb8y.js} +2 -2
- package/dist/_chunks/{node-response-B9aviPDa.js.map → node-response-D3hXWb8y.js.map} +1 -1
- package/dist/_chunks/{poison-scan-DJYxZc_7.js → poison-scan-CRSP06Es.js} +2 -2
- package/dist/_chunks/{poison-scan-DJYxZc_7.js.map → poison-scan-CRSP06Es.js.map} +1 -1
- package/dist/_chunks/route-methods-Dk2kZc0n.js +36 -0
- package/dist/_chunks/route-methods-Dk2kZc0n.js.map +1 -0
- package/dist/_chunks/{scanner-CJC-ScJU.js → scanner-BNQ4qnLX.js} +2 -2
- package/dist/_chunks/{scanner-CJC-ScJU.js.map → scanner-BNQ4qnLX.js.map} +1 -1
- package/dist/_chunks/segment-context-GAyTjjtS.js +33 -0
- package/dist/_chunks/segment-context-GAyTjjtS.js.map +1 -0
- package/dist/_chunks/{sizeof-DG4W40lv.js → sizeof-Cmx6Fs-Y.js} +2 -2
- package/dist/_chunks/{sizeof-DG4W40lv.js.map → sizeof-Cmx6Fs-Y.js.map} +1 -1
- package/dist/_chunks/{status-page-marker-C8POawuF.js → status-page-marker-U6B1aFMb.js} +3 -32
- package/dist/_chunks/status-page-marker-U6B1aFMb.js.map +1 -0
- package/dist/_chunks/{walkers-DIE203ir.js → walkers-D_QHR_nf.js} +3 -3
- package/dist/_chunks/{walkers-DIE203ir.js.map → walkers-D_QHR_nf.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/index.js +2 -2
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/client/browser-entry/hmr.d.ts +7 -1
- package/dist/client/browser-entry/hmr.d.ts.map +1 -1
- package/dist/client/dev-pill/index.d.ts +32 -0
- package/dist/client/dev-pill/index.d.ts.map +1 -0
- package/dist/client/dev-pill/store.d.ts +96 -0
- package/dist/client/dev-pill/store.d.ts.map +1 -0
- package/dist/client/dev-pill/view.d.ts +9 -0
- package/dist/client/dev-pill/view.d.ts.map +1 -0
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/internal.js +16 -7
- package/dist/client/internal.js.map +1 -1
- package/dist/client/navigation-context.d.ts +20 -0
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/router-lifecycle.d.ts +4 -1
- package/dist/client/router-lifecycle.d.ts.map +1 -1
- package/dist/client/use-pending-navigation.d.ts +33 -9
- package/dist/client/use-pending-navigation.d.ts.map +1 -1
- package/dist/config-types.d.ts +10 -0
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/dev-tools/await-span.d.ts +17 -0
- package/dist/dev-tools/await-span.d.ts.map +1 -0
- package/dist/dev-tools/instrumentation.d.ts.map +1 -1
- package/dist/dev-tools/logger.d.ts.map +1 -1
- package/dist/dev-tools/logs.d.ts.map +1 -1
- package/dist/dev-tools/span-sink.d.ts +42 -0
- package/dist/dev-tools/span-sink.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +282 -9
- package/dist/index.js.map +1 -1
- package/dist/plugins/dev-await.d.ts +40 -0
- package/dist/plugins/dev-await.d.ts.map +1 -0
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/csrf.d.ts +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.d.ts +2 -1
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +26 -27
- package/dist/server/internal.js.map +1 -1
- package/dist/server/pipeline.d.ts +8 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts +1 -2
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-methods.d.ts +23 -0
- package/dist/server/route-methods.d.ts.map +1 -0
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/tracing.d.ts +18 -8
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/shared/dev-span.d.ts +97 -0
- package/dist/shared/dev-span.d.ts.map +1 -0
- package/docs/api/31-api-client.mdx +27 -1
- package/docs/api/34-api-config.mdx +21 -1
- package/docs/learn/09-streaming.mdx +7 -1
- package/package.json +3 -3
- package/src/client/browser-entry/hmr.ts +13 -1
- package/src/client/browser-entry/index.ts +4 -1
- package/src/client/dev-pill/index.ts +128 -0
- package/src/client/dev-pill/store.ts +231 -0
- package/src/client/dev-pill/view.ts +278 -0
- package/src/client/index.ts +1 -0
- package/src/client/navigation-context.ts +5 -2
- package/src/client/router-lifecycle.ts +23 -3
- package/src/client/use-pending-navigation.ts +93 -14
- package/src/config-types.ts +10 -0
- package/src/config-validation.ts +10 -0
- package/src/dev-tools/await-span.ts +40 -0
- package/src/dev-tools/instrumentation.ts +20 -0
- package/src/dev-tools/logger.ts +3 -37
- package/src/dev-tools/logs.ts +10 -1
- package/src/dev-tools/span-sink.ts +132 -0
- package/src/index.ts +2 -0
- package/src/plugins/dev-await.ts +268 -0
- package/src/plugins/entries.ts +2 -0
- package/src/routing/convention-lint.ts +1 -3
- package/src/server/action-handler.ts +5 -0
- package/src/server/csrf.ts +11 -3
- package/src/server/internal.ts +2 -1
- package/src/server/pipeline.ts +14 -0
- package/src/server/route-handler.ts +8 -19
- package/src/server/route-methods.ts +37 -0
- package/src/server/rsc-entry/index.ts +7 -1
- package/src/server/slot-resolver.ts +45 -5
- package/src/server/tracing.ts +124 -90
- package/src/shared/dev-span.ts +182 -0
- package/dist/_chunks/build-manifest-Y4jl7nwU.js.map +0 -1
- package/dist/_chunks/chains-CwOr3Myj.js +0 -1
- package/dist/_chunks/convention-lint-hZwz5wd4.js.map +0 -1
- package/dist/_chunks/dev-server-B7o4As0l.js.map +0 -1
- package/dist/_chunks/dev-server-hZzmbMvK.js +0 -1
- package/dist/_chunks/global-context-DbxNWeBP.js.map +0 -1
- package/dist/_chunks/logger-CWk44DLp.js.map +0 -1
- package/dist/_chunks/navigation-root-M3B2ZrdO.js +0 -122
- package/dist/_chunks/navigation-root-M3B2ZrdO.js.map +0 -1
- package/dist/_chunks/segment-context-CYiGTi3K.js +0 -131
- package/dist/_chunks/segment-context-CYiGTi3K.js.map +0 -1
- package/dist/_chunks/status-page-marker-C8POawuF.js.map +0 -1
|
@@ -80,6 +80,29 @@ function collectRouteModulepreloads(segments, manifest) {
|
|
|
80
80
|
}
|
|
81
81
|
return result;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
// src/shared/dev-span.ts
|
|
84
|
+
/**
|
|
85
|
+
* The wire contract between the dev server's span sink and the dev request
|
|
86
|
+
* pill in the browser. Dev-only; see design/50-dev-request-pill.md.
|
|
87
|
+
*
|
|
88
|
+
* Isomorphic: no server, client, or build-time imports.
|
|
89
|
+
*/
|
|
90
|
+
/** HMR event that carries one finished span to the browser. */
|
|
91
|
+
var DEV_SPAN_EVENT = "timber:span";
|
|
92
|
+
/** HMR event a tab sends to ask for a trace's spans that ended before it connected. */
|
|
93
|
+
var DEV_SPAN_REPLAY_EVENT = "timber:span-replay";
|
|
94
|
+
/**
|
|
95
|
+
* `globalThis` key holding the span sink. The dev server plugin installs it
|
|
96
|
+
* and `DevSpanProcessor` (RSC module graph, same process, separate module
|
|
97
|
+
* instances) reads it, so the hand-off is a `Symbol.for` global.
|
|
98
|
+
*/
|
|
99
|
+
var DEV_SPAN_SINK_KEY = Symbol.for("timber.dev.span-sink");
|
|
100
|
+
/** The `Server-Timing` metric whose `desc` is the response's trace ID. */
|
|
101
|
+
var TRACE_TIMING_NAME = "timber-trace";
|
|
102
|
+
/** The `Server-Timing` entry that carries a trace ID. */
|
|
103
|
+
function traceTimingEntry(traceId) {
|
|
104
|
+
return `${TRACE_TIMING_NAME};desc="${traceId}"`;
|
|
105
|
+
}
|
|
106
|
+
export { EMPTY_BUILD_MANIFEST as a, collectRouteModulepreloads as c, traceTimingEntry as i, DEV_SPAN_REPLAY_EVENT as n, collectRouteCss as o, DEV_SPAN_SINK_KEY as r, collectRouteFonts as s, DEV_SPAN_EVENT as t };
|
|
84
107
|
|
|
85
|
-
//# sourceMappingURL=
|
|
108
|
+
//# sourceMappingURL=dev-span-_NzMX-au.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-span-_NzMX-au.js","names":[],"sources":["../../src/server/build-manifest.ts","../../src/shared/dev-span.ts"],"sourcesContent":["/**\n * Build manifest types and utilities for CSS and JS asset tracking.\n *\n * The build manifest maps route segment file paths to their output\n * chunks from Vite's client build. This enables:\n * - <link rel=\"stylesheet\"> injection in HTML <head>\n * - <script type=\"module\"> with hashed URLs in production\n * - <link rel=\"modulepreload\"> for client chunk dependencies\n * - Link preload headers for Early Hints (103)\n *\n * In dev mode, Vite's HMR client handles CSS/JS injection, so the build\n * manifest is empty. In production, it's populated from Vite's\n * .vite/manifest.json after the client build.\n *\n * Design docs: 18-build-system.md §\"Build Manifest\", 02-rendering-pipeline.md §\"Early Hints\"\n */\n\n/** A font asset entry in the build manifest. */\nexport interface ManifestFontEntry {\n /** URL path to the font file (e.g. `/_timber/fonts/inter-latin-400-abc123.woff2`). */\n href: string;\n /** Font format (e.g. `woff2`). */\n format: string;\n /** Crossorigin attribute — always `anonymous` for fonts. */\n crossOrigin: string;\n}\n\n/** Build manifest mapping input file paths to output asset URLs. */\nexport interface BuildManifest {\n /** Map from input file path (relative to project root) to output CSS URLs. */\n css: Record<string, string[]>;\n /** Map from input file path to output JS chunk URL (hashed filename). */\n js: Record<string, string>;\n /** Map from input file path to transitive JS dependency URLs for modulepreload. */\n modulepreload: Record<string, string[]>;\n /** Map from input file path to font assets used by that module. */\n fonts: Record<string, ManifestFontEntry[]>;\n /**\n * Cache-busting hashes for metadata route files (opengraph-image, etc.).\n * Map from file path (relative to project root) to short content hash.\n * In dev mode this is empty — a startup nonce is used instead.\n */\n metadataRouteHashes?: Record<string, string>;\n /**\n * Static request-dependency map from the Vite plugin's module-graph analysis.\n * Map from segment entry file path to whether it's request-dependent.\n * Used by buildSegmentInfo() for X-Timber-Segments in production.\n */\n requestDep?: Record<string, boolean>;\n}\n\n/**\n * Empty build manifest used in dev mode, and the single source of truth for\n * what an empty manifest contains.\n *\n * `virtual:timber-build-manifest` serializes this constant into its generated\n * source rather than restating it — one literal for the dev module, one for the\n * production module's `globalThis.__TIMBER_BUILD_MANIFEST__ ?? …` fallback.\n * They were three hand-written objects that had already drifted: this one and\n * the dev literal were missing `requestDep` while the production fallback had\n * it, so a reader who grepped the built bundle for `requestDep` found the one\n * copy that mentioned it and read the fallback as the shipped map (TIM-1300).\n * A field added here now reaches every copy.\n */\nexport const EMPTY_BUILD_MANIFEST: BuildManifest = {\n css: {},\n js: {},\n modulepreload: {},\n fonts: {},\n metadataRouteHashes: {},\n requestDep: {},\n};\n\n/** Segment shape expected by collectRouteCss (matches ManifestSegmentNode). */\ninterface SegmentWithFiles {\n layout?: { filePath: string };\n page?: { filePath: string };\n}\n\n/**\n * Collect all CSS files needed for a matched route's segment chain.\n *\n * Walks segments root → leaf, collecting CSS for each layout and page.\n * Deduplicates while preserving order (root layout CSS first).\n */\nexport function collectRouteCss(segments: SegmentWithFiles[], manifest: BuildManifest): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n for (const segment of segments) {\n for (const file of [segment.layout, segment.page]) {\n if (!file) continue;\n const cssFiles = manifest.css[file.filePath];\n if (!cssFiles) continue;\n for (const url of cssFiles) {\n if (!seen.has(url)) {\n seen.add(url);\n result.push(url);\n }\n }\n }\n }\n\n return result;\n}\n\n/**\n * Generate <link rel=\"stylesheet\"> tags for CSS URLs.\n *\n * Returns an HTML string to prepend to headHtml for injection\n * via injectHead() before </head>.\n */\nexport function buildCssLinkTags(cssUrls: string[]): string {\n // Emit only <link rel=\"stylesheet\"> — no preload tags. CSS preloading\n // is handled by 103 Early Hints (Link header) which fires before the\n // HTML stream. Float also emits `<link rel=\"stylesheet\" data-precedence>`\n // at the top of <head> during Fizz rendering — the browser discovers\n // CSS from that tag. A <link rel=\"preload\"> here would arrive *after*\n // Float's stylesheet tag and trigger \"Preload was ignored\" warnings.\n return cssUrls.map((url) => `<link rel=\"stylesheet\" href=\"${url}\">`).join('');\n}\n\n// ─── Font utilities ──────────────────────────────────────────────────────\n\n/**\n * Collect all font entries needed for a matched route's segment chain.\n *\n * Walks segments root → leaf, collecting fonts for each layout and page.\n * Deduplicates by href while preserving order.\n */\nexport function collectRouteFonts(\n segments: SegmentWithFiles[],\n manifest: BuildManifest\n): ManifestFontEntry[] {\n const seen = new Set<string>();\n const result: ManifestFontEntry[] = [];\n\n for (const segment of segments) {\n for (const file of [segment.layout, segment.page]) {\n if (!file) continue;\n const fonts = manifest.fonts[file.filePath];\n if (!fonts) continue;\n for (const entry of fonts) {\n if (!seen.has(entry.href)) {\n seen.add(entry.href);\n result.push(entry);\n }\n }\n }\n }\n\n return result;\n}\n\n/**\n * Generate <link rel=\"preload\"> tags for font assets.\n *\n * Font preloads use `as=font` and always include `crossorigin` (required\n * for font preloads even for same-origin resources per the spec).\n */\nexport function buildFontPreloadTags(fonts: ManifestFontEntry[]): string {\n return fonts\n .map(\n (f) =>\n `<link rel=\"preload\" href=\"${f.href}\" as=\"font\" type=\"font/${f.format}\" crossorigin=\"${f.crossOrigin}\">`\n )\n .join('');\n}\n\n// ─── JS chunk utilities ──────────────────────────────────────────────────\n\n/**\n * Collect modulepreload URLs for a matched route's segment chain.\n *\n * Walks segments root → leaf, collecting transitive JS dependencies\n * for each layout and page. Deduplicates across segments.\n */\nexport function collectRouteModulepreloads(\n segments: SegmentWithFiles[],\n manifest: BuildManifest\n): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n\n for (const segment of segments) {\n for (const file of [segment.layout, segment.page]) {\n if (!file) continue;\n const preloads = manifest.modulepreload[file.filePath];\n if (!preloads) continue;\n for (const url of preloads) {\n if (!seen.has(url)) {\n seen.add(url);\n result.push(url);\n }\n }\n }\n }\n\n return result;\n}\n\n/**\n * Generate <link rel=\"modulepreload\"> tags for JS dependency URLs.\n *\n * Modulepreload hints tell the browser to fetch and parse JS modules\n * before they're needed, reducing waterfall latency for dynamic imports.\n */\nexport function buildModulepreloadTags(urls: string[]): string {\n return urls.map((url) => `<link rel=\"modulepreload\" href=\"${url}\">`).join('');\n}\n","/**\n * The wire contract between the dev server's span sink and the dev request\n * pill in the browser. Dev-only; see design/50-dev-request-pill.md.\n *\n * Isomorphic: no server, client, or build-time imports.\n */\n\n/** HMR event that carries one finished span to the browser. */\nexport const DEV_SPAN_EVENT = 'timber:span';\n\n/** HMR event a tab sends to ask for a trace's spans that ended before it connected. */\nexport const DEV_SPAN_REPLAY_EVENT = 'timber:span-replay';\n\n/**\n * `globalThis` key holding the span sink. The dev server plugin installs it\n * and `DevSpanProcessor` (RSC module graph, same process, separate module\n * instances) reads it, so the hand-off is a `Symbol.for` global.\n */\nexport const DEV_SPAN_SINK_KEY = Symbol.for('timber.dev.span-sink');\n\n/** The `Server-Timing` metric whose `desc` is the response's trace ID. */\nexport const TRACE_TIMING_NAME = 'timber-trace';\n\n/**\n * `globalThis` key holding the dev await wrapper. The dev await transform\n * (`plugins/dev-await.ts`) rewrites `await x` in app server code to call\n * it, looked up at call time; dev tracing installs it. With nothing\n * installed the call is a plain await. See design/50-dev-request-pill.md\n * §\"Phase 2\".\n */\nexport const DEV_AWAIT_KEY = Symbol.for('timber.dev.await');\n\n/** Span name for one awaited call in app server code. */\nexport const AWAIT_SPAN_NAME = 'timber.await';\n\n/**\n * Await spans shorter than this are dropped before they reach the terminal\n * tree or the pill: `await params` and other awaits of settled values would\n * otherwise drown the I/O the spans exist to show.\n */\nexport const AWAIT_SPAN_MIN_MS = 1;\n\n/** Root span of every pipeline request. */\nexport const ROOT_SPAN_NAME = 'http.server.request';\n\n/**\n * The span attributes that may reach the browser — the ones the pill reads,\n * and nothing else. An allowlist of keys, not of prefixes: a prefix let\n * through `timber.fetch_error` (an error message that can quote a full URL)\n * and user attributes such as `url.full` or\n * `http.request.header.authorization`. Typing the payload with this list\n * means the pill cannot read an attribute that isn't on it.\n */\nexport const DEV_SPAN_ATTRIBUTES = [\n 'http.request.method',\n 'http.response.status_code',\n /** Query and fragment stripped. */\n 'http.url',\n /** Query and fragment stripped. */\n 'url.path',\n 'timber.route',\n 'timber.segment',\n 'timber.slot',\n 'timber.action_name',\n 'timber.cache_status',\n /** The awaited expression's source text, whitespace collapsed, truncated. */\n 'timber.await_label',\n /** `path/relative/to/root.ts:line` of the await. */\n 'timber.await_location',\n] as const;\n\nexport type DevSpanAttribute = (typeof DEV_SPAN_ATTRIBUTES)[number];\n\n/** Attributes that hold a URL; sent without query or fragment. */\nexport const DEV_SPAN_URL_ATTRIBUTES: ReadonlySet<DevSpanAttribute> = new Set([\n 'http.url',\n 'url.path',\n]);\n\nexport type DevSpanSink = (span: DevSpanPayload) => void;\n\n/** One finished span, projected for the browser. */\nexport interface DevSpanPayload {\n traceId: string;\n spanId: string;\n /** Absent for the root span. */\n parentSpanId?: string;\n name: string;\n /** Epoch milliseconds. */\n startMs: number;\n /** Epoch milliseconds. */\n endMs: number;\n error: boolean;\n /** Only `DEV_SPAN_ATTRIBUTES`; URLs without query or fragment. */\n attributes: Partial<Record<DevSpanAttribute, string | number | boolean>>;\n /** Names of `timber.*` span events, e.g. `timber.cache.hit`. */\n events: string[];\n}\n\n/**\n * Read the trace ID from `Server-Timing` metrics, either a raw header value\n * or the `serverTiming` entries of a `PerformanceResourceTiming`.\n */\nexport function traceIdFromServerTiming(\n timing: string | null | readonly { name: string; description: string }[]\n): string | null {\n if (timing == null) return null;\n if (typeof timing !== 'string') {\n return timing.find((t) => t.name === TRACE_TIMING_NAME)?.description || null;\n }\n // `timber-trace;desc=\"<32 hex>\"` — the ID is hex, so no escaping to undo.\n const match = new RegExp(`(?:^|,)\\\\s*${TRACE_TIMING_NAME}\\\\s*;\\\\s*desc=\"?([0-9a-f]+)\"?`).exec(\n timing\n );\n return match?.[1] ?? null;\n}\n\n/** The `Server-Timing` entry that carries a trace ID. */\nexport function traceTimingEntry(traceId: string): string {\n return `${TRACE_TIMING_NAME};desc=\"${traceId}\"`;\n}\n\n// ─── Labels ─────────────────────────────────────────────────────────────────\n\n/** Span attributes as either side holds them (OTEL also allows arrays). */\ntype SpanAttributes = Readonly<Record<string, unknown>>;\n\n/** `@slot ` for a span from a parallel slot, so it reads apart from the main route. */\nfunction slotPrefix(attrs: SpanAttributes): string {\n const slot = attrs['timber.slot'];\n return slot ? `${String(slot)} ` : '';\n}\n\n/**\n * Map a span to its display label and environment tag. One mapping for the\n * terminal tree and the dev request pill, so the two never name a span\n * differently.\n */\nexport function devSpanLabel(name: string, attrs: SpanAttributes): { label: string; env: string } {\n switch (name) {\n case ROOT_SPAN_NAME: {\n const method = attrs['http.request.method'] ?? 'GET';\n const path = attrs['url.path'] ?? '/';\n return { label: `${String(method)} ${String(path)}`, env: 'rsc' };\n }\n case 'timber.proxy':\n return { label: 'proxy.ts', env: 'proxy' };\n case 'timber.middleware':\n return { label: 'middleware.ts', env: 'rsc' };\n case 'timber.render':\n return { label: 'render', env: 'rsc' };\n case 'timber.access': {\n const seg = attrs['timber.segment'] ?? 'segment';\n return { label: `AccessGate (${String(seg)})`, env: 'rsc' };\n }\n case 'timber.ssr':\n return { label: 'hydration render', env: 'ssr' };\n case 'timber.action': {\n const actionName = attrs['timber.action_name'] ?? 'action';\n return { label: String(actionName), env: 'rsc' };\n }\n case 'timber.metadata':\n return { label: 'metadata()', env: 'rsc' };\n case 'timber.layout': {\n const seg = attrs['timber.segment'] ?? '/';\n return { label: `layout ${slotPrefix(attrs)}${String(seg)}`, env: 'rsc' };\n }\n case 'timber.page': {\n const route = attrs['timber.route'] ?? '/';\n return { label: `page ${slotPrefix(attrs)}${String(route)}`, env: 'rsc' };\n }\n case AWAIT_SPAN_NAME:\n return { label: `await ${String(attrs['timber.await_label'] ?? '')}`, env: 'await' };\n case 'timber.fetch': {\n const fetchMethod = attrs['http.request.method'] ?? 'GET';\n const fetchUrl = attrs['http.url'] ?? '';\n return { label: `fetch ${String(fetchMethod)} ${String(fetchUrl)}`, env: 'fetch' };\n }\n default:\n return { label: name, env: 'rsc' };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgEA,IAAa,uBAAsC;CACjD,KAAK,CAAC;CACN,IAAI,CAAC;CACL,eAAe,CAAC;CAChB,OAAO,CAAC;CACR,qBAAqB,CAAC;CACtB,YAAY,CAAC;AACf;;;;;;;AAcA,SAAgB,gBAAgB,UAA8B,UAAmC;CAC/F,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,SAAmB,CAAC;CAE1B,KAAK,MAAM,WAAW,UACpB,KAAK,MAAM,QAAQ,CAAC,QAAQ,QAAQ,QAAQ,IAAI,GAAG;EACjD,IAAI,CAAC,MAAM;EACX,MAAM,WAAW,SAAS,IAAI,KAAK;EACnC,IAAI,CAAC,UAAU;EACf,KAAK,MAAM,OAAO,UAChB,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG;GAClB,KAAK,IAAI,GAAG;GACZ,OAAO,KAAK,GAAG;EACjB;CAEJ;CAGF,OAAO;AACT;;;;;;;AA0BA,SAAgB,kBACd,UACA,UACqB;CACrB,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,SAA8B,CAAC;CAErC,KAAK,MAAM,WAAW,UACpB,KAAK,MAAM,QAAQ,CAAC,QAAQ,QAAQ,QAAQ,IAAI,GAAG;EACjD,IAAI,CAAC,MAAM;EACX,MAAM,QAAQ,SAAS,MAAM,KAAK;EAClC,IAAI,CAAC,OAAO;EACZ,KAAK,MAAM,SAAS,OAClB,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,GAAG;GACzB,KAAK,IAAI,MAAM,IAAI;GACnB,OAAO,KAAK,KAAK;EACnB;CAEJ;CAGF,OAAO;AACT;;;;;;;AAyBA,SAAgB,2BACd,UACA,UACU;CACV,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,SAAmB,CAAC;CAE1B,KAAK,MAAM,WAAW,UACpB,KAAK,MAAM,QAAQ,CAAC,QAAQ,QAAQ,QAAQ,IAAI,GAAG;EACjD,IAAI,CAAC,MAAM;EACX,MAAM,WAAW,SAAS,cAAc,KAAK;EAC7C,IAAI,CAAC,UAAU;EACf,KAAK,MAAM,OAAO,UAChB,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG;GAClB,KAAK,IAAI,GAAG;GACZ,OAAO,KAAK,GAAG;EACjB;CAEJ;CAGF,OAAO;AACT;;;;;;;;;AC/LA,IAAa,iBAAiB;;AAG9B,IAAa,wBAAwB;;;;;;AAOrC,IAAa,oBAAoB,OAAO,IAAI,sBAAsB;;AAGlE,IAAa,oBAAoB;;AAiGjC,SAAgB,iBAAiB,SAAyB;CACxD,OAAO,GAAG,kBAAkB,SAAS,QAAQ;AAC/C"}
|
|
@@ -2,9 +2,9 @@ import { n as isRscContentType, t as RSC_CONTENT_TYPE } from "./rsc-media-type-m
|
|
|
2
2
|
import { i as withBasePath, r as stripBasePath } from "./base-path-DDIx0FXe.js";
|
|
3
3
|
import { n as rscPayloadPath } from "./rsc-payload-path-EphpDB-J.js";
|
|
4
4
|
import { a as randomRscCacheKey, n as RSC_KEY_PARAM, o as recordLookup, s as rscCacheKey } from "./rsc-cache-key-D0cb0Gmc.js";
|
|
5
|
-
import { t as StatusPageMarker } from "./status-page-marker-
|
|
5
|
+
import { t as StatusPageMarker } from "./status-page-marker-U6B1aFMb.js";
|
|
6
6
|
import { o as _setUnloading, p as unloading } from "./state-B-EBjeER.js";
|
|
7
|
-
import {
|
|
7
|
+
import { o as getRouterOrNull, t as setHardNavigating } from "./navigation-root-CoGHIMiE.js";
|
|
8
8
|
import { Component, createContext, createElement } from "react";
|
|
9
9
|
// src/shared/payload-root.ts
|
|
10
10
|
/**
|
|
@@ -1097,4 +1097,4 @@ function statusMatches(boundaryStatus, errorStatus) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
export { createSpaExits as a, createRenderOwner as c, fetchRscPayload as d, readPayloadTree as f, createScrollEffects as i, isClientStale as l, TimberErrorBoundary as n, runAsHandle as o, readPublishedParams as p, createNavigationRecovery as r, recordSkew as s, DenyAncestryContext as t, NonRscResponse as u };
|
|
1099
1099
|
|
|
1100
|
-
//# sourceMappingURL=error-boundary-
|
|
1100
|
+
//# sourceMappingURL=error-boundary-OHK1mI99.js.map
|