@timber-js/app 0.2.0-alpha.198 → 0.2.0-alpha.199
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-BS-m5SLv.js → actions-d1hCqnU3.js} +35 -8
- package/dist/_chunks/actions-d1hCqnU3.js.map +1 -0
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
- package/dist/_chunks/{cache-api-DqzgTEqk.js → cache-api-ByagcC-J.js} +2 -2
- package/dist/_chunks/{cache-api-DqzgTEqk.js.map → cache-api-ByagcC-J.js.map} +1 -1
- package/dist/_chunks/canonicalize-CgHoscYO.js +66 -0
- package/dist/_chunks/canonicalize-CgHoscYO.js.map +1 -0
- package/dist/_chunks/{chains-CZG7E5zg.js → chains-Bpb0W4ax.js} +3 -3
- package/dist/_chunks/{chains-CZG7E5zg.js.map → chains-Bpb0W4ax.js.map} +1 -1
- package/dist/_chunks/{cli-check-dVDi1GQz.js → cli-check-D6VolrDV.js} +3 -3
- package/dist/_chunks/{cli-check-dVDi1GQz.js.map → cli-check-D6VolrDV.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-DTy_-Msq.js → cli-schema-sync-D6rO-VcS.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-DTy_-Msq.js.map → cli-schema-sync-D6rO-VcS.js.map} +1 -1
- package/dist/_chunks/{convention-lint-Ph6luW4c.js → convention-lint-fRkwVwEH.js} +25 -4
- package/dist/_chunks/convention-lint-fRkwVwEH.js.map +1 -0
- package/dist/_chunks/error-boundary-BfPHZjm0.js +1050 -0
- package/dist/_chunks/error-boundary-BfPHZjm0.js.map +1 -0
- package/dist/_chunks/{live-graph-BXDsdzBv.js → live-graph-D_2D32Ad.js} +3 -3
- package/dist/_chunks/{live-graph-BXDsdzBv.js.map → live-graph-D_2D32Ad.js.map} +1 -1
- package/dist/_chunks/{logger-DDirEsn7.js → logger-uLBuGKDI.js} +471 -440
- package/dist/_chunks/logger-uLBuGKDI.js.map +1 -0
- package/dist/_chunks/{navigation-root-B00jjGd5.js → navigation-context-D0TU0Jog.js} +3 -101
- package/dist/_chunks/navigation-context-D0TU0Jog.js.map +1 -0
- package/dist/_chunks/navigation-root-mHSK9psY.js +126 -0
- package/dist/_chunks/{navigation-root-B00jjGd5.js.map → navigation-root-mHSK9psY.js.map} +1 -1
- package/dist/_chunks/{poison-scan-BoDLgbix.js → poison-scan-Bm9Yyqk9.js} +2 -2
- package/dist/_chunks/{poison-scan-BoDLgbix.js.map → poison-scan-Bm9Yyqk9.js.map} +1 -1
- package/dist/_chunks/{scanner-tdFPvDYi.js → scanner-AiazgH_f.js} +6 -5
- package/dist/_chunks/scanner-AiazgH_f.js.map +1 -0
- package/dist/_chunks/{segment-keys-BhqoHiLc.js → segment-keys-lqtdookO.js} +2 -65
- package/dist/_chunks/segment-keys-lqtdookO.js.map +1 -0
- package/dist/_chunks/{ssr-data-BQGhTPAK.js → ssr-data-D6T6Y3ef.js} +4 -26
- package/dist/_chunks/ssr-data-D6T6Y3ef.js.map +1 -0
- package/dist/_chunks/state-FippDgxN.js +52 -0
- package/dist/_chunks/state-FippDgxN.js.map +1 -0
- package/dist/_chunks/status-page-marker-DwQBrLBz.js +496 -0
- package/dist/_chunks/status-page-marker-DwQBrLBz.js.map +1 -0
- package/dist/_chunks/{walkers-DNX05dC0.js → walkers-B6XUtmqK.js} +2 -2
- package/dist/_chunks/{walkers-DNX05dC0.js.map → walkers-B6XUtmqK.js.map} +1 -1
- package/dist/analyze/crawl-entry.js +2 -2
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/index.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/client/browser-entry/action-dispatch.d.ts +6 -4
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/action-queue.d.ts +44 -0
- package/dist/client/browser-entry/action-queue.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/deny-last-resort.d.ts +29 -0
- package/dist/client/deny-last-resort.d.ts.map +1 -0
- package/dist/client/error-boundary.d.ts +48 -2
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +2 -2
- package/dist/client/history.d.ts +21 -2
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.js +34 -14
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +1 -0
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +272 -1225
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-commit.d.ts +12 -19
- package/dist/client/navigation-commit.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +62 -11
- package/dist/client/navigation-transition.d.ts.map +1 -1
- package/dist/client/router-effects.d.ts +9 -8
- package/dist/client/router-effects.d.ts.map +1 -1
- package/dist/client/router-lifecycle.d.ts +60 -17
- package/dist/client/router-lifecycle.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +7 -4
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +63 -8
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +0 -9
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +23 -8
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/state.d.ts +16 -0
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/status-page-marker.d.ts +25 -0
- package/dist/client/status-page-marker.d.ts.map +1 -0
- package/dist/cookies/index.js +1 -1
- package/dist/dev-tools/holding-server.d.ts +4 -17
- package/dist/dev-tools/holding-server.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -175
- package/dist/index.js.map +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/interception.d.ts +2 -2
- package/dist/routing/slot-placement.d.ts +2 -2
- package/dist/server/access-gate.d.ts +73 -1
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +16 -1
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +3 -9
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/children-interception.d.ts +1 -1
- package/dist/server/default-status-page.d.ts +2 -2
- package/dist/server/default-status-page.d.ts.map +1 -1
- package/dist/server/deny-boundary.d.ts +15 -9
- package/dist/server/deny-boundary.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +21 -4
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/error-response-headers.d.ts +3 -0
- package/dist/server/error-response-headers.d.ts.map +1 -0
- package/dist/server/index.js +3 -3
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +1 -2
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +2339 -2506
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-collector.d.ts +2 -5
- package/dist/server/metadata-collector.d.ts.map +1 -1
- package/dist/server/param-coercion.d.ts +10 -3
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts +11 -0
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/port-resolution.d.ts +3 -89
- package/dist/server/port-resolution.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +38 -10
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/response-cache-policy.d.ts +3 -0
- package/dist/server/response-cache-policy.d.ts.map +1 -0
- package/dist/server/route-element-builder.d.ts +11 -41
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-element-helpers.d.ts +12 -0
- package/dist/server/route-element-helpers.d.ts.map +1 -0
- package/dist/server/route-module-loader.d.ts +37 -0
- package/dist/server/route-module-loader.d.ts.map +1 -0
- package/dist/server/rsc-cache-key-guard.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts +22 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +4 -11
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-error-envelope.d.ts +11 -0
- package/dist/server/rsc-error-envelope.d.ts.map +1 -0
- package/dist/server/skippable-prefix.d.ts +18 -15
- package/dist/server/skippable-prefix.d.ts.map +1 -1
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/slot-subtree-contain.d.ts +54 -0
- package/dist/server/slot-subtree-contain.d.ts.map +1 -0
- package/dist/server/stream-utils.d.ts.map +1 -1
- package/dist/server/utils/element-type.d.ts +10 -0
- package/dist/server/utils/element-type.d.ts.map +1 -1
- package/dist/shared/rsc-error-envelope.d.ts +0 -9
- package/dist/shared/rsc-error-envelope.d.ts.map +1 -1
- package/dist/shared/status-reason-phrase.d.ts +26 -0
- package/dist/shared/status-reason-phrase.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +4 -2
- package/docs/api/31-api-client.mdx +5 -1
- package/docs/api/36-cli.mdx +5 -3
- package/docs/learn/12-error-handling.mdx +5 -1
- package/package.json +10 -10
- package/src/client/browser-entry/action-dispatch.ts +166 -99
- package/src/client/browser-entry/action-queue.ts +90 -0
- package/src/client/browser-entry/router-init.ts +60 -35
- package/src/client/deny-last-resort.tsx +54 -0
- package/src/client/error-boundary.tsx +144 -42
- package/src/client/history.ts +52 -3
- package/src/client/internal.ts +1 -0
- package/src/client/link.tsx +70 -35
- package/src/client/navigation-commit.ts +79 -27
- package/src/client/navigation-transition.ts +176 -127
- package/src/client/router-effects.ts +14 -17
- package/src/client/router-lifecycle.ts +181 -115
- package/src/client/router-pipeline.ts +94 -71
- package/src/client/router-types.ts +61 -7
- package/src/client/router.ts +147 -74
- package/src/client/rsc-fetch.ts +0 -13
- package/src/client/segment-cache.ts +43 -10
- package/src/client/state.ts +26 -0
- package/src/client/status-page-marker.tsx +32 -0
- package/src/dev-tools/holding-server.ts +4 -17
- package/src/index.ts +18 -34
- package/src/plugins/dev-server.ts +2 -1
- package/src/routing/interception.ts +2 -2
- package/src/routing/slot-placement.ts +2 -2
- package/src/server/access-gate.tsx +89 -21
- package/src/server/action-client.ts +2 -2
- package/src/server/action-handler.ts +23 -10
- package/src/server/actions.ts +81 -34
- package/src/server/als-registry.ts +3 -9
- package/src/server/children-interception.ts +1 -1
- package/src/server/default-status-page.ts +7 -47
- package/src/server/deny-boundary.ts +45 -28
- package/src/server/deny-renderer.ts +6 -2
- package/src/server/error-boundary-wrapper.ts +23 -4
- package/src/server/error-response-headers.ts +18 -0
- package/src/server/internal.ts +2 -10
- package/src/server/metadata-collector.ts +3 -18
- package/src/server/param-coercion.ts +13 -4
- package/src/server/pipeline-outcome.ts +35 -13
- package/src/server/pipeline-phases.ts +22 -16
- package/src/server/port-resolution.ts +3 -165
- package/src/server/prebuilt-builder.ts +4 -4
- package/src/server/primitives.ts +75 -11
- package/src/server/response-cache-policy.ts +45 -0
- package/src/server/route-element-builder.ts +149 -412
- package/src/server/route-element-helpers.ts +37 -0
- package/src/server/route-handler.ts +2 -2
- package/src/server/route-module-loader.ts +161 -0
- package/src/server/rsc-cache-key-guard.ts +2 -42
- package/src/server/rsc-entry/action-middleware-runner.ts +4 -4
- package/src/server/rsc-entry/api-handler.ts +5 -5
- package/src/server/rsc-entry/error-renderer.ts +3 -4
- package/src/server/rsc-entry/helpers.ts +1 -1
- package/src/server/rsc-entry/index.ts +3 -3
- package/src/server/rsc-entry/render-route.ts +4 -8
- package/src/server/rsc-entry/rsc-payload.ts +59 -42
- package/src/server/rsc-entry/rsc-stream.ts +48 -27
- package/src/server/rsc-entry/ssr-renderer.ts +6 -10
- package/src/server/rsc-error-envelope.ts +18 -0
- package/src/server/skippable-prefix.ts +105 -7
- package/src/server/slot-resolver.ts +43 -12
- package/src/server/slot-subtree-contain.ts +255 -0
- package/src/server/stream-utils.ts +12 -8
- package/src/server/utils/element-type.ts +18 -2
- package/src/shared/rsc-error-envelope.ts +0 -15
- package/src/shared/status-reason-phrase.ts +61 -0
- package/dist/_chunks/actions-BS-m5SLv.js.map +0 -1
- package/dist/_chunks/convention-lint-Ph6luW4c.js.map +0 -1
- package/dist/_chunks/error-boundary-BvRCCmbN.js +0 -353
- package/dist/_chunks/error-boundary-BvRCCmbN.js.map +0 -1
- package/dist/_chunks/logger-DDirEsn7.js.map +0 -1
- package/dist/_chunks/mdx-file-CXyHGUpS.js +0 -25
- package/dist/_chunks/mdx-file-CXyHGUpS.js.map +0 -1
- package/dist/_chunks/router-ref-8gr8qsxN.js +0 -28
- package/dist/_chunks/router-ref-8gr8qsxN.js.map +0 -1
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js +0 -40
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js.map +0 -1
- package/dist/_chunks/scanner-tdFPvDYi.js.map +0 -1
- package/dist/_chunks/segment-keys-BhqoHiLc.js.map +0 -1
- package/dist/_chunks/ssr-data-BQGhTPAK.js.map +0 -1
- package/dist/server/tree-builder.d.ts +0 -150
- package/dist/server/tree-builder.d.ts.map +0 -1
- package/src/server/tree-builder.ts +0 -313
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/client/link.tsx"],"names":[],"mappings":"AAqBA,OAAO,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/client/link.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAEf,MAAM,O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;;GAgBG;AAIH,eAAO,MAAM,IAAI,EAAE,YA8LlB,CAAC"}
|
|
@@ -14,6 +14,13 @@ import type { HistoryStack } from './history.ts';
|
|
|
14
14
|
import type { SegmentInfo, StateTree } from '../shared/segment-info.ts';
|
|
15
15
|
import type { ParamsSource } from '../shared/payload-root.ts';
|
|
16
16
|
import { type NavigationState } from './navigation-context.ts';
|
|
17
|
+
/**
|
|
18
|
+
* Record that a status page for the main route is on screen. Called from
|
|
19
|
+
* `StatusPageMarker`'s layout effect; consumed by the commit of the
|
|
20
|
+
* navigation whose tree it belongs to, and acted on immediately for the
|
|
21
|
+
* commits that have none.
|
|
22
|
+
*/
|
|
23
|
+
export declare function reportStatusPageRendered(): void;
|
|
17
24
|
/** Everything a commit needs to describe the page it makes current. */
|
|
18
25
|
export interface NavigationCommitInput {
|
|
19
26
|
payload: unknown;
|
|
@@ -36,22 +43,6 @@ export interface NavigationCommitInput {
|
|
|
36
43
|
/** When true, clear the segment cache if segmentInfo is absent
|
|
37
44
|
* (popstate replay for entries without layout metadata). */
|
|
38
45
|
clearSegmentCacheOnEmpty?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* HTTP status of the response this navigation rendered, when it came from a
|
|
41
|
-
* fetch. Omitted by replays, which re-publish a tree already judged.
|
|
42
|
-
*
|
|
43
|
-
* An error response rendered a status page, and a status page replaces a
|
|
44
|
-
* subtree: the deny page lands at the segment owning the matched file and
|
|
45
|
-
* nothing below it mounts. `segmentInfo` nonetheless describes the whole
|
|
46
|
-
* chain the payload was built against — it must, because the merge point is
|
|
47
|
-
* chosen out of it — so the cache has to be told not to learn from this one.
|
|
48
|
-
*
|
|
49
|
-
* Enforced here rather than at the call sites because there are three of
|
|
50
|
-
* them (`performNavigationFetch`, `refresh()`, and uncached traversal, the
|
|
51
|
-
* last two through `fetchCommitAndRender`) and only one had the check.
|
|
52
|
-
* See TIM-1356.
|
|
53
|
-
*/
|
|
54
|
-
status?: number;
|
|
55
46
|
/**
|
|
56
47
|
* Layouts the server skipped on this response (`X-Timber-Skipped-Segments`),
|
|
57
48
|
* when it came from a fetch. Omitted by replays and revalidation.
|
|
@@ -63,9 +54,11 @@ export interface NavigationCommitInput {
|
|
|
63
54
|
* replayed later, shows whatever the client holds *then*, not what was on
|
|
64
55
|
* screen when the entry committed. Such entries store a null payload and
|
|
65
56
|
* traversals to them fetch instead. Decided here, not at the fetch call
|
|
66
|
-
* sites,
|
|
67
|
-
*
|
|
68
|
-
*
|
|
57
|
+
* sites, because there are three of those (`performNavigationFetch`,
|
|
58
|
+
* `refresh()`, and uncached traversal) and a rule applied at one of them
|
|
59
|
+
* holds by accident: `performNavigationFetch` had the check and
|
|
60
|
+
* `fetchCommitAndRender` did not, so a back/forward fetch that was
|
|
61
|
+
* answered with skips stored the holes (TIM-1432).
|
|
69
62
|
*/
|
|
70
63
|
skippedSegments?: string[] | null;
|
|
71
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-commit.d.ts","sourceRoot":"","sources":["../../src/client/navigation-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation-commit.d.ts","sourceRoot":"","sources":["../../src/client/navigation-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,W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E,YAAY,CAAC;IAC3B,oEAAoE;IACpE,kBAAkB,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;CAC/C,GAAG,mBAAmB,CAgHtB"}
|
|
@@ -89,18 +89,57 @@ export interface TransitionResult<E = ReactNode> {
|
|
|
89
89
|
*/
|
|
90
90
|
commit: () => void;
|
|
91
91
|
}
|
|
92
|
+
/** What happened to this navigation's tree. */
|
|
93
|
+
export type CommitOutcome = 'committed' | 'superseded' | 'failed';
|
|
92
94
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
95
|
+
* A per-render identity that replaces the transition counter, the
|
|
96
|
+
* `handedOffNavAborts` set, and the `AbortController`-as-owner pattern.
|
|
97
|
+
*
|
|
98
|
+
* The navigation lifecycle holds one slot (`current: RenderOwner | null`).
|
|
99
|
+
* All supersession is "take the slot":
|
|
100
|
+
*
|
|
101
|
+
* - Navigation takes unconditionally (previous owner gets settled + aborted
|
|
102
|
+
* if !handedOff).
|
|
103
|
+
* - Revalidation takes only if empty (epoch check).
|
|
104
|
+
* - Handover gate before root.render checks `current === owner`.
|
|
105
|
+
* - `settle()` is called from NavigationRoot publish (committed), slot
|
|
106
|
+
* takeover (superseded), or rejection (failed).
|
|
107
|
+
*
|
|
108
|
+
* `settle()` records the outcome and resolves `displaced` for non-committed
|
|
109
|
+
* outcomes. The `outcome` field is first-wins with one exception:
|
|
110
|
+
* `settle('superseded')` overrides a prior `'committed'`, because a
|
|
111
|
+
* committed-but-still-decoding navigation can be displaced by a successor
|
|
112
|
+
* and the post-decode check must throw rather than letting the old
|
|
113
|
+
* navigation continue.
|
|
114
|
+
*
|
|
115
|
+
* TIM-1481: replaces counter + waiters + bumpTransitionCounter +
|
|
116
|
+
* supersedeNavigationTransitions + handedOffNavAborts + globalThis singleton.
|
|
102
117
|
*/
|
|
103
|
-
export
|
|
118
|
+
export interface RenderOwner {
|
|
119
|
+
readonly kind: 'navigation' | 'revalidation';
|
|
120
|
+
readonly fetchAbort: AbortController;
|
|
121
|
+
handedOff: boolean;
|
|
122
|
+
/** Sync read for the post-perform() check. null until settled. */
|
|
123
|
+
outcome: CommitOutcome | null;
|
|
124
|
+
/**
|
|
125
|
+
* Resolves when this owner is displaced — a successor supersedes it or it
|
|
126
|
+
* fails. Does NOT resolve on commit: a committed navigation still waits
|
|
127
|
+
* for its decode to finish. Used to stop waiting on a decode that is no
|
|
128
|
+
* longer this navigation's business.
|
|
129
|
+
*/
|
|
130
|
+
readonly displaced: Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Record this owner's outcome and, for non-committed outcomes, resolve
|
|
133
|
+
* `displaced`. First-wins with one exception: `settle('superseded')`
|
|
134
|
+
* overrides a prior `'committed'`.
|
|
135
|
+
*/
|
|
136
|
+
settle: (outcome: CommitOutcome) => void;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Create a fresh RenderOwner. Exported so tests that call
|
|
140
|
+
* `navigateTransition` directly can construct one without a router.
|
|
141
|
+
*/
|
|
142
|
+
export declare function createRenderOwner(kind: 'navigation' | 'revalidation'): RenderOwner;
|
|
104
143
|
/**
|
|
105
144
|
* Run a full navigation, handing its tree to React in a transition.
|
|
106
145
|
*
|
|
@@ -130,7 +169,19 @@ export declare function supersedeNavigationTransitions(): void;
|
|
|
130
169
|
* one's `perform()` was in flight — the stale tree is never handed to React
|
|
131
170
|
* and its `commit` never runs (TIM-629, TIM-1301).
|
|
132
171
|
*
|
|
172
|
+
* `onCommit` is the caller's hook on the *commit*, which the returned promise
|
|
173
|
+
* deliberately does not wait for. It runs exactly once: when React commits
|
|
174
|
+
* this navigation's tree, or — so nothing waits on a commit that will never
|
|
175
|
+
* come — when the navigation is abandoned instead: superseded by a newer
|
|
176
|
+
* transition (before or after its tree was handed to React) or failed. It is
|
|
177
|
+
* how `<Link>` keeps `isPending` up until the destination is on screen
|
|
178
|
+
* without scheduling anything against React's lanes (TIM-1418).
|
|
179
|
+
*
|
|
180
|
+
* `owner` is the `RenderOwner` for this render (TIM-1481). Supersession is
|
|
181
|
+
* detected via `owner.outcome` (sync) and `owner.displaced` (async).
|
|
182
|
+
* No module-level state; no globalThis singleton.
|
|
183
|
+
*
|
|
133
184
|
* Used for: navigate(), refresh(), popstate with fetch.
|
|
134
185
|
*/
|
|
135
|
-
export declare function navigateTransition(perform: () => Promise<TransitionResult>, render: NavigationRender): Promise<void>;
|
|
186
|
+
export declare function navigateTransition(owner: RenderOwner, perform: () => Promise<TransitionResult>, render: NavigationRender, onCommit?: (outcome: CommitOutcome) => void): Promise<void>;
|
|
136
187
|
//# sourceMappingURL=navigation-transition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-transition.d.ts","sourceRoot":"","sources":["../../src/client/navigation-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,SAAS;IAC7C,kCAAkC;IAClC,OAAO,EAAE,CAAC,CAAC;IACX,kEAAkE;IAClE,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC;;;;;;;;;;OAUG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"navigation-transition.d.ts","sourceRoot":"","sources":["../../src/client/navigation-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,KAAK,EAAE,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@@
|
|
|
8
8
|
*
|
|
9
9
|
* See design/19-client-navigation.md §"Scroll Restoration"
|
|
10
10
|
*/
|
|
11
|
+
import type { RenderOwner } from './navigation-transition.ts';
|
|
11
12
|
/** The subset of `RouterDeps` the post-paint scroll effects need. */
|
|
12
13
|
export interface ScrollEffectDeps {
|
|
13
14
|
scrollTo: (x: number, y: number) => void;
|
|
@@ -44,14 +45,14 @@ export declare function createScrollEffects(deps: ScrollEffectDeps): ScrollEffec
|
|
|
44
45
|
*/
|
|
45
46
|
export declare function leaveSpa(url: string, fromUrl: string): Promise<never>;
|
|
46
47
|
export interface SpaExitDeps {
|
|
47
|
-
/** The
|
|
48
|
-
|
|
48
|
+
/** The owner that holds the router right now, or null when idle. */
|
|
49
|
+
currentOwner: () => RenderOwner | null;
|
|
49
50
|
/** Supersede whatever is in flight and take ownership. */
|
|
50
51
|
supersede: () => void;
|
|
51
52
|
}
|
|
52
53
|
export interface SpaExits {
|
|
53
54
|
/**
|
|
54
|
-
* Leave the SPA — but only if `
|
|
55
|
+
* Leave the SPA — but only if `owner` still owns the router. Every
|
|
55
56
|
* failure a navigation can end on (a server error, a non-RSC response, a
|
|
56
57
|
* version skew) can surface long after the user has clicked something else:
|
|
57
58
|
* a fetch that was never cancellable, a Flight thenable that rejects late.
|
|
@@ -63,7 +64,7 @@ export interface SpaExits {
|
|
|
63
64
|
* `finally` clears the current controller, so an ownership check downstream
|
|
64
65
|
* of it compares against `null` and never leaves at all.
|
|
65
66
|
*/
|
|
66
|
-
leaveSpaIfOwned: (
|
|
67
|
+
leaveSpaIfOwned: (owner: RenderOwner, url: string, fromUrl: string) => Promise<void>;
|
|
67
68
|
/**
|
|
68
69
|
* Leave the SPA from a path that never entered `runNavigation()` — the
|
|
69
70
|
* stale-client short circuits, which decide before any fetch is attempted.
|
|
@@ -84,10 +85,10 @@ export interface SpaExits {
|
|
|
84
85
|
* together because every caller of `leaveSpa()` needs one or the other, and
|
|
85
86
|
* an unguarded call is the bug (TIM-1275, TIM-1276).
|
|
86
87
|
*/
|
|
87
|
-
export declare function createSpaExits({
|
|
88
|
+
export declare function createSpaExits({ currentOwner, supersede }: SpaExitDeps): SpaExits;
|
|
88
89
|
export interface NavigationRecoveryDeps {
|
|
89
|
-
/** The
|
|
90
|
-
|
|
90
|
+
/** The owner that holds the router right now, or null when idle. */
|
|
91
|
+
currentOwner: () => RenderOwner | null;
|
|
91
92
|
leaveSpaIfOwned: SpaExits['leaveSpaIfOwned'];
|
|
92
93
|
/** Replace the current entry with `url` — the router's own `navigate()`. */
|
|
93
94
|
navigate: (url: string) => Promise<void>;
|
|
@@ -114,7 +115,7 @@ export interface NavigationRecoveryDeps {
|
|
|
114
115
|
* Must be called from inside the `runNavigation()` callback — see
|
|
115
116
|
* {@link SpaExits.leaveSpaIfOwned}.
|
|
116
117
|
*/
|
|
117
|
-
export declare function createNavigationRecovery({
|
|
118
|
+
export declare function createNavigationRecovery({ currentOwner, leaveSpaIfOwned, navigate, }: NavigationRecoveryDeps): (error: unknown, owner: RenderOwner, url: string, fromUrl: string) => Promise<boolean>;
|
|
118
119
|
/**
|
|
119
120
|
* Perform the full document load.
|
|
120
121
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-effects.d.ts","sourceRoot":"","sources":["../../src/client/router-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"router-effects.d.ts","sourceRoot":"","sources":["../../src/client/router-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAA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;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,YAAY,EACZ,eAAe,EACf,QAAQ,GACT,EAAE,sBAAsB,WAEd,OAAO,SACP,WAAW,OACb,MAAM,WACF,MAAM,KACd,OAAO,CAAC,OAAO,CAAC,CAsBpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAS/D"}
|
|
@@ -2,19 +2,35 @@
|
|
|
2
2
|
* Navigation Lifecycle — who owns the router, and when a fetch may be cut.
|
|
3
3
|
*
|
|
4
4
|
* One navigation at a time owns the router. This module holds that ownership
|
|
5
|
-
*
|
|
6
|
-
* the wrapper every navigation runs inside (`runNavigation`),
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `usePendingNavigation()` subscribe to.
|
|
5
|
+
* as a single `RenderOwner` slot, the rule for taking it (`createNavOwner`
|
|
6
|
+
* supersedes), the wrapper every navigation runs inside (`runNavigation`),
|
|
7
|
+
* and the pending store that `TopLoader` and `usePendingNavigation()`
|
|
8
|
+
* subscribe to.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* TIM-1481: replaced the transition counter, the `handedOffNavAborts` set,
|
|
11
|
+
* and the `AbortController`-as-owner pattern with `RenderOwner`. Supersession
|
|
12
|
+
* is "take the slot": settle the previous owner and abort its fetch unless
|
|
13
|
+
* handed off.
|
|
15
14
|
*
|
|
16
15
|
* See design/19-client-navigation.md §"How Pending State Works".
|
|
17
16
|
*/
|
|
17
|
+
import { type RenderOwner } from './navigation-transition.ts';
|
|
18
|
+
/**
|
|
19
|
+
* A snapshot of "which page, and was a navigation in flight" at one instant.
|
|
20
|
+
* Captured before an action's POST and compared at response time so the
|
|
21
|
+
* router can tell whether the response still describes the page on screen.
|
|
22
|
+
*
|
|
23
|
+
* `seq` is a monotonic counter bumped on every `createNavOwner` — covering
|
|
24
|
+
* every path through `runNavigation`. `idle` is false when the router is
|
|
25
|
+
* mid-navigation OR a handed-off tree has not yet committed (the
|
|
26
|
+
* handover-to-commit window on the History API fallback).
|
|
27
|
+
*
|
|
28
|
+
* See design/19-client-navigation.md §State Update Invariants (TIM-1474).
|
|
29
|
+
*/
|
|
30
|
+
export interface NavigationEpoch {
|
|
31
|
+
readonly seq: number;
|
|
32
|
+
readonly idle: boolean;
|
|
33
|
+
}
|
|
18
34
|
/** The subset of `RouterDeps` the navigation lifecycle needs. */
|
|
19
35
|
export interface NavigationLifecycleDeps {
|
|
20
36
|
/**
|
|
@@ -25,31 +41,58 @@ export interface NavigationLifecycleDeps {
|
|
|
25
41
|
completeRouterNavigation?: () => void;
|
|
26
42
|
}
|
|
27
43
|
export interface NavigationLifecycle {
|
|
28
|
-
/** The
|
|
29
|
-
|
|
44
|
+
/** The owner that holds the router right now, or null when idle. */
|
|
45
|
+
currentOwner: () => RenderOwner | null;
|
|
30
46
|
/**
|
|
31
|
-
* Take ownership of the router, superseding whatever held it.
|
|
32
|
-
*
|
|
47
|
+
* Take ownership of the router, superseding whatever held it. Returns
|
|
48
|
+
* a fresh `RenderOwner` for the new navigation. See the implementation
|
|
49
|
+
* for the three parts of superseding.
|
|
33
50
|
*/
|
|
34
|
-
|
|
51
|
+
createNavOwner: (kind: 'navigation' | 'revalidation', externalSignal?: AbortSignal) => RenderOwner;
|
|
35
52
|
/**
|
|
36
53
|
* Run `fn` inside the abort/pending/cleanup lifecycle. AbortErrors are
|
|
37
54
|
* swallowed (not application errors); all other errors propagate.
|
|
38
55
|
*/
|
|
39
|
-
runNavigation: (url: string, fn: (
|
|
56
|
+
runNavigation: (url: string, fn: (owner: RenderOwner) => Promise<void>, externalSignal?: AbortSignal) => Promise<void>;
|
|
40
57
|
/**
|
|
41
58
|
* Record that `owner`'s payload has reached React, so its stream is no
|
|
42
59
|
* longer cuttable. No-op when `owner` no longer owns the router.
|
|
43
60
|
*/
|
|
44
|
-
markHandedOff: (owner:
|
|
61
|
+
markHandedOff: (owner: RenderOwner) => void;
|
|
45
62
|
/** React has committed `owner`'s tree — every earlier handoff is off screen. */
|
|
46
|
-
forgetOlderHandoffs: (owner:
|
|
63
|
+
forgetOlderHandoffs: (owner: RenderOwner) => void;
|
|
47
64
|
/** Whether a navigation is currently in flight. */
|
|
48
65
|
isPending: () => boolean;
|
|
49
66
|
/** The URL currently being navigated to, or null if idle. */
|
|
50
67
|
getPendingUrl: () => string | null;
|
|
51
68
|
/** Subscribe to pending state changes. */
|
|
52
69
|
onPendingChange: (listener: (pending: boolean) => void) => () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Place a revalidation owner in the slot without bumping the navigation
|
|
72
|
+
* sequence. Unlike `createNavOwner`, this does not supersede what's in the
|
|
73
|
+
* slot — the caller (applyActionResult) has already verified the slot is
|
|
74
|
+
* idle via the epoch check. A concurrent navigation will supersede this
|
|
75
|
+
* owner through the normal `createNavOwner` path.
|
|
76
|
+
*/
|
|
77
|
+
placeRevalidationOwner: (owner: RenderOwner) => void;
|
|
78
|
+
/** Snapshot the router's navigation state (TIM-1474). */
|
|
79
|
+
epoch: () => NavigationEpoch;
|
|
80
|
+
/** True iff no navigation has started or is in flight since `e` was taken. */
|
|
81
|
+
isEpochCurrent: (e: NavigationEpoch) => boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Run `task` now if the router is idle, otherwise once when it next becomes
|
|
84
|
+
* idle (pending false AND commit done). Single slot — a later request
|
|
85
|
+
* replaces an earlier one (TIM-1474).
|
|
86
|
+
*/
|
|
87
|
+
runWhenIdle: (task: () => void) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Settle any handed-off-but-uncommitted owners as superseded, then flush
|
|
90
|
+
* the idle task if the router is now idle. Called by `syncShallowSearch`
|
|
91
|
+
* when a shallow URL update displaces a suspended transition — without
|
|
92
|
+
* it, `hasUncommittedNav` stays true indefinitely and `runWhenIdle`
|
|
93
|
+
* tasks never fire (TIM-1480).
|
|
94
|
+
*/
|
|
95
|
+
settleHandoffs: () => void;
|
|
53
96
|
}
|
|
54
97
|
export declare function createNavigationLifecycle(deps: NavigationLifecycleDeps): NavigationLifecycle;
|
|
55
98
|
//# sourceMappingURL=router-lifecycle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-lifecycle.d.ts","sourceRoot":"","sources":["../../src/client/router-lifecycle.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"router-lifecycle.d.ts","sourceRoot":"","sources":["../../src/client/router-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGjF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACvC;;;;OAIG;IACH,cAAc,EAAE,CACd,IAAI,EAAE,YAAY,GAAG,cAAc,EACnC,cAAc,CAAC,EAAE,WAAW,KACzB,WAAW,CAAC;IACjB;;;OAGG;IACH,aAAa,EAAE,CACb,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EACzC,cAAc,CAAC,EAAE,WAAW,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,gFAAgF;IAChF,mBAAmB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAElD,mDAAmD;IACnD,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,6DAA6D;IAC7D,aAAa,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACnC,0CAA0C;IAC1C,eAAe,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IAEtE;;;;;;OAMG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACrD,yDAAyD;IACzD,KAAK,EAAE,MAAM,eAAe,CAAC;IAC7B,8EAA8E;IAC9E,cAAc,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;IAChD;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACxC;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAYD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,mBAAmB,CAwO5F"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* that makes the page current, and hand the result over inside a transition.
|
|
7
7
|
*
|
|
8
8
|
* `router.ts` keeps the *operations* — `navigate`, `refresh`, `handlePopState`,
|
|
9
|
-
* `prefetch`, `
|
|
9
|
+
* `prefetch`, `applyActionResult` — and each of them is a call into here. The
|
|
10
10
|
* split is the same one `router-effects.ts` and `router-lifecycle.ts` made
|
|
11
11
|
* (design/18-build-system.md §"No file >500 lines").
|
|
12
12
|
*
|
|
@@ -19,6 +19,7 @@ import type { StateTree } from '../shared/segment-info.ts';
|
|
|
19
19
|
import type { NavigationState } from './navigation-context.ts';
|
|
20
20
|
import { type NavigationCommitter } from './navigation-commit.ts';
|
|
21
21
|
import type { RouterDeps } from './router-types.ts';
|
|
22
|
+
import type { CommitOutcome, RenderOwner } from './navigation-transition.ts';
|
|
22
23
|
/** A fetched payload plus the state update that makes it the current page. */
|
|
23
24
|
export type NavigationPayload = FetchResult & {
|
|
24
25
|
navState: NavigationState;
|
|
@@ -36,15 +37,17 @@ export interface NavigationPipelineDeps extends Pick<NavigationCommitter, 'prepa
|
|
|
36
37
|
deps: RouterDeps;
|
|
37
38
|
prefetchCache: PrefetchCache;
|
|
38
39
|
/** Record that this navigation's tree reached React (router-lifecycle.ts). */
|
|
39
|
-
markHandedOff: (owner:
|
|
40
|
+
markHandedOff: (owner: RenderOwner) => void;
|
|
40
41
|
/** React committed this navigation's tree (router-lifecycle.ts). */
|
|
41
|
-
forgetOlderHandoffs: (owner:
|
|
42
|
+
forgetOlderHandoffs: (owner: RenderOwner) => void;
|
|
42
43
|
}
|
|
43
44
|
export interface NavigationPipeline {
|
|
44
45
|
/** Fetch (or replay a prefetch), then stage the commit. */
|
|
45
46
|
performNavigationFetch: (url: string, options: NavigationFetchOptions) => Promise<NavigationPayload>;
|
|
46
47
|
/** Hand a payload to React inside a transition, or render it directly in tests. */
|
|
47
|
-
renderViaTransition: (url: string, owner:
|
|
48
|
+
renderViaTransition: (url: string, owner: RenderOwner, perform: () => Promise<NavigationPayload>,
|
|
49
|
+
/** See `NavigationOptions.onCommit`. */
|
|
50
|
+
onCommit?: (outcome: CommitOutcome) => void) => Promise<void>;
|
|
48
51
|
/** Render a decoded payload into the DOM if a renderer is available. */
|
|
49
52
|
renderPayload: (payload: unknown, navState: NavigationState, params: ParamsSource, commit: () => void) => void;
|
|
50
53
|
/** Resolve thenable payloads on the fallback (test) path. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-pipeline.d.ts","sourceRoot":"","sources":["../../src/client/router-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,aAA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AC,EACvC,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,GACpB,EAAE,sBAAsB,GAAG,kBAAkB,CAuT7C"}
|
|
@@ -13,12 +13,22 @@ import type { ParamsSource } from '../shared/payload-root.ts';
|
|
|
13
13
|
import type { SegmentInfo } from '../shared/segment-info.ts';
|
|
14
14
|
import type { SegmentCache, PrefetchCache } from './segment-cache.ts';
|
|
15
15
|
import type { HistoryStack } from './history.ts';
|
|
16
|
-
import type { TransitionResult } from './navigation-transition.ts';
|
|
16
|
+
import type { TransitionResult, CommitOutcome, RenderOwner } from './navigation-transition.ts';
|
|
17
|
+
import type { NavigationEpoch } from './router-lifecycle.ts';
|
|
17
18
|
export interface NavigationOptions {
|
|
18
19
|
/** Set to false to prevent scroll-to-top on forward navigation */
|
|
19
20
|
scroll?: boolean;
|
|
20
21
|
/** Use replaceState instead of pushState (replaces current history entry) */
|
|
21
22
|
replace?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Runs exactly once, when React commits this navigation's tree — or when
|
|
25
|
+
* the navigation is abandoned (superseded or failed) and no such commit
|
|
26
|
+
* will come. The returned promise resolves on decode, which can be before
|
|
27
|
+
* OR after the commit; this is the hook for the other event. `<Link>`
|
|
28
|
+
* holds `isPending` until both have happened (TIM-1418). The outcome says
|
|
29
|
+
* which of the three it was.
|
|
30
|
+
*/
|
|
31
|
+
onCommit?: (outcome: CommitOutcome) => void;
|
|
22
32
|
/**
|
|
23
33
|
* @internal AbortSignal from the Navigation API's NavigateEvent.
|
|
24
34
|
* When provided, the signal is linked to the router's per-navigation
|
|
@@ -100,7 +110,7 @@ export interface RouterDeps {
|
|
|
100
110
|
*
|
|
101
111
|
* If not provided (tests), the router falls back to renderRoot.
|
|
102
112
|
*/
|
|
103
|
-
navigateTransition?: (pendingUrl: string, perform: (wrapPayload: (payload: unknown, navState: NavigationState,
|
|
113
|
+
navigateTransition?: (pendingUrl: string, owner: RenderOwner, perform: (wrapPayload: (payload: unknown, navState: NavigationState,
|
|
104
114
|
/**
|
|
105
115
|
* The params to publish over `payload`. On a partial navigation
|
|
106
116
|
* `payload` is the *retained* tree and these are the *incoming*
|
|
@@ -108,7 +118,9 @@ export interface RouterDeps {
|
|
|
108
118
|
* which is the entire point of the client owning the provider
|
|
109
119
|
* (TIM-1297).
|
|
110
120
|
*/
|
|
111
|
-
params: ParamsSource, segmentUpdates?: Map<string, unknown>) => unknown) => Promise<TransitionResult<unknown
|
|
121
|
+
params: ParamsSource, segmentUpdates?: Map<string, unknown>) => unknown) => Promise<TransitionResult<unknown>>,
|
|
122
|
+
/** See `NavigationOptions.onCommit`; forwarded to `navigateTransition`. */
|
|
123
|
+
onCommit?: (outcome: CommitOutcome) => void) => Promise<void>;
|
|
112
124
|
/**
|
|
113
125
|
* Whether the Navigation API is active and handling traversals.
|
|
114
126
|
* When true, the popstate handler is a no-op — the Navigation API's
|
|
@@ -169,7 +181,9 @@ export interface RouterInstance {
|
|
|
169
181
|
/** Navigate to a new URL (forward navigation) */
|
|
170
182
|
navigate(url: string, options?: NavigationOptions): Promise<void>;
|
|
171
183
|
/** Full re-render of the current URL — no state tree sent */
|
|
172
|
-
refresh(
|
|
184
|
+
refresh(options?: {
|
|
185
|
+
onCommit?: (outcome: CommitOutcome) => void;
|
|
186
|
+
}): Promise<void>;
|
|
173
187
|
/** Handle a popstate event (back/forward button). scrollY is read from history.state. */
|
|
174
188
|
handlePopState(url: string, scrollY?: number, externalSignal?: AbortSignal): Promise<void>;
|
|
175
189
|
/** Whether a navigation is currently in flight */
|
|
@@ -181,12 +195,53 @@ export interface RouterInstance {
|
|
|
181
195
|
/** Prefetch an RSC payload for a URL (used by Link hover) */
|
|
182
196
|
prefetch(url: string): void;
|
|
183
197
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
|
|
198
|
+
* Snapshot the router's navigation state before dispatching a server action.
|
|
199
|
+
* Hand the epoch back to `applyActionResult` with the response (TIM-1474).
|
|
200
|
+
*/
|
|
201
|
+
epoch(): NavigationEpoch;
|
|
202
|
+
/**
|
|
203
|
+
* Reconcile the page after a server action. `tree` is the piggybacked
|
|
204
|
+
* revalidation payload root, or `undefined` when the server sent none.
|
|
205
|
+
*
|
|
206
|
+
* Returns `true` when the result was applied, `false` when stale (a
|
|
207
|
+
* navigation happened since `epoch` was taken or the router was busy at
|
|
208
|
+
* dispatch). Async because the no-tree path awaits `refresh()` — the next
|
|
209
|
+
* queued action must not capture its epoch while the refresh is in-flight.
|
|
210
|
+
*
|
|
211
|
+
* Does NOT call `runWhenIdle` — that is the action queue's responsibility
|
|
212
|
+
* (gated on "queue empty", not just "router idle").
|
|
213
|
+
*
|
|
187
214
|
* See design/08-forms-and-actions.md §"Single-Roundtrip Revalidation".
|
|
188
215
|
*/
|
|
189
|
-
|
|
216
|
+
applyActionResult(epoch: NavigationEpoch, tree?: unknown): Promise<boolean>;
|
|
217
|
+
/**
|
|
218
|
+
* Run `task` now if the router is idle (not pending, no uncommitted tree),
|
|
219
|
+
* otherwise once when it next becomes idle. Single slot — the action queue
|
|
220
|
+
* uses this to flush one deferred refresh when both queue-empty and
|
|
221
|
+
* router-idle are true (TIM-1474).
|
|
222
|
+
*/
|
|
223
|
+
runWhenIdle(task: () => void): void;
|
|
224
|
+
/**
|
|
225
|
+
* Settle any handed-off-but-uncommitted owners as superseded, then flush
|
|
226
|
+
* idle tasks. Called by `syncShallowSearch` when a shallow URL update
|
|
227
|
+
* displaces a suspended transition (TIM-1480).
|
|
228
|
+
*/
|
|
229
|
+
settleHandoffs(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Invalidate client caches for a path so the next navigation fetches
|
|
232
|
+
* fresh data. Called when `revalidatePath` targeted a non-current path.
|
|
233
|
+
*/
|
|
234
|
+
invalidatePath(path: string): void;
|
|
235
|
+
/**
|
|
236
|
+
* Evict all prefetch cache entries and history stack payloads (TIM-1476).
|
|
237
|
+
* Called after a server action that revalidated data — the mutation may
|
|
238
|
+
* affect any route's data, not just the paths the server named, so every
|
|
239
|
+
* cached payload is stale. In-flight prefetch singleflights are fenced
|
|
240
|
+
* by the eviction generation — their results are discarded if they
|
|
241
|
+
* complete after eviction. The current URL's history entry is preserved
|
|
242
|
+
* so `applyActionResult` can read its segment metadata.
|
|
243
|
+
*/
|
|
244
|
+
evictStaleCaches(): void;
|
|
190
245
|
/**
|
|
191
246
|
* Populate the segment cache from server-provided segment metadata.
|
|
192
247
|
* Called on initial hydration with segment info embedded in the HTML.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-types.d.ts","sourceRoot":"","sources":["../../src/client/router-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"router-types.d.ts","sourceRoot":"","sources":["../../src/client/router-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EA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IACH,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEhD,gEAAgE;IAChE,YAAY,EAAE,YAAY,CAAC;IAC3B,iEAAiE;IACjE,aAAa,EAAE,aAAa,CAAC;IAC7B,4CAA4C;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/client/router.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAqB,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/client/router.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAqB,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKvF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAwd7D"}
|
|
@@ -40,15 +40,6 @@ export interface FetchResult {
|
|
|
40
40
|
segmentInfo: SegmentInfo[] | null;
|
|
41
41
|
/** Segment paths that were skipped by the server (for client-side merging). */
|
|
42
42
|
skippedSegments: string[] | null;
|
|
43
|
-
/**
|
|
44
|
-
* HTTP status of the navigation response.
|
|
45
|
-
*
|
|
46
|
-
* Read at the commit site to decide whether the tree this payload produced
|
|
47
|
-
* is one worth caching. A deny page replaced a subtree, so `segmentInfo`
|
|
48
|
-
* describes more than actually mounted — but it cannot simply be emptied,
|
|
49
|
-
* because the merge point is chosen out of it. See TIM-1356.
|
|
50
|
-
*/
|
|
51
|
-
status: number;
|
|
52
43
|
}
|
|
53
44
|
/** Set the client deployment ID. Called once at bootstrap. */
|
|
54
45
|
export declare function setClientDeploymentId(id: string | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-fetch.d.ts","sourceRoot":"","sources":["../../src/client/rsc-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;;OAQG;IACH,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACnD;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC,uFAAuF;IACvF,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAClC,+EAA+E;IAC/E,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"rsc-fetch.d.ts","sourceRoot":"","sources":["../../src/client/rsc-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;I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