@timber-js/app 0.2.0-alpha.220 → 0.2.0-alpha.222
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-BwkmAYXq.js → actions-vBHr2vqd.js} +3 -3
- package/dist/_chunks/{actions-BwkmAYXq.js.map → actions-vBHr2vqd.js.map} +1 -1
- package/dist/_chunks/{cache-api-LA3sBpUS.js → cache-api-DdcDLpBj.js} +72 -145
- package/dist/_chunks/cache-api-DdcDLpBj.js.map +1 -0
- package/dist/_chunks/chains-B8TCLved.js +1 -0
- package/dist/_chunks/{chains-e_Buf9vg.js → chains-BchW_AtW.js} +2 -2
- package/dist/_chunks/{chains-e_Buf9vg.js.map → chains-BchW_AtW.js.map} +1 -1
- package/dist/_chunks/{classify-2Yp3xJY1.js → classify-IqzMpxMs.js} +2 -2
- package/dist/_chunks/{classify-2Yp3xJY1.js.map → classify-IqzMpxMs.js.map} +1 -1
- package/dist/_chunks/{cli-check-DDwCkeDY.js → cli-check-DQne_YhU.js} +3 -3
- package/dist/_chunks/{cli-check-DDwCkeDY.js.map → cli-check-DQne_YhU.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-BdIebmk3.js → cli-schema-sync-BS-RFGE2.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-BdIebmk3.js.map → cli-schema-sync-BS-RFGE2.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-CLNfXQDK.js → cli-schema-sync-v872sHms.js} +1 -1
- package/dist/_chunks/{client-dep-entries-BOkpKjj1.js → client-dep-entries-BJyP9SIu.js} +2 -2
- package/dist/_chunks/{client-dep-entries-BOkpKjj1.js.map → client-dep-entries-BJyP9SIu.js.map} +1 -1
- package/dist/_chunks/{convention-lint-ByKJ6aqD.js → convention-lint-VwzrtjIt.js} +3 -3
- package/dist/_chunks/{convention-lint-ByKJ6aqD.js.map → convention-lint-VwzrtjIt.js.map} +1 -1
- package/dist/_chunks/{dev-server-DnODXuNM.js → dev-server-BNr5drEO.js} +57 -8
- package/dist/_chunks/dev-server-BNr5drEO.js.map +1 -0
- package/dist/_chunks/dev-server-CUg7Mqh_.js +1 -0
- package/dist/_chunks/dev-store-BOa304m_.js +283 -0
- package/dist/_chunks/dev-store-BOa304m_.js.map +1 -0
- package/dist/_chunks/{error-boundary-xxxLtXt6.js → error-boundary-Bc8QPZuq.js} +71 -21
- package/dist/_chunks/error-boundary-Bc8QPZuq.js.map +1 -0
- package/dist/_chunks/{flight-source-node-0dE-t3kq.js → flight-source-node-BdHUOUqg.js} +6 -7
- package/dist/_chunks/flight-source-node-BdHUOUqg.js.map +1 -0
- package/dist/_chunks/global-context-B9PFncvb.js +48 -0
- package/dist/_chunks/global-context-B9PFncvb.js.map +1 -0
- package/dist/_chunks/{json-lossy-check-C8zBY2uZ.js → json-lossy-check-C3Sht92C.js} +2 -2
- package/dist/_chunks/{json-lossy-check-C8zBY2uZ.js.map → json-lossy-check-C3Sht92C.js.map} +1 -1
- package/dist/_chunks/{live-graph-tSWrv8eH.js → live-graph-DEu_GWbc.js} +4 -4
- package/dist/_chunks/{live-graph-tSWrv8eH.js.map → live-graph-DEu_GWbc.js.map} +1 -1
- package/dist/_chunks/{logger-CbLdcy-W.js → logger-CI_hThfy.js} +10 -2
- package/dist/_chunks/{logger-CbLdcy-W.js.map → logger-CI_hThfy.js.map} +1 -1
- package/dist/_chunks/{node-response-Dibufw_b.js → node-response-bF0bKoig.js} +49 -3
- package/dist/_chunks/node-response-bF0bKoig.js.map +1 -0
- package/dist/_chunks/{poison-scan-C4FgMxFl.js → poison-scan-DTWIfNgD.js} +2 -2
- package/dist/_chunks/{poison-scan-C4FgMxFl.js.map → poison-scan-DTWIfNgD.js.map} +1 -1
- package/dist/_chunks/{purge-store-Byr8XOjU.js → purge-store-WZaxu-3m.js} +2 -2
- package/dist/_chunks/purge-store-WZaxu-3m.js.map +1 -0
- package/dist/_chunks/{render-timeout-DOf_BBcO.js → render-timeout-Ln_u7fX-.js} +19 -11
- package/dist/_chunks/render-timeout-Ln_u7fX-.js.map +1 -0
- package/dist/_chunks/{resolve-schema-CBR6Lm4i.js → resolve-schema-CkAInout.js} +2 -2
- package/dist/_chunks/{resolve-schema-CBR6Lm4i.js.map → resolve-schema-CkAInout.js.map} +1 -1
- package/dist/_chunks/{scanner-Cb3fSjAC.js → scanner-C8fdKvKG.js} +2 -2
- package/dist/_chunks/{scanner-Cb3fSjAC.js.map → scanner-C8fdKvKG.js.map} +1 -1
- package/dist/_chunks/{schema-bridge-C83xa9lT.js → schema-bridge-DpOmvZlI.js} +60 -23
- package/dist/_chunks/schema-bridge-DpOmvZlI.js.map +1 -0
- package/dist/_chunks/{segment-context-xtPUGfdq.js → segment-context-D3DNxKFq.js} +4 -8
- package/dist/_chunks/segment-context-D3DNxKFq.js.map +1 -0
- package/dist/_chunks/{sizeof-QPE5nd3u.js → sizeof-CO3dk0V1.js} +2 -2
- package/dist/_chunks/{sizeof-QPE5nd3u.js.map → sizeof-CO3dk0V1.js.map} +1 -1
- package/dist/_chunks/{walkers-qu8TpiLh.js → walkers-BqzxnwGC.js} +3 -3
- package/dist/_chunks/{walkers-qu8TpiLh.js.map → walkers-BqzxnwGC.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/cache-api.d.ts.map +1 -1
- package/dist/cache/guarded-read.d.ts +29 -0
- package/dist/cache/guarded-read.d.ts.map +1 -0
- package/dist/cache/handler-store.d.ts +13 -1
- package/dist/cache/handler-store.d.ts.map +1 -1
- package/dist/cache/index.js +3 -2
- package/dist/cache/invalidation-epoch.d.ts +7 -0
- package/dist/cache/invalidation-epoch.d.ts.map +1 -1
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/purge-store.d.ts +10 -1
- package/dist/cdn/purge-store.d.ts.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/global-context.d.ts +21 -1
- package/dist/client/global-context.d.ts.map +1 -1
- package/dist/client/index.js +9 -27
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +38 -65
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +68 -14
- package/dist/client/navigation-transition.d.ts.map +1 -1
- package/dist/client/params-context.d.ts.map +1 -1
- package/dist/client/router-effects.d.ts +35 -31
- package/dist/client/router-effects.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +2 -6
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +10 -30
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/slot-context.d.ts +2 -2
- package/dist/client/slot-context.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/cookies/index.js +1 -1
- package/dist/dev-tools/logs.d.ts +2 -2
- package/dist/dev-tools/logs.d.ts.map +1 -1
- package/dist/index.js +149 -56
- package/dist/index.js.map +1 -1
- package/dist/params/index.js +1 -1
- package/dist/plugins/dev-server.d.ts +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/dev-store-clear.d.ts +28 -0
- package/dist/plugins/dev-store-clear.d.ts.map +1 -0
- package/dist/plugins/entries.d.ts +5 -0
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/orphaned-modules.d.ts +57 -0
- package/dist/plugins/orphaned-modules.d.ts.map +1 -0
- package/dist/plugins/prebuilt.d.ts +6 -6
- package/dist/plugins/prerender-sugar.d.ts.map +1 -1
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/rsc-runtime/dev-reference-cache.d.ts +47 -0
- package/dist/rsc-runtime/dev-reference-cache.d.ts.map +1 -0
- package/dist/rsc-runtime/rsc.d.ts +0 -15
- package/dist/rsc-runtime/rsc.d.ts.map +1 -1
- package/dist/rsc-runtime/ssr.d.ts +0 -11
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts +28 -19
- package/dist/schema-bridge.d.ts.map +1 -1
- package/dist/search-params/define.d.ts +1 -1
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.js +7 -8
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/wrappers.d.ts +3 -3
- package/dist/server/abort-scope.d.ts +27 -0
- package/dist/server/abort-scope.d.ts.map +1 -0
- package/dist/server/flight-source-node.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/instrumentation.d.ts +2 -1
- package/dist/server/instrumentation.d.ts.map +1 -1
- package/dist/server/internal.d.ts +1 -1
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +350 -151
- package/dist/server/internal.js.map +1 -1
- package/dist/server/logger.d.ts +9 -0
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +10 -7
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/prebuilt/cache-key.d.ts +26 -0
- package/dist/server/prebuilt/cache-key.d.ts.map +1 -1
- package/dist/server/prebuilt/capture-render.d.ts +9 -4
- package/dist/server/prebuilt/capture-render.d.ts.map +1 -1
- package/dist/server/prebuilt/capture-routes.d.ts +1 -1
- package/dist/server/prebuilt/dev-store.d.ts +103 -0
- package/dist/server/prebuilt/dev-store.d.ts.map +1 -0
- package/dist/server/prebuilt/overlay.d.ts +14 -3
- package/dist/server/prebuilt/overlay.d.ts.map +1 -1
- package/dist/server/prebuilt/payload-source.d.ts +8 -0
- package/dist/server/prebuilt/payload-source.d.ts.map +1 -1
- package/dist/server/prebuilt/slots.d.ts +5 -6
- package/dist/server/prebuilt/slots.d.ts.map +1 -1
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/prebuilt-runtime.d.ts +5 -10
- package/dist/server/prebuilt-runtime.d.ts.map +1 -1
- package/dist/server/render-timeout.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/docs/api/32-api-cache.mdx +2 -0
- package/docs/api/33-api-search-params.mdx +3 -1
- package/docs/learn/06-typed-params.mdx +2 -2
- package/docs/learn/10-caching.mdx +12 -0
- package/docs/learn/11-middleware.mdx +2 -0
- package/package.json +1 -1
- package/src/cache/cache-api.ts +7 -1
- package/src/cache/guarded-read.ts +44 -0
- package/src/cache/handler-store.ts +38 -1
- package/src/cache/invalidation-epoch.ts +18 -6
- package/src/cache/timber-cache.ts +9 -3
- package/src/cdn/purge-store.ts +29 -1
- package/src/client/browser-entry/action-dispatch.ts +5 -5
- package/src/client/browser-entry/router-init.ts +2 -4
- package/src/client/global-context.ts +42 -14
- package/src/client/link.tsx +14 -18
- package/src/client/navigation-context.ts +4 -11
- package/src/client/navigation-transition.ts +86 -33
- package/src/client/params-context.ts +5 -17
- package/src/client/router-effects.ts +70 -45
- package/src/client/router-lifecycle.ts +1 -1
- package/src/client/router-pipeline.ts +52 -65
- package/src/client/router-types.ts +11 -31
- package/src/client/router.ts +98 -104
- package/src/client/segment-update-context.ts +1 -1
- package/src/client/slot-content-cache-context.ts +1 -1
- package/src/client/slot-context.ts +6 -17
- package/src/dev-tools/logs.ts +76 -50
- package/src/plugins/dev-server.ts +58 -9
- package/src/plugins/dev-store-clear.ts +47 -0
- package/src/plugins/entries.ts +6 -0
- package/src/plugins/orphaned-modules.ts +78 -0
- package/src/plugins/prebuilt.ts +17 -17
- package/src/plugins/prerender-sugar.ts +38 -6
- package/src/plugins/routing.ts +23 -1
- package/src/rsc-runtime/dev-reference-cache.ts +115 -0
- package/src/rsc-runtime/rsc.ts +10 -0
- package/src/rsc-runtime/ssr.ts +10 -0
- package/src/rsc-runtime/vendor-types.d.ts +8 -0
- package/src/schema-bridge.ts +93 -38
- package/src/search-params/define.ts +5 -6
- package/src/search-params/wrappers.ts +3 -3
- package/src/server/abort-scope.ts +49 -0
- package/src/server/action-handler.ts +18 -2
- package/src/server/flight-source-node.ts +5 -4
- package/src/server/instrumentation.ts +32 -8
- package/src/server/internal.ts +1 -6
- package/src/server/logger.ts +9 -0
- package/src/server/pipeline-helpers.ts +5 -3
- package/src/server/pipeline.ts +31 -20
- package/src/server/prebuilt/cache-key.ts +41 -0
- package/src/server/prebuilt/capture-render.ts +10 -6
- package/src/server/prebuilt/capture-routes.ts +1 -1
- package/src/server/prebuilt/dev-store.ts +173 -0
- package/src/server/prebuilt/overlay.ts +21 -5
- package/src/server/prebuilt/payload-source.ts +19 -0
- package/src/server/prebuilt/slots.ts +5 -6
- package/src/server/prebuilt-builder.ts +3 -2
- package/src/server/prebuilt-runtime.ts +194 -177
- package/src/server/render-timeout.ts +12 -17
- package/src/server/rsc-entry/action-dispatcher.ts +3 -1
- package/src/server/rsc-entry/index.ts +47 -13
- package/src/server/ssr-render.ts +9 -11
- package/dist/_chunks/cache-api-LA3sBpUS.js.map +0 -1
- package/dist/_chunks/chains-CDK1AWZQ.js +0 -1
- package/dist/_chunks/dev-server-DkytOEG2.js +0 -1
- package/dist/_chunks/dev-server-DnODXuNM.js.map +0 -1
- package/dist/_chunks/error-boundary-xxxLtXt6.js.map +0 -1
- package/dist/_chunks/flight-source-node-0dE-t3kq.js.map +0 -1
- package/dist/_chunks/node-response-Dibufw_b.js.map +0 -1
- package/dist/_chunks/purge-store-Byr8XOjU.js.map +0 -1
- package/dist/_chunks/render-timeout-DOf_BBcO.js.map +0 -1
- package/dist/_chunks/schema-bridge-C83xa9lT.js.map +0 -1
- package/dist/_chunks/segment-context-xtPUGfdq.js.map +0 -1
package/src/client/router.ts
CHANGED
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
createScrollEffects,
|
|
23
23
|
createSpaExits,
|
|
24
24
|
createNavigationRecovery,
|
|
25
|
-
|
|
25
|
+
runAsHandle,
|
|
26
|
+
type NavigationEndings,
|
|
26
27
|
} from './router-effects.ts';
|
|
27
28
|
import { createNavigationLifecycle } from './router-lifecycle.ts';
|
|
28
29
|
import { createNavigationPipeline, prefetchKeyFor } from './router-pipeline.ts';
|
|
@@ -35,7 +36,7 @@ import type {
|
|
|
35
36
|
RouterInstance,
|
|
36
37
|
TraverseDirection,
|
|
37
38
|
} from './router-types.ts';
|
|
38
|
-
import { createRenderOwner, type
|
|
39
|
+
import { createRenderOwner, type NavigationHandle } from './navigation-transition.ts';
|
|
39
40
|
|
|
40
41
|
// ─── Router Factory ──────────────────────────────────────────────
|
|
41
42
|
|
|
@@ -107,11 +108,19 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
107
108
|
currentOwner,
|
|
108
109
|
leaveSpaIfOwned,
|
|
109
110
|
// Hoisted — `navigate` is a function declaration below.
|
|
110
|
-
navigate: (url, { types, replace, scroll
|
|
111
|
-
navigate(url, { replace, scroll, _renderTypes: types
|
|
111
|
+
navigate: (url, { types, replace, scroll }) =>
|
|
112
|
+
navigate(url, { replace, scroll, _renderTypes: types }),
|
|
112
113
|
});
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
function navigate(url: string, options: NavigationOptions = {}): NavigationHandle {
|
|
116
|
+
return runAsHandle((endings) => navigateWith(url, options, endings));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async function navigateWith(
|
|
120
|
+
url: string,
|
|
121
|
+
options: NavigationOptions,
|
|
122
|
+
endings: NavigationEndings
|
|
123
|
+
): Promise<void> {
|
|
115
124
|
const scroll = options.scroll !== false;
|
|
116
125
|
const replace = options.replace === true;
|
|
117
126
|
// A push, a replace, and a server action redirect all move the user
|
|
@@ -157,25 +166,18 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
157
166
|
await leaveSpaSuperseding(url, departingUrl);
|
|
158
167
|
}
|
|
159
168
|
|
|
160
|
-
// A redirect this navigation follows inherits its onCommit (RedirectHop).
|
|
161
|
-
const heldCommit = holdCommit(options.onCommit);
|
|
162
|
-
|
|
163
169
|
await runNavigation(url, async (owner) => {
|
|
164
170
|
try {
|
|
165
|
-
|
|
166
|
-
fetchUrl,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
commitUrl: url,
|
|
173
|
-
signal: owner.fetchAbort.signal,
|
|
174
|
-
departingUrl,
|
|
175
|
-
}),
|
|
176
|
-
heldCommit.transition,
|
|
177
|
-
options.onHandOff
|
|
171
|
+
const render = renderViaTransition(fetchUrl, owner, types, () =>
|
|
172
|
+
performNavigationFetch(fetchUrl, {
|
|
173
|
+
replace,
|
|
174
|
+
commitUrl: url,
|
|
175
|
+
signal: owner.fetchAbort.signal,
|
|
176
|
+
departingUrl,
|
|
177
|
+
})
|
|
178
178
|
);
|
|
179
|
+
endings.track(render);
|
|
180
|
+
await render;
|
|
179
181
|
|
|
180
182
|
// Scroll-to-top on forward navigation, scroll to the #fragment target
|
|
181
183
|
// when the URL has one, or restore captured position for scroll={false}.
|
|
@@ -191,13 +193,14 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
191
193
|
// instead would rebuild the page they were *leaving* and discard
|
|
192
194
|
// the click (TIM-1275).
|
|
193
195
|
if (
|
|
194
|
-
await recoverFromNavigationError(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
await recoverFromNavigationError(
|
|
197
|
+
error,
|
|
198
|
+
owner,
|
|
199
|
+
url,
|
|
200
|
+
departingUrl,
|
|
201
|
+
{ types, replace, scroll },
|
|
202
|
+
endings
|
|
203
|
+
)
|
|
201
204
|
) {
|
|
202
205
|
return;
|
|
203
206
|
}
|
|
@@ -219,44 +222,38 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
219
222
|
url: string,
|
|
220
223
|
/** The view transition type the render adds. */
|
|
221
224
|
type: NavigationTransitionType,
|
|
225
|
+
endings: NavigationEndings,
|
|
222
226
|
opts: {
|
|
223
227
|
/** Omitted by refresh(): the server renders the complete payload. */
|
|
224
228
|
stateTree?: { segments: string[] };
|
|
225
229
|
/** Restored after paint when present — traversals only. */
|
|
226
230
|
scrollY?: number;
|
|
227
231
|
externalSignal?: AbortSignal;
|
|
228
|
-
/** Fires once when React commits, or when the navigation is abandoned. */
|
|
229
|
-
onCommit?: (outcome: CommitOutcome) => void;
|
|
230
232
|
} = {}
|
|
231
233
|
): Promise<void> {
|
|
232
|
-
const heldCommit = holdCommit(opts.onCommit);
|
|
233
234
|
await runNavigation(
|
|
234
235
|
url,
|
|
235
236
|
async (owner) => {
|
|
236
237
|
try {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return { ...result, params, navState, commit };
|
|
257
|
-
},
|
|
258
|
-
heldCommit.transition
|
|
259
|
-
);
|
|
238
|
+
const render = renderViaTransition(url, owner, [type], async () => {
|
|
239
|
+
const result = await fetchRscPayload(
|
|
240
|
+
url,
|
|
241
|
+
deps,
|
|
242
|
+
opts.stateTree,
|
|
243
|
+
undefined,
|
|
244
|
+
owner.fetchAbort.signal
|
|
245
|
+
);
|
|
246
|
+
const params = await result.params;
|
|
247
|
+
const { navState, commit } = prepareNavigation(url, {
|
|
248
|
+
payload: result.payload,
|
|
249
|
+
params,
|
|
250
|
+
segmentInfo: result.segmentInfo,
|
|
251
|
+
skippedSegments: result.skippedSegments,
|
|
252
|
+
});
|
|
253
|
+
return { ...result, params, navState, commit };
|
|
254
|
+
});
|
|
255
|
+
endings.track(render);
|
|
256
|
+
await render;
|
|
260
257
|
} catch (error) {
|
|
261
258
|
// Neither path is a navigate(), and neither has a caller that
|
|
262
259
|
// handles a rejection — `refresh()` is `void`-called everywhere it
|
|
@@ -270,12 +267,14 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
270
267
|
// where it already is. So `hardNavigate()` takes its same-document
|
|
271
268
|
// branch and reloads rather than pushing an entry.
|
|
272
269
|
if (
|
|
273
|
-
await recoverFromNavigationError(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
await recoverFromNavigationError(
|
|
271
|
+
error,
|
|
272
|
+
owner,
|
|
273
|
+
url,
|
|
274
|
+
url,
|
|
275
|
+
{ types: [type], replace: true, scroll: true },
|
|
276
|
+
endings
|
|
277
|
+
)
|
|
279
278
|
)
|
|
280
279
|
return;
|
|
281
280
|
throw error;
|
|
@@ -287,7 +286,11 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
287
286
|
);
|
|
288
287
|
}
|
|
289
288
|
|
|
290
|
-
|
|
289
|
+
function refresh(options: RefreshOptions = {}): NavigationHandle {
|
|
290
|
+
return runAsHandle((endings) => refreshWith(options, endings));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async function refreshWith(options: RefreshOptions, endings: NavigationEndings): Promise<void> {
|
|
291
294
|
const currentUrl = deps.getCurrentUrl();
|
|
292
295
|
|
|
293
296
|
// A refresh on a stale client is a full document load of the current URL.
|
|
@@ -298,9 +301,7 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
298
301
|
await leaveSpaSuperseding(currentUrl, currentUrl);
|
|
299
302
|
}
|
|
300
303
|
|
|
301
|
-
await fetchCommitAndRender(currentUrl, options.transitionType ?? 'refresh',
|
|
302
|
-
onCommit: options.onCommit,
|
|
303
|
-
});
|
|
304
|
+
await fetchCommitAndRender(currentUrl, options.transitionType ?? 'refresh', endings);
|
|
304
305
|
}
|
|
305
306
|
|
|
306
307
|
async function handlePopState(
|
|
@@ -380,11 +381,13 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
380
381
|
// This happens when navigating back to the initial SSR'd page
|
|
381
382
|
// (its payload is null since it was rendered via SSR, not RSC fetch)
|
|
382
383
|
// or when the entry doesn't exist at all.
|
|
383
|
-
await
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
384
|
+
await runAsHandle((endings) =>
|
|
385
|
+
fetchCommitAndRender(url, direction, endings, {
|
|
386
|
+
stateTree: currentStateTree(),
|
|
387
|
+
scrollY,
|
|
388
|
+
externalSignal,
|
|
389
|
+
})
|
|
390
|
+
);
|
|
388
391
|
}
|
|
389
392
|
}
|
|
390
393
|
|
|
@@ -472,13 +475,9 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
472
475
|
// distinguishes a committed refresh from one superseded by a
|
|
473
476
|
// navigation the user started while the refresh was in flight
|
|
474
477
|
// (TIM-1477).
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
refresh({ transitionType: 'revalidate', onCommit: outcomeResolve }).catch(() => {}),
|
|
479
|
-
outcomePromise,
|
|
480
|
-
]);
|
|
481
|
-
return outcome === 'committed';
|
|
478
|
+
const refreshed = refresh({ transitionType: 'revalidate' });
|
|
479
|
+
await refreshed.catch(() => {});
|
|
480
|
+
return (await refreshed.committed) === 'committed';
|
|
482
481
|
}
|
|
483
482
|
// Render the piggybacked payload from a server action response.
|
|
484
483
|
// Routed through renderViaTransition so the piggybacked tree gets
|
|
@@ -494,40 +493,35 @@ export function createRouter(deps: RouterDeps): RouterInstance {
|
|
|
494
493
|
// `window.location`'s (TIM-1541).
|
|
495
494
|
const segmentInfo = committedSegmentInfo();
|
|
496
495
|
|
|
497
|
-
let outcomeResolve!: (o: CommitOutcome) => void;
|
|
498
|
-
const outcomePromise = new Promise<CommitOutcome>((r) => (outcomeResolve = r));
|
|
499
496
|
// Place in the lifecycle's slot so a concurrent navigation supersedes
|
|
500
497
|
// this owner. The epoch check above ensures the slot is idle. Don't use
|
|
501
498
|
// createNavOwner — that bumps navigationSeq, which is reserved for
|
|
502
499
|
// navigations (the epoch test pins this: TIM-1474).
|
|
503
500
|
const owner = createRenderOwner('revalidation');
|
|
504
501
|
lifecycle.placeRevalidationOwner(owner);
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
outcomePromise,
|
|
529
|
-
]);
|
|
530
|
-
return outcome === 'committed';
|
|
502
|
+
const render = renderViaTransition(
|
|
503
|
+
currentUrl,
|
|
504
|
+
owner,
|
|
505
|
+
['revalidate' satisfies NavigationTransitionType],
|
|
506
|
+
async () => {
|
|
507
|
+
const { navState, commit } = prepareNavigation(currentUrl, {
|
|
508
|
+
payload: payloadTree,
|
|
509
|
+
params,
|
|
510
|
+
segmentInfo,
|
|
511
|
+
});
|
|
512
|
+
return {
|
|
513
|
+
payload: payloadTree,
|
|
514
|
+
params,
|
|
515
|
+
navState,
|
|
516
|
+
commit,
|
|
517
|
+
decodePromise: null,
|
|
518
|
+
segmentInfo,
|
|
519
|
+
skippedSegments: null,
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
await render.catch(() => {});
|
|
524
|
+
return (await render.committed) === 'committed';
|
|
531
525
|
},
|
|
532
526
|
runWhenIdle: (task: () => void) => lifecycle.runWhenIdle(task),
|
|
533
527
|
onIdle: (listener) => lifecycle.onIdle(listener),
|
|
@@ -18,6 +18,6 @@ import { createGlobalContext } from './global-context.ts';
|
|
|
18
18
|
export const EMPTY_SEGMENT_UPDATES = new Map<string, ReactNode>();
|
|
19
19
|
|
|
20
20
|
export const SegmentUpdateContext = createGlobalContext<Map<string, ReactNode>>(
|
|
21
|
-
'__timber_segment_update_ctx',
|
|
21
|
+
Symbol.for('__timber_segment_update_ctx'),
|
|
22
22
|
EMPTY_SEGMENT_UPDATES
|
|
23
23
|
);
|
|
@@ -38,6 +38,6 @@ import { createGlobalContext } from './global-context.ts';
|
|
|
38
38
|
export type SlotContentCache = Map<string, ReactNode>;
|
|
39
39
|
|
|
40
40
|
export const SlotContentCacheContext = createGlobalContext<SlotContentCache | null>(
|
|
41
|
-
'__timber_slot_content_cache_ctx',
|
|
41
|
+
Symbol.for('__timber_slot_content_cache_ctx'),
|
|
42
42
|
null
|
|
43
43
|
);
|
|
@@ -28,23 +28,12 @@
|
|
|
28
28
|
|
|
29
29
|
'use client';
|
|
30
30
|
|
|
31
|
-
import
|
|
31
|
+
import { type ReactNode } from 'react';
|
|
32
|
+
import { createGlobalContext } from './global-context.ts';
|
|
32
33
|
|
|
33
34
|
export type SlotValues = Record<string, ReactNode>;
|
|
34
35
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| React.Context<SlotValues | null>
|
|
40
|
-
| undefined;
|
|
41
|
-
if (existing !== undefined) return existing;
|
|
42
|
-
if (typeof React.createContext === 'function') {
|
|
43
|
-
const ctx = React.createContext<SlotValues | null>(null);
|
|
44
|
-
(globalThis as Record<symbol, unknown>)[CTX_KEY] = ctx;
|
|
45
|
-
return ctx;
|
|
46
|
-
}
|
|
47
|
-
return undefined as unknown as React.Context<SlotValues | null>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const SlotContext = getOrCreateContext();
|
|
36
|
+
export const SlotContext = createGlobalContext<SlotValues | null>(
|
|
37
|
+
Symbol.for('__timber_slot_ctx'),
|
|
38
|
+
null
|
|
39
|
+
);
|
package/src/dev-tools/logs.ts
CHANGED
|
@@ -283,6 +283,14 @@ export function isFrameworkInternalCaller(): boolean {
|
|
|
283
283
|
|
|
284
284
|
// ─── Console Patching ────────────────────────────────────────────────────
|
|
285
285
|
|
|
286
|
+
/** Where a patched console method forwards: its dev server, until that closes. */
|
|
287
|
+
interface ForwardTarget {
|
|
288
|
+
server: ViteDevServer | null;
|
|
289
|
+
projectRoot: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
type ConsoleMethod = (...args: unknown[]) => void;
|
|
293
|
+
|
|
286
294
|
/**
|
|
287
295
|
* Patch console methods to forward logs to the browser via HMR WebSocket.
|
|
288
296
|
*
|
|
@@ -290,60 +298,78 @@ export function isFrameworkInternalCaller(): boolean {
|
|
|
290
298
|
* 1. Calls the original console method (server terminal still works)
|
|
291
299
|
* 2. Serializes arguments for JSON transport
|
|
292
300
|
* 3. Sends via server.hot.send() — dropped if no clients connected
|
|
301
|
+
*
|
|
302
|
+
* The returned cleanup stops forwarding to `server`, and unwraps a method
|
|
303
|
+
* only while this patch is still the outermost one. Vite's
|
|
304
|
+
* `server.restart()` configures the new server, whose patch wraps this one,
|
|
305
|
+
* before it closes this server. React's dev Flight server also wraps the
|
|
306
|
+
* console when it loads. Restoring the method this patch found would drop
|
|
307
|
+
* every wrapper installed since, the new server's included (TIM-1589). A
|
|
308
|
+
* patch left inside another passes calls through once its server is closed.
|
|
293
309
|
*/
|
|
294
310
|
function patchConsole(server: ViteDevServer, projectRoot: string): () => void {
|
|
295
|
-
const
|
|
296
|
-
|
|
311
|
+
const target: ForwardTarget = { server, projectRoot };
|
|
312
|
+
const installed = new Map<ServerLogLevel, { method: ConsoleMethod; prev: ConsoleMethod }>();
|
|
313
|
+
for (const level of LOG_LEVELS) {
|
|
314
|
+
const prev = console[level].bind(console);
|
|
315
|
+
const method = createForwardingMethod(level, prev, target);
|
|
316
|
+
console[level] = method;
|
|
317
|
+
installed.set(level, { method, prev });
|
|
318
|
+
}
|
|
319
|
+
return () => {
|
|
320
|
+
target.server = null;
|
|
321
|
+
for (const [level, { method, prev }] of installed) {
|
|
322
|
+
if (console[level] === method) console[level] = prev;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function createForwardingMethod(
|
|
328
|
+
level: ServerLogLevel,
|
|
329
|
+
prev: (...args: unknown[]) => void,
|
|
330
|
+
target: ForwardTarget
|
|
331
|
+
): ConsoleMethod {
|
|
332
|
+
// Same-level guard so a console.warn inside a console.error handler isn't
|
|
297
333
|
// suppressed — only same-level synchronous re-entrancy is blocked.
|
|
298
|
-
|
|
334
|
+
let forwarding = false;
|
|
335
|
+
return (...args: unknown[]) => {
|
|
336
|
+
// Same-level re-entrancy guard: if prev's wrapper calls back into
|
|
337
|
+
// console[level], just pass through without forwarding.
|
|
338
|
+
if (forwarding) {
|
|
339
|
+
prev(...args);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
299
342
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
343
|
+
forwarding = true;
|
|
344
|
+
try {
|
|
345
|
+
// Call the previous console method first — guarantees terminal output
|
|
346
|
+
// even if serialization or forwarding fails downstream. If prev throws,
|
|
347
|
+
// the error propagates (not swallowed) but the guard is still reset by
|
|
348
|
+
// the outer finally.
|
|
349
|
+
prev(...args);
|
|
350
|
+
|
|
351
|
+
const { server } = target;
|
|
352
|
+
if (!server) return;
|
|
353
|
+
// Skip framework-internal logs (plugins/, adapters/) from browser forwarding.
|
|
354
|
+
if (isFrameworkInternalCaller()) return;
|
|
310
355
|
|
|
311
|
-
patchingLevel.add(level);
|
|
312
356
|
try {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
location: extractCallerLocation(projectRoot),
|
|
327
|
-
timestamp: Date.now(),
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
server.hot.send('timber:server-log', payload);
|
|
331
|
-
} catch (e) {
|
|
332
|
-
originalConsole.debug(
|
|
333
|
-
'[timber] server log forwarding failed:',
|
|
334
|
-
e instanceof Error ? e.message : e
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
} finally {
|
|
338
|
-
patchingLevel.delete(level);
|
|
357
|
+
const payload: ServerLogPayload = {
|
|
358
|
+
level,
|
|
359
|
+
args: args.map((arg) => serializeArg(arg)),
|
|
360
|
+
location: extractCallerLocation(target.projectRoot),
|
|
361
|
+
timestamp: Date.now(),
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
server.hot.send('timber:server-log', payload);
|
|
365
|
+
} catch (e) {
|
|
366
|
+
originalConsole.debug(
|
|
367
|
+
'[timber] server log forwarding failed:',
|
|
368
|
+
e instanceof Error ? e.message : e
|
|
369
|
+
);
|
|
339
370
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
// Return a cleanup function to restore the previous console methods
|
|
344
|
-
return () => {
|
|
345
|
-
for (const [level, prev] of prevConsole) {
|
|
346
|
-
console[level] = prev;
|
|
371
|
+
} finally {
|
|
372
|
+
forwarding = false;
|
|
347
373
|
}
|
|
348
374
|
};
|
|
349
375
|
}
|
|
@@ -353,8 +379,8 @@ function patchConsole(server: ViteDevServer, projectRoot: string): () => void {
|
|
|
353
379
|
/**
|
|
354
380
|
* Create the timber-dev-logs Vite plugin.
|
|
355
381
|
*
|
|
356
|
-
* Patches console methods when the dev server starts and
|
|
357
|
-
* when
|
|
382
|
+
* Patches console methods when the dev server starts and stops forwarding
|
|
383
|
+
* to it when it closes. Only active during `vite dev`.
|
|
358
384
|
*/
|
|
359
385
|
export function timberDevLogs(_ctx: PluginContext): Plugin {
|
|
360
386
|
let cleanup: (() => void) | null = null;
|
|
@@ -366,7 +392,7 @@ export function timberDevLogs(_ctx: PluginContext): Plugin {
|
|
|
366
392
|
configureServer(server: ViteDevServer) {
|
|
367
393
|
cleanup = patchConsole(server, _ctx.root);
|
|
368
394
|
|
|
369
|
-
//
|
|
395
|
+
// Stop forwarding to this server once it closes
|
|
370
396
|
server.httpServer?.on('close', () => {
|
|
371
397
|
cleanup?.();
|
|
372
398
|
cleanup = null;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Design docs: 18-build-system.md §"Dev Server", 02-rendering-pipeline.md
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type
|
|
15
|
+
import { loadConfigFromFile, type Plugin, type ViteDevServer, type DevEnvironment } from 'vite';
|
|
16
16
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
17
17
|
import type { TLSSocket } from 'node:tls';
|
|
18
18
|
import { existsSync, realpathSync, statSync } from 'node:fs';
|
|
@@ -41,6 +41,8 @@ import {
|
|
|
41
41
|
import { compressResponse } from '../server/compress.ts';
|
|
42
42
|
import { isMetadataRouteServePath } from '../server/metadata-routes.ts';
|
|
43
43
|
import { canonicalize } from '../server/canonicalize.ts';
|
|
44
|
+
import { PREBUILT_DEV_CLEAR_EVENT } from '../server/prebuilt/dev-store.ts';
|
|
45
|
+
import { clearDevStoreOnWatcherEvents } from './dev-store-clear.ts';
|
|
44
46
|
import { matchUrlParts } from '../server/tree-match.ts';
|
|
45
47
|
import type { RouteTree } from '../routing/types.ts';
|
|
46
48
|
|
|
@@ -132,10 +134,12 @@ export function timberDevServer(ctx: PluginContext): Plugin {
|
|
|
132
134
|
async configureServer(server: ViteDevServer) {
|
|
133
135
|
// Watch config files for changes. When running under the CLI
|
|
134
136
|
// supervisor (__TIMBER_DEV_WORKER), exit the process so the
|
|
135
|
-
// supervisor respawns with a fresh require cache.
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
137
|
+
// supervisor respawns with a fresh require cache. Under `vite dev`
|
|
138
|
+
// directly (no supervisor) only say so: an in-process
|
|
139
|
+
// server.restart() would serve the stale config anyway (TIM-1444),
|
|
140
|
+
// and each one leaks the whole previous server — its environments,
|
|
141
|
+
// module runners, and React's dev Flight server stay reachable — so a
|
|
142
|
+
// few config saves ran the dev server out of heap (TIM-1589).
|
|
139
143
|
const configPaths = CONFIG_FILE_NAMES.map((name) => join(ctx.root, name));
|
|
140
144
|
server.watcher.add(configPaths);
|
|
141
145
|
const configPathSet = new Set(configPaths);
|
|
@@ -146,17 +150,48 @@ export function timberDevServer(ctx: PluginContext): Plugin {
|
|
|
146
150
|
console.log(`\n[timber] ${basename(filePath)} changed — restarting dev server...\n`);
|
|
147
151
|
process.exit(RESTART_EXIT_CODE);
|
|
148
152
|
} else {
|
|
149
|
-
console.
|
|
150
|
-
`\n[timber] ${basename(filePath)} changed
|
|
151
|
-
|
|
153
|
+
console.warn(
|
|
154
|
+
`\n[timber] ${basename(filePath)} changed. Restart the dev server to apply it,` +
|
|
155
|
+
` or run \`timber dev\` instead of \`vite dev\` to restart automatically.\n`
|
|
152
156
|
);
|
|
153
|
-
server.restart();
|
|
154
157
|
}
|
|
155
158
|
};
|
|
156
159
|
server.watcher.on('change', onConfigChange);
|
|
157
160
|
server.watcher.on('add', onConfigChange);
|
|
158
161
|
server.watcher.on('unlink', onConfigChange);
|
|
159
162
|
|
|
163
|
+
// Vite's own restarts (vite.config.ts or one of its dependencies, a
|
|
164
|
+
// .env file) go through server.restart(), which
|
|
165
|
+
// builds a new server in this process and leaks the old one through
|
|
166
|
+
// rolldown's native resolver (rolldown#10887). Under the supervisor,
|
|
167
|
+
// restart the process instead, as timber.config.ts changes do
|
|
168
|
+
// (TIM-1590). The new config is loaded here first: a vite.config.ts
|
|
169
|
+
// that fails to evaluate would fail the new worker's startup, and the
|
|
170
|
+
// supervisor respawns only on RESTART_EXIT_CODE, so exiting would take
|
|
171
|
+
// the dev server down. Vite's own restart keeps the old server then.
|
|
172
|
+
if (hasSupervisor) {
|
|
173
|
+
server.restart = async () => {
|
|
174
|
+
const { configFile, mode, root, logger } = server.config;
|
|
175
|
+
try {
|
|
176
|
+
await loadConfigFromFile(
|
|
177
|
+
{ command: 'serve', mode },
|
|
178
|
+
configFile || undefined,
|
|
179
|
+
root,
|
|
180
|
+
'silent'
|
|
181
|
+
);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
logger.error(
|
|
184
|
+
`[timber] ${configFile ? basename(configFile) : 'Vite config'} failed to load — ` +
|
|
185
|
+
`keeping the running server.\n${error instanceof Error ? error.message : String(error)}`,
|
|
186
|
+
{ timestamp: true }
|
|
187
|
+
);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
console.log('\n[timber] Restarting the dev server process...\n');
|
|
191
|
+
process.exit(RESTART_EXIT_CODE);
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
160
195
|
// Listen for client-side errors forwarded from the browser.
|
|
161
196
|
// The browser entry sends 'timber:client-error' events via HMR
|
|
162
197
|
// for uncaught errors and unhandled rejections. We echo them back
|
|
@@ -169,6 +204,20 @@ export function timberDevServer(ctx: PluginContext): Plugin {
|
|
|
169
204
|
// never reach the app pipeline. Dev-only by construction (this
|
|
170
205
|
// plugin is apply: 'serve'). See design/47 §"Dev-server endpoint".
|
|
171
206
|
server.middlewares.use(createGraphEndpointMiddleware(server, ctx));
|
|
207
|
+
|
|
208
|
+
// Every watcher event clears the RSC environment's cache.component dev
|
|
209
|
+
// store (TIM-1588) — source files, and files outside the module graph
|
|
210
|
+
// that a component reads with fs. A raw listener, not hotUpdate: it
|
|
211
|
+
// runs in the same synchronous dispatch as every other watcher
|
|
212
|
+
// listener (timber-routing's reloads included), before Vite's own
|
|
213
|
+
// handling sends any HMR update. A browser that a reload or update
|
|
214
|
+
// makes refetch can only reach the server after the clear has gone
|
|
215
|
+
// out. A trailing clear covers the saves the watcher drops
|
|
216
|
+
// (dev-store-clear.ts).
|
|
217
|
+
const rscHot = server.environments.rsc?.hot;
|
|
218
|
+
clearDevStoreOnWatcherEvents(server.watcher, () => {
|
|
219
|
+
rscHot?.send({ type: 'custom', event: PREBUILT_DEV_CLEAR_EVENT });
|
|
220
|
+
});
|
|
172
221
|
graphChannel = makeGraphUpdateChannel(
|
|
173
222
|
ctx,
|
|
174
223
|
(payload) => server.hot.send(payload),
|