@teyik0/furin 0.9.0-alpha.3 → 0.9.0-alpha.5
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/adapter/runtime-build.d.ts +1 -0
- package/dist/build/index.js +65 -25
- package/dist/build/route-metadata.d.ts +1 -1
- package/dist/cli/index.js +65 -25
- package/dist/client/chunks/{client-rdxyrw11.js → client-hjqd5m3b.js} +1 -1
- package/dist/client/chunks/{client-d9v49jwz.js → client-whph3y67.js} +66 -3
- package/dist/client/chunks/{client-a7spxfnn.js → client-xf7r768c.js} +13 -1
- package/dist/client/define-route.d.ts +12 -0
- package/dist/client/internal/runtime-types.d.ts +7 -0
- package/dist/client/link.js +200 -40
- package/dist/client/query.d.ts +13 -0
- package/dist/client/route-element.d.ts +5 -0
- package/dist/client/router/history.d.ts +6 -0
- package/dist/client/router/link-utils.d.ts +7 -0
- package/dist/client/router/navigation-controller.d.ts +20 -2
- package/dist/client/router/pending.d.ts +17 -0
- package/dist/client/router/search/index.d.ts +2 -0
- package/dist/client/router/search/index.js +7 -3
- package/dist/client/router/types.d.ts +21 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +21 -4
- package/dist/define-route.d.ts +37 -10
- package/dist/furin.js +92 -43
- package/dist/plugin/client-plugin.d.ts +1 -1
- package/dist/plugin/index.js +36 -17
- package/dist/plugin/route-manifest.d.ts +2 -1
- package/dist/plugin/strip-server-stages.d.ts +1 -1
- package/dist/server/dev/graph.d.ts +0 -1
- package/dist/server/internal.d.ts +1 -0
- package/dist/server/internal.js +46 -22
- package/dist/server/router/defined-route.d.ts +3 -0
- package/dist/server/router/hmr.d.ts +0 -1
- package/dist/server/router/source-version.d.ts +0 -1
- package/dist/server/router/types.d.ts +7 -1
- package/dist/server/static-export.js +49 -22
- package/dist/server/sync/index.js +1 -1
- package/dist/shared/pending.d.ts +13 -0
- package/dist/shared/search-params.d.ts +1 -0
- package/dist/sync-client.js +1 -1
- package/package.json +1 -1
- package/src/adapter/runtime-build.ts +4 -0
- package/src/build/hydrate.ts +11 -2
- package/src/build/preload-manifest.ts +3 -1
- package/src/build/route-metadata.ts +3 -2
- package/src/client/define-route.ts +23 -3
- package/src/client/internal/runtime-types.ts +7 -0
- package/src/client/link.tsx +26 -4
- package/src/client/query-store.ts +2 -1
- package/src/client/query.tsx +87 -0
- package/src/client/route-element.tsx +41 -15
- package/src/client/router/context.ts +29 -8
- package/src/client/router/history.ts +10 -0
- package/src/client/router/link-utils.ts +23 -0
- package/src/client/router/navigation-controller.ts +239 -19
- package/src/client/router/pending.ts +58 -0
- package/src/client/router/provider.tsx +5 -2
- package/src/client/router/search/index.ts +7 -2
- package/src/client/router/types.ts +29 -3
- package/src/client.ts +1 -1
- package/src/define-route.ts +74 -26
- package/src/plugin/client-plugin.ts +5 -4
- package/src/plugin/route-config.ts +9 -2
- package/src/plugin/route-manifest.ts +11 -3
- package/src/plugin/route-tree.ts +2 -2
- package/src/plugin/strip-server-stages.ts +60 -35
- package/src/server/dev/graph.ts +2 -7
- package/src/server/dev/runtime.ts +1 -2
- package/src/server/internal.ts +1 -0
- package/src/server/router/defined-route.ts +6 -0
- package/src/server/router/discovery.ts +5 -2
- package/src/server/router/hmr.ts +1 -5
- package/src/server/router/source-version.ts +3 -6
- package/src/server/router/types.ts +7 -1
- package/src/shared/pending.ts +16 -0
- package/src/shared/search-params.ts +1 -1
|
@@ -3,8 +3,9 @@ import { defaultInstanceBucket, scopedInstance } from "../instance.ts";
|
|
|
3
3
|
|
|
4
4
|
export function routeModuleSourceVersion(path: string): string {
|
|
5
5
|
// Bun's runtime plugin loads modules outside any runtime scope. Use the
|
|
6
|
-
// graphs whose routes depend on this source (or that have no snapshot yet)
|
|
7
|
-
//
|
|
6
|
+
// graphs whose routes depend on this source (or that have no snapshot yet).
|
|
7
|
+
// A version only advances when the source or a recorded dependency changes,
|
|
8
|
+
// so an unchanged module keeps one ESM identity for every importer.
|
|
8
9
|
const current = devGraph(scopedInstance() ?? defaultInstanceBucket());
|
|
9
10
|
const relevant = developmentGraphs().filter((graph) => {
|
|
10
11
|
const { snapshot } = graph;
|
|
@@ -22,7 +23,3 @@ export function routeModuleSourceVersion(path: string): string {
|
|
|
22
23
|
)
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
export function invalidateRouteModuleSourceVersions(): void {
|
|
27
|
-
devGraph(undefined).invalidateModules();
|
|
28
|
-
}
|
|
@@ -35,6 +35,11 @@ export interface SegmentBoundary {
|
|
|
35
35
|
* except the root's, which is the pages directory.
|
|
36
36
|
*/
|
|
37
37
|
path: string;
|
|
38
|
+
/**
|
|
39
|
+
* Module declaring the pending screen: a `loading.tsx`, or the route file
|
|
40
|
+
* of a `fromRoute` boundary. Only the client renders it.
|
|
41
|
+
*/
|
|
42
|
+
pendingPath?: string;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
/** A layout wrapping a page, from the route manifest. */
|
|
@@ -58,7 +63,8 @@ export interface ResolvedRoute {
|
|
|
58
63
|
routeChain: RuntimeRoute[];
|
|
59
64
|
/**
|
|
60
65
|
* Per-directory boundary chain, ordered shallow → deep. Only directories
|
|
61
|
-
* that DECLARE at least one of `error.tsx` / `not-found.tsx`
|
|
66
|
+
* that DECLARE at least one of `error.tsx` / `not-found.tsx` / `loading.tsx`
|
|
67
|
+
* (or routes with `.error()` / `.notFound()` / `.pending()`) are included;
|
|
62
68
|
* directories without conventions are skipped. Empty when no conventions
|
|
63
69
|
* exist anywhere in the path.
|
|
64
70
|
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export type PendingComponent = FC;
|
|
4
|
+
|
|
5
|
+
/** When a navigation shows a route's pending screen (TanStack `pendingMs` / `pendingMinMs`). */
|
|
6
|
+
export interface PendingOptions {
|
|
7
|
+
/** Minimum time the screen stays once shown, so it never blinks. Default: 500. */
|
|
8
|
+
minMs?: number;
|
|
9
|
+
/** Delay before the screen shows, so fast navigations never flash it. Default: 1000. */
|
|
10
|
+
ms?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A route's `.pending()` (TanStack style) or a directory's `loading.tsx` (Next.js style). */
|
|
14
|
+
export interface RoutePending extends PendingOptions {
|
|
15
|
+
component: PendingComponent;
|
|
16
|
+
}
|
|
@@ -48,7 +48,7 @@ function objectsDeepEqual(a: { [key: string]: unknown }, b: { [key: string]: unk
|
|
|
48
48
|
return true;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function deepEqual(a: unknown, b: unknown): boolean {
|
|
51
|
+
export function deepEqual(a: unknown, b: unknown): boolean {
|
|
52
52
|
if (Object.is(a, b)) {
|
|
53
53
|
return true;
|
|
54
54
|
}
|