@timber-js/app 0.2.0-alpha.133 → 0.2.0-alpha.135
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/{actions-BNhpxrnV.js → actions-CHFblsdT.js} +62 -19
- package/dist/_chunks/actions-CHFblsdT.js.map +1 -0
- package/dist/_chunks/{build-output-helper-K7oUCRqU.js → build-output-helper-CfBfOU9m.js} +1 -1
- package/dist/_chunks/{build-output-helper-K7oUCRqU.js.map → build-output-helper-CfBfOU9m.js.map} +1 -1
- package/dist/_chunks/cli-schema-sync-q-Ce6-iG.js.map +1 -1
- package/dist/_chunks/{codec-registry-DqkeAydt.js → codec-registry-G9hD5LOq.js} +1 -1
- package/dist/_chunks/{codec-registry-DqkeAydt.js.map → codec-registry-G9hD5LOq.js.map} +1 -1
- package/dist/_chunks/{define-jeHDXZGq.js → define-DXWUJb-K.js} +3 -3
- package/dist/_chunks/{define-jeHDXZGq.js.map → define-DXWUJb-K.js.map} +1 -1
- package/dist/_chunks/{define-DMq-Yjp7.js → define-Dp-qu3ql.js} +3 -3
- package/dist/_chunks/{define-DMq-Yjp7.js.map → define-Dp-qu3ql.js.map} +1 -1
- package/dist/_chunks/fast-hash-DXZ7S2D5.js +36 -0
- package/dist/_chunks/fast-hash-DXZ7S2D5.js.map +1 -0
- package/dist/_chunks/{format-BjN9HLu9.js → format-CR6v1pWE.js} +1 -1
- package/dist/_chunks/{format-BjN9HLu9.js.map → format-CR6v1pWE.js.map} +1 -1
- package/dist/_chunks/{handler-store-bIAstrxQ.js → handler-store-aQMpqPe7.js} +1 -1
- package/dist/_chunks/{handler-store-bIAstrxQ.js.map → handler-store-aQMpqPe7.js.map} +1 -1
- package/dist/_chunks/href-validation-2G-HZaQ8.js +124 -0
- package/dist/_chunks/href-validation-2G-HZaQ8.js.map +1 -0
- package/dist/_chunks/logger-CMd9P1xQ.js.map +1 -1
- package/dist/_chunks/metadata-routes-DESG8uk5.js.map +1 -1
- package/dist/_chunks/{navigation-root-B5-RmsPi.js → navigation-root-BQqFQI-n.js} +3 -3
- package/dist/_chunks/{navigation-root-B5-RmsPi.js.map → navigation-root-BQqFQI-n.js.map} +1 -1
- package/dist/_chunks/{registry-BI9cgCt7.js → registry-Dp_hJL4s.js} +1 -1
- package/dist/_chunks/{registry-BI9cgCt7.js.map → registry-Dp_hJL4s.js.map} +1 -1
- package/dist/_chunks/{resolve-schema-DU2nbVOi.js → resolve-schema-D3CbcdCW.js} +2 -2
- package/dist/_chunks/{resolve-schema-DU2nbVOi.js.map → resolve-schema-D3CbcdCW.js.map} +1 -1
- package/dist/_chunks/{router-ref-B2-2kIIC.js → router-ref-B50j42zB.js} +2 -2
- package/dist/_chunks/{router-ref-B2-2kIIC.js.map → router-ref-B50j42zB.js.map} +1 -1
- package/dist/_chunks/{schema-bridge-o0SwFtXW.js → schema-bridge-Cuy8BaYu.js} +2 -2
- package/dist/_chunks/{schema-bridge-o0SwFtXW.js.map → schema-bridge-Cuy8BaYu.js.map} +1 -1
- package/dist/_chunks/segment-classify-BjfuctV2.js.map +1 -1
- package/dist/_chunks/{segment-context-Bg0pFbLT.js → segment-context-BnxoPSFQ.js} +1 -1
- package/dist/_chunks/{segment-context-Bg0pFbLT.js.map → segment-context-BnxoPSFQ.js.map} +1 -1
- package/dist/_chunks/{ssr-data-DVX8S7vj.js → ssr-data-DxXyoRrz.js} +1 -1
- package/dist/_chunks/{ssr-data-DVX8S7vj.js.map → ssr-data-DxXyoRrz.js.map} +1 -1
- package/dist/_chunks/{stale-reload-CCqb62Z3.js → stale-reload-DIIIVGh_.js} +1 -1
- package/dist/_chunks/{stale-reload-CCqb62Z3.js.map → stale-reload-DIIIVGh_.js.map} +1 -1
- package/dist/_chunks/tracing-DP5djRq5.js.map +1 -1
- package/dist/_chunks/{use-query-states-C9G6LP0F.js → use-query-states-D9SBlAfp.js} +2 -2
- package/dist/_chunks/{use-query-states-C9G6LP0F.js.map → use-query-states-D9SBlAfp.js.map} +1 -1
- package/dist/_chunks/{use-segment-params-CIeinIx2.js → use-segment-params-x2poKmk8.js} +2 -2
- package/dist/_chunks/use-segment-params-x2poKmk8.js.map +1 -0
- package/dist/_chunks/{validation-AfEFM5ze.js → validation-BoWM_qI1.js} +31 -2
- package/dist/_chunks/validation-BoWM_qI1.js.map +1 -0
- package/dist/_chunks/walkers-BbEu2_Pp.js.map +1 -1
- package/dist/_chunks/warnings-CAzunaGo.js.map +1 -1
- package/dist/adapters/cloudflare-dev.js.map +1 -1
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/cloudflare.js.map +1 -1
- package/dist/adapters/nitro.js +1 -1
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/cache/cache-api.d.ts +1 -1
- package/dist/cache/cache-api.d.ts.map +1 -1
- package/dist/cache/index.js +17 -39
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/timber-cache.d.ts +1 -1
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/error-boundary.js +2 -2
- package/dist/client/error-boundary.js.map +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +14 -26
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +8 -8
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts +2 -4
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/use-pathname.d.ts.map +1 -1
- package/dist/client/use-router.d.ts.map +1 -1
- package/dist/client/use-search-params.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/codec.js.map +1 -1
- package/dist/cookies/index.js +3 -3
- package/dist/cookies/index.js.map +1 -1
- package/dist/cookies/validation.d.ts +11 -23
- package/dist/cookies/validation.d.ts.map +1 -1
- package/dist/dev-tools/error-page.d.ts.map +1 -1
- package/dist/fonts/virtual-modules.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +259 -3
- package/dist/index.js.map +1 -1
- package/dist/params/define-schema.d.ts.map +1 -1
- package/dist/params/index.js +2 -2
- package/dist/params/index.js.map +1 -1
- package/dist/plugins/cache.d.ts +31 -0
- package/dist/plugins/cache.d.ts.map +1 -0
- package/dist/routing/link-codegen.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts.map +1 -1
- package/dist/search-params/index.js +3 -3
- package/dist/search-params/index.js.map +1 -1
- package/dist/segment-params/index.js +1 -1
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/body-limits.d.ts.map +1 -1
- package/dist/server/cookie-context.d.ts +2 -2
- package/dist/server/cookie-context.d.ts.map +1 -1
- package/dist/server/csrf.d.ts +3 -2
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/html-injector-core.d.ts.map +1 -1
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.js +17 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.js +69 -21
- package/dist/server/internal.js.map +1 -1
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts +5 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +5 -2
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +108 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +15 -0
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/sitemap-handler.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/dist/shared/href-validation.d.ts +38 -0
- package/dist/shared/href-validation.d.ts.map +1 -0
- package/dist/shims/font-google.js.map +1 -1
- package/dist/shims/font-local.js.map +1 -1
- package/package.json +5 -5
- package/src/cache/cache-api.ts +3 -2
- package/src/cache/timber-cache.ts +27 -4
- package/src/client/index.ts +1 -0
- package/src/client/link.tsx +13 -37
- package/src/client/navigation-context.ts +2 -0
- package/src/client/use-pathname.ts +1 -0
- package/src/client/use-router.ts +3 -0
- package/src/client/use-search-params.ts +1 -0
- package/src/client/use-segment-params.ts +1 -0
- package/src/config-validation.ts +1 -1
- package/src/cookies/validation.ts +58 -0
- package/src/dev-tools/error-page.ts +1 -0
- package/src/fonts/virtual-modules.ts +2 -0
- package/src/index.ts +5 -1
- package/src/params/define-schema.ts +1 -0
- package/src/plugins/cache.ts +180 -0
- package/src/routing/link-codegen.ts +5 -3
- package/src/schema-bridge.ts +3 -2
- package/src/server/action-client.ts +31 -13
- package/src/server/actions.ts +20 -3
- package/src/server/body-limits.ts +10 -2
- package/src/server/cookie-context.ts +7 -2
- package/src/server/cookie-parsing.ts +1 -1
- package/src/server/csrf.ts +39 -6
- package/src/server/deny-renderer.ts +0 -1
- package/src/server/html-injector-core.ts +6 -5
- package/src/server/html-injectors.ts +8 -5
- package/src/server/pipeline-interception.ts +1 -0
- package/src/server/pipeline-phases.ts +30 -19
- package/src/server/pipeline.ts +27 -1
- package/src/server/primitives.ts +19 -18
- package/src/server/route-element-builder.ts +2 -0
- package/src/server/rsc-entry/error-renderer.ts +4 -3
- package/src/server/rsc-entry/index.ts +16 -36
- package/src/server/rsc-entry/revalidate-renderer.ts +344 -0
- package/src/server/rsc-entry/rsc-payload.ts +0 -4
- package/src/server/rsc-entry/ssr-renderer.ts +76 -0
- package/src/server/sitemap-handler.ts +24 -2
- package/src/server/slot-resolver.ts +8 -2
- package/src/server/ssr-wrappers.tsx +2 -0
- package/src/server/tree-builder.ts +2 -0
- package/src/server/types.ts +2 -2
- package/src/shared/href-validation.ts +127 -0
- package/dist/_chunks/actions-BNhpxrnV.js.map +0 -1
- package/dist/_chunks/merge-search-params-Cm1j99HC.js +0 -41
- package/dist/_chunks/merge-search-params-Cm1j99HC.js.map +0 -1
- package/dist/_chunks/use-segment-params-CIeinIx2.js.map +0 -1
- package/dist/_chunks/validation-AfEFM5ze.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-interception.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"pipeline-interception.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;CACxB;AAcD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,4BAA4B,EAAE,mBAAmB,EAAE,GACnE,uBAAuB,GAAG,IAAI,CAahC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAyBjF"}
|
|
@@ -46,7 +46,11 @@ export declare function runRenderPhase(config: PipelineConfig, req: Request, mat
|
|
|
46
46
|
*
|
|
47
47
|
* Used both as the top-level entry (when no proxy.ts is configured) and as
|
|
48
48
|
* the `next()` continuation passed to `runProxy()`.
|
|
49
|
+
*
|
|
50
|
+
* @param pathIsCanonical When true, `path` has already been canonicalized by
|
|
51
|
+
* `createPipeline` — skip re-canonicalization to prevent double-decode.
|
|
52
|
+
* When false (default), runs canonicalize as a safety net for direct callers.
|
|
49
53
|
*/
|
|
50
|
-
export declare function handleRequest(config: PipelineConfig, req: Request, method: string, path: string): Promise<Response>;
|
|
54
|
+
export declare function handleRequest(config: PipelineConfig, req: Request, method: string, path: string, pathIsCanonical?: boolean): Promise<Response>;
|
|
51
55
|
export {};
|
|
52
56
|
//# sourceMappingURL=pipeline-phases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-phases.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoBH,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKrF,UAAU,aAAa;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAwBD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAavB;AAID;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,oBAAoB,EAAE,OAAO,EAC7B,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,YAAY,CAAC,CA6DvB;AAID;;;GAGG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,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;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,CACxB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;KAAE,CAAC,KACnF,IAAI,CAAC;IAEV;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO,KACrB,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO;IACxB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,UAAU,KACf,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACnC;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAmK1F"}
|
|
@@ -130,10 +130,13 @@ export declare function redirect(path: string, statusOrOptions?: number | Redire
|
|
|
130
130
|
*/
|
|
131
131
|
export declare function permanentRedirect(path: string, options?: Omit<RedirectOptions, 'status'>): never;
|
|
132
132
|
/**
|
|
133
|
-
* Redirect to an external URL. The
|
|
133
|
+
* Redirect to an external URL. The origin must be in the provided allow-list.
|
|
134
|
+
*
|
|
135
|
+
* Only http: and https: schemes are permitted. The allow-list is matched
|
|
136
|
+
* against full origins (scheme + host + port), not bare hostnames.
|
|
134
137
|
*
|
|
135
138
|
* @param url - Absolute URL to redirect to.
|
|
136
|
-
* @param allowList - Array of allowed
|
|
139
|
+
* @param allowList - Array of allowed origins (e.g. ['https://example.com', 'https://auth.example.com']).
|
|
137
140
|
* @param status - HTTP redirect status code (3xx). Defaults to 302.
|
|
138
141
|
*/
|
|
139
142
|
export declare function redirectExternal(url: string, allowList: string[], status?: number): never;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/server/primitives.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASnD;;;;;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;gBAEhC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB;IAOnD;;;;OAIG;IACH,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAqBnC;CACF;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAiB3F;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,KAAK,CAEhC;AAED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AAE,KAAK,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAcpE;AAID,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7C;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAqBrF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAID;;;;;;;;;;GAUG;AACH,qBAAa,cAAe,SAAQ,KAAK;aAGrB,KAAK,EAAE,OAAO;gBAD9B,OAAO,EAAE,MAAM,EACC,KAAK,EAAE,OAAO;CAKjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAY9D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAc7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,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,EAAE,mBAAmB,EAAE;gBAF/B,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,gBAAgB,EAAE,oBAAoB,EAAE,EACxC,QAAQ,EAAE,mBAAmB,EAAE;CAIlD;AA8DD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,mBAAmB,EAClC,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAob7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/error-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAYvD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"error-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/error-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAYvD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAsHD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,WAAW,EAAE,EAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,qBAAqB,EACtC,WAAW,CAAC,EAAE,eAAe,GAC5B,OAAO,CAAC,QAAQ,CAAC,CAwCnB;AAqID;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,qBAAqB,GACrC,OAAO,CAAC,QAAQ,CAAC,CAuCnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AAuBA,OAAO,uCAAuC,CAAC;AAqB/C,OAAO,KAAK,EAAuB,cAAc,EAAc,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AAuBA,OAAO,uCAAuC,CAAC;AAqB/C,OAAO,KAAK,EAAuB,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAoCtF;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAE5E;AAiWD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,QAAA,MAAiB,QAAQ,qCAGxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAkB,CAAC;AAE9C,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Revalidation renderer — builds the React element tree for the target
|
|
3
|
+
* path requested by `revalidatePath()` from inside a server action, with
|
|
4
|
+
* the same security guarantees as a normal route render.
|
|
5
|
+
*
|
|
6
|
+
* Before this module existed, `revalidatePath()` matched the route, coerced
|
|
7
|
+
* params, and called `buildRouteElement()` directly. That bypassed the
|
|
8
|
+
* target route's `middleware.ts` chain entirely. An action that revalidated
|
|
9
|
+
* a higher-privilege or user-controlled path could leak an authenticated
|
|
10
|
+
* RSC tree to the action submitter even when middleware on that path
|
|
11
|
+
* would have denied them.
|
|
12
|
+
*
|
|
13
|
+
* The fix (TIM-996) is to run the target route's middleware chain inside
|
|
14
|
+
* a fresh `runWithRequestContext` scope BEFORE building the element tree,
|
|
15
|
+
* propagate `DenySignal` and `RedirectSignal` to `executeAction`, drop the
|
|
16
|
+
* revalidation when middleware returns a short-circuit `Response`, and
|
|
17
|
+
* lift the request-header overlay onto the action's ALS store so the
|
|
18
|
+
* revalidated component render sees middleware-injected headers via
|
|
19
|
+
* `getHeaders()`.
|
|
20
|
+
*
|
|
21
|
+
* The input `path` is also validated as a local root-relative pathname so
|
|
22
|
+
* `revalidatePath('//evil.com/admin')` and similar scheme/authority
|
|
23
|
+
* injections cannot smuggle a foreign host through `new URL(path, base)`.
|
|
24
|
+
*
|
|
25
|
+
* See design/08-forms-and-actions.md §"revalidatePath()" and
|
|
26
|
+
* design/13-security.md §"Server actions silently bypass middleware".
|
|
27
|
+
*/
|
|
28
|
+
import type { BuildManifest } from '../build-manifest.js';
|
|
29
|
+
import type { RouteMatcher } from '../pipeline.js';
|
|
30
|
+
import type { RevalidateRenderer } from '../actions.js';
|
|
31
|
+
import { type CoerceSegmentParamsFn } from './action-middleware-runner.js';
|
|
32
|
+
/**
|
|
33
|
+
* Sentinel thrown when revalidation cannot proceed because middleware
|
|
34
|
+
* returned a short-circuit `Response` (a non-redirect HTTP response that
|
|
35
|
+
* we cannot translate back to an element tree). `executeAction` catches
|
|
36
|
+
* this and drops the revalidation — the action result is still delivered,
|
|
37
|
+
* but no `_tree` is piggybacked onto the response. The matching name
|
|
38
|
+
* `RevalidationDropped` is exported so callers can identify it via
|
|
39
|
+
* `instanceof` without leaking the message text to clients.
|
|
40
|
+
*/
|
|
41
|
+
export declare class RevalidationDropped extends Error {
|
|
42
|
+
constructor(message: string);
|
|
43
|
+
}
|
|
44
|
+
/** Result of validating a `revalidatePath()` argument. */
|
|
45
|
+
type PathValidation = {
|
|
46
|
+
ok: true;
|
|
47
|
+
pathname: string;
|
|
48
|
+
search: string;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
reason: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Validate a `revalidatePath()` argument.
|
|
55
|
+
*
|
|
56
|
+
* Accepts local root-relative pathnames only. Rejects anything that
|
|
57
|
+
* `new URL(path, base)` would resolve to a different host or scheme:
|
|
58
|
+
*
|
|
59
|
+
* - Empty / non-string input
|
|
60
|
+
* - Anything not starting with `/` (relative, scheme-bearing, etc.)
|
|
61
|
+
* - Protocol-relative `//evil.com/admin` — resolves to scheme://evil.com
|
|
62
|
+
* - Backslash-prefixed `/\evil.com` — some clients fold `\` into `/`
|
|
63
|
+
* - Control characters and null bytes
|
|
64
|
+
* - Paths that fail canonicalization (encoded separators, `..` escaping
|
|
65
|
+
* root, malformed percent-encoding)
|
|
66
|
+
*
|
|
67
|
+
* The pathname is canonicalized so the rest of the renderer matches the
|
|
68
|
+
* same shape the page pipeline matches.
|
|
69
|
+
*/
|
|
70
|
+
export declare function validateRevalidatePath(path: unknown): PathValidation;
|
|
71
|
+
/** Dependencies for the revalidate renderer factory. */
|
|
72
|
+
export interface RevalidateRendererDeps {
|
|
73
|
+
matchRoute: RouteMatcher;
|
|
74
|
+
coerceSegmentParams: CoerceSegmentParamsFn;
|
|
75
|
+
buildManifest: BuildManifest;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Build a per-request `RevalidateRenderer`.
|
|
79
|
+
*
|
|
80
|
+
* The returned renderer:
|
|
81
|
+
* 1. Validates the requested path.
|
|
82
|
+
* 2. Matches the canonicalized path against the route tree.
|
|
83
|
+
* 3. Coerces segment params via the matched chain's `params.ts` codecs.
|
|
84
|
+
* 4. Runs the matched route's `middleware.ts` chain inside a fresh
|
|
85
|
+
* `runWithRequestContext` scope (via `runMiddlewareForAction`).
|
|
86
|
+
* Deny/redirect signals are re-thrown so `executeAction` can apply
|
|
87
|
+
* its existing redirect handling and the new deny-drop behavior.
|
|
88
|
+
* A short-circuit `Response` becomes `RevalidationDropped`.
|
|
89
|
+
* 5. Lifts the request-header overlay onto the OUTER action's ALS store
|
|
90
|
+
* so the revalidated component render (which happens later inside
|
|
91
|
+
* `renderToReadableStream` in the action's scope) observes
|
|
92
|
+
* middleware-injected headers via `getHeaders()`. Acceptable because
|
|
93
|
+
* revalidation runs after the action body has returned — the only
|
|
94
|
+
* remaining ALS readers are render-phase code that should see the
|
|
95
|
+
* same overlay a normal page render would see.
|
|
96
|
+
* 6. Builds and returns the route element tree, ready for the action
|
|
97
|
+
* handler to serialize alongside the action result.
|
|
98
|
+
*
|
|
99
|
+
* Cookies set inside the revalidation middleware are intentionally NOT
|
|
100
|
+
* propagated to the action response. The middleware on a *different* path
|
|
101
|
+
* setting cookies via the action's response is surprising semantics; the
|
|
102
|
+
* scoped cookie jar on the inner ALS run is discarded with the scope.
|
|
103
|
+
* The primary security boundary closed here is auth — `deny()` from the
|
|
104
|
+
* target's middleware now prevents the revalidated tree from leaking.
|
|
105
|
+
*/
|
|
106
|
+
export declare function createRevalidateRendererFactory(deps: RevalidateRendererDeps): (req: Request) => RevalidateRenderer;
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=revalidate-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revalidate-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/revalidate-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK/D,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AAE5E,OAAO,EAA0B,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEnG;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED,0DAA0D;AAC1D,KAAK,cAAc,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAiCpE;AAoBD,wDAAwD;AACxD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,YAAY,CAAC;IACzB,mBAAmB,EAAE,qBAAqB,CAAC;IAC3C,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,sBAAsB,GAC3B,CAAC,GAAG,EAAE,OAAO,KAAK,kBAAkB,CA6KtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-payload.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,oBAAoB,EAAE,EACxC,YAAY,EAAE,WAAW,EAAE,EAC3B,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,eAAe,CAAC,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"rsc-payload.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,oBAAoB,EAAE,EACxC,YAAY,EAAE,WAAW,EAAE,EAC3B,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,eAAe,CAAC,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,QAAQ,CAAC,CAqKnB"}
|
|
@@ -29,6 +29,21 @@ import type { RenderSignals } from './rsc-stream.js';
|
|
|
29
29
|
export declare const __test_only_signalPromotionDepth: {
|
|
30
30
|
value: number;
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Test-only observable: true when the promotion loop hit the cap without
|
|
34
|
+
* capturing a signal (the silent-miss path — state 3 in TIM-970). False
|
|
35
|
+
* when the loop captured a signal at any depth, when it was skipped via
|
|
36
|
+
* `_fizzAllReadyResolved`, or when no signal was ever expected at a depth
|
|
37
|
+
* shallower than the cap.
|
|
38
|
+
*
|
|
39
|
+
* Pairs with `__test_only_signalPromotionDepth`: depth alone cannot
|
|
40
|
+
* distinguish "cap hit with signal captured on yield 5" from "cap hit with
|
|
41
|
+
* signal arriving on yield 6+" — both read `.value === 5`. This flag closes
|
|
42
|
+
* that gap. See TIM-970, design/05-streaming.md §"Signal Promotion".
|
|
43
|
+
*/
|
|
44
|
+
export declare const __test_only_signalPromotionCapHit: {
|
|
45
|
+
value: boolean;
|
|
46
|
+
};
|
|
32
47
|
interface SsrRenderOptions {
|
|
33
48
|
req: Request;
|
|
34
49
|
rscStream: ReadableStream<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/ssr-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B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gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoVjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sitemap-handler.d.ts","sourceRoot":"","sources":["../../src/server/sitemap-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"sitemap-handler.d.ts","sourceRoot":"","sources":["../../src/server/sitemap-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAgH9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-wrappers.d.ts","sourceRoot":"","sources":["../../src/server/ssr-wrappers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAwEhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,YAAY,EAAE,OAAO,GACpB,SAAS,
|
|
1
|
+
{"version":3,"file":"ssr-wrappers.d.ts","sourceRoot":"","sources":["../../src/server/ssr-wrappers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAwEhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,YAAY,EAAE,OAAO,GACpB,SAAS,CAgBX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-builder.d.ts","sourceRoot":"","sources":["../../src/server/tree-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlE,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAErF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,SAAS,CAAC;AAoDhE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAC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OAAO,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAoF1F"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared href/URL validation for all navigation sinks.
|
|
3
|
+
*
|
|
4
|
+
* Used by <Link>, useRouter().push/replace, and redirectExternal().
|
|
5
|
+
* Single source of truth for dangerous-scheme detection — prevents
|
|
6
|
+
* control-character smuggling that bypasses naive regex checks.
|
|
7
|
+
*
|
|
8
|
+
* See design/13-security.md §"Link scheme injection" (test #9)
|
|
9
|
+
* and design/07-routing.md §"<Link> Scheme Validation".
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Validate an href for navigation sinks (<Link>, useRouter, etc.).
|
|
13
|
+
*
|
|
14
|
+
* Rejects dangerous schemes (javascript:, data:, vbscript:) even when
|
|
15
|
+
* control characters are embedded to bypass naive regex checks.
|
|
16
|
+
* Also rejects protocol-relative URLs (//evil.com).
|
|
17
|
+
*
|
|
18
|
+
* Throws on rejection. Safe hrefs pass through silently.
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateNavigationHref(href: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Check if an href is internal (same-origin navigation) or external.
|
|
23
|
+
*
|
|
24
|
+
* Strips control characters before checking so that "java\tscript:" is
|
|
25
|
+
* correctly identified as having a scheme (and thus not internal).
|
|
26
|
+
*/
|
|
27
|
+
export declare function isInternalHref(href: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Validate and canonicalize an external redirect URL.
|
|
30
|
+
*
|
|
31
|
+
* Requires http: or https: scheme and checks origin against an allow-list.
|
|
32
|
+
* Returns the parsed canonical URL string (from URL.href) to prevent
|
|
33
|
+
* raw user input from reaching the Location header.
|
|
34
|
+
*
|
|
35
|
+
* @throws On invalid URL, dangerous scheme, or origin not in allow-list.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateExternalRedirectUrl(url: string, allowList: string[]): string;
|
|
38
|
+
//# sourceMappingURL=href-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"href-validation.d.ts","sourceRoot":"","sources":["../../src/shared/href-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAqBzD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUpD;AAID;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAiCpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-google.js","names":[],"sources":["../../src/shims/font-google.ts"],"sourcesContent":["/**\n * Fallback shim for `next/font/google` → `@timber/fonts/google`.\n *\n * At build time, the timber-fonts plugin's transform hook replaces font\n * function calls with static FontResult objects containing real class names\n * and font stacks. This file serves two purposes:\n *\n * 1. **TypeScript resolution** — provides types for IDEs and `tsc` outside\n * of Vite's module graph (where the virtual module handles it).\n * 2. **Runtime fallback** — returns empty className/fontFamily values when\n * the plugin hasn't processed a call (e.g. in tests or non-Vite environments).\n *\n * The shim resolution path (`next/font/google` → `\\0@timber/fonts/google`)\n * is unchanged — this file is NOT on that resolution path. It exists as a\n * physical module for direct imports and type re-exports.\n *\n * Design doc: 24-fonts.md, \"Next.js Font Compatibility\"\n */\n\nimport type { GoogleFontConfig, FontResult } from '../fonts/types.js';\n\nexport type { GoogleFontConfig, FontResult };\n\n/**\n * Create a stub FontResult with empty values.\n *\n * The timber-fonts plugin replaces these calls at build time with real\n * class names and font stacks. This stub ensures code that imports\n * font functions outside of the build pipeline (tests, type-checking)\n * gets a valid FontResult shape without runtime errors.\n */\nfunction createStubFontResult(config?: GoogleFontConfig): FontResult {\n return {\n className: '',\n style: { fontFamily: '' },\n variable: config?.variable,\n };\n}\n\n/**\n * Generic font loader — accepts any font name, returns a stub FontResult.\n *\n * Named exports like `Inter`, `Roboto`, etc. are generated dynamically\n * by the virtual module at build time. This function provides a catch-all\n * for non-Vite contexts.\n */\nexport function createFont(_family: string, config?: GoogleFontConfig): FontResult {\n return createStubFontResult(config);\n}\n\n// Common Google Font exports for TypeScript autocomplete.\n// These are stubs — the virtual module and transform hook provide real values.\nexport const Inter = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Roboto = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Open_Sans = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Lato = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Montserrat = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Poppins = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Geist = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Geist_Mono = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const JetBrains_Mono = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Source_Code_Pro = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Playfair_Display = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Merriweather = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\n"],"mappings":";;;;;;;;;AA+BA,SAAS,qBAAqB,QAAuC;
|
|
1
|
+
{"version":3,"file":"font-google.js","names":[],"sources":["../../src/shims/font-google.ts"],"sourcesContent":["/**\n * Fallback shim for `next/font/google` → `@timber/fonts/google`.\n *\n * At build time, the timber-fonts plugin's transform hook replaces font\n * function calls with static FontResult objects containing real class names\n * and font stacks. This file serves two purposes:\n *\n * 1. **TypeScript resolution** — provides types for IDEs and `tsc` outside\n * of Vite's module graph (where the virtual module handles it).\n * 2. **Runtime fallback** — returns empty className/fontFamily values when\n * the plugin hasn't processed a call (e.g. in tests or non-Vite environments).\n *\n * The shim resolution path (`next/font/google` → `\\0@timber/fonts/google`)\n * is unchanged — this file is NOT on that resolution path. It exists as a\n * physical module for direct imports and type re-exports.\n *\n * Design doc: 24-fonts.md, \"Next.js Font Compatibility\"\n */\n\nimport type { GoogleFontConfig, FontResult } from '../fonts/types.js';\n\nexport type { GoogleFontConfig, FontResult };\n\n/**\n * Create a stub FontResult with empty values.\n *\n * The timber-fonts plugin replaces these calls at build time with real\n * class names and font stacks. This stub ensures code that imports\n * font functions outside of the build pipeline (tests, type-checking)\n * gets a valid FontResult shape without runtime errors.\n */\nfunction createStubFontResult(config?: GoogleFontConfig): FontResult {\n return {\n className: '',\n style: { fontFamily: '' },\n variable: config?.variable,\n };\n}\n\n/**\n * Generic font loader — accepts any font name, returns a stub FontResult.\n *\n * Named exports like `Inter`, `Roboto`, etc. are generated dynamically\n * by the virtual module at build time. This function provides a catch-all\n * for non-Vite contexts.\n */\nexport function createFont(_family: string, config?: GoogleFontConfig): FontResult {\n return createStubFontResult(config);\n}\n\n// Common Google Font exports for TypeScript autocomplete.\n// These are stubs — the virtual module and transform hook provide real values.\nexport const Inter = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Roboto = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Open_Sans = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Lato = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Montserrat = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Poppins = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Geist = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const Geist_Mono = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\nexport const JetBrains_Mono = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Source_Code_Pro = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Playfair_Display = (config?: GoogleFontConfig): FontResult =>\n createStubFontResult(config);\nexport const Merriweather = (config?: GoogleFontConfig): FontResult => createStubFontResult(config);\n"],"mappings":";;;;;;;;;AA+BA,SAAS,qBAAqB,QAAuC;CACnE,OAAO;EACL,WAAW;EACX,OAAO,EAAE,YAAY,IAAI;EACzB,UAAU,QAAQ;EACnB;;;;;;;;;AAUH,SAAgB,WAAW,SAAiB,QAAuC;CACjF,OAAO,qBAAqB,OAAO;;AAKrC,IAAa,SAAS,WAA0C,qBAAqB,OAAO;AAC5F,IAAa,UAAU,WAA0C,qBAAqB,OAAO;AAC7F,IAAa,aAAa,WAA0C,qBAAqB,OAAO;AAChG,IAAa,QAAQ,WAA0C,qBAAqB,OAAO;AAC3F,IAAa,cAAc,WAA0C,qBAAqB,OAAO;AACjG,IAAa,WAAW,WAA0C,qBAAqB,OAAO;AAC9F,IAAa,SAAS,WAA0C,qBAAqB,OAAO;AAC5F,IAAa,cAAc,WAA0C,qBAAqB,OAAO;AACjG,IAAa,kBAAkB,WAC7B,qBAAqB,OAAO;AAC9B,IAAa,mBAAmB,WAC9B,qBAAqB,OAAO;AAC9B,IAAa,oBAAoB,WAC/B,qBAAqB,OAAO;AAC9B,IAAa,gBAAgB,WAA0C,qBAAqB,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-local.js","names":[],"sources":["../../src/shims/font-local.ts"],"sourcesContent":["/**\n * Fallback shim for `next/font/local` → `@timber/fonts/local`.\n *\n * At build time, the timber-fonts plugin's transform hook replaces\n * `localFont()` calls with static FontResult objects containing real\n * class names and font stacks. This file serves two purposes:\n *\n * 1. **TypeScript resolution** — provides types for IDEs and `tsc` outside\n * of Vite's module graph (where the virtual module handles it).\n * 2. **Runtime fallback** — returns empty className/fontFamily values when\n * the plugin hasn't processed a call (e.g. in tests or non-Vite environments).\n *\n * Design doc: 24-fonts.md, \"Next.js Font Compatibility\"\n */\n\nimport type { LocalFontConfig, FontResult } from '../fonts/types.js';\n\nexport type { LocalFontConfig, FontResult };\n\n/**\n * Create a local font.\n *\n * The timber-fonts plugin replaces these calls at build time with real\n * class names and font stacks. This stub ensures code that imports\n * `localFont` outside of the build pipeline (tests, type-checking)\n * gets a valid FontResult shape without runtime errors.\n */\nexport default function localFont(config?: LocalFontConfig): FontResult {\n return {\n className: '',\n style: { fontFamily: '' },\n variable: config?.variable,\n };\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAwB,UAAU,QAAsC;
|
|
1
|
+
{"version":3,"file":"font-local.js","names":[],"sources":["../../src/shims/font-local.ts"],"sourcesContent":["/**\n * Fallback shim for `next/font/local` → `@timber/fonts/local`.\n *\n * At build time, the timber-fonts plugin's transform hook replaces\n * `localFont()` calls with static FontResult objects containing real\n * class names and font stacks. This file serves two purposes:\n *\n * 1. **TypeScript resolution** — provides types for IDEs and `tsc` outside\n * of Vite's module graph (where the virtual module handles it).\n * 2. **Runtime fallback** — returns empty className/fontFamily values when\n * the plugin hasn't processed a call (e.g. in tests or non-Vite environments).\n *\n * Design doc: 24-fonts.md, \"Next.js Font Compatibility\"\n */\n\nimport type { LocalFontConfig, FontResult } from '../fonts/types.js';\n\nexport type { LocalFontConfig, FontResult };\n\n/**\n * Create a local font.\n *\n * The timber-fonts plugin replaces these calls at build time with real\n * class names and font stacks. This stub ensures code that imports\n * `localFont` outside of the build pipeline (tests, type-checking)\n * gets a valid FontResult shape without runtime errors.\n */\nexport default function localFont(config?: LocalFontConfig): FontResult {\n return {\n className: '',\n style: { fontFamily: '' },\n variable: config?.variable,\n };\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAwB,UAAU,QAAsC;CACtE,OAAO;EACL,WAAW;EACX,OAAO,EAAE,YAAY,IAAI;EACzB,UAAU,QAAQ;EACnB"}
|
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.135",
|
|
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",
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"@opentelemetry/api": "^1.9.1",
|
|
124
|
-
"@opentelemetry/context-async-hooks": "^2.
|
|
125
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
124
|
+
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
125
|
+
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
126
126
|
"magic-string": "^0.30.21",
|
|
127
|
-
"nitro": "3.0.
|
|
127
|
+
"nitro": "3.0.260429-beta"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
130
|
"@content-collections/core": "^0.14.0",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"nuqs": "^2.0.0",
|
|
137
137
|
"react": "19.3.0-canary-d5736f09-20260507",
|
|
138
138
|
"react-dom": "19.3.0-canary-d5736f09-20260507",
|
|
139
|
-
"vite": "^8.0.
|
|
139
|
+
"vite": "^8.0.8",
|
|
140
140
|
"wrangler": "^4.0.0",
|
|
141
141
|
"zod": "^3.22.0 || ^4.0.0"
|
|
142
142
|
},
|
package/src/cache/cache-api.ts
CHANGED
|
@@ -20,9 +20,10 @@ import { getCacheHandler } from './handler-store';
|
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
21
|
export function cache<Fn extends (...args: any[]) => Promise<any>>(
|
|
22
22
|
fn: Fn,
|
|
23
|
-
opts: CacheOptions<Fn
|
|
23
|
+
opts: CacheOptions<Fn>,
|
|
24
|
+
stableId?: string
|
|
24
25
|
): Fn {
|
|
25
|
-
return createCache(fn, opts, getCacheHandler());
|
|
26
|
+
return createCache(fn, opts, getCacheHandler(), stableId);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -34,8 +34,8 @@ function resolveTags<Fn extends (...args: any[]) => any>(
|
|
|
34
34
|
return opts.tags(...args);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
let
|
|
37
|
+
let unstableIdCounter = 0;
|
|
38
|
+
let hasWarnedUnstableId = false;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Creates a cached wrapper around an async function.
|
|
@@ -53,9 +53,32 @@ let fnIdCounter = 0;
|
|
|
53
53
|
export function createCache<Fn extends (...args: any[]) => Promise<any>>(
|
|
54
54
|
fn: Fn,
|
|
55
55
|
opts: CacheOptions<Fn>,
|
|
56
|
-
handler: CacheHandler
|
|
56
|
+
handler: CacheHandler,
|
|
57
|
+
stableId?: string
|
|
57
58
|
): Fn {
|
|
58
|
-
|
|
59
|
+
let fnId: string;
|
|
60
|
+
if (stableId) {
|
|
61
|
+
fnId = stableId;
|
|
62
|
+
} else if (opts.key) {
|
|
63
|
+
// Explicit key function — fnId is only used for singleflight, not for
|
|
64
|
+
// cache keys, so a counter is acceptable here.
|
|
65
|
+
fnId = `timber-cache:${unstableIdCounter++}`;
|
|
66
|
+
} else {
|
|
67
|
+
fnId = `timber-cache:unstable:${unstableIdCounter++}`;
|
|
68
|
+
if (
|
|
69
|
+
!hasWarnedUnstableId &&
|
|
70
|
+
typeof process !== 'undefined' &&
|
|
71
|
+
process.env?.NODE_ENV !== 'test'
|
|
72
|
+
) {
|
|
73
|
+
hasWarnedUnstableId = true;
|
|
74
|
+
console.warn(
|
|
75
|
+
'[timber] cache() called without a stable ID or explicit key function. ' +
|
|
76
|
+
'Cache keys will use a process-local counter which is unstable across ' +
|
|
77
|
+
'cold starts. Run through the timber Vite plugin or provide an explicit ' +
|
|
78
|
+
'`key` option to fix this.'
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
59
82
|
const sf = opts.timeoutMs
|
|
60
83
|
? createSingleflight({ timeoutMs: opts.timeoutMs })
|
|
61
84
|
: defaultSingleflight;
|
package/src/client/index.ts
CHANGED
|
@@ -56,6 +56,7 @@ export type { LinkSegmentParams, OnNavigateHandler, OnNavigateEvent } from './li
|
|
|
56
56
|
//
|
|
57
57
|
// See TIM-624 (original typed Link), TIM-830 (flat searchParams), and
|
|
58
58
|
// TIM-832 (this restructure for overload error UX).
|
|
59
|
+
// eslint-disable-next-line typescript/no-empty-interface -- augmented by codegen
|
|
59
60
|
export interface LinkFunction {
|
|
60
61
|
// intentionally empty — call signatures are provided via codegen
|
|
61
62
|
// augmentation in `.timber/timber-routes.d.ts`.
|
package/src/client/link.tsx
CHANGED
|
@@ -28,6 +28,10 @@ import type { SearchParamsDefinition } from '../search-params/define.js';
|
|
|
28
28
|
import { getSearchParamsDefinition } from '../search-params/registry.js';
|
|
29
29
|
import type { LinkFunction } from './index.js';
|
|
30
30
|
import { classifyUrlSegment, type UrlSegment } from '../routing/segment-classify.js';
|
|
31
|
+
import {
|
|
32
|
+
validateNavigationHref as validateLinkHref,
|
|
33
|
+
isInternalHref,
|
|
34
|
+
} from '../shared/href-validation.js';
|
|
31
35
|
import { LinkStatusContext } from './use-link-status.js';
|
|
32
36
|
import { getRouterOrNull } from './router-ref.js';
|
|
33
37
|
import { getSsrData } from './ssr-data.js';
|
|
@@ -168,38 +172,7 @@ export type LinkPropsWithParams = LinkRuntimeProps & {
|
|
|
168
172
|
};
|
|
169
173
|
export type LinkProps = LinkRuntimeProps;
|
|
170
174
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Reject dangerous URL schemes that could execute script.
|
|
175
|
-
* Security: design/13-security.md § Link scheme injection (test #9)
|
|
176
|
-
*/
|
|
177
|
-
const DANGEROUS_SCHEMES = /^\s*(javascript|data|vbscript):/i;
|
|
178
|
-
|
|
179
|
-
export function validateLinkHref(href: string): void {
|
|
180
|
-
if (DANGEROUS_SCHEMES.test(href)) {
|
|
181
|
-
throw new Error(
|
|
182
|
-
`<Link> received a dangerous href: "${href}". ` +
|
|
183
|
-
'javascript:, data:, and vbscript: URLs are not allowed.'
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// ─── Internal Link Detection ─────────────────────────────────────
|
|
189
|
-
|
|
190
|
-
/** Returns true if the href is an internal path (not an external URL) */
|
|
191
|
-
export function isInternalHref(href: string): boolean {
|
|
192
|
-
// Relative paths, root-relative paths, and hash links are internal
|
|
193
|
-
if (href.startsWith('/') || href.startsWith('#') || href.startsWith('?')) {
|
|
194
|
-
return true;
|
|
195
|
-
}
|
|
196
|
-
// Anything with a protocol scheme is external
|
|
197
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(href)) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
// Bare relative paths (e.g., "dashboard") are internal
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
175
|
+
export { validateLinkHref, isInternalHref };
|
|
203
176
|
|
|
204
177
|
// ─── URL Interpolation ──────────────────────────────────────────
|
|
205
178
|
|
|
@@ -509,11 +482,14 @@ export const Link: LinkFunction = function LinkImpl(props: any) {
|
|
|
509
482
|
// We read current search params directly to avoid unconditional hook calls.
|
|
510
483
|
// On the client, window.location.search is always current; during SSR,
|
|
511
484
|
// getSsrData() provides the request's search params.
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
const
|
|
485
|
+
const internal = isInternalHref(baseHref);
|
|
486
|
+
|
|
487
|
+
// Only preserve search params for internal links — leaking current
|
|
488
|
+
// page params (tokens, UTM, etc.) to external domains is a data leak.
|
|
489
|
+
const resolvedHref =
|
|
490
|
+
preserveSearchParams && internal
|
|
491
|
+
? mergePreservedSearchParams(baseHref, getCurrentSearch(), preserveSearchParams)
|
|
492
|
+
: baseHref;
|
|
517
493
|
|
|
518
494
|
// ─── Click handler ───────────────────────────────────────────
|
|
519
495
|
// Each Link component owns its click handling. The router is
|
|
@@ -102,6 +102,7 @@ export function useNavigationContext(): NavigationState | null {
|
|
|
102
102
|
if (!ctx) return null;
|
|
103
103
|
// useContext may not exist in the RSC environment — caller wraps in try/catch
|
|
104
104
|
if (typeof React.useContext !== 'function') return null;
|
|
105
|
+
// eslint-disable-next-line rules-of-hooks -- conditional on environment, not render path
|
|
105
106
|
return React.useContext(ctx);
|
|
106
107
|
}
|
|
107
108
|
|
|
@@ -203,6 +204,7 @@ export function usePendingNavigationUrl(): string | null {
|
|
|
203
204
|
const ctx = getOrCreatePendingContext();
|
|
204
205
|
if (!ctx) return null;
|
|
205
206
|
if (typeof React.useContext !== 'function') return null;
|
|
207
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- conditional on environment, not render path
|
|
206
208
|
return React.useContext(ctx);
|
|
207
209
|
}
|
|
208
210
|
|
|
@@ -31,6 +31,7 @@ export function usePathname(): string {
|
|
|
31
31
|
// Try reading from NavigationContext (client-side, inside React tree).
|
|
32
32
|
// During SSR, no NavigationProvider is mounted, so this returns null.
|
|
33
33
|
try {
|
|
34
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- conditional on environment, not render path
|
|
34
35
|
const navContext = useNavigationContext();
|
|
35
36
|
if (navContext !== null) {
|
|
36
37
|
return navContext.pathname;
|
package/src/client/use-router.ts
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { getRouterOrNull } from './router-ref.js';
|
|
27
|
+
import { validateNavigationHref } from '../shared/href-validation.js';
|
|
27
28
|
|
|
28
29
|
export interface AppRouterInstance {
|
|
29
30
|
/** Navigate to a URL, pushing a new history entry */
|
|
@@ -60,6 +61,7 @@ export interface AppRouterInstance {
|
|
|
60
61
|
export function useRouter(): AppRouterInstance {
|
|
61
62
|
return {
|
|
62
63
|
push(href: string, options?: { scroll?: boolean }) {
|
|
64
|
+
validateNavigationHref(href);
|
|
63
65
|
const router = getRouterOrNull();
|
|
64
66
|
if (!router) {
|
|
65
67
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -72,6 +74,7 @@ export function useRouter(): AppRouterInstance {
|
|
|
72
74
|
void router.navigate(href, { scroll: options?.scroll });
|
|
73
75
|
},
|
|
74
76
|
replace(href: string, options?: { scroll?: boolean }) {
|
|
77
|
+
validateNavigationHref(href);
|
|
75
78
|
const router = getRouterOrNull();
|
|
76
79
|
if (!router) {
|
|
77
80
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -41,6 +41,7 @@ function getSearchParams(search: string): URLSearchParams {
|
|
|
41
41
|
*/
|
|
42
42
|
export function useSearchParams(): URLSearchParams {
|
|
43
43
|
try {
|
|
44
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- conditional on environment, not render path
|
|
44
45
|
const navContext = useNavigationContext();
|
|
45
46
|
if (navContext !== null) {
|
|
46
47
|
return getSearchParams(navContext.search);
|
|
@@ -128,6 +128,7 @@ export function useSegmentParams(_segmentPath?: string): Record<string, string |
|
|
|
128
128
|
// During SSR, no NavigationProvider is mounted, so this returns null.
|
|
129
129
|
// When called outside a React component, useContext throws — caught below.
|
|
130
130
|
try {
|
|
131
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- conditional on environment, not render path
|
|
131
132
|
const navContext = useNavigationContext();
|
|
132
133
|
if (navContext !== null) {
|
|
133
134
|
return navContext.params;
|
package/src/config-validation.ts
CHANGED
|
@@ -92,7 +92,7 @@ export function validateConfig(config: TimberUserConfig): ConfigError[] {
|
|
|
92
92
|
field: 'renderTimeoutMs',
|
|
93
93
|
message: `renderTimeoutMs must be a non-negative number (got ${JSON.stringify(config.renderTimeoutMs)}).`,
|
|
94
94
|
value: config.renderTimeoutMs,
|
|
95
|
-
suggestion: 'Use renderTimeoutMs: 30000 (default)
|
|
95
|
+
suggestion: 'Use renderTimeoutMs: 30000 (default). Setting 0 uses a 120s safety ceiling.',
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}
|