@rangojs/router 0.0.0-experimental.8 → 0.0.0-experimental.8a4d0430
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/AGENTS.md +5 -0
- package/README.md +884 -4
- package/dist/bin/rango.js +1601 -0
- package/dist/vite/index.js +4474 -867
- package/package.json +60 -51
- package/skills/breadcrumbs/SKILL.md +250 -0
- package/skills/cache-guide/SKILL.md +262 -0
- package/skills/caching/SKILL.md +50 -21
- package/skills/composability/SKILL.md +172 -0
- package/skills/debug-manifest/SKILL.md +12 -8
- package/skills/document-cache/SKILL.md +18 -16
- package/skills/fonts/SKILL.md +167 -0
- package/skills/hooks/SKILL.md +334 -72
- package/skills/host-router/SKILL.md +218 -0
- package/skills/intercept/SKILL.md +131 -8
- package/skills/layout/SKILL.md +100 -3
- package/skills/links/SKILL.md +89 -30
- package/skills/loader/SKILL.md +388 -38
- package/skills/middleware/SKILL.md +171 -34
- package/skills/mime-routes/SKILL.md +128 -0
- package/skills/parallel/SKILL.md +78 -1
- package/skills/prerender/SKILL.md +643 -0
- package/skills/rango/SKILL.md +85 -16
- package/skills/response-routes/SKILL.md +411 -0
- package/skills/route/SKILL.md +226 -14
- package/skills/router-setup/SKILL.md +123 -30
- package/skills/tailwind/SKILL.md +129 -0
- package/skills/theme/SKILL.md +9 -8
- package/skills/typesafety/SKILL.md +318 -89
- package/skills/use-cache/SKILL.md +324 -0
- package/src/__internal.ts +102 -4
- package/src/bin/rango.ts +321 -0
- package/src/browser/action-coordinator.ts +97 -0
- package/src/browser/action-response-classifier.ts +99 -0
- package/src/browser/event-controller.ts +87 -64
- package/src/browser/history-state.ts +80 -0
- package/src/browser/intercept-utils.ts +52 -0
- package/src/browser/link-interceptor.ts +24 -4
- package/src/browser/logging.ts +55 -0
- package/src/browser/merge-segment-loaders.ts +20 -12
- package/src/browser/navigation-bridge.ts +285 -553
- package/src/browser/navigation-client.ts +124 -71
- package/src/browser/navigation-store.ts +33 -50
- package/src/browser/navigation-transaction.ts +295 -0
- package/src/browser/network-error-handler.ts +61 -0
- package/src/browser/partial-update.ts +258 -308
- package/src/browser/prefetch/cache.ts +146 -0
- package/src/browser/prefetch/fetch.ts +135 -0
- package/src/browser/prefetch/observer.ts +65 -0
- package/src/browser/prefetch/policy.ts +42 -0
- package/src/browser/prefetch/queue.ts +88 -0
- package/src/browser/rango-state.ts +112 -0
- package/src/browser/react/Link.tsx +185 -73
- package/src/browser/react/NavigationProvider.tsx +51 -11
- package/src/browser/react/context.ts +6 -0
- package/src/browser/react/filter-segment-order.ts +11 -0
- package/src/browser/react/index.ts +12 -12
- package/src/browser/react/location-state-shared.ts +95 -53
- package/src/browser/react/location-state.ts +60 -15
- package/src/browser/react/mount-context.ts +6 -1
- package/src/browser/react/nonce-context.ts +23 -0
- package/src/browser/react/shallow-equal.ts +27 -0
- package/src/browser/react/use-action.ts +29 -51
- package/src/browser/react/use-client-cache.ts +5 -3
- package/src/browser/react/use-handle.ts +32 -79
- package/src/browser/react/use-href.tsx +2 -2
- package/src/browser/react/use-link-status.ts +6 -5
- package/src/browser/react/use-navigation.ts +22 -63
- package/src/browser/react/use-params.ts +65 -0
- package/src/browser/react/use-pathname.ts +47 -0
- package/src/browser/react/use-router.ts +63 -0
- package/src/browser/react/use-search-params.ts +56 -0
- package/src/browser/react/use-segments.ts +80 -97
- package/src/browser/response-adapter.ts +73 -0
- package/src/browser/rsc-router.tsx +107 -26
- package/src/browser/scroll-restoration.ts +92 -16
- package/src/browser/segment-reconciler.ts +216 -0
- package/src/browser/segment-structure-assert.ts +16 -0
- package/src/browser/server-action-bridge.ts +504 -599
- package/src/browser/shallow.ts +6 -1
- package/src/browser/types.ts +109 -47
- package/src/browser/validate-redirect-origin.ts +29 -0
- package/src/build/generate-manifest.ts +235 -24
- package/src/build/generate-route-types.ts +36 -0
- package/src/build/index.ts +13 -0
- package/src/build/route-trie.ts +265 -0
- package/src/build/route-types/ast-helpers.ts +25 -0
- package/src/build/route-types/ast-route-extraction.ts +98 -0
- package/src/build/route-types/codegen.ts +102 -0
- package/src/build/route-types/include-resolution.ts +411 -0
- package/src/build/route-types/param-extraction.ts +48 -0
- package/src/build/route-types/per-module-writer.ts +128 -0
- package/src/build/route-types/router-processing.ts +469 -0
- package/src/build/route-types/scan-filter.ts +78 -0
- package/src/build/runtime-discovery.ts +231 -0
- package/src/cache/background-task.ts +34 -0
- package/src/cache/cache-key-utils.ts +44 -0
- package/src/cache/cache-policy.ts +125 -0
- package/src/cache/cache-runtime.ts +338 -0
- package/src/cache/cache-scope.ts +120 -303
- package/src/cache/cf/cf-cache-store.ts +119 -7
- package/src/cache/cf/index.ts +8 -2
- package/src/cache/document-cache.ts +101 -72
- package/src/cache/handle-capture.ts +81 -0
- package/src/cache/handle-snapshot.ts +41 -0
- package/src/cache/index.ts +0 -15
- package/src/cache/memory-segment-store.ts +191 -13
- package/src/cache/profile-registry.ts +73 -0
- package/src/cache/read-through-swr.ts +134 -0
- package/src/cache/segment-codec.ts +256 -0
- package/src/cache/taint.ts +98 -0
- package/src/cache/types.ts +72 -122
- package/src/client.rsc.tsx +3 -1
- package/src/client.tsx +106 -126
- package/src/component-utils.ts +4 -4
- package/src/components/DefaultDocument.tsx +5 -1
- package/src/context-var.ts +86 -0
- package/src/debug.ts +17 -7
- package/src/errors.ts +108 -2
- package/src/handle.ts +15 -29
- package/src/handles/MetaTags.tsx +73 -20
- package/src/handles/breadcrumbs.ts +66 -0
- package/src/handles/index.ts +1 -0
- package/src/handles/meta.ts +30 -13
- package/src/host/cookie-handler.ts +21 -15
- package/src/host/errors.ts +8 -8
- package/src/host/index.ts +4 -7
- package/src/host/pattern-matcher.ts +27 -27
- package/src/host/router.ts +61 -39
- package/src/host/testing.ts +8 -8
- package/src/host/types.ts +15 -7
- package/src/host/utils.ts +1 -1
- package/src/href-client.ts +119 -29
- package/src/index.rsc.ts +153 -19
- package/src/index.ts +211 -30
- package/src/internal-debug.ts +11 -0
- package/src/loader.rsc.ts +26 -157
- package/src/loader.ts +27 -10
- package/src/network-error-thrower.tsx +3 -1
- package/src/outlet-provider.tsx +45 -0
- package/src/prerender/param-hash.ts +37 -0
- package/src/prerender/store.ts +185 -0
- package/src/prerender.ts +463 -0
- package/src/reverse.ts +330 -0
- package/src/root-error-boundary.tsx +41 -29
- package/src/route-content-wrapper.tsx +7 -4
- package/src/route-definition/dsl-helpers.ts +934 -0
- package/src/route-definition/helper-factories.ts +200 -0
- package/src/route-definition/helpers-types.ts +430 -0
- package/src/route-definition/index.ts +52 -0
- package/src/route-definition/redirect.ts +93 -0
- package/src/route-definition.ts +1 -1428
- package/src/route-map-builder.ts +211 -123
- package/src/route-name.ts +53 -0
- package/src/route-types.ts +59 -8
- package/src/router/content-negotiation.ts +116 -0
- package/src/router/debug-manifest.ts +72 -0
- package/src/router/error-handling.ts +9 -9
- package/src/router/find-match.ts +158 -0
- package/src/router/handler-context.ts +374 -81
- package/src/router/intercept-resolution.ts +395 -0
- package/src/router/lazy-includes.ts +234 -0
- package/src/router/loader-resolution.ts +215 -122
- package/src/router/logging.ts +248 -0
- package/src/router/manifest.ts +148 -35
- package/src/router/match-api.ts +620 -0
- package/src/router/match-context.ts +5 -3
- package/src/router/match-handlers.ts +440 -0
- package/src/router/match-middleware/background-revalidation.ts +80 -93
- package/src/router/match-middleware/cache-lookup.ts +382 -9
- package/src/router/match-middleware/cache-store.ts +51 -22
- package/src/router/match-middleware/intercept-resolution.ts +55 -17
- package/src/router/match-middleware/segment-resolution.ts +24 -6
- package/src/router/match-pipelines.ts +10 -45
- package/src/router/match-result.ts +34 -28
- package/src/router/metrics.ts +235 -15
- package/src/router/middleware-cookies.ts +55 -0
- package/src/router/middleware-types.ts +222 -0
- package/src/router/middleware.ts +324 -367
- package/src/router/pattern-matching.ts +211 -43
- package/src/router/prerender-match.ts +402 -0
- package/src/router/preview-match.ts +170 -0
- package/src/router/revalidation.ts +137 -38
- package/src/router/router-context.ts +36 -21
- package/src/router/router-interfaces.ts +452 -0
- package/src/router/router-options.ts +592 -0
- package/src/router/router-registry.ts +24 -0
- package/src/router/segment-resolution/fresh.ts +570 -0
- package/src/router/segment-resolution/helpers.ts +263 -0
- package/src/router/segment-resolution/loader-cache.ts +198 -0
- package/src/router/segment-resolution/revalidation.ts +1241 -0
- package/src/router/segment-resolution/static-store.ts +67 -0
- package/src/router/segment-resolution.ts +21 -0
- package/src/router/segment-wrappers.ts +289 -0
- package/src/router/telemetry-otel.ts +299 -0
- package/src/router/telemetry.ts +300 -0
- package/src/router/timeout.ts +148 -0
- package/src/router/trie-matching.ts +239 -0
- package/src/router/types.ts +77 -3
- package/src/router.ts +692 -4257
- package/src/rsc/handler-context.ts +45 -0
- package/src/rsc/handler.ts +764 -754
- package/src/rsc/helpers.ts +140 -6
- package/src/rsc/index.ts +0 -20
- package/src/rsc/loader-fetch.ts +209 -0
- package/src/rsc/manifest-init.ts +86 -0
- package/src/rsc/nonce.ts +14 -0
- package/src/rsc/origin-guard.ts +141 -0
- package/src/rsc/progressive-enhancement.ts +379 -0
- package/src/rsc/response-error.ts +37 -0
- package/src/rsc/response-route-handler.ts +347 -0
- package/src/rsc/rsc-rendering.ts +235 -0
- package/src/rsc/runtime-warnings.ts +42 -0
- package/src/rsc/server-action.ts +348 -0
- package/src/rsc/ssr-setup.ts +128 -0
- package/src/rsc/types.ts +38 -11
- package/src/search-params.ts +230 -0
- package/src/segment-system.tsx +25 -13
- package/src/server/context.ts +182 -51
- package/src/server/cookie-store.ts +190 -0
- package/src/server/fetchable-loader-store.ts +37 -0
- package/src/server/handle-store.ts +94 -15
- package/src/server/loader-registry.ts +15 -56
- package/src/server/request-context.ts +430 -70
- package/src/server.ts +35 -130
- package/src/ssr/index.tsx +100 -31
- package/src/static-handler.ts +114 -0
- package/src/theme/ThemeProvider.tsx +21 -15
- package/src/theme/ThemeScript.tsx +5 -5
- package/src/theme/constants.ts +5 -2
- package/src/theme/index.ts +4 -14
- package/src/theme/theme-context.ts +4 -30
- package/src/theme/theme-script.ts +21 -18
- package/src/types/boundaries.ts +158 -0
- package/src/types/cache-types.ts +198 -0
- package/src/types/error-types.ts +192 -0
- package/src/types/global-namespace.ts +100 -0
- package/src/types/handler-context.ts +687 -0
- package/src/types/index.ts +88 -0
- package/src/types/loader-types.ts +183 -0
- package/src/types/route-config.ts +170 -0
- package/src/types/route-entry.ts +102 -0
- package/src/types/segments.ts +148 -0
- package/src/types.ts +1 -1623
- package/src/urls/include-helper.ts +197 -0
- package/src/urls/index.ts +53 -0
- package/src/urls/path-helper-types.ts +339 -0
- package/src/urls/path-helper.ts +329 -0
- package/src/urls/pattern-types.ts +95 -0
- package/src/urls/response-types.ts +106 -0
- package/src/urls/type-extraction.ts +372 -0
- package/src/urls/urls-function.ts +98 -0
- package/src/urls.ts +1 -802
- package/src/use-loader.tsx +85 -77
- package/src/vite/discovery/bundle-postprocess.ts +184 -0
- package/src/vite/discovery/discover-routers.ts +344 -0
- package/src/vite/discovery/prerender-collection.ts +385 -0
- package/src/vite/discovery/route-types-writer.ts +258 -0
- package/src/vite/discovery/self-gen-tracking.ts +47 -0
- package/src/vite/discovery/state.ts +110 -0
- package/src/vite/discovery/virtual-module-codegen.ts +203 -0
- package/src/vite/index.ts +11 -1133
- package/src/vite/plugin-types.ts +131 -0
- package/src/vite/plugins/cjs-to-esm.ts +93 -0
- package/src/vite/plugins/client-ref-dedup.ts +115 -0
- package/src/vite/plugins/client-ref-hashing.ts +105 -0
- package/src/vite/{expose-action-id.ts → plugins/expose-action-id.ts} +72 -51
- package/src/vite/plugins/expose-id-utils.ts +287 -0
- package/src/vite/plugins/expose-ids/export-analysis.ts +296 -0
- package/src/vite/plugins/expose-ids/handler-transform.ts +179 -0
- package/src/vite/plugins/expose-ids/loader-transform.ts +74 -0
- package/src/vite/plugins/expose-ids/router-transform.ts +110 -0
- package/src/vite/plugins/expose-ids/types.ts +45 -0
- package/src/vite/plugins/expose-internal-ids.ts +569 -0
- package/src/vite/plugins/refresh-cmd.ts +65 -0
- package/src/vite/plugins/use-cache-transform.ts +323 -0
- package/src/vite/plugins/version-injector.ts +83 -0
- package/src/vite/plugins/version-plugin.ts +254 -0
- package/src/vite/{virtual-entries.ts → plugins/virtual-entries.ts} +23 -14
- package/src/vite/plugins/virtual-stub-plugin.ts +29 -0
- package/src/vite/rango.ts +510 -0
- package/src/vite/router-discovery.ts +785 -0
- package/src/vite/utils/ast-handler-extract.ts +517 -0
- package/src/vite/utils/banner.ts +36 -0
- package/src/vite/utils/bundle-analysis.ts +137 -0
- package/src/vite/utils/manifest-utils.ts +70 -0
- package/src/vite/{package-resolution.ts → utils/package-resolution.ts} +25 -29
- package/src/vite/utils/prerender-utils.ts +189 -0
- package/src/vite/utils/shared-utils.ts +169 -0
- package/CLAUDE.md +0 -43
- package/src/browser/lru-cache.ts +0 -69
- package/src/browser/request-controller.ts +0 -164
- package/src/cache/memory-store.ts +0 -253
- package/src/href-context.ts +0 -33
- package/src/href.ts +0 -255
- package/src/server/route-manifest-cache.ts +0 -173
- package/src/vite/expose-handle-id.ts +0 -209
- package/src/vite/expose-loader-id.ts +0 -426
- package/src/vite/expose-location-state-id.ts +0 -177
- /package/src/vite/{version.d.ts → plugins/version.d.ts} +0 -0
|
@@ -2,20 +2,33 @@ import type {
|
|
|
2
2
|
ServerActionBridge,
|
|
3
3
|
ServerActionBridgeConfig,
|
|
4
4
|
RscPayload,
|
|
5
|
-
ResolvedSegment,
|
|
6
|
-
NavigationStore,
|
|
7
5
|
} from "./types.js";
|
|
8
6
|
import { createPartialUpdater } from "./partial-update.js";
|
|
9
|
-
import { createNavigationTransaction } from "./navigation-
|
|
7
|
+
import { createNavigationTransaction } from "./navigation-transaction.js";
|
|
10
8
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
reconcileSegments,
|
|
10
|
+
reconcileErrorSegments,
|
|
11
|
+
} from "./segment-reconciler.js";
|
|
12
|
+
import { startTransition } from "react";
|
|
13
|
+
import type { EventController } from "./event-controller.js";
|
|
14
|
+
import {
|
|
15
|
+
toNetworkError,
|
|
16
|
+
emitNetworkError,
|
|
17
|
+
isBackgroundSuppressible,
|
|
18
|
+
} from "./network-error-handler.js";
|
|
19
|
+
import {
|
|
20
|
+
browserDebugLog,
|
|
21
|
+
isBrowserDebugEnabled,
|
|
22
|
+
startBrowserTransaction,
|
|
23
|
+
} from "./logging.js";
|
|
24
|
+
import { validateRedirectOrigin } from "./validate-redirect-origin.js";
|
|
25
|
+
import {
|
|
26
|
+
extractRscHeaderUrl,
|
|
27
|
+
emptyResponse,
|
|
28
|
+
teeWithCompletion,
|
|
29
|
+
} from "./response-adapter.js";
|
|
30
|
+
import { mergeLocationState } from "./history-state.js";
|
|
31
|
+
import { classifyActionOutcome } from "./action-coordinator.js";
|
|
19
32
|
|
|
20
33
|
// Polyfill Symbol.dispose/asyncDispose for Safari and older browsers
|
|
21
34
|
if (typeof Symbol.dispose === "undefined") {
|
|
@@ -25,26 +38,18 @@ if (typeof Symbol.asyncDispose === "undefined") {
|
|
|
25
38
|
(Symbol as any).asyncDispose = Symbol("Symbol.asyncDispose");
|
|
26
39
|
}
|
|
27
40
|
|
|
28
|
-
/**
|
|
29
|
-
* Normalize action ID - returns the ID as-is
|
|
30
|
-
*
|
|
31
|
-
* Server actions have IDs like "hash#actionName" or "src/actions.ts#actionName".
|
|
32
|
-
* The full ID is used for tracking in the event controller. When subscribing
|
|
33
|
-
* via useAction, both exact matching (full ID) and suffix matching (action name
|
|
34
|
-
* only) are supported by the event controller.
|
|
35
|
-
*/
|
|
36
|
-
function normalizeActionId(actionId: string): string {
|
|
37
|
-
return actionId;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
41
|
/**
|
|
41
42
|
* Extended configuration for server action bridge with event controller
|
|
42
43
|
*/
|
|
43
|
-
export interface ServerActionBridgeConfigWithController
|
|
44
|
-
extends ServerActionBridgeConfig {
|
|
44
|
+
export interface ServerActionBridgeConfigWithController extends ServerActionBridgeConfig {
|
|
45
45
|
eventController: EventController;
|
|
46
46
|
/** RSC version from initial payload metadata */
|
|
47
47
|
version?: string;
|
|
48
|
+
/** Callback to trigger SPA navigation (for action redirects) */
|
|
49
|
+
onNavigate?: (
|
|
50
|
+
url: string,
|
|
51
|
+
options?: { state?: unknown; replace?: boolean; _skipCache?: boolean },
|
|
52
|
+
) => Promise<void>;
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
/**
|
|
@@ -61,10 +66,18 @@ export interface ServerActionBridgeConfigWithController
|
|
|
61
66
|
* @returns ServerActionBridge instance
|
|
62
67
|
*/
|
|
63
68
|
export function createServerActionBridge(
|
|
64
|
-
config: ServerActionBridgeConfigWithController
|
|
69
|
+
config: ServerActionBridgeConfigWithController,
|
|
65
70
|
): ServerActionBridge {
|
|
66
|
-
const {
|
|
67
|
-
|
|
71
|
+
const {
|
|
72
|
+
store,
|
|
73
|
+
client,
|
|
74
|
+
eventController,
|
|
75
|
+
deps,
|
|
76
|
+
onUpdate,
|
|
77
|
+
renderSegments,
|
|
78
|
+
version,
|
|
79
|
+
onNavigate,
|
|
80
|
+
} = config;
|
|
68
81
|
|
|
69
82
|
let isRegistered = false;
|
|
70
83
|
|
|
@@ -76,280 +89,385 @@ export function createServerActionBridge(
|
|
|
76
89
|
version,
|
|
77
90
|
});
|
|
78
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Refetch current route via a navigation transaction.
|
|
94
|
+
* Encapsulates the repeated pattern of creating a navTx + fetchPartialUpdate
|
|
95
|
+
* used by navigated-away, hmr-missing, and consolidation-needed scenarios.
|
|
96
|
+
*/
|
|
97
|
+
async function refetchRoute(opts?: {
|
|
98
|
+
segments?: string[];
|
|
99
|
+
interceptSourceUrl?: string | null;
|
|
100
|
+
}): Promise<void> {
|
|
101
|
+
const src = opts?.interceptSourceUrl ?? null;
|
|
102
|
+
const navTx = createNavigationTransaction(
|
|
103
|
+
store,
|
|
104
|
+
eventController,
|
|
105
|
+
window.location.href,
|
|
106
|
+
{ replace: true, skipLoadingState: true },
|
|
107
|
+
);
|
|
108
|
+
try {
|
|
109
|
+
await fetchPartialUpdate(
|
|
110
|
+
window.location.href,
|
|
111
|
+
opts?.segments ?? [],
|
|
112
|
+
false,
|
|
113
|
+
navTx.handle.signal,
|
|
114
|
+
navTx.with({
|
|
115
|
+
url: window.location.href,
|
|
116
|
+
storeOnly: true,
|
|
117
|
+
...(src ? { intercept: true, interceptSourceUrl: src } : {}),
|
|
118
|
+
}),
|
|
119
|
+
{
|
|
120
|
+
type: "action" as const,
|
|
121
|
+
...(src ? { interceptSourceUrl: src } : {}),
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
} finally {
|
|
125
|
+
navTx[Symbol.dispose]();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
79
129
|
/**
|
|
80
130
|
* Server action callback handler
|
|
81
131
|
*/
|
|
82
132
|
async function handleServerAction(id: string, args: any[]): Promise<unknown> {
|
|
83
|
-
|
|
133
|
+
const tx = isBrowserDebugEnabled()
|
|
134
|
+
? startBrowserTransaction("action")
|
|
135
|
+
: null;
|
|
136
|
+
const log = (msg: string, details?: Record<string, unknown>) => {
|
|
137
|
+
if (tx) browserDebugLog(tx, msg, details);
|
|
138
|
+
};
|
|
139
|
+
|
|
84
140
|
const locationKey = window.history.state?.key;
|
|
85
|
-
|
|
86
|
-
console.log("ID", { id, actionId, args });
|
|
141
|
+
log("action start", { id, argsCount: args.length });
|
|
87
142
|
|
|
88
143
|
// Start action in event controller - handles lifecycle tracking
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log(`[Browser] Args:`, args);
|
|
144
|
+
const handle = eventController.startAction(id, args);
|
|
145
|
+
try {
|
|
146
|
+
const segmentState = store.getSegmentState();
|
|
93
147
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
148
|
+
// Mark cache as stale immediately when action starts
|
|
149
|
+
// This ensures SWR pattern kicks in if user navigates away during action
|
|
150
|
+
store.markCacheAsStaleAndBroadcast();
|
|
97
151
|
|
|
98
|
-
|
|
99
|
-
|
|
152
|
+
// Create temporary references for serialization
|
|
153
|
+
const temporaryReferences = deps.createTemporaryReferenceSet();
|
|
100
154
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
155
|
+
// Capture URL pathname at action start to detect navigation during action
|
|
156
|
+
// Must use window.location (not store.path) because intercepts change URL
|
|
157
|
+
// without changing store.path (e.g., /kanban -> /kanban/card/1)
|
|
158
|
+
const actionStartPathname = window.location.pathname;
|
|
105
159
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
160
|
+
// Build action request URL with current segments
|
|
161
|
+
const url = new URL(window.location.href);
|
|
162
|
+
url.searchParams.set("_rsc_action", id);
|
|
163
|
+
url.searchParams.set(
|
|
164
|
+
"_rsc_segments",
|
|
165
|
+
segmentState.currentSegmentIds.join(","),
|
|
166
|
+
);
|
|
167
|
+
// Add version param for version mismatch detection
|
|
168
|
+
if (version) {
|
|
169
|
+
url.searchParams.set("_rsc_v", version);
|
|
170
|
+
}
|
|
117
171
|
|
|
118
|
-
|
|
119
|
-
|
|
172
|
+
// Encode arguments
|
|
173
|
+
const encodedBody = await deps.encodeReply(args, { temporaryReferences });
|
|
120
174
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
console.log(
|
|
128
|
-
`[Browser] Current segments: ${segmentState.currentSegmentIds.join(", ")}`
|
|
129
|
-
);
|
|
175
|
+
log("sending action request", {
|
|
176
|
+
url: url.href,
|
|
177
|
+
bodyType: typeof encodedBody,
|
|
178
|
+
isFormData: encodedBody instanceof FormData,
|
|
179
|
+
segmentCount: segmentState.currentSegmentIds.length,
|
|
180
|
+
});
|
|
130
181
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// Get intercept source URL if in intercept context
|
|
138
|
-
const interceptSourceUrl = store.getInterceptSourceUrl();
|
|
139
|
-
|
|
140
|
-
// Track streaming token - will be set when response arrives
|
|
141
|
-
let streamingToken: { end(): void } | null = null;
|
|
142
|
-
|
|
143
|
-
// Send action request with stream tracking
|
|
144
|
-
const responsePromise = fetch(url, {
|
|
145
|
-
method: "POST",
|
|
146
|
-
headers: {
|
|
147
|
-
"rsc-action": id,
|
|
148
|
-
"X-RSC-Router-Client-Path": segmentState.currentUrl,
|
|
149
|
-
// Send intercept source URL so server can maintain intercept context
|
|
150
|
-
...(interceptSourceUrl && {
|
|
151
|
-
"X-RSC-Router-Intercept-Source": interceptSourceUrl,
|
|
152
|
-
}),
|
|
153
|
-
},
|
|
154
|
-
body: encodedBody,
|
|
155
|
-
}).then(async (response) => {
|
|
156
|
-
// Check for version mismatch - server wants us to reload
|
|
157
|
-
const reloadUrl = response.headers.get("X-RSC-Reload");
|
|
158
|
-
if (reloadUrl) {
|
|
159
|
-
console.log(`[Browser] Version mismatch on action - reloading: ${reloadUrl}`);
|
|
160
|
-
window.location.href = reloadUrl;
|
|
161
|
-
// Return a never-resolving promise to prevent further processing
|
|
162
|
-
return new Promise<Response>(() => {});
|
|
163
|
-
}
|
|
182
|
+
// Track when the stream completes
|
|
183
|
+
let resolveStreamComplete: () => void;
|
|
184
|
+
const streamComplete = new Promise<void>((resolve) => {
|
|
185
|
+
resolveStreamComplete = resolve;
|
|
186
|
+
});
|
|
164
187
|
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
188
|
+
// Get intercept source URL if in intercept context
|
|
189
|
+
const interceptSourceUrl = store.getInterceptSourceUrl();
|
|
190
|
+
|
|
191
|
+
// Track streaming token - will be set when response arrives
|
|
192
|
+
let streamingToken: { end(): void } | null = null;
|
|
193
|
+
|
|
194
|
+
// Use a dedicated abort controller for the fetch so we can cancel network
|
|
195
|
+
// I/O without disrupting the Flight stream once the response has arrived.
|
|
196
|
+
// Aborting a response mid-stream causes React's Flight decoder to throw
|
|
197
|
+
// asynchronous unhandled errors (BodyStreamBuffer was aborted).
|
|
198
|
+
const fetchAbort = new AbortController();
|
|
199
|
+
const onHandleAbort = () => fetchAbort.abort();
|
|
200
|
+
handle.signal.addEventListener("abort", onHandleAbort, { once: true });
|
|
201
|
+
|
|
202
|
+
// Send action request with stream tracking
|
|
203
|
+
const responsePromise = fetch(url, {
|
|
204
|
+
method: "POST",
|
|
205
|
+
headers: {
|
|
206
|
+
"rsc-action": id,
|
|
207
|
+
"X-RSC-Router-Client-Path": segmentState.currentUrl,
|
|
208
|
+
...(tx && { "X-RSC-Router-Request-Id": tx.requestId }),
|
|
209
|
+
// Send intercept source URL so server can maintain intercept context
|
|
210
|
+
...(interceptSourceUrl && {
|
|
211
|
+
"X-RSC-Router-Intercept-Source": interceptSourceUrl,
|
|
212
|
+
}),
|
|
213
|
+
},
|
|
214
|
+
body: encodedBody,
|
|
215
|
+
signal: fetchAbort.signal,
|
|
216
|
+
}).then(async (response) => {
|
|
217
|
+
// Response arrived — disconnect fetch abort from handle abort so
|
|
218
|
+
// abortAllActions() doesn't disrupt the in-progress Flight stream.
|
|
219
|
+
handle.signal.removeEventListener("abort", onHandleAbort);
|
|
220
|
+
|
|
221
|
+
// Check for version mismatch - server wants us to reload
|
|
222
|
+
const reload = extractRscHeaderUrl(response, "X-RSC-Reload");
|
|
223
|
+
if (reload === "blocked") {
|
|
224
|
+
resolveStreamComplete();
|
|
225
|
+
return emptyResponse();
|
|
226
|
+
}
|
|
227
|
+
if (reload) {
|
|
228
|
+
log("version mismatch on action, reloading", {
|
|
229
|
+
reloadUrl: reload.url,
|
|
230
|
+
});
|
|
231
|
+
window.location.href = reload.url;
|
|
232
|
+
return new Promise<Response>(() => {});
|
|
233
|
+
}
|
|
169
234
|
|
|
170
|
-
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
235
|
+
// Simple redirect from action (no state, no RSC payload).
|
|
236
|
+
// Short-circuits before createFromFetch — no Flight deserialization needed.
|
|
237
|
+
// Check handle.signal.aborted to avoid redirecting from a stale action
|
|
238
|
+
// when the user has already navigated away.
|
|
239
|
+
const redirect = extractRscHeaderUrl(response, "X-RSC-Redirect");
|
|
240
|
+
if (redirect && redirect !== "blocked" && !handle.signal.aborted) {
|
|
241
|
+
log("action simple redirect", { url: redirect.url });
|
|
242
|
+
handle.complete(undefined);
|
|
243
|
+
if (onNavigate) {
|
|
244
|
+
await onNavigate(redirect.url, {
|
|
245
|
+
replace: true,
|
|
246
|
+
_skipCache: true,
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
window.location.href = redirect.url;
|
|
250
|
+
}
|
|
251
|
+
return new Promise<Response>(() => {});
|
|
252
|
+
}
|
|
253
|
+
if (redirect === "blocked") {
|
|
254
|
+
resolveStreamComplete();
|
|
255
|
+
return emptyResponse();
|
|
256
|
+
}
|
|
176
257
|
|
|
177
|
-
|
|
178
|
-
|
|
258
|
+
// Start streaming immediately when response arrives
|
|
259
|
+
if (!handle.signal.aborted) {
|
|
260
|
+
streamingToken = handle.startStreaming();
|
|
261
|
+
}
|
|
179
262
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const reader = trackingStream.getReader();
|
|
183
|
-
try {
|
|
184
|
-
while (true) {
|
|
185
|
-
const { done } = await reader.read();
|
|
186
|
-
if (done) break;
|
|
187
|
-
}
|
|
188
|
-
} finally {
|
|
189
|
-
reader.releaseLock();
|
|
190
|
-
console.log("[STREAMING] RSC stream complete");
|
|
263
|
+
return teeWithCompletion(response, () => {
|
|
264
|
+
log("stream complete");
|
|
191
265
|
streamingToken?.end();
|
|
192
266
|
resolveStreamComplete();
|
|
193
|
-
}
|
|
194
|
-
})().catch((error) => {
|
|
195
|
-
console.error("[STREAMING] Error reading tracking stream:", error);
|
|
196
|
-
streamingToken?.end();
|
|
267
|
+
});
|
|
197
268
|
});
|
|
198
269
|
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
270
|
+
// Deserialize response (MUST use same temporaryReferences)
|
|
271
|
+
let payload: RscPayload;
|
|
272
|
+
try {
|
|
273
|
+
payload = await deps.createFromFetch<RscPayload>(responsePromise, {
|
|
274
|
+
temporaryReferences,
|
|
275
|
+
});
|
|
276
|
+
} catch (error) {
|
|
277
|
+
// Clean up streaming token on error (may be null if fetch failed before .then() ran)
|
|
278
|
+
// The token is assigned in .then() callback which runs before this catch block,
|
|
279
|
+
// but TypeScript doesn't track cross-async assignments, so use type assertion
|
|
280
|
+
(streamingToken as { end(): void } | null)?.end();
|
|
281
|
+
// resolveStreamComplete is assigned in the Promise constructor so it's safe to call
|
|
282
|
+
resolveStreamComplete!();
|
|
283
|
+
|
|
284
|
+
// Silently swallow abort errors — the action was intentionally cancelled
|
|
285
|
+
// (e.g., user navigated away or abortAllActions was called).
|
|
286
|
+
// Return undefined instead of throwing to avoid surfacing as a page error.
|
|
287
|
+
// Check both DOMException AbortError and stream-level abort messages
|
|
288
|
+
// (BodyStreamBuffer was aborted) that propagate from the aborted fetch.
|
|
289
|
+
if (handle.signal.aborted) {
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
206
292
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
293
|
+
// Convert network-level errors to NetworkError for proper handling
|
|
294
|
+
const networkError = toNetworkError(error, {
|
|
295
|
+
url: url.toString(),
|
|
296
|
+
operation: "action",
|
|
297
|
+
});
|
|
298
|
+
if (networkError) {
|
|
299
|
+
handle.fail(networkError);
|
|
300
|
+
emitNetworkError(onUpdate, networkError, segmentState.currentUrl);
|
|
301
|
+
throw networkError;
|
|
302
|
+
}
|
|
303
|
+
throw error;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
log("action response received", {
|
|
307
|
+
isPartial: payload.metadata?.isPartial,
|
|
308
|
+
isError: payload.metadata?.isError,
|
|
309
|
+
matchedCount: payload.metadata?.matched?.length ?? 0,
|
|
310
|
+
diffCount: payload.metadata?.diff?.length ?? 0,
|
|
212
311
|
});
|
|
213
|
-
} catch (error) {
|
|
214
|
-
// Clean up streaming token on error (may be null if fetch failed before .then() ran)
|
|
215
|
-
// The token is assigned in .then() callback which runs before this catch block,
|
|
216
|
-
// but TypeScript doesn't track cross-async assignments, so use type assertion
|
|
217
|
-
(streamingToken as { end(): void } | null)?.end();
|
|
218
|
-
// resolveStreamComplete is assigned in the Promise constructor so it's safe to call
|
|
219
|
-
resolveStreamComplete!();
|
|
220
|
-
|
|
221
|
-
// Convert network-level errors to NetworkError for proper handling
|
|
222
|
-
if (isNetworkError(error)) {
|
|
223
|
-
const networkError = new NetworkError(
|
|
224
|
-
"Unable to connect to server. Please check your connection.",
|
|
225
|
-
{
|
|
226
|
-
cause: error,
|
|
227
|
-
url: url.toString(),
|
|
228
|
-
operation: "action",
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
312
|
|
|
232
|
-
|
|
233
|
-
|
|
313
|
+
// Guard: if the action was aborted while streaming (e.g., user navigated
|
|
314
|
+
// away or abortAllActions fired), bail out before any reconcile/render/cache
|
|
315
|
+
// writes to avoid overwriting the current UI with stale action results.
|
|
316
|
+
if (handle.signal.aborted) {
|
|
317
|
+
log("action aborted after response, skipping reconciliation");
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
234
320
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
321
|
+
// Process response
|
|
322
|
+
const { metadata, returnValue } = payload;
|
|
323
|
+
|
|
324
|
+
// Handle action redirect: server converted the redirect to a Flight payload
|
|
325
|
+
// so we can perform SPA navigation instead of a full page reload.
|
|
326
|
+
// Check handle.signal.aborted to avoid redirecting from a stale action
|
|
327
|
+
// when the user has already navigated away.
|
|
328
|
+
if (metadata?.redirect && !handle.signal.aborted) {
|
|
329
|
+
const redirectUrl = validateRedirectOrigin(
|
|
330
|
+
metadata.redirect.url,
|
|
331
|
+
window.location.origin,
|
|
332
|
+
);
|
|
333
|
+
if (!redirectUrl) {
|
|
334
|
+
log("blocked action redirect payload", {
|
|
335
|
+
url: metadata.redirect.url,
|
|
245
336
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
337
|
+
handle.complete(returnValue?.data);
|
|
338
|
+
return returnValue?.data;
|
|
339
|
+
}
|
|
340
|
+
const redirectState = metadata.locationState;
|
|
341
|
+
log("action redirect", { url: redirectUrl });
|
|
342
|
+
handle.complete(returnValue?.data);
|
|
343
|
+
if (onNavigate) {
|
|
344
|
+
await onNavigate(redirectUrl, {
|
|
345
|
+
state: redirectState,
|
|
346
|
+
replace: true,
|
|
347
|
+
_skipCache: true,
|
|
348
|
+
});
|
|
349
|
+
} else {
|
|
350
|
+
window.location.href = redirectUrl;
|
|
351
|
+
}
|
|
352
|
+
return returnValue?.data;
|
|
249
353
|
}
|
|
250
|
-
throw error;
|
|
251
|
-
}
|
|
252
354
|
|
|
253
|
-
|
|
355
|
+
// Bail out if the action was aborted after deserialization (e.g. user
|
|
356
|
+
// navigated away or abortAllActions was called while the Flight stream
|
|
357
|
+
// was being consumed). Without this check the code below would mutate
|
|
358
|
+
// the store / UI for a stale action.
|
|
359
|
+
if (handle.signal.aborted) {
|
|
360
|
+
log("action aborted after deserialization, skipping mutations");
|
|
361
|
+
return returnValue?.data;
|
|
362
|
+
}
|
|
254
363
|
|
|
255
|
-
|
|
256
|
-
const { metadata, returnValue } = payload;
|
|
257
|
-
const { matched, diff, segments, isPartial, isError } = metadata || {};
|
|
364
|
+
const { matched, diff, segments, isPartial, isError } = metadata || {};
|
|
258
365
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
console.log(`[Browser] Action result:`, returnValue);
|
|
262
|
-
if (!returnValue.ok) {
|
|
366
|
+
// Log action result
|
|
367
|
+
if (returnValue && !returnValue.ok) {
|
|
263
368
|
console.error(`[Browser] Action failed:`, returnValue.data);
|
|
264
369
|
}
|
|
265
|
-
}
|
|
266
370
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
371
|
+
// Handle error responses with error boundary UI
|
|
372
|
+
if (isError && isPartial && segments && diff) {
|
|
373
|
+
log("processing error boundary response");
|
|
270
374
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
375
|
+
// Fail current handle BEFORE aborting all actions so the event controller
|
|
376
|
+
// records the error state (abortAllActions clears inflight entries)
|
|
377
|
+
if (returnValue && !returnValue.ok) {
|
|
378
|
+
handle.fail(returnValue.data);
|
|
379
|
+
}
|
|
274
380
|
|
|
275
|
-
|
|
276
|
-
|
|
381
|
+
// Abort all other pending action requests - error takes precedence
|
|
382
|
+
// This prevents other actions from completing and overwriting the error UI
|
|
383
|
+
eventController.abortAllActions();
|
|
277
384
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const cached = store.getCachedSegments(currentKey);
|
|
281
|
-
const cachedSegments = cached?.segments || [];
|
|
385
|
+
// Clear concurrent action tracking - no consolidation needed when showing error
|
|
386
|
+
handle.clearConsolidation();
|
|
282
387
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
388
|
+
// Get current page's cached segments
|
|
389
|
+
const currentKey = store.getHistoryKey();
|
|
390
|
+
const cached = store.getCachedSegments(currentKey);
|
|
391
|
+
const cachedSegments = cached?.segments || [];
|
|
392
|
+
|
|
393
|
+
// Reconcile error segments with cached tree
|
|
394
|
+
const errorResult = reconcileErrorSegments(cachedSegments, segments);
|
|
395
|
+
|
|
396
|
+
// Render the full tree with error segment merged with parent layouts
|
|
397
|
+
const errorTree = await renderSegments(errorResult.mainSegments, {
|
|
398
|
+
isAction: true,
|
|
399
|
+
interceptSegments:
|
|
400
|
+
errorResult.interceptSegments.length > 0
|
|
401
|
+
? errorResult.interceptSegments
|
|
402
|
+
: undefined,
|
|
403
|
+
});
|
|
295
404
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
});
|
|
405
|
+
// Re-check route stability after async renderSegments — user may have
|
|
406
|
+
// navigated away while the error tree was being prepared.
|
|
407
|
+
if (window.location.pathname !== actionStartPathname) {
|
|
408
|
+
log("user navigated during error render, skipping");
|
|
409
|
+
if (returnValue && !returnValue.ok) {
|
|
410
|
+
throw returnValue.data;
|
|
411
|
+
}
|
|
412
|
+
handle.complete(undefined);
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
const currentKeyNow = store.getHistoryKey();
|
|
416
|
+
if (currentKeyNow !== currentKey) {
|
|
417
|
+
log("history key changed during error render, skipping cache update");
|
|
418
|
+
if (returnValue && !returnValue.ok) {
|
|
419
|
+
throw returnValue.data;
|
|
420
|
+
}
|
|
421
|
+
handle.complete(undefined);
|
|
422
|
+
return undefined;
|
|
423
|
+
}
|
|
316
424
|
|
|
317
|
-
|
|
425
|
+
// Update UI with error boundary
|
|
426
|
+
startTransition(() => {
|
|
427
|
+
onUpdate({ root: errorTree, metadata: metadata! });
|
|
428
|
+
});
|
|
318
429
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
430
|
+
// Update segment tracking to exclude error segment IDs
|
|
431
|
+
const errorSegmentIds = new Set(diff);
|
|
432
|
+
const segmentIdsAfterError = segmentState.currentSegmentIds.filter(
|
|
433
|
+
(id) => !errorSegmentIds.has(id),
|
|
434
|
+
);
|
|
324
435
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
436
|
+
// Update store state
|
|
437
|
+
store.setSegmentIds(segmentIdsAfterError);
|
|
438
|
+
const currentHandleData = eventController.getHandleState().data;
|
|
439
|
+
store.cacheSegmentsForHistory(
|
|
440
|
+
currentKey,
|
|
441
|
+
errorResult.segments,
|
|
442
|
+
currentHandleData,
|
|
443
|
+
);
|
|
329
444
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
445
|
+
// Throw the error so the action promise rejects
|
|
446
|
+
if (returnValue && !returnValue.ok) {
|
|
447
|
+
throw returnValue.data;
|
|
448
|
+
}
|
|
334
449
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
throw returnValue.data;
|
|
450
|
+
// No error in returnValue (shouldn't happen with isError: true)
|
|
451
|
+
handle.complete(undefined);
|
|
452
|
+
return undefined;
|
|
339
453
|
}
|
|
340
454
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
455
|
+
if (!isPartial) {
|
|
456
|
+
// Protocol invariant: action revalidation responses MUST be partial.
|
|
457
|
+
// The server always sends isPartial: true for successful revalidation
|
|
458
|
+
// and isPartial: true + isError: true for error boundary responses.
|
|
459
|
+
// A non-partial payload here indicates a server-side bug.
|
|
460
|
+
throw new Error(
|
|
461
|
+
`[Browser] Action response missing isPartial — the server must ` +
|
|
462
|
+
`always send partial payloads for action revalidation.`,
|
|
463
|
+
);
|
|
464
|
+
}
|
|
345
465
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
);
|
|
352
|
-
console.log(`[Browser] Server expects client to have:`, matched);
|
|
466
|
+
log("processing partial update", {
|
|
467
|
+
serverSegments: segments?.length ?? 0,
|
|
468
|
+
diff: diff?.join(", ") ?? "",
|
|
469
|
+
matched: matched?.join(", ") ?? "",
|
|
470
|
+
});
|
|
353
471
|
|
|
354
472
|
// Record revalidated segments for concurrent action tracking
|
|
355
473
|
if (diff) {
|
|
@@ -360,375 +478,174 @@ export function createServerActionBridge(
|
|
|
360
478
|
const currentKey = store.getHistoryKey();
|
|
361
479
|
const cached = store.getCachedSegments(currentKey);
|
|
362
480
|
const cachedSegments = cached?.segments || [];
|
|
363
|
-
const currentSegmentMap = new Map<string, ResolvedSegment>();
|
|
364
|
-
cachedSegments.forEach((s) => currentSegmentMap.set(s.id, s));
|
|
365
|
-
|
|
366
|
-
console.log(
|
|
367
|
-
`[Browser] Client cache has ${currentSegmentMap.size} entries:`,
|
|
368
|
-
Array.from(currentSegmentMap.keys())
|
|
369
|
-
);
|
|
370
|
-
|
|
371
|
-
// Create lookup for new segments from server
|
|
372
|
-
const newSegmentMap = new Map<string, ResolvedSegment>();
|
|
373
|
-
(segments || []).forEach((s: ResolvedSegment) =>
|
|
374
|
-
newSegmentMap.set(s.id, s)
|
|
375
|
-
);
|
|
376
481
|
|
|
377
482
|
if (!matched) {
|
|
378
|
-
console.log(`[Browser] Matched segments: ${matched}`);
|
|
379
483
|
throw new Error("No matched segments in response");
|
|
380
484
|
}
|
|
381
485
|
|
|
382
|
-
//
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return mergeSegmentLoaders(fromServer, fromCache);
|
|
392
|
-
}
|
|
393
|
-
// When server returns component: null for a layout segment, it means
|
|
394
|
-
// "this segment doesn't need re-rendering" - preserve the cached component
|
|
395
|
-
// to maintain the outlet chain and prevent React tree changes
|
|
396
|
-
const cached = currentSegmentMap.get(segId); // Re-fetch to avoid type narrowing issues
|
|
397
|
-
if (
|
|
398
|
-
fromServer.component === null &&
|
|
399
|
-
fromServer.type === "layout" &&
|
|
400
|
-
cached?.component != null
|
|
401
|
-
) {
|
|
402
|
-
console.log(
|
|
403
|
-
`[Browser] Preserving cached component for layout ${segId} (server returned null)`
|
|
404
|
-
);
|
|
405
|
-
return { ...fromServer, component: cached.component };
|
|
406
|
-
}
|
|
407
|
-
// Dev-mode assertion: warn if tree structure would change
|
|
408
|
-
if (cached) {
|
|
409
|
-
assertSegmentStructure(cached, fromServer, "action-bridge");
|
|
410
|
-
}
|
|
411
|
-
// Preserve cached loading value to maintain consistent tree structure.
|
|
412
|
-
// SSR may set loading=false for skipSSR routes, but actions set
|
|
413
|
-
// loading=<skeleton> (isSSR=false). Changing loading between renders
|
|
414
|
-
// alters the React tree (with/without RouteContentWrapper), causing
|
|
415
|
-
// remounts that destroy useActionState.
|
|
416
|
-
if (
|
|
417
|
-
cached &&
|
|
418
|
-
cached.loading !== undefined &&
|
|
419
|
-
fromServer.loading !== cached.loading
|
|
420
|
-
) {
|
|
421
|
-
return { ...fromServer, loading: cached.loading };
|
|
422
|
-
}
|
|
423
|
-
return fromServer;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// Fall back to current page's cached segments
|
|
427
|
-
if (!fromCache) {
|
|
428
|
-
console.error(`[Browser] MISSING SEGMENT: ${segId} not in cache!`);
|
|
429
|
-
}
|
|
430
|
-
return fromCache;
|
|
431
|
-
})
|
|
432
|
-
.filter(Boolean) as ResolvedSegment[];
|
|
433
|
-
|
|
434
|
-
console.log(
|
|
435
|
-
`[Browser] Rebuilt ${fullSegments.length} segments from matched array`
|
|
436
|
-
);
|
|
486
|
+
// Reconcile server segments with cached segments (single source of truth)
|
|
487
|
+
const reconciled = reconcileSegments({
|
|
488
|
+
actor: "action",
|
|
489
|
+
matched,
|
|
490
|
+
diff: diff || [],
|
|
491
|
+
serverSegments: segments || [],
|
|
492
|
+
cachedSegments,
|
|
493
|
+
});
|
|
494
|
+
const fullSegments = reconciled.segments;
|
|
437
495
|
|
|
438
496
|
const returnData = returnValue?.data;
|
|
439
497
|
|
|
440
|
-
console.log(
|
|
441
|
-
`[Browser] Action complete - UI updated (after action state committed)`
|
|
442
|
-
);
|
|
443
|
-
|
|
444
498
|
if (returnValue && !returnValue.ok) {
|
|
445
499
|
handle.fail(returnValue.data);
|
|
446
500
|
throw returnValue.data;
|
|
447
501
|
}
|
|
448
502
|
|
|
449
|
-
//
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
// Check if the history key changed (different cache entry)
|
|
464
|
-
// This happens when navigating between intercept and non-intercept routes
|
|
465
|
-
if (currentLocationKey !== locationKey) {
|
|
466
|
-
console.log(
|
|
467
|
-
`[Browser] History key changed (${locationKey} -> ${currentLocationKey}), triggering background revalidation`
|
|
468
|
-
);
|
|
503
|
+
// Classify the post-reconciliation scenario
|
|
504
|
+
const scenario = classifyActionOutcome({
|
|
505
|
+
handleId: handle.id,
|
|
506
|
+
inflightActions: eventController.getInflightActions(),
|
|
507
|
+
hadAnyConcurrentActions: eventController.hadAnyConcurrentActions(),
|
|
508
|
+
revalidatedSegments: handle.getRevalidatedSegments(),
|
|
509
|
+
actionStartPathname,
|
|
510
|
+
currentPathname: window.location.pathname,
|
|
511
|
+
actionStartLocationKey: locationKey,
|
|
512
|
+
currentLocationKey: window.history.state?.key,
|
|
513
|
+
reconciledSegmentCount: fullSegments.length,
|
|
514
|
+
matchedCount: matched.length,
|
|
515
|
+
currentInterceptSource: store.getInterceptSourceUrl(),
|
|
516
|
+
});
|
|
469
517
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
window.location.href,
|
|
493
|
-
{ replace: true, skipLoadingState: true }
|
|
494
|
-
);
|
|
495
|
-
fetchPartialUpdate(
|
|
496
|
-
window.location.href,
|
|
497
|
-
[],
|
|
498
|
-
false,
|
|
499
|
-
navTx.handle.signal,
|
|
500
|
-
navTx.with({
|
|
501
|
-
url: window.location.href,
|
|
502
|
-
storeOnly: true,
|
|
503
|
-
}),
|
|
504
|
-
{
|
|
505
|
-
isAction: true,
|
|
506
|
-
}
|
|
507
|
-
).then(() => {
|
|
508
|
-
console.log(`[Browser] Background revalidation complete`);
|
|
509
|
-
});
|
|
518
|
+
switch (scenario.type) {
|
|
519
|
+
case "navigated-away": {
|
|
520
|
+
log("user navigated away during action", {
|
|
521
|
+
from: actionStartPathname,
|
|
522
|
+
to: window.location.pathname,
|
|
523
|
+
historyKeyChanged: scenario.historyKeyChanged,
|
|
524
|
+
});
|
|
525
|
+
// Clear concurrent action tracking - don't consolidate for old route's segments
|
|
526
|
+
handle.clearConsolidation();
|
|
527
|
+
|
|
528
|
+
if (scenario.historyKeyChanged) {
|
|
529
|
+
if (!scenario.onInterceptRoute) {
|
|
530
|
+
store.markCacheAsStaleAndBroadcast();
|
|
531
|
+
refetchRoute().catch((error) => {
|
|
532
|
+
if (isBackgroundSuppressible(error)) return;
|
|
533
|
+
console.error(
|
|
534
|
+
"[Browser] Background revalidation failed:",
|
|
535
|
+
error,
|
|
536
|
+
);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
break;
|
|
510
540
|
}
|
|
511
541
|
|
|
512
|
-
|
|
513
|
-
|
|
542
|
+
// Same history key but different pathname - safe to refetch current route
|
|
543
|
+
store.markCacheAsStaleAndBroadcast();
|
|
544
|
+
await refetchRoute({
|
|
545
|
+
interceptSourceUrl: store.getInterceptSourceUrl(),
|
|
546
|
+
});
|
|
547
|
+
break;
|
|
514
548
|
}
|
|
515
549
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
store
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
{ replace: true, skipLoadingState: true }
|
|
525
|
-
);
|
|
526
|
-
// Preserve intercept context
|
|
527
|
-
const currentInterceptSource = store.getInterceptSourceUrl();
|
|
528
|
-
await fetchPartialUpdate(
|
|
529
|
-
window.location.href,
|
|
530
|
-
[], // Empty array = refetch all segments for current route
|
|
531
|
-
false,
|
|
532
|
-
navTx.handle.signal,
|
|
533
|
-
navTx.with({
|
|
534
|
-
url: window.location.href,
|
|
535
|
-
storeOnly: true,
|
|
536
|
-
intercept: !!currentInterceptSource,
|
|
537
|
-
interceptSourceUrl: currentInterceptSource ?? undefined,
|
|
538
|
-
}),
|
|
539
|
-
{
|
|
540
|
-
isAction: true,
|
|
541
|
-
interceptSourceUrl: currentInterceptSource ?? undefined,
|
|
542
|
-
}
|
|
543
|
-
);
|
|
544
|
-
console.log(`[Browser] Refetch after navigation complete`);
|
|
545
|
-
handle.complete(returnData);
|
|
546
|
-
return returnData;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// HMR resilience check - only runs if user DIDN'T navigate away
|
|
550
|
-
if (fullSegments.length < matched.length) {
|
|
551
|
-
console.warn(
|
|
552
|
-
`[Browser] Missing segments after action (HMR detected), refetching...`
|
|
553
|
-
);
|
|
554
|
-
|
|
555
|
-
using navTx = createNavigationTransaction(
|
|
556
|
-
store,
|
|
557
|
-
eventController,
|
|
558
|
-
window.location.href,
|
|
559
|
-
{ replace: true, skipLoadingState: true }
|
|
560
|
-
);
|
|
561
|
-
await fetchPartialUpdate(
|
|
562
|
-
window.location.href,
|
|
563
|
-
[],
|
|
564
|
-
false,
|
|
565
|
-
navTx.handle.signal,
|
|
566
|
-
navTx.with({
|
|
567
|
-
url: window.location.href,
|
|
568
|
-
storeOnly: true,
|
|
569
|
-
intercept: !!interceptSourceUrl,
|
|
570
|
-
interceptSourceUrl: interceptSourceUrl ?? undefined,
|
|
571
|
-
}),
|
|
572
|
-
{
|
|
573
|
-
isAction: true,
|
|
574
|
-
interceptSourceUrl: interceptSourceUrl ?? undefined,
|
|
575
|
-
}
|
|
576
|
-
);
|
|
577
|
-
console.log(
|
|
578
|
-
`[Browser] Refetch complete (HMR), now returning action result`
|
|
579
|
-
);
|
|
550
|
+
case "hmr-missing": {
|
|
551
|
+
console.warn(
|
|
552
|
+
`[Browser] Missing segments after action (HMR detected), refetching...`,
|
|
553
|
+
);
|
|
554
|
+
await refetchRoute({ interceptSourceUrl });
|
|
555
|
+
store.broadcastCacheInvalidation();
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
580
558
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
559
|
+
case "consolidation-needed": {
|
|
560
|
+
log("consolidation fetch needed", {
|
|
561
|
+
segmentIds: scenario.segmentIds,
|
|
562
|
+
});
|
|
563
|
+
// Calculate segments to send (exclude the ones we want fresh)
|
|
564
|
+
const currentSegmentIds = store.getSegmentState().currentSegmentIds;
|
|
565
|
+
const segmentsToSend = currentSegmentIds.filter(
|
|
566
|
+
(sid) => !scenario.segmentIds.includes(sid),
|
|
567
|
+
);
|
|
586
568
|
|
|
587
|
-
|
|
588
|
-
|
|
569
|
+
// Clear consolidation tracking before fetch
|
|
570
|
+
handle.clearConsolidation();
|
|
589
571
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
const currentSegmentIds = store.getSegmentState().currentSegmentIds;
|
|
598
|
-
const segmentsToSend = currentSegmentIds.filter(
|
|
599
|
-
(id) => !consolidationSegments.includes(id)
|
|
600
|
-
);
|
|
572
|
+
await refetchRoute({
|
|
573
|
+
segments: segmentsToSend,
|
|
574
|
+
interceptSourceUrl,
|
|
575
|
+
});
|
|
576
|
+
store.broadcastCacheInvalidation();
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
601
579
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
580
|
+
case "concurrent-skip": {
|
|
581
|
+
log("skipping UI update, other actions fetching", {
|
|
582
|
+
otherCount: scenario.otherFetchingCount,
|
|
583
|
+
});
|
|
584
|
+
// Only update store if history key hasn't changed (user didn't navigate away)
|
|
585
|
+
const currentKeyNow = store.getHistoryKey();
|
|
586
|
+
if (currentKeyNow === currentKey) {
|
|
587
|
+
store.setSegmentIds(matched);
|
|
588
|
+
const currentHandleData = eventController.getHandleState().data;
|
|
589
|
+
store.cacheSegmentsForHistory(
|
|
590
|
+
currentKey,
|
|
591
|
+
fullSegments,
|
|
592
|
+
currentHandleData,
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
606
597
|
|
|
607
|
-
|
|
608
|
-
|
|
598
|
+
case "normal": {
|
|
599
|
+
// Prepare new tree (await loader data resolution)
|
|
600
|
+
const newTree = await renderSegments(reconciled.mainSegments, {
|
|
601
|
+
isAction: true,
|
|
602
|
+
interceptSegments:
|
|
603
|
+
reconciled.interceptSegments.length > 0
|
|
604
|
+
? reconciled.interceptSegments
|
|
605
|
+
: undefined,
|
|
606
|
+
});
|
|
609
607
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
);
|
|
608
|
+
// Re-check if user navigated away (could happen during async renderSegments)
|
|
609
|
+
if (window.location.pathname !== actionStartPathname) {
|
|
610
|
+
log("user navigated during render, skipping");
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
616
613
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
navTx.with({
|
|
624
|
-
url: window.location.href,
|
|
625
|
-
storeOnly: true,
|
|
626
|
-
intercept: !!interceptSourceUrl,
|
|
627
|
-
interceptSourceUrl: interceptSourceUrl ?? undefined,
|
|
628
|
-
}),
|
|
629
|
-
{
|
|
630
|
-
isAction: true,
|
|
631
|
-
interceptSourceUrl: interceptSourceUrl ?? undefined,
|
|
614
|
+
// Verify the store's current key still matches what we captured at action start
|
|
615
|
+
// If they differ, user navigated away and we should NOT cache under the old key
|
|
616
|
+
const currentKeyNow = store.getHistoryKey();
|
|
617
|
+
if (currentKeyNow !== currentKey) {
|
|
618
|
+
log("history key changed during action, skipping cache update");
|
|
619
|
+
break;
|
|
632
620
|
}
|
|
633
|
-
);
|
|
634
621
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
console.log(
|
|
639
|
-
`[Browser] Consolidate/Reconcile - Returning to React:`,
|
|
640
|
-
returnData
|
|
641
|
-
);
|
|
622
|
+
startTransition(() => {
|
|
623
|
+
onUpdate({ root: newTree, metadata: metadata! });
|
|
624
|
+
});
|
|
642
625
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
626
|
+
// Apply server-set location state to history.state (non-redirect flow)
|
|
627
|
+
const actionLocationState = metadata?.locationState;
|
|
628
|
+
if (actionLocationState) {
|
|
629
|
+
mergeLocationState(actionLocationState);
|
|
630
|
+
}
|
|
646
631
|
|
|
647
|
-
|
|
648
|
-
// Exclude the current action since we already have our response
|
|
649
|
-
// We don't need to wait for streaming to complete - just for the response to arrive
|
|
650
|
-
const otherFetchingActions = [...eventController.getInflightActions().values()].filter(
|
|
651
|
-
(a) => a.phase === "fetching" && a.id !== handle.id
|
|
652
|
-
);
|
|
653
|
-
if (otherFetchingActions.length > 0) {
|
|
654
|
-
console.log(
|
|
655
|
-
`[Browser] Skipping UI update - ${otherFetchingActions.length} other action(s) still fetching`
|
|
656
|
-
);
|
|
657
|
-
console.log(
|
|
658
|
-
`[Browser] Multi actions - Returning to React (no cache clear):`,
|
|
659
|
-
returnData
|
|
660
|
-
);
|
|
661
|
-
// Only update store if history key hasn't changed (user didn't navigate away)
|
|
662
|
-
const currentKeyNow = store.getHistoryKey();
|
|
663
|
-
if (currentKeyNow === currentKey) {
|
|
632
|
+
// Update store state
|
|
664
633
|
store.setSegmentIds(matched);
|
|
665
634
|
const currentHandleData = eventController.getHandleState().data;
|
|
666
|
-
store.cacheSegmentsForHistory(
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
635
|
+
store.cacheSegmentsForHistory(
|
|
636
|
+
currentKey,
|
|
637
|
+
fullSegments,
|
|
638
|
+
currentHandleData,
|
|
670
639
|
);
|
|
640
|
+
store.markCacheAsStaleAndBroadcast();
|
|
641
|
+
break;
|
|
671
642
|
}
|
|
672
|
-
handle.complete(returnData);
|
|
673
|
-
return returnData;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
// No concurrent actions - normal flow with single action
|
|
677
|
-
// INTERCEPT HANDLING: Separate intercept segments for explicit injection
|
|
678
|
-
const isInterceptSegment = (s: ResolvedSegment) =>
|
|
679
|
-
s.namespace?.startsWith("intercept:") ||
|
|
680
|
-
(s.type === "parallel" && s.id.includes(".@"));
|
|
681
|
-
|
|
682
|
-
const interceptSegments = fullSegments.filter(isInterceptSegment);
|
|
683
|
-
const mainSegments = fullSegments.filter((s) => !isInterceptSegment(s));
|
|
684
|
-
|
|
685
|
-
// Prepare new tree (await loader data resolution)
|
|
686
|
-
const renderOptions = {
|
|
687
|
-
isAction: true,
|
|
688
|
-
interceptSegments:
|
|
689
|
-
interceptSegments.length > 0 ? interceptSegments : undefined,
|
|
690
|
-
};
|
|
691
|
-
const newTree = await renderSegments(mainSegments, renderOptions);
|
|
692
|
-
|
|
693
|
-
// Re-check if user navigated away (could happen during async wait)
|
|
694
|
-
const currentPathnameNow = window.location.pathname;
|
|
695
|
-
if (currentPathnameNow !== actionStartPathname) {
|
|
696
|
-
console.log(
|
|
697
|
-
`[Browser] User navigated during UI update scheduling, skipping`
|
|
698
|
-
);
|
|
699
|
-
handle.complete(returnData);
|
|
700
|
-
return returnData;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
// Verify the store's current key still matches what we captured at action start
|
|
704
|
-
// If they differ, user navigated away and we should NOT cache under the old key
|
|
705
|
-
const currentKeyNow = store.getHistoryKey();
|
|
706
|
-
if (currentKeyNow !== currentKey) {
|
|
707
|
-
console.log(
|
|
708
|
-
`[Browser] History key changed during action (${currentKey} -> ${currentKeyNow}), skipping cache update`
|
|
709
|
-
);
|
|
710
|
-
handle.complete(returnData);
|
|
711
|
-
return returnData;
|
|
712
643
|
}
|
|
713
644
|
|
|
714
|
-
startTransition(() => {
|
|
715
|
-
onUpdate({ root: newTree, metadata: metadata! });
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
// Update store state
|
|
719
|
-
store.setSegmentIds(matched);
|
|
720
|
-
const currentHandleData = eventController.getHandleState().data;
|
|
721
|
-
store.cacheSegmentsForHistory(currentKey, fullSegments, currentHandleData);
|
|
722
|
-
store.markCacheAsStaleAndBroadcast();
|
|
723
|
-
|
|
724
|
-
console.log(`[Browser] Normal - Returning to React:`, returnData);
|
|
725
645
|
handle.complete(returnData);
|
|
726
646
|
return returnData;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
throw new Error(
|
|
730
|
-
`[Browser] Full update after action is not supported yet`
|
|
731
|
-
);
|
|
647
|
+
} finally {
|
|
648
|
+
handle[Symbol.dispose]();
|
|
732
649
|
}
|
|
733
650
|
}
|
|
734
651
|
|
|
@@ -743,18 +660,6 @@ export function createServerActionBridge(
|
|
|
743
660
|
}
|
|
744
661
|
deps.setServerCallback(handleServerAction);
|
|
745
662
|
isRegistered = true;
|
|
746
|
-
console.log("[Browser] Server action callback registered");
|
|
747
|
-
},
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* Unregister the server action callback
|
|
751
|
-
*/
|
|
752
|
-
unregister(): void {
|
|
753
|
-
if (!isRegistered) {
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
isRegistered = false;
|
|
757
|
-
console.log("[Browser] Server action bridge unregistered");
|
|
758
663
|
},
|
|
759
664
|
};
|
|
760
665
|
}
|