@timber-js/app 0.2.0-alpha.71 → 0.2.0-alpha.72
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-Dg-ANYHb.js +421 -0
- package/dist/_chunks/actions-Dg-ANYHb.js.map +1 -0
- package/dist/_chunks/{als-registry-BJARkOcu.js → als-registry-HS0LGUl2.js} +1 -1
- package/dist/_chunks/als-registry-HS0LGUl2.js.map +1 -0
- package/dist/_chunks/{define-Dz1bqwaS.js → define-C77ScO0m.js} +14 -14
- package/dist/_chunks/define-C77ScO0m.js.map +1 -0
- package/dist/_chunks/{define-CGuYoRHU.js → define-CZqDwhSu.js} +15 -15
- package/dist/_chunks/define-CZqDwhSu.js.map +1 -0
- package/dist/_chunks/{define-cookie-B5mewxwM.js → define-cookie-C2IkoFGN.js} +9 -8
- package/dist/_chunks/{define-cookie-B5mewxwM.js.map → define-cookie-C2IkoFGN.js.map} +1 -1
- package/dist/_chunks/{format-Rn922VH2.js → dev-warnings-DpGRGoDi.js} +4 -26
- package/dist/_chunks/dev-warnings-DpGRGoDi.js.map +1 -0
- package/dist/_chunks/format-CYBGxKtc.js +14 -0
- package/dist/_chunks/format-CYBGxKtc.js.map +1 -0
- package/dist/_chunks/{interception-CEdHHviP.js → interception-Dpn_UfAD.js} +2 -2
- package/dist/_chunks/{interception-CEdHHviP.js.map → interception-Dpn_UfAD.js.map} +1 -1
- package/dist/_chunks/{segment-context-hzuJ048X.js → merge-search-params-Cm_KIWDX.js} +2 -33
- package/dist/_chunks/merge-search-params-Cm_KIWDX.js.map +1 -0
- package/dist/_chunks/{request-context-CywiO4jV.js → request-context-qMsWgy9C.js} +72 -36
- package/dist/_chunks/request-context-qMsWgy9C.js.map +1 -0
- package/dist/_chunks/{schema-bridge-C4SwjCQD.js → schema-bridge-C3xl_vfb.js} +1 -1
- package/dist/_chunks/{schema-bridge-C4SwjCQD.js.map → schema-bridge-C3xl_vfb.js.map} +1 -1
- package/dist/_chunks/segment-context-fHFLF1PE.js +34 -0
- package/dist/_chunks/segment-context-fHFLF1PE.js.map +1 -0
- package/dist/_chunks/ssr-data-DzuI0bIV.js +88 -0
- package/dist/_chunks/ssr-data-DzuI0bIV.js.map +1 -0
- package/dist/_chunks/{stale-reload-BLUC_Pl_.js → stale-reload-C2plcNtG.js} +1 -1
- package/dist/_chunks/{stale-reload-BLUC_Pl_.js.map → stale-reload-C2plcNtG.js.map} +1 -1
- package/dist/_chunks/{handler-store-BVePM7hp.js → tracing-CCYbKn5n.js} +60 -60
- package/dist/_chunks/tracing-CCYbKn5n.js.map +1 -0
- package/dist/_chunks/use-params-B1AuhI1p.js +307 -0
- package/dist/_chunks/use-params-B1AuhI1p.js.map +1 -0
- package/dist/_chunks/{use-query-states-DAhgj8Gx.js → use-query-states-Lo_s_pw2.js} +4 -4
- package/dist/_chunks/use-query-states-Lo_s_pw2.js.map +1 -0
- package/dist/_chunks/{wrappers-LZbghvn0.js → wrappers-_DTmImGt.js} +1 -1
- package/dist/_chunks/{wrappers-LZbghvn0.js.map → wrappers-_DTmImGt.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
- package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
- package/dist/adapters/cloudflare-kv-cache.js +95 -0
- package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
- package/dist/cache/index.d.ts +18 -4
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +78 -12
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/sizeof.d.ts +22 -0
- package/dist/cache/sizeof.d.ts.map +1 -0
- package/dist/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +27 -1
- package/dist/client/browser-dev.d.ts.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
- package/dist/client/browser-entry/hmr.d.ts +21 -0
- package/dist/client/browser-entry/hmr.d.ts.map +1 -0
- package/dist/client/browser-entry/hydrate.d.ts +46 -0
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
- package/dist/client/browser-entry/index.d.ts +30 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -0
- package/dist/client/browser-entry/post-hydration.d.ts +26 -0
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
- package/dist/client/browser-entry/router-init.d.ts +23 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -0
- package/dist/client/browser-entry/rsc-stream.d.ts +24 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
- package/dist/client/browser-entry/scroll.d.ts +19 -0
- package/dist/client/browser-entry/scroll.d.ts.map +1 -0
- package/dist/client/error-boundary.js +131 -1
- package/dist/client/error-boundary.js.map +1 -0
- package/dist/client/index.d.ts +4 -19
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +14 -1191
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +18 -0
- package/dist/client/internal.d.ts.map +1 -0
- package/dist/client/internal.js +890 -0
- package/dist/client/internal.js.map +1 -0
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/top-loader.d.ts +2 -2
- package/dist/client/use-link-status.d.ts +1 -1
- package/dist/client/{use-navigation-pending.d.ts → use-pending-navigation.d.ts} +4 -4
- package/dist/client/use-pending-navigation.d.ts.map +1 -0
- package/dist/client/use-router.d.ts +1 -1
- package/dist/codec.d.ts +10 -0
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/config-types.d.ts +210 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/content/index.d.ts +1 -10
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +0 -2
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.d.ts +0 -2
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +2 -3
- package/dist/index.d.ts +25 -288
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +261 -43
- package/dist/index.js.map +1 -1
- package/dist/plugin-context.d.ts +84 -0
- package/dist/plugin-context.d.ts.map +1 -0
- package/dist/plugins/adapter-build.d.ts +1 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/build-report.d.ts +1 -1
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/content.d.ts +1 -1
- package/dist/plugins/content.d.ts.map +1 -1
- package/dist/plugins/dev-browser-logs.d.ts +1 -1
- package/dist/plugins/dev-browser-logs.d.ts.map +1 -1
- package/dist/plugins/dev-logs.d.ts +1 -1
- package/dist/plugins/dev-logs.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/mdx.d.ts +1 -1
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +4 -4
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/index.js +1 -1
- package/dist/search-params/define.d.ts +6 -6
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.d.ts +1 -2
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +4 -4
- package/dist/search-params/registry.d.ts +1 -1
- package/dist/search-params/registry.d.ts.map +1 -1
- package/dist/segment-params/define.d.ts +6 -6
- package/dist/segment-params/define.d.ts.map +1 -1
- package/dist/segment-params/index.d.ts +0 -1
- package/dist/segment-params/index.d.ts.map +1 -1
- package/dist/segment-params/index.js +3 -3
- package/dist/server/als-registry.d.ts +1 -1
- package/dist/server/dev-holding-server.d.ts +52 -0
- package/dist/server/dev-holding-server.d.ts.map +1 -0
- package/dist/server/dev-warnings.d.ts +1 -7
- package/dist/server/dev-warnings.d.ts.map +1 -1
- package/dist/server/index.d.ts +6 -45
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -3272
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +46 -0
- package/dist/server/internal.d.ts.map +1 -0
- package/dist/server/internal.js +2865 -0
- package/dist/server/internal.js.map +1 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +41 -17
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +45 -15
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/tracing.d.ts +4 -4
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/shims/headers.d.ts +2 -1
- package/dist/shims/headers.d.ts.map +1 -1
- package/dist/shims/navigation.d.ts +2 -1
- package/dist/shims/navigation.d.ts.map +1 -1
- package/package.json +19 -13
- package/src/adapters/cloudflare-kv-cache.ts +142 -0
- package/src/cache/handler-store.ts +2 -2
- package/src/cache/index.ts +74 -15
- package/src/cache/sizeof.ts +31 -0
- package/src/cli.ts +6 -1
- package/src/client/browser-dev.ts +128 -1
- package/src/client/browser-entry/action-dispatch.ts +116 -0
- package/src/client/browser-entry/hmr.ts +81 -0
- package/src/client/browser-entry/hydrate.ts +145 -0
- package/src/client/browser-entry/index.ts +138 -0
- package/src/client/browser-entry/post-hydration.ts +119 -0
- package/src/client/browser-entry/router-init.ts +184 -0
- package/src/client/browser-entry/rsc-stream.ts +157 -0
- package/src/client/browser-entry/scroll.ts +27 -0
- package/src/client/index.ts +10 -38
- package/src/client/internal.ts +57 -0
- package/src/client/navigation-context.ts +6 -2
- package/src/client/navigation-root.tsx +1 -1
- package/src/client/router-ref.ts +1 -1
- package/src/client/top-loader.tsx +2 -2
- package/src/client/use-link-status.ts +1 -1
- package/src/client/{use-navigation-pending.ts → use-pending-navigation.ts} +5 -5
- package/src/client/use-query-states.ts +2 -2
- package/src/client/use-router.ts +1 -1
- package/src/codec.ts +15 -0
- package/src/config-types.ts +208 -0
- package/src/content/index.ts +5 -13
- package/src/cookies/define-cookie.ts +9 -7
- package/src/cookies/index.ts +6 -5
- package/src/index.ts +84 -416
- package/src/plugin-context.ts +200 -0
- package/src/plugins/adapter-build.ts +1 -1
- package/src/plugins/build-manifest.ts +1 -1
- package/src/plugins/build-report.ts +1 -1
- package/src/plugins/content.ts +1 -1
- package/src/plugins/dev-browser-logs.ts +1 -1
- package/src/plugins/dev-logs.ts +1 -1
- package/src/plugins/dev-server.ts +16 -1
- package/src/plugins/entries.ts +2 -2
- package/src/plugins/fonts.ts +4 -3
- package/src/plugins/mdx.ts +1 -1
- package/src/plugins/routing.ts +1 -1
- package/src/plugins/shims.ts +53 -5
- package/src/plugins/static-build.ts +8 -6
- package/src/search-params/define.ts +22 -22
- package/src/search-params/index.ts +3 -3
- package/src/search-params/registry.ts +1 -1
- package/src/segment-params/define.ts +18 -18
- package/src/segment-params/index.ts +2 -1
- package/src/server/action-handler.ts +1 -1
- package/src/server/als-registry.ts +3 -3
- package/src/server/dev-holding-server.ts +185 -0
- package/src/server/dev-warnings.ts +2 -21
- package/src/server/html-injectors.ts +3 -3
- package/src/server/index.ts +25 -180
- package/src/server/internal.ts +169 -0
- package/src/server/pipeline.ts +12 -7
- package/src/server/primitives.ts +71 -30
- package/src/server/request-context.ts +77 -39
- package/src/server/route-element-builder.ts +1 -1
- package/src/server/rsc-entry/index.ts +2 -2
- package/src/server/rsc-entry/ssr-renderer.ts +1 -1
- package/src/server/slot-resolver.ts +1 -1
- package/src/server/tracing.ts +6 -6
- package/src/server/tree-builder.ts +1 -1
- package/src/shims/headers.ts +5 -1
- package/src/shims/navigation.ts +5 -1
- package/dist/_chunks/als-registry-BJARkOcu.js.map +0 -1
- package/dist/_chunks/define-CGuYoRHU.js.map +0 -1
- package/dist/_chunks/define-Dz1bqwaS.js.map +0 -1
- package/dist/_chunks/error-boundary-D9hzsveV.js +0 -216
- package/dist/_chunks/error-boundary-D9hzsveV.js.map +0 -1
- package/dist/_chunks/format-Rn922VH2.js.map +0 -1
- package/dist/_chunks/handler-store-BVePM7hp.js.map +0 -1
- package/dist/_chunks/request-context-CywiO4jV.js.map +0 -1
- package/dist/_chunks/segment-context-hzuJ048X.js.map +0 -1
- package/dist/_chunks/use-query-states-DAhgj8Gx.js.map +0 -1
- package/dist/client/browser-entry.d.ts +0 -21
- package/dist/client/browser-entry.d.ts.map +0 -1
- package/dist/client/use-navigation-pending.d.ts.map +0 -1
- package/src/client/browser-entry.ts +0 -846
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydration — pre-hydration sequence and React root creation.
|
|
3
|
+
*
|
|
4
|
+
* Handles two paths:
|
|
5
|
+
* 1. RSC payload available: hydrateRoot with NavigationProvider wrapping
|
|
6
|
+
* 2. No RSC payload: deferred root creation via installDeferredNavigation
|
|
7
|
+
*
|
|
8
|
+
* Pre-hydration ordering contract (MUST execute in this order):
|
|
9
|
+
* 1. initRouter() — creates the global router so useRouter()
|
|
10
|
+
* works during render
|
|
11
|
+
* 2. setCurrentParams() — populates params snapshot so
|
|
12
|
+
* + setNavigationState() useSegmentParams() and usePathname()
|
|
13
|
+
* return correct values during hydration
|
|
14
|
+
* 3. hydrateRoot() — synchronously executes component render
|
|
15
|
+
* functions that depend on steps 1-2
|
|
16
|
+
*
|
|
17
|
+
* See design/19-client-navigation.md §"NavigationContext"
|
|
18
|
+
*/
|
|
19
|
+
import type { TopLoaderConfig } from '../top-loader.js';
|
|
20
|
+
import type { RscStreamResult } from './rsc-stream.js';
|
|
21
|
+
interface HydrateOptions {
|
|
22
|
+
/** RSC stream result (null if no inlined payload) */
|
|
23
|
+
rscResult: RscStreamResult | null;
|
|
24
|
+
/** Runtime config from virtual:timber-config */
|
|
25
|
+
config: {
|
|
26
|
+
topLoader?: TopLoaderConfig;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run the pre-hydration sequence: read server-embedded params and
|
|
31
|
+
* set navigation state. Must be called AFTER initRouter().
|
|
32
|
+
*/
|
|
33
|
+
export declare function runPreHydration(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Hydrate the React tree or set up deferred root creation.
|
|
36
|
+
*
|
|
37
|
+
* When an RSC payload is available, wraps it with NavigationProvider +
|
|
38
|
+
* TimberNuqsAdapter + NavigationRoot and calls hydrateRoot on the
|
|
39
|
+
* document.
|
|
40
|
+
*
|
|
41
|
+
* When no RSC payload is available (JS-only client), sets up deferred
|
|
42
|
+
* navigation so the first client navigation creates the React root.
|
|
43
|
+
*/
|
|
44
|
+
export declare function hydrateApp({ rscResult, config }: HydrateOptions): void;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=hydrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/hydrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,UAAU,cAAc;IACtB,qDAAqD;IACrD,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,gDAAgD;IAChD,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,eAAe,CAAA;KAAE,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAetC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,IAAI,CAwEtE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser Entry — Client-side hydration and navigation bootstrap.
|
|
3
|
+
*
|
|
4
|
+
* This is the thin orchestrator that coordinates the bootstrap sequence.
|
|
5
|
+
* Each responsibility is extracted into a focused module:
|
|
6
|
+
*
|
|
7
|
+
* action-dispatch.ts — server action callServer callback
|
|
8
|
+
* rsc-stream.ts — __timber_f chunk handling + ReadableStream
|
|
9
|
+
* router-init.ts — createRouter + Navigation API setup
|
|
10
|
+
* hydrate.ts — pre-hydration sequence + hydrateRoot/createRoot
|
|
11
|
+
* post-hydration.ts — history stack, segment cache, popstate, scroll
|
|
12
|
+
* hmr.ts — dev-only HMR + error forwarding
|
|
13
|
+
* scroll.ts — getScrollY helper
|
|
14
|
+
*
|
|
15
|
+
* Bootstrap call order contract:
|
|
16
|
+
*
|
|
17
|
+
* 1. setupServerActions() — register callServer (independent)
|
|
18
|
+
* 2. createRscPayloadStream() — decode inlined RSC payload
|
|
19
|
+
* 3. createTimberRouter() — create router + Navigation API
|
|
20
|
+
* 4. runPreHydration() — set params + navigation state
|
|
21
|
+
* 5. hydrateApp() — hydrateRoot or deferred createRoot
|
|
22
|
+
* 6. setupPostHydration() — history stack, popstate, scroll
|
|
23
|
+
* 7. setupHmr() — dev-only HMR wiring
|
|
24
|
+
* 8. stale reload handlers — global error listeners
|
|
25
|
+
* 9. timber-ready signal — E2E test readiness indicator
|
|
26
|
+
*
|
|
27
|
+
* Design docs: 18-build-system.md §"Entry Files", 19-client-navigation.md
|
|
28
|
+
*/
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-Hydration Wiring — history stack, segment cache, popstate, scroll.
|
|
3
|
+
*
|
|
4
|
+
* Sets up everything that needs to happen after the React root exists:
|
|
5
|
+
* - Stores initial page in history stack for instant back navigation
|
|
6
|
+
* - Initializes scroll state for the initial entry
|
|
7
|
+
* - Populates segment cache from server-embedded metadata
|
|
8
|
+
* - Registers popstate handler for back/forward navigation
|
|
9
|
+
* - Sets up debounced scroll position saving
|
|
10
|
+
*
|
|
11
|
+
* See design/19-client-navigation.md §"History Stack"
|
|
12
|
+
*/
|
|
13
|
+
import type { RouterInstance } from '#client-internal';
|
|
14
|
+
import type { NavigationApiController } from '../navigation-api.js';
|
|
15
|
+
interface PostHydrationOptions {
|
|
16
|
+
router: RouterInstance;
|
|
17
|
+
navApiController: NavigationApiController | null;
|
|
18
|
+
/** Decoded RSC element from initial SSR (null if no RSC payload) */
|
|
19
|
+
initialElement: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Wire up post-hydration event handlers and state.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setupPostHydration({ router, navApiController, initialElement, }: PostHydrationOptions): void;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=post-hydration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-hydration.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/post-hydration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,UAAU,oBAAoB;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,gBAAgB,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACjD,oEAAoE;IACpE,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,EAAE,oBAAoB,GAAG,IAAI,CAqF7B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Router Initialization — creates the timber router with all dependencies.
|
|
3
|
+
*
|
|
4
|
+
* Wires up RouterDeps (fetch, history, scroll, RSC decoding, render
|
|
5
|
+
* callbacks) and optionally sets up Navigation API integration.
|
|
6
|
+
*
|
|
7
|
+
* See design/19-client-navigation.md §"Navigation API Integration"
|
|
8
|
+
*/
|
|
9
|
+
import type { RouterInstance } from '#client-internal';
|
|
10
|
+
import { type NavigationApiController } from '../navigation-api.js';
|
|
11
|
+
export interface RouterInitResult {
|
|
12
|
+
router: RouterInstance;
|
|
13
|
+
navApiController: NavigationApiController | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create and register the global timber router.
|
|
17
|
+
*
|
|
18
|
+
* Must be called before hydrateRoot so `useRouter()` works during
|
|
19
|
+
* the initial render (methods lazily resolve the router at invocation,
|
|
20
|
+
* not render time, but initRouter must still run first).
|
|
21
|
+
*/
|
|
22
|
+
export declare function createTimberRouter(): RouterInitResult;
|
|
23
|
+
//# sourceMappingURL=router-init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-init.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/router-init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOnE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,gBAAgB,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAClD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAiJrD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RSC Stream Bootstrap — decodes the server-inlined RSC payload.
|
|
3
|
+
*
|
|
4
|
+
* The RSC payload is embedded in the HTML as progressive inline script
|
|
5
|
+
* tags that call `self.__timber_f.push([type, data])` as RSC chunks arrive.
|
|
6
|
+
* Typed tuples: [0] = bootstrap signal, [1, string] = Flight data chunk.
|
|
7
|
+
*
|
|
8
|
+
* This module sets up a ReadableStream fed by those push() calls so
|
|
9
|
+
* `createFromReadableStream` can decode the Flight protocol progressively.
|
|
10
|
+
*
|
|
11
|
+
* See design/18-build-system.md §"Entry Files"
|
|
12
|
+
*/
|
|
13
|
+
export interface RscStreamResult {
|
|
14
|
+
/** The decoded RSC element (thenable/lazy — resolved by React during render) */
|
|
15
|
+
element: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create the RSC payload stream from server-inlined `__timber_f` chunks.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if no RSC payload was inlined (e.g., JS-only client).
|
|
21
|
+
* When a payload exists, returns the decoded element for hydration.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createRscPayloadStream(): RscStreamResult | null;
|
|
24
|
+
//# sourceMappingURL=rsc-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,GAAG,IAAI,CA+H/D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll position helpers for the browser entry.
|
|
3
|
+
*
|
|
4
|
+
* Reads scroll position from the document viewport or explicitly marked
|
|
5
|
+
* `data-timber-scroll-restoration` containers.
|
|
6
|
+
*
|
|
7
|
+
* See design/19-client-navigation.md §"Overflow Scroll Containers".
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Read the current scroll position.
|
|
11
|
+
*
|
|
12
|
+
* Checks window scroll first, then explicit `data-timber-scroll-restoration`
|
|
13
|
+
* containers. With segment tree merging, shared layouts are reconciled in
|
|
14
|
+
* place via `cloneElement` — React preserves their DOM and scroll state
|
|
15
|
+
* naturally. We don't need to auto-detect overflow containers; only
|
|
16
|
+
* explicitly marked containers are tracked.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getScrollY(): number;
|
|
19
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/client/browser-entry/scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAQnC"}
|
|
@@ -1,4 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
3
|
+
import { n as getSsrData } from "../_chunks/ssr-data-DzuI0bIV.js";
|
|
4
|
+
import { Component, createElement } from "react";
|
|
5
|
+
//#region src/client/error-boundary.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Framework-injected React error boundary.
|
|
8
|
+
*
|
|
9
|
+
* Catches errors thrown by children and renders a fallback component
|
|
10
|
+
* with the appropriate props based on error type:
|
|
11
|
+
* - DenySignal (4xx) → { status, dangerouslyPassData }
|
|
12
|
+
* - RenderError (5xx) → { error, digest, reset }
|
|
13
|
+
* - Unhandled error → { error, digest: null, reset }
|
|
14
|
+
*
|
|
15
|
+
* The `status` prop controls which errors this boundary catches:
|
|
16
|
+
* - Specific code (e.g. 403) → only that status
|
|
17
|
+
* - Category (400) → any 4xx
|
|
18
|
+
* - Category (500) → any 5xx
|
|
19
|
+
* - Omitted → catches everything (error.tsx behavior)
|
|
20
|
+
*
|
|
21
|
+
* See design/10-error-handling.md §"Status-Code Files"
|
|
22
|
+
*/
|
|
23
|
+
var _isUnloading = false;
|
|
24
|
+
if (typeof window !== "undefined") {
|
|
25
|
+
window.addEventListener("beforeunload", () => {
|
|
26
|
+
_isUnloading = true;
|
|
27
|
+
});
|
|
28
|
+
window.addEventListener("pagehide", () => {
|
|
29
|
+
_isUnloading = true;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
var TimberErrorBoundary = class extends Component {
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props);
|
|
35
|
+
this.state = {
|
|
36
|
+
hasError: false,
|
|
37
|
+
error: null
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static getDerivedStateFromError(error) {
|
|
41
|
+
if (_isUnloading) return {
|
|
42
|
+
hasError: false,
|
|
43
|
+
error: null
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
hasError: true,
|
|
47
|
+
error
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
componentDidUpdate(prevProps) {
|
|
51
|
+
if (this.state.hasError && prevProps.children !== this.props.children) this.setState({
|
|
52
|
+
hasError: false,
|
|
53
|
+
error: null
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** Reset the error state so children re-render. */
|
|
57
|
+
reset = () => {
|
|
58
|
+
this.setState({
|
|
59
|
+
hasError: false,
|
|
60
|
+
error: null
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
render() {
|
|
64
|
+
if (!this.state.hasError || !this.state.error) return this.props.children;
|
|
65
|
+
const error = this.state.error;
|
|
66
|
+
const parsed = parseDigest(error);
|
|
67
|
+
if (parsed?.type === "redirect") throw error;
|
|
68
|
+
if (this.props.status != null) {
|
|
69
|
+
const errorStatus = getErrorStatus(parsed, error);
|
|
70
|
+
if (errorStatus == null || !statusMatches(this.props.status, errorStatus)) throw error;
|
|
71
|
+
}
|
|
72
|
+
if (parsed?.type === "deny") {
|
|
73
|
+
if (this.props.fallbackElement == null || this.props.isSlotBoundary) {
|
|
74
|
+
const ssrData = getSsrData();
|
|
75
|
+
if (ssrData?._navContext) {
|
|
76
|
+
ssrData._navContext._denyHandledByBoundary = true;
|
|
77
|
+
if (!this.props.isSlotBoundary) ssrData._navContext.statusCode = parsed.status;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (this.props.fallbackElement != null) return this.props.fallbackElement;
|
|
82
|
+
if (parsed?.type === "deny") return createElement(this.props.fallbackComponent, {
|
|
83
|
+
status: parsed.status,
|
|
84
|
+
dangerouslyPassData: parsed.data
|
|
85
|
+
});
|
|
86
|
+
const digest = parsed?.type === "render-error" ? {
|
|
87
|
+
code: parsed.code,
|
|
88
|
+
data: parsed.data
|
|
89
|
+
} : null;
|
|
90
|
+
return createElement(this.props.fallbackComponent, {
|
|
91
|
+
error,
|
|
92
|
+
digest,
|
|
93
|
+
reset: this.reset
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Parse the structured digest from the error.
|
|
99
|
+
* React sets `error.digest` from the string returned by RSC's onError.
|
|
100
|
+
*/
|
|
101
|
+
function parseDigest(error) {
|
|
102
|
+
const raw = error.digest;
|
|
103
|
+
if (typeof raw !== "string") return null;
|
|
104
|
+
try {
|
|
105
|
+
const parsed = JSON.parse(raw);
|
|
106
|
+
if (parsed && typeof parsed === "object" && typeof parsed.type === "string") return parsed;
|
|
107
|
+
} catch {}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Extract the HTTP status code from a parsed digest or error message.
|
|
112
|
+
* Falls back to message pattern matching for errors without a digest.
|
|
113
|
+
*/
|
|
114
|
+
function getErrorStatus(parsed, error) {
|
|
115
|
+
if (parsed?.type === "deny") return parsed.status;
|
|
116
|
+
if (parsed?.type === "render-error") return parsed.status;
|
|
117
|
+
if (parsed?.type === "redirect") return parsed.status;
|
|
118
|
+
const match = error.message.match(/^Access denied with status (\d+)$/);
|
|
119
|
+
if (match) return parseInt(match[1], 10);
|
|
120
|
+
return 500;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Check whether an error's status matches the boundary's status filter.
|
|
124
|
+
* Category markers (400, 500) match any status in that range.
|
|
125
|
+
*/
|
|
126
|
+
function statusMatches(boundaryStatus, errorStatus) {
|
|
127
|
+
if (boundaryStatus === 400) return errorStatus >= 400 && errorStatus <= 499;
|
|
128
|
+
if (boundaryStatus === 500) return errorStatus >= 500 && errorStatus <= 599;
|
|
129
|
+
return boundaryStatus === errorStatus;
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
4
132
|
export { TimberErrorBoundary };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=error-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-boundary.js","names":[],"sources":["../../src/client/error-boundary.tsx"],"sourcesContent":["'use client';\n\n/**\n * Framework-injected React error boundary.\n *\n * Catches errors thrown by children and renders a fallback component\n * with the appropriate props based on error type:\n * - DenySignal (4xx) → { status, dangerouslyPassData }\n * - RenderError (5xx) → { error, digest, reset }\n * - Unhandled error → { error, digest: null, reset }\n *\n * The `status` prop controls which errors this boundary catches:\n * - Specific code (e.g. 403) → only that status\n * - Category (400) → any 4xx\n * - Category (500) → any 5xx\n * - Omitted → catches everything (error.tsx behavior)\n *\n * See design/10-error-handling.md §\"Status-Code Files\"\n */\n\nimport { Component, createElement, type ReactNode } from 'react';\nimport { getSsrData } from './ssr-data.js';\n\n// ─── Page Unload Detection ───────────────────────────────────────────────────\n// Track whether the page is being unloaded (user refreshed or navigated away).\n// When this is true, error boundaries suppress activation — the error is from\n// the aborted connection, not an application error.\nlet _isUnloading = false;\nif (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n _isUnloading = true;\n });\n window.addEventListener('pagehide', () => {\n _isUnloading = true;\n });\n}\n\n// ─── Digest Types ────────────────────────────────────────────────────────────\n\n/** Structured digest returned by RSC onError for DenySignal. */\ninterface DenyDigest {\n type: 'deny';\n status: number;\n data: unknown;\n}\n\n/** Structured digest returned by RSC onError for RenderError. */\ninterface RenderErrorDigest {\n type: 'render-error';\n code: string;\n data: unknown;\n status: number;\n}\n\n/** Structured digest returned by RSC onError for RedirectSignal. */\ninterface RedirectDigest {\n type: 'redirect';\n location: string;\n status: number;\n}\n\ntype ParsedDigest = DenyDigest | RenderErrorDigest | RedirectDigest;\n\n// ─── Props & State ───────────────────────────────────────────────────────────\n\nexport interface TimberErrorBoundaryProps {\n /** The component to render when an error is caught. */\n fallbackComponent?: (...args: unknown[]) => ReactNode;\n /**\n * Pre-rendered fallback element. Used for MDX status files which are server\n * components and cannot be passed as function props across the RSC→client\n * boundary. When set, rendered directly instead of calling fallbackComponent.\n *\n * See design/10-error-handling.md §\"Status-Code File Variants\" — MDX status\n * files are server components by default (zero client JS).\n */\n fallbackElement?: ReactNode;\n /**\n * Status code filter. If set, only catches errors matching this status.\n * 400 = any 4xx, 500 = any 5xx, specific number = exact match.\n */\n status?: number;\n /**\n * When true, this boundary wraps a parallel slot. Slot denials are\n * graceful degradation — they must NOT change the HTTP status code.\n */\n isSlotBoundary?: boolean;\n children: ReactNode;\n}\n\ninterface TimberErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport class TimberErrorBoundary extends Component<\n TimberErrorBoundaryProps,\n TimberErrorBoundaryState\n> {\n constructor(props: TimberErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error): TimberErrorBoundaryState {\n // Suppress error boundaries during page unload (refresh/navigate away).\n // The aborted connection causes React's streaming hydration to error,\n // but the page is about to be replaced — showing an error boundary\n // would be a jarring flash for the user.\n if (_isUnloading) {\n return { hasError: false, error: null };\n }\n\n return { hasError: true, error };\n }\n\n componentDidUpdate(prevProps: TimberErrorBoundaryProps): void {\n // Reset error state when children change (e.g. client-side navigation).\n // Without this, navigating from one error page to another keeps the\n // stale error — getDerivedStateFromError doesn't re-fire for new children.\n if (this.state.hasError && prevProps.children !== this.props.children) {\n this.setState({ hasError: false, error: null });\n }\n }\n\n /** Reset the error state so children re-render. */\n private reset = () => {\n this.setState({ hasError: false, error: null });\n };\n\n render(): ReactNode {\n if (!this.state.hasError || !this.state.error) {\n return this.props.children;\n }\n\n const error = this.state.error;\n const parsed = parseDigest(error);\n\n // RedirectSignal errors must propagate through all error boundaries\n // so the SSR shell fails and the pipeline catch block can produce a\n // proper HTTP redirect response. See design/04-authorization.md.\n if (parsed?.type === 'redirect') {\n throw error;\n }\n\n // If this boundary has a status filter, check whether the error matches.\n // Non-matching errors re-throw so an outer boundary can catch them.\n if (this.props.status != null) {\n const errorStatus = getErrorStatus(parsed, error);\n if (errorStatus == null || !statusMatches(this.props.status, errorStatus)) {\n // Re-throw: this boundary doesn't handle this error.\n throw error;\n }\n }\n\n // Report DenySignal handling so the pipeline skips the redundant\n // renderDenyPage() re-render — but ONLY when this boundary can fully\n // handle the deny in-tree:\n //\n // ✅ TSX boundaries (fallbackComponent) — can receive runtime props\n // (status, dangerouslyPassData) dynamically in render()\n // ❌ MDX boundaries (fallbackElement) — pre-rendered at tree-build time,\n // cannot receive runtime deny props. Must fall through to re-render.\n //\n // For qualifying segment boundaries: also set the HTTP status code from\n // the DenySignal so the Response has the correct 4xx status. This runs\n // synchronously during Fizz rendering, BEFORE onShellReady.\n //\n // For slot boundaries: set _denyHandledByBoundary but do NOT change\n // statusCode — slot denials are graceful degradation.\n //\n // See TIM-664, LOCAL-298.\n if (parsed?.type === 'deny') {\n const canHandleInTree = this.props.fallbackElement == null;\n\n if (canHandleInTree || this.props.isSlotBoundary) {\n const ssrData = getSsrData();\n if (ssrData?._navContext) {\n ssrData._navContext._denyHandledByBoundary = true;\n if (!this.props.isSlotBoundary) {\n ssrData._navContext.statusCode = parsed.status;\n }\n }\n }\n }\n\n // Pre-rendered fallback element (MDX status files) — render directly.\n // MDX components are server components that cannot be passed as function\n // props across the RSC→client boundary. Instead, they are pre-rendered\n // as elements in the RSC environment and passed here as fallbackElement.\n if (this.props.fallbackElement != null) {\n return this.props.fallbackElement;\n }\n\n // Render the fallback component with the right props shape.\n if (parsed?.type === 'deny') {\n return createElement(this.props.fallbackComponent as never, {\n status: parsed.status,\n dangerouslyPassData: parsed.data,\n });\n }\n\n // 5xx / RenderError / unhandled error\n const digest =\n parsed?.type === 'render-error' ? { code: parsed.code, data: parsed.data } : null;\n\n return createElement(this.props.fallbackComponent as never, {\n error,\n digest,\n reset: this.reset,\n });\n }\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/**\n * Parse the structured digest from the error.\n * React sets `error.digest` from the string returned by RSC's onError.\n */\nfunction parseDigest(error: Error): ParsedDigest | null {\n const raw = (error as { digest?: string }).digest;\n if (typeof raw !== 'string') return null;\n try {\n const parsed = JSON.parse(raw);\n if (parsed && typeof parsed === 'object' && typeof parsed.type === 'string') {\n return parsed as ParsedDigest;\n }\n } catch {\n // Not JSON — legacy or unknown digest format\n }\n return null;\n}\n\n/**\n * Extract the HTTP status code from a parsed digest or error message.\n * Falls back to message pattern matching for errors without a digest.\n */\nfunction getErrorStatus(parsed: ParsedDigest | null, error: Error): number | null {\n if (parsed?.type === 'deny') return parsed.status;\n if (parsed?.type === 'render-error') return parsed.status;\n if (parsed?.type === 'redirect') return parsed.status;\n\n // Fallback: parse DenySignal message pattern for errors that lost their digest\n const match = error.message.match(/^Access denied with status (\\d+)$/);\n if (match) return parseInt(match[1], 10);\n\n // Unhandled errors are implicitly 500\n return 500;\n}\n\n/**\n * Check whether an error's status matches the boundary's status filter.\n * Category markers (400, 500) match any status in that range.\n */\nfunction statusMatches(boundaryStatus: number, errorStatus: number): boolean {\n // Category catch-all: 400 matches any 4xx, 500 matches any 5xx\n if (boundaryStatus === 400) return errorStatus >= 400 && errorStatus <= 499;\n if (boundaryStatus === 500) return errorStatus >= 500 && errorStatus <= 599;\n // Exact match\n return boundaryStatus === errorStatus;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAI,eAAe;AACnB,IAAI,OAAO,WAAW,aAAa;AACjC,QAAO,iBAAiB,sBAAsB;AAC5C,iBAAe;GACf;AACF,QAAO,iBAAiB,kBAAkB;AACxC,iBAAe;GACf;;AA+DJ,IAAa,sBAAb,cAAyC,UAGvC;CACA,YAAY,OAAiC;AAC3C,QAAM,MAAM;AACZ,OAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAG/C,OAAO,yBAAyB,OAAwC;AAKtE,MAAI,aACF,QAAO;GAAE,UAAU;GAAO,OAAO;GAAM;AAGzC,SAAO;GAAE,UAAU;GAAM;GAAO;;CAGlC,mBAAmB,WAA2C;AAI5D,MAAI,KAAK,MAAM,YAAY,UAAU,aAAa,KAAK,MAAM,SAC3D,MAAK,SAAS;GAAE,UAAU;GAAO,OAAO;GAAM,CAAC;;;CAKnD,cAAsB;AACpB,OAAK,SAAS;GAAE,UAAU;GAAO,OAAO;GAAM,CAAC;;CAGjD,SAAoB;AAClB,MAAI,CAAC,KAAK,MAAM,YAAY,CAAC,KAAK,MAAM,MACtC,QAAO,KAAK,MAAM;EAGpB,MAAM,QAAQ,KAAK,MAAM;EACzB,MAAM,SAAS,YAAY,MAAM;AAKjC,MAAI,QAAQ,SAAS,WACnB,OAAM;AAKR,MAAI,KAAK,MAAM,UAAU,MAAM;GAC7B,MAAM,cAAc,eAAe,QAAQ,MAAM;AACjD,OAAI,eAAe,QAAQ,CAAC,cAAc,KAAK,MAAM,QAAQ,YAAY,CAEvE,OAAM;;AAqBV,MAAI,QAAQ,SAAS;OACK,KAAK,MAAM,mBAAmB,QAE/B,KAAK,MAAM,gBAAgB;IAChD,MAAM,UAAU,YAAY;AAC5B,QAAI,SAAS,aAAa;AACxB,aAAQ,YAAY,yBAAyB;AAC7C,SAAI,CAAC,KAAK,MAAM,eACd,SAAQ,YAAY,aAAa,OAAO;;;;AAUhD,MAAI,KAAK,MAAM,mBAAmB,KAChC,QAAO,KAAK,MAAM;AAIpB,MAAI,QAAQ,SAAS,OACnB,QAAO,cAAc,KAAK,MAAM,mBAA4B;GAC1D,QAAQ,OAAO;GACf,qBAAqB,OAAO;GAC7B,CAAC;EAIJ,MAAM,SACJ,QAAQ,SAAS,iBAAiB;GAAE,MAAM,OAAO;GAAM,MAAM,OAAO;GAAM,GAAG;AAE/E,SAAO,cAAc,KAAK,MAAM,mBAA4B;GAC1D;GACA;GACA,OAAO,KAAK;GACb,CAAC;;;;;;;AAUN,SAAS,YAAY,OAAmC;CACtD,MAAM,MAAO,MAA8B;AAC3C,KAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,MAAI,UAAU,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS,SACjE,QAAO;SAEH;AAGR,QAAO;;;;;;AAOT,SAAS,eAAe,QAA6B,OAA6B;AAChF,KAAI,QAAQ,SAAS,OAAQ,QAAO,OAAO;AAC3C,KAAI,QAAQ,SAAS,eAAgB,QAAO,OAAO;AACnD,KAAI,QAAQ,SAAS,WAAY,QAAO,OAAO;CAG/C,MAAM,QAAQ,MAAM,QAAQ,MAAM,oCAAoC;AACtE,KAAI,MAAO,QAAO,SAAS,MAAM,IAAI,GAAG;AAGxC,QAAO;;;;;;AAOT,SAAS,cAAc,gBAAwB,aAA8B;AAE3E,KAAI,mBAAmB,IAAK,QAAO,eAAe,OAAO,eAAe;AACxE,KAAI,mBAAmB,IAAK,QAAO,eAAe,OAAO,eAAe;AAExE,QAAO,mBAAmB"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { RenderErrorDigest } from './types';
|
|
2
2
|
export { Link, interpolateParams, resolveHref, validateLinkHref, buildLinkProps } from './link';
|
|
3
3
|
export { mergePreservedSearchParams } from '../shared/merge-search-params.js';
|
|
4
4
|
export type { LinkFunction, LinkProps, LinkPropsWithHref, LinkPropsWithParams } from './link';
|
|
5
5
|
export type { LinkSegmentParams, OnNavigateHandler, OnNavigateEvent } from './link';
|
|
6
|
-
export {
|
|
7
|
-
export type { RouterInstance, NavigationOptions, RouterDeps, RouterPhase, RscDecoder, RootRenderer, } from './router';
|
|
8
|
-
export { useNavigationPending } from './use-navigation-pending';
|
|
6
|
+
export { usePendingNavigation } from './use-pending-navigation';
|
|
9
7
|
export { useLinkStatus, LinkStatusContext } from './use-link-status';
|
|
10
8
|
export type { LinkStatus } from './use-link-status';
|
|
11
|
-
export { getRouter, getRouterOrNull, setGlobalRouter } from './router-ref';
|
|
12
9
|
export { useRouter } from './use-router';
|
|
13
10
|
export type { AppRouterInstance } from './use-router';
|
|
14
11
|
export { usePathname } from './use-pathname';
|
|
15
12
|
export { useSearchParams } from './use-search-params';
|
|
16
13
|
export { useSelectedLayoutSegment, useSelectedLayoutSegments } from './use-selected-layout-segment';
|
|
17
|
-
export { SegmentProvider, useSegmentContext } from './segment-context';
|
|
18
|
-
export type { SegmentContextValue } from './segment-context';
|
|
19
|
-
export { SegmentCache, PrefetchCache } from './segment-cache';
|
|
20
|
-
export type { SegmentNode, StateTree } from './segment-cache';
|
|
21
|
-
export { HistoryStack } from './history';
|
|
22
|
-
export type { HistoryEntry } from './history';
|
|
23
14
|
export { useActionState, useFormAction, useFormErrors } from './form';
|
|
24
15
|
export type { UseActionStateFn, UseActionStateReturn, FormErrorsResult } from './form';
|
|
25
|
-
export { useSegmentParams
|
|
26
|
-
export {
|
|
27
|
-
export type { NavigationState } from './navigation-context';
|
|
28
|
-
export { useQueryStates, bindUseQueryStates } from './use-query-states';
|
|
16
|
+
export { useSegmentParams } from './use-params';
|
|
17
|
+
export { useQueryStates } from './use-query-states';
|
|
29
18
|
export { useCookie } from './use-cookie';
|
|
30
19
|
export type { ClientCookieOptions, CookieSetter } from './use-cookie';
|
|
31
|
-
export { setSsrData, clearSsrData, getSsrData } from './ssr-data';
|
|
32
|
-
export type { SsrData } from './ssr-data';
|
|
33
|
-
export { TimberErrorBoundary } from './error-boundary';
|
|
34
|
-
export type { TimberErrorBoundaryProps } from './error-boundary';
|
|
35
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AASA,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC9F,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAGpG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|