@timber-js/app 0.2.0-alpha.183 → 0.2.0-alpha.185
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/dist/_chunks/{build-output-helper-BC-Zg0_w.js → build-output-helper-DOGYFb_X.js} +11 -3
- package/dist/_chunks/build-output-helper-DOGYFb_X.js.map +1 -0
- package/dist/_chunks/{cli-schema-sync-D3naS3eH.js → cli-schema-sync-BTWEKJXo.js} +1 -21
- package/dist/_chunks/cli-schema-sync-BTWEKJXo.js.map +1 -0
- package/dist/_chunks/{cloudflare-nlD9KhDj.js → cloudflare-CnT5Lr7U.js} +2 -2
- package/dist/_chunks/{cloudflare-nlD9KhDj.js.map → cloudflare-CnT5Lr7U.js.map} +1 -1
- package/dist/_chunks/logger-AWfuX-KJ.js.map +1 -1
- package/dist/_chunks/plugin-context---kTF5v8.js.map +1 -1
- package/dist/_chunks/segment-classify-Byy425ng.js.map +1 -1
- package/dist/_chunks/{walkers-BtTlKviE.js → walkers-_6zKFlch.js} +2 -2
- package/dist/_chunks/{walkers-BtTlKviE.js.map → walkers-_6zKFlch.js.map} +1 -1
- package/dist/adapters/build-output-helper.d.ts.map +1 -1
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/nitro.js +1 -1
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/internal.js +70 -22
- package/dist/client/internal.js.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +17 -0
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/index.js +128 -9
- package/dist/index.js.map +1 -1
- package/dist/plugin-context.d.ts +7 -0
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +42 -0
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/manifest-codegen.d.ts.map +1 -1
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/types.d.ts +1 -3
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/server/deny-boundary.d.ts +4 -7
- package/dist/server/deny-boundary.d.ts.map +1 -1
- package/dist/server/internal.js +135 -161
- package/dist/server/internal.js.map +1 -1
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +0 -12
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/sitemap-generator.d.ts.map +1 -1
- package/dist/server/static-generator.d.ts.map +1 -1
- package/dist/server/status-code-resolver.d.ts +3 -10
- package/dist/server/status-code-resolver.d.ts.map +1 -1
- package/dist/shims/navigation-client.d.ts +8 -19
- package/dist/shims/navigation-client.d.ts.map +1 -1
- package/dist/shims/navigation.d.ts +0 -1
- package/dist/shims/navigation.d.ts.map +1 -1
- package/docs/learn/11-error-handling.mdx +2 -3
- package/package.json +1 -1
- package/src/adapters/build-output-helper.ts +6 -1
- package/src/adapters/shared.ts +5 -2
- package/src/client/router.ts +24 -7
- package/src/client/rsc-fetch.ts +85 -39
- package/src/plugin-context.ts +7 -0
- package/src/plugins/routing.ts +1 -1
- package/src/plugins/static-build.ts +161 -6
- package/src/routing/manifest-codegen.ts +1 -6
- package/src/routing/scanner.ts +0 -24
- package/src/routing/types.ts +1 -3
- package/src/server/deny-boundary.ts +5 -31
- package/src/server/deny-renderer.ts +2 -2
- package/src/server/pipeline-outcome.ts +1 -1
- package/src/server/prebuilt-builder.ts +1 -7
- package/src/server/primitives.ts +0 -18
- package/src/server/rsc-entry/render-route.ts +3 -3
- package/src/server/sitemap-generator.ts +1 -7
- package/src/server/static-generator.ts +2 -18
- package/src/server/status-code-resolver.ts +4 -47
- package/src/shims/navigation-client.ts +8 -26
- package/src/shims/navigation.ts +0 -4
- package/dist/_chunks/build-output-helper-BC-Zg0_w.js.map +0 -1
- package/dist/_chunks/cli-schema-sync-D3naS3eH.js.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ional form only).
|
|
55
55
|
*/
|
|
56
56
|
export declare function deny(statusOrOptions?: number | DenyOptions, data?: JsonSerializable): never;
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Use `deny(404)` instead.
|
|
59
|
-
* Kept for internal use by the Next.js shim layer.
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
export declare function notFound(): never;
|
|
63
57
|
export { RedirectType } from '../shared/redirect-type.js';
|
|
64
58
|
/**
|
|
65
59
|
* Render-phase signal thrown by `redirect()` and `redirectExternal()`.
|
|
@@ -121,12 +115,6 @@ export interface RedirectOptions {
|
|
|
121
115
|
* redirect(`/docs/${version}/${slug}`, { preserveSearchParams: ['foo'] });
|
|
122
116
|
*/
|
|
123
117
|
export declare function redirect(path: string, statusOrOptions?: number | RedirectOptions): never;
|
|
124
|
-
/**
|
|
125
|
-
* @deprecated Use `redirect(path, { permanent: true })` instead.
|
|
126
|
-
* Kept for internal use by the Next.js shim layer.
|
|
127
|
-
* @internal
|
|
128
|
-
*/
|
|
129
|
-
export declare function permanentRedirect(path: string, options?: Omit<RedirectOptions, 'status'>): never;
|
|
130
118
|
/**
|
|
131
119
|
* Redirect to an external URL. The origin must be in the provided allow-list.
|
|
132
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/server/primitives.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAYnD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,SAAS,GAAG,MAAM,GAAG,IAAI,CA8DhF;AAsBD;;;GAGG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAE5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,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AAsB,mBAAmB,CACvC,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC9B,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAAC;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,MAAM,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAC,CA2GjE;
|
|
1
|
+
{"version":3,"file":"static-generator.d.ts","sourceRoot":"","sources":["../../src/server/static-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAgB,MAAM,oBAAoB,CAAC;AAO1F,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,kCAAkC;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;CAC9B;AAED,qDAAqD;AACrD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,MAAM,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* Pass 4 — framework default (returns null)
|
|
22
|
+
* Pass 2 — error.tsx (leaf → root)
|
|
23
|
+
* Pass 3 — framework default (returns null)
|
|
25
24
|
*
|
|
26
25
|
* **JSON chain (4xx and 5xx):**
|
|
27
26
|
* Pass 1 — json status files (leaf → root): {status}.json → {category}.json
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
*/
|
|
34
33
|
import type { SegmentNode } from '../routing/types.js';
|
|
35
34
|
/** How the status-code file was matched. */
|
|
36
|
-
export type StatusFileKind = 'exact' | 'category' | '
|
|
35
|
+
export type StatusFileKind = 'exact' | 'category' | 'error';
|
|
37
36
|
/** Response format family for status-code resolution. */
|
|
38
37
|
export type StatusFileFormat = 'component' | 'json';
|
|
39
38
|
/** Result of resolving a status-code file for a segment chain. */
|
|
@@ -58,12 +57,6 @@ export interface SlotDeniedResolution<TFile> {
|
|
|
58
57
|
/** How the file was matched. */
|
|
59
58
|
kind: SlotDeniedKind;
|
|
60
59
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Maps legacy file convention names to their corresponding HTTP status codes.
|
|
63
|
-
* Only used in the 4xx component fallback chain. Exported so the in-tree
|
|
64
|
-
* deny chain (deny-boundary.ts) uses the same mapping — see TIM-1081.
|
|
65
|
-
*/
|
|
66
|
-
export declare const LEGACY_FILE_TO_STATUS: Record<string, number>;
|
|
67
60
|
/**
|
|
68
61
|
* Resolve the status-code file to render for a given HTTP status code.
|
|
69
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-code-resolver.d.ts","sourceRoot":"","sources":["../../src/server/status-code-resolver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"status-code-resolver.d.ts","sourceRoot":"","sources":["../../src/server/status-code-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,UAAU,GACV,OAAO,CAAC;AAEZ,yDAAyD;AACzD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,MAAM,CAAC;AAEpD,kEAAkE;AAClE,MAAM,WAAW,oBAAoB,CAAC,KAAK;IACzC,8BAA8B;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElD,8CAA8C;AAC9C,MAAM,WAAW,oBAAoB,CAAC,KAAK;IACzC,0DAA0D;IAC1D,IAAI,EAAE,KAAK,CAAC;IACZ,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,IAAI,EAAE,cAAc,CAAC;CACtB;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAC3C,MAAM,GAAE,gBAA8B,GACrC,oBAAoB,CAAC,KAAK,CAAC,GAAG,IAAI,CAKpC;AAoFD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EACrC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,GAC3B,oBAAoB,CAAC,KAAK,CAAC,GAAG,IAAI,CAYpC"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Shim: next/navigation (client environment only)
|
|
3
3
|
*
|
|
4
4
|
* Re-exports the client-side hooks from timber's client API, and implements
|
|
5
|
-
* client-render `redirect()`
|
|
6
|
-
*
|
|
5
|
+
* client-render `redirect()` without pulling server/primitives.ts into the
|
|
6
|
+
* browser bundle.
|
|
7
7
|
*
|
|
8
|
-
* Next.js supports calling redirect()
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* Next.js supports calling redirect() during client component render.
|
|
9
|
+
* timber matches that by throwing a plain Error carrying the same JSON
|
|
10
|
+
* digest the server pipeline attaches to RedirectSignal. TimberErrorBoundary
|
|
11
|
+
* recognizes the digest and converts it to an SPA navigation (replace
|
|
12
|
+
* semantics), and browser-dev's isFrameworkSignalError() keeps it out of
|
|
13
|
+
* the dev overlay.
|
|
14
14
|
*
|
|
15
15
|
* The full shim (navigation.ts) is still used in the RSC and SSR environments
|
|
16
16
|
* where the real server primitives produce proper HTTP responses.
|
|
@@ -36,15 +36,4 @@ export { RedirectType } from '../shared/redirect-type.js';
|
|
|
36
36
|
* matching the server-side redirect().
|
|
37
37
|
*/
|
|
38
38
|
export declare function redirect(path: string, _type?: RedirectTypeValue): never;
|
|
39
|
-
/**
|
|
40
|
-
* Client-render permanent redirect. On the client there is no HTTP status —
|
|
41
|
-
* this behaves identically to redirect() apart from the digest's status.
|
|
42
|
-
*/
|
|
43
|
-
export declare function permanentRedirect(path: string, _type?: RedirectTypeValue): never;
|
|
44
|
-
/**
|
|
45
|
-
* Client-render notFound. Throws a deny-digest error (status 404) that the
|
|
46
|
-
* nearest matching TimberErrorBoundary renders as the 404 fallback. The
|
|
47
|
-
* message matches DenySignal's so digest-less fallback parsing still works.
|
|
48
|
-
*/
|
|
49
|
-
export declare function notFound(): never;
|
|
50
39
|
//# sourceMappingURL=navigation-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-client.d.ts","sourceRoot":"","sources":["../../src/shims/navigation-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS1D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAGvE
|
|
1
|
+
{"version":3,"file":"navigation-client.d.ts","sourceRoot":"","sources":["../../src/shims/navigation-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS1D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAGvE"}
|
|
@@ -12,5 +12,4 @@ export { useSegmentParams, useSegmentParams as useParams } from '../client/use-s
|
|
|
12
12
|
export { useSearchParams } from '../client/use-search-params.js';
|
|
13
13
|
export { usePathname, useRouter, useSelectedLayoutSegment, useSelectedLayoutSegments, } from '@timber-js/app/client';
|
|
14
14
|
export { redirect, redirectExternal, RedirectType } from '@timber-js/app/server';
|
|
15
|
-
export { permanentRedirect, notFound } from '../server/primitives.js';
|
|
16
15
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/shims/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/shims/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -70,9 +70,8 @@ Priority order (innermost to outermost):
|
|
|
70
70
|
|
|
71
71
|
1. Specific status files (`403.tsx`, `503.tsx`)
|
|
72
72
|
2. Category catch-alls (`4xx.tsx`, `5xx.tsx`)
|
|
73
|
-
3.
|
|
74
|
-
4.
|
|
75
|
-
5. Parent segments → framework default
|
|
73
|
+
3. `error.tsx` — catches anything unmatched
|
|
74
|
+
4. Parent segments → framework default
|
|
76
75
|
|
|
77
76
|
## `error.tsx`
|
|
78
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.185",
|
|
4
4
|
"description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare-workers",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// IMPORTANT: This module must remain a leaf — no imports from ../server/,
|
|
12
12
|
// ../client/, or Vite-dependent code. See adapters/shared.ts header.
|
|
13
13
|
|
|
14
|
-
import { writeFile, mkdir, cp, readdir, readFile } from 'node:fs/promises';
|
|
14
|
+
import { writeFile, mkdir, cp, rm, readdir, readFile } from 'node:fs/promises';
|
|
15
15
|
import { join, basename, relative } from 'node:path';
|
|
16
16
|
import { generateHeadersFile } from './shared.js';
|
|
17
17
|
import type { TimberConfig } from './types';
|
|
@@ -141,6 +141,7 @@ export async function findUnhashedStaticFiles(publicDir: string): Promise<string
|
|
|
141
141
|
for (const file of files) {
|
|
142
142
|
const rel = relative(publicDir, file).replace(/\\/g, '/');
|
|
143
143
|
if (rel.startsWith('assets/') || rel.startsWith('_timber/')) continue;
|
|
144
|
+
if (rel.startsWith('rsc/') || rel.startsWith('ssr/') || rel.startsWith('_rsc/')) continue;
|
|
144
145
|
if (basename(rel).startsWith('_')) continue;
|
|
145
146
|
const urlPath = '/' + rel;
|
|
146
147
|
if (PRIORITY_FILES.has(urlPath)) {
|
|
@@ -195,6 +196,10 @@ export async function buildStaticDirectoryOutput(
|
|
|
195
196
|
outDir: string,
|
|
196
197
|
publicDirName: string
|
|
197
198
|
): Promise<void> {
|
|
199
|
+
// Clean stale artifacts from prior builds (e.g. server-mode builds that
|
|
200
|
+
// left rsc/, ssr/, _worker.js in the outDir). Without this, a static
|
|
201
|
+
// build after a server build inherits 140+ unused server chunks.
|
|
202
|
+
await rm(outDir, { recursive: true, force: true }).catch(() => {});
|
|
198
203
|
await mkdir(outDir, { recursive: true });
|
|
199
204
|
|
|
200
205
|
const publicDir = join(outDir, publicDirName);
|
package/src/adapters/shared.ts
CHANGED
|
@@ -35,8 +35,8 @@ export const STATIC_CACHE = 'public, max-age=3600, must-revalidate';
|
|
|
35
35
|
* (invalid per RFC 9111).
|
|
36
36
|
*/
|
|
37
37
|
// Cloudflare Workers Static Assets caps _headers at 100 rules.
|
|
38
|
-
// Reserve
|
|
39
|
-
const MAX_PER_FILE_RULES =
|
|
38
|
+
// Reserve 3 for the wildcard hashed-asset rules (/assets/*, /_timber/fonts/*, /_rsc/*).
|
|
39
|
+
const MAX_PER_FILE_RULES = 97;
|
|
40
40
|
|
|
41
41
|
export function generateHeadersFile(
|
|
42
42
|
unhashedPaths?: string[],
|
|
@@ -50,6 +50,9 @@ export function generateHeadersFile(
|
|
|
50
50
|
|
|
51
51
|
/_timber/fonts/*
|
|
52
52
|
Cache-Control: ${IMMUTABLE_CACHE}
|
|
53
|
+
|
|
54
|
+
/_rsc/*
|
|
55
|
+
Cache-Control: ${IMMUTABLE_CACHE}
|
|
53
56
|
`;
|
|
54
57
|
|
|
55
58
|
// Content-Type rules are higher priority than cache headers for
|
package/src/client/router.ts
CHANGED
|
@@ -494,6 +494,28 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
+
/**
|
|
498
|
+
* Perform a hard navigation to a URL. When the target is same-document
|
|
499
|
+
* (same pathname+search, different hash), `location.href = url` is a
|
|
500
|
+
* hash change — no reload. Use `location.reload()` instead (TIM-1235).
|
|
501
|
+
*
|
|
502
|
+
* `fromUrl` is the departing URL captured before any pushState or
|
|
503
|
+
* Navigation API commit — deps.getCurrentUrl() is unreliable here
|
|
504
|
+
* because the URL may have already been updated.
|
|
505
|
+
*/
|
|
506
|
+
function hardNavigate(url: string, fromUrl: string): void {
|
|
507
|
+
const current = new URL(fromUrl, window.location.origin);
|
|
508
|
+
const target = new URL(url, window.location.origin);
|
|
509
|
+
if (target.pathname === current.pathname && target.search === current.search) {
|
|
510
|
+
// Assign first to update the hash in the address bar, then reload
|
|
511
|
+
// to force a full page load. href alone is a no-op hash change.
|
|
512
|
+
window.location.href = url;
|
|
513
|
+
window.location.reload();
|
|
514
|
+
} else {
|
|
515
|
+
window.location.href = url;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
497
519
|
/** Run a callback after the next paint (after React commit). */
|
|
498
520
|
function afterPaint(callback: () => void): void {
|
|
499
521
|
if (deps.afterPaint) {
|
|
@@ -695,17 +717,12 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
695
717
|
}
|
|
696
718
|
if (error instanceof ServerErrorResponse) {
|
|
697
719
|
setHardNavigating(true);
|
|
698
|
-
|
|
699
|
-
// is hash-stripped. Preserves fragment on hard navigation.
|
|
700
|
-
window.location.href = url;
|
|
720
|
+
hardNavigate(url, departingUrl);
|
|
701
721
|
await new Promise(() => {});
|
|
702
722
|
}
|
|
703
723
|
if (error instanceof NonRscResponse) {
|
|
704
724
|
setHardNavigating(true);
|
|
705
|
-
|
|
706
|
-
// is hash-stripped. Preserves fragment on hard navigation (e.g.,
|
|
707
|
-
// /manual.pdf#page=5). Matches no-JS <a> behavior.
|
|
708
|
-
window.location.href = url;
|
|
725
|
+
hardNavigate(url, departingUrl);
|
|
709
726
|
await new Promise(() => {});
|
|
710
727
|
}
|
|
711
728
|
throw error;
|
package/src/client/rsc-fetch.ts
CHANGED
|
@@ -106,15 +106,58 @@ export function isStaticMode(): boolean {
|
|
|
106
106
|
return staticMode;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* RSC manifest entry: hashed URL with optional inlined route params.
|
|
111
|
+
* Params are embedded at build time (TIM-1255) so no sidecar fetch needed.
|
|
112
|
+
*/
|
|
113
|
+
interface RscManifestEntry {
|
|
114
|
+
url: string;
|
|
115
|
+
params?: Record<string, string | string[]>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type RscManifest = Record<string, RscManifestEntry>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* RSC manifest mapping unhashed → hashed URLs + params. Populated from
|
|
122
|
+
* `window.__TIMBER_RSC_MANIFEST__` (injected into HTML during
|
|
123
|
+
* static generation). See TIM-1254, TIM-1255.
|
|
124
|
+
*/
|
|
125
|
+
let rscManifest: RscManifest | null = null;
|
|
126
|
+
|
|
127
|
+
function getRscManifest(): RscManifest | null {
|
|
128
|
+
if (rscManifest) return rscManifest;
|
|
129
|
+
if (typeof window !== 'undefined' && (window as any).__TIMBER_RSC_MANIFEST__) {
|
|
130
|
+
rscManifest = (window as any).__TIMBER_RSC_MANIFEST__;
|
|
131
|
+
}
|
|
132
|
+
return rscManifest;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @internal Exported for testing. */
|
|
136
|
+
export function setRscManifest(manifest: RscManifest | null): void {
|
|
137
|
+
rscManifest = manifest;
|
|
138
|
+
}
|
|
139
|
+
|
|
109
140
|
/**
|
|
110
141
|
* Convert a route URL to the corresponding _rsc/*.rsc file path.
|
|
111
142
|
* Mirrors the naming in plugins/static-build.ts staticOutputPath.
|
|
112
143
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
144
|
+
* When an RSC manifest is available (hashed filenames from TIM-1254),
|
|
145
|
+
* the manifest is consulted to resolve to the hashed path.
|
|
146
|
+
*
|
|
147
|
+
* / → /_rsc/index.rsc (or /_rsc/index-B7YxEKdN.rsc with manifest)
|
|
148
|
+
* /about → /_rsc/about.rsc (or /_rsc/about-C8ZzFLfO.rsc with manifest)
|
|
115
149
|
* /blog/hello → /_rsc/blog/hello.rsc
|
|
116
150
|
*/
|
|
117
151
|
function toStaticRscUrl(url: string): string {
|
|
152
|
+
const unhashed = toUnhashedRscUrl(url);
|
|
153
|
+
return manifestLookup(unhashed) ?? unhashed;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Compute the unhashed _rsc/*.rsc URL for a route path.
|
|
158
|
+
* @internal Exported for testing.
|
|
159
|
+
*/
|
|
160
|
+
export function toUnhashedRscUrl(url: string): string {
|
|
118
161
|
const hashIndex = url.indexOf('#');
|
|
119
162
|
const queryIndex = url.indexOf('?');
|
|
120
163
|
const hashEnd = hashIndex === -1 ? url.length : hashIndex;
|
|
@@ -130,12 +173,35 @@ function toStaticRscUrl(url: string): string {
|
|
|
130
173
|
}
|
|
131
174
|
|
|
132
175
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* in the X-Timber-Params response header. See TIM-1246.
|
|
176
|
+
* Look up a key in the RSC manifest, falling back to percent-decoded
|
|
177
|
+
* lookup for encoded browser URLs. Returns the entry or null.
|
|
136
178
|
*/
|
|
137
|
-
function
|
|
138
|
-
|
|
179
|
+
function manifestEntry(key: string): RscManifestEntry | null {
|
|
180
|
+
const manifest = getRscManifest();
|
|
181
|
+
if (!manifest) return null;
|
|
182
|
+
if (manifest[key]) return manifest[key];
|
|
183
|
+
try {
|
|
184
|
+
const decoded = decodeURIComponent(key);
|
|
185
|
+
if (decoded !== key && manifest[decoded]) return manifest[decoded];
|
|
186
|
+
} catch {
|
|
187
|
+
// Malformed percent sequence (e.g. /100%.rsc) — skip decoded lookup
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Look up the hashed URL for an unhashed RSC path.
|
|
194
|
+
*/
|
|
195
|
+
function manifestLookup(key: string): string | null {
|
|
196
|
+
return manifestEntry(key)?.url ?? null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Look up inlined route params for a route from the manifest. TIM-1255.
|
|
201
|
+
*/
|
|
202
|
+
function manifestParams(url: string): Record<string, string | string[]> | null {
|
|
203
|
+
const key = toUnhashedRscUrl(url);
|
|
204
|
+
return manifestEntry(key)?.params ?? null;
|
|
139
205
|
}
|
|
140
206
|
|
|
141
207
|
// ─── Reload Signal ───────────────────────────────────────────────
|
|
@@ -378,10 +444,13 @@ export async function fetchRscPayload(
|
|
|
378
444
|
): Promise<FetchResult> {
|
|
379
445
|
// In static mode, fetch the pre-generated _rsc/*.rsc file directly
|
|
380
446
|
// instead of the route URL with Accept headers. Static hosts ignore
|
|
381
|
-
// Accept headers, so the route URL would return HTML.
|
|
382
|
-
// is still appended for cache busting.
|
|
447
|
+
// Accept headers, so the route URL would return HTML.
|
|
383
448
|
const fetchTarget = staticMode ? toStaticRscUrl(url) : url;
|
|
384
|
-
|
|
449
|
+
// Skip the cache-bust param when the manifest supplies a content-hashed
|
|
450
|
+
// URL — the hash itself guarantees freshness, and the param would defeat
|
|
451
|
+
// the immutable cache headers on /_rsc/* (TIM-1254).
|
|
452
|
+
const isHashedFromManifest = staticMode && fetchTarget !== toUnhashedRscUrl(url);
|
|
453
|
+
const rscUrl = isHashedFromManifest ? fetchTarget : appendRscParam(fetchTarget);
|
|
385
454
|
const headers = buildRscHeaders(staticMode ? undefined : stateTree, currentUrl);
|
|
386
455
|
if (deps.decodeRsc) {
|
|
387
456
|
// Production path: use createFromFetch for streaming RSC decoding.
|
|
@@ -391,21 +460,6 @@ export async function fetchRscPayload(
|
|
|
391
460
|
// Intercept the response to read segment metadata before createFromFetch
|
|
392
461
|
// consumes the body. Reading headers does NOT consume the body stream.
|
|
393
462
|
const fetchPromise = deps.fetch(rscUrl, { headers, redirect: 'manual', signal });
|
|
394
|
-
// In static mode, fetch the params sidecar in parallel. The .rsc
|
|
395
|
-
// file has no HTTP headers, so params come from a .params.json
|
|
396
|
-
// sidecar written at build time. See TIM-1246.
|
|
397
|
-
const staticParamsFetch = staticMode
|
|
398
|
-
? deps
|
|
399
|
-
.fetch(toStaticParamsUrl(url), { signal })
|
|
400
|
-
.then((r) => (r.ok ? (r.json() as Promise<Record<string, string | string[]>>) : null))
|
|
401
|
-
.catch((e) => {
|
|
402
|
-
if (e instanceof DOMException && e.name === 'AbortError') throw e;
|
|
403
|
-
return null;
|
|
404
|
-
})
|
|
405
|
-
: null;
|
|
406
|
-
// Observe the sidecar promise so its rejection doesn't become
|
|
407
|
-
// unhandled if wrappedPromise rejects first (TIM-1248).
|
|
408
|
-
staticParamsFetch?.catch(() => {});
|
|
409
463
|
let segmentInfo: SegmentInfo[] | null = null;
|
|
410
464
|
let params: Record<string, string | string[]> | null = null;
|
|
411
465
|
let skippedSegments: string[] | null = null;
|
|
@@ -483,10 +537,10 @@ export async function fetchRscPayload(
|
|
|
483
537
|
});
|
|
484
538
|
// Await headers so segmentInfo/params are populated.
|
|
485
539
|
await wrappedPromise;
|
|
486
|
-
// In static mode, params come from the
|
|
487
|
-
//
|
|
488
|
-
if (
|
|
489
|
-
params =
|
|
540
|
+
// In static mode, params come from the manifest (inlined at build
|
|
541
|
+
// time) since .rsc files have no HTTP headers. TIM-1255.
|
|
542
|
+
if (staticMode && !params) {
|
|
543
|
+
params = manifestParams(url);
|
|
490
544
|
}
|
|
491
545
|
// Start decoding but do NOT await — return the in-progress thenable.
|
|
492
546
|
// React can render a Flight thenable directly: it suspends on unresolved
|
|
@@ -546,17 +600,9 @@ export async function fetchRscPayload(
|
|
|
546
600
|
}
|
|
547
601
|
}
|
|
548
602
|
let fallbackParams = extractParams(response);
|
|
549
|
-
// In static mode, params come from the
|
|
603
|
+
// In static mode, params come from the manifest. TIM-1255.
|
|
550
604
|
if (staticMode && !fallbackParams) {
|
|
551
|
-
|
|
552
|
-
const paramsResponse = await deps.fetch(toStaticParamsUrl(url), { signal });
|
|
553
|
-
if (paramsResponse.ok) {
|
|
554
|
-
fallbackParams = (await paramsResponse.json()) as Record<string, string | string[]>;
|
|
555
|
-
}
|
|
556
|
-
} catch (e) {
|
|
557
|
-
if (e instanceof DOMException && e.name === 'AbortError') throw e;
|
|
558
|
-
// No params sidecar — non-dynamic route, params stay null
|
|
559
|
-
}
|
|
605
|
+
fallbackParams = manifestParams(url);
|
|
560
606
|
}
|
|
561
607
|
return {
|
|
562
608
|
payload: await response.text(),
|
package/src/plugin-context.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type { CaptureSummary } from './server/prebuilt-builder';
|
|
|
18
18
|
import type { StartupTimer } from './utils/startup-timer';
|
|
19
19
|
import { createStartupTimer } from './utils/startup-timer';
|
|
20
20
|
import type { TimberUserConfig, ClientJavascriptConfig } from './config-types.js';
|
|
21
|
+
import type { RscManifest } from './plugins/static-build.js';
|
|
21
22
|
import type { HoldingServer } from './dev-tools/holding-server.js';
|
|
22
23
|
import type { ProgramNode } from './plugins/callsite-ast.js';
|
|
23
24
|
|
|
@@ -166,6 +167,12 @@ export interface PluginContext {
|
|
|
166
167
|
* write per-path Content-Type rules in _headers. See TIM-1241.
|
|
167
168
|
*/
|
|
168
169
|
staticContentTypes?: Record<string, string>;
|
|
170
|
+
/**
|
|
171
|
+
* RSC flight payload manifest mapping unhashed → hashed URLs.
|
|
172
|
+
* Populated during static generation, consumed by adapters to set
|
|
173
|
+
* immutable cache headers for `_rsc/` files. See TIM-1254.
|
|
174
|
+
*/
|
|
175
|
+
rscManifest?: RscManifest;
|
|
169
176
|
}
|
|
170
177
|
|
|
171
178
|
// ── AST parse memo ───────────────────────────────────────────────────────
|
package/src/plugins/routing.ts
CHANGED
|
@@ -69,7 +69,7 @@ const SEGMENT_PREFIX = '\0$segment:';
|
|
|
69
69
|
* File convention names we track for changes that require manifest regeneration.
|
|
70
70
|
*/
|
|
71
71
|
const ROUTE_FILE_PATTERNS =
|
|
72
|
-
/\/(page|layout|middleware|access|route|error|global-error|default|denied|params|schema|\d{3}|[45]xx|
|
|
72
|
+
/\/(page|layout|middleware|access|route|error|global-error|default|denied|params|schema|\d{3}|[45]xx|sitemap|robots|manifest|favicon|icon|opengraph-image|apple-icon)\./;
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Create the timber-routing Vite plugin.
|