@rebask/core 0.2.1 → 0.4.0
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/components/head.d.ts +2 -11
- package/dist/components/head.d.ts.map +1 -1
- package/dist/components/head.js +12 -24
- package/dist/components/image.d.ts +16 -3
- package/dist/components/image.d.ts.map +1 -1
- package/dist/components/image.js +50 -68
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +6 -2
- package/dist/entry.browser.js +2 -2
- package/dist/entry.ssr.d.ts.map +1 -1
- package/dist/entry.ssr.js +12 -7
- package/dist/handlers/rsc/background-render.js +2 -2
- package/dist/handlers/rsc/render-request.js +2 -2
- package/dist/handlers/rsc/render-to-response.js +2 -2
- package/dist/handlers/rsc/state.d.ts.map +1 -1
- package/dist/handlers/rsc/state.js +11 -5
- package/dist/lib/client-route-prediction.d.ts +1 -1
- package/dist/lib/client-route-prediction.d.ts.map +1 -1
- package/dist/lib/client-route-prediction.js +2 -7
- package/dist/lib/head/head-manager.d.ts +9 -0
- package/dist/lib/head/head-manager.d.ts.map +1 -0
- package/dist/lib/head/head-manager.js +98 -0
- package/dist/lib/head/head-script.js +8 -13
- package/dist/lib/image-optimization/fetch-remote-image.d.ts +17 -0
- package/dist/lib/image-optimization/fetch-remote-image.d.ts.map +1 -0
- package/dist/lib/image-optimization/fetch-remote-image.js +157 -0
- package/dist/lib/image-optimization/get-img-props.d.ts +3 -5
- package/dist/lib/image-optimization/get-img-props.d.ts.map +1 -1
- package/dist/lib/image-optimization/get-img-props.js +66 -40
- package/dist/lib/image-optimization/handler.d.ts +0 -3
- package/dist/lib/image-optimization/handler.d.ts.map +1 -1
- package/dist/lib/image-optimization/handler.js +339 -124
- package/dist/lib/image-optimization/image-config.d.ts +31 -4
- package/dist/lib/image-optimization/image-config.d.ts.map +1 -1
- package/dist/lib/image-optimization/image-config.js +6 -0
- package/dist/lib/image-optimization/image-error.d.ts +8 -0
- package/dist/lib/image-optimization/image-error.d.ts.map +1 -0
- package/dist/lib/image-optimization/image-error.js +10 -0
- package/dist/lib/image-optimization/image-plugin.d.ts +2 -0
- package/dist/lib/image-optimization/image-plugin.d.ts.map +1 -1
- package/dist/lib/image-optimization/image-plugin.js +36 -16
- package/dist/lib/image-optimization/is-private-ip.d.ts +2 -0
- package/dist/lib/image-optimization/is-private-ip.d.ts.map +1 -0
- package/dist/lib/image-optimization/is-private-ip.js +43 -0
- package/dist/lib/image-optimization/match-patterns.d.ts +4 -0
- package/dist/lib/image-optimization/match-patterns.d.ts.map +1 -0
- package/dist/lib/image-optimization/match-patterns.js +39 -0
- package/dist/lib/image-optimization/read-body.d.ts +2 -0
- package/dist/lib/image-optimization/read-body.d.ts.map +1 -0
- package/dist/lib/image-optimization/read-body.js +27 -0
- package/dist/lib/image-optimization/static-image-loader.d.ts +2 -0
- package/dist/lib/image-optimization/static-image-loader.d.ts.map +1 -0
- package/dist/lib/image-optimization/static-image-loader.js +60 -0
- package/dist/lib/plugin-names.d.ts +3 -0
- package/dist/lib/plugin-names.d.ts.map +1 -0
- package/dist/lib/plugin-names.js +2 -0
- package/dist/lib/proxy/build-proxy.d.ts +1 -1
- package/dist/lib/proxy/build-proxy.d.ts.map +1 -1
- package/dist/lib/proxy/build-proxy.js +4 -11
- package/dist/lib/proxy/pattern.d.ts +7 -0
- package/dist/lib/proxy/pattern.d.ts.map +1 -0
- package/dist/lib/proxy/pattern.js +18 -0
- package/dist/lib/proxy/types.d.ts +3 -1
- package/dist/lib/proxy/types.d.ts.map +1 -1
- package/dist/lib/route-prediction.d.ts.map +1 -1
- package/dist/lib/rsc-request.d.ts.map +1 -1
- package/dist/lib/rsc-request.js +6 -4
- package/dist/lib/server-router/build-entries.d.ts +76 -0
- package/dist/lib/server-router/build-entries.d.ts.map +1 -0
- package/dist/lib/server-router/build-entries.js +74 -0
- package/dist/lib/server-router/get-router.d.ts.map +1 -1
- package/dist/lib/server-router/get-router.js +55 -105
- package/dist/lib/server-router/rou3.d.ts +20 -0
- package/dist/lib/server-router/rou3.d.ts.map +1 -0
- package/dist/lib/server-router/rou3.js +55 -0
- package/dist/lib/server-router/route-entries.d.ts +16 -0
- package/dist/lib/server-router/route-entries.d.ts.map +1 -0
- package/dist/lib/server-router/route-entries.js +67 -0
- package/dist/lib/server-router/types.d.ts +24 -33
- package/dist/lib/server-router/types.d.ts.map +1 -1
- package/dist/lib/server-router/types.js +1 -6
- package/dist/lib/types.d.ts +2 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/plugins/prerender.d.ts +3 -4
- package/dist/plugins/prerender.d.ts.map +1 -1
- package/dist/plugins/prerender.js +31 -0
- package/dist/plugins/proxy.d.ts.map +1 -1
- package/dist/plugins/proxy.js +7 -1
- package/dist/plugins/router/rou3-compiled.d.ts +9 -0
- package/dist/plugins/router/rou3-compiled.d.ts.map +1 -0
- package/dist/plugins/router/rou3-compiled.js +14 -0
- package/dist/plugins/router/rou3-router.d.ts +3 -0
- package/dist/plugins/router/rou3-router.d.ts.map +1 -0
- package/dist/plugins/router/rou3-router.js +16 -0
- package/dist/plugins/router/router-plugin.d.ts +6 -16
- package/dist/plugins/router/router-plugin.d.ts.map +1 -1
- package/dist/plugins/router/router-plugin.js +43 -22
- package/dist/proxy.d.ts +1 -0
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +1 -0
- package/dist/request-context.d.ts +0 -2
- package/dist/request-context.d.ts.map +1 -1
- package/dist/request-context.js +0 -4
- package/dist/router.d.ts +1 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +4 -4
- package/dist/server-router.d.ts +3 -3
- package/dist/server-router.d.ts.map +1 -1
- package/dist/server-router.js +2 -2
- package/dist/vite.d.ts +8 -3
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +72 -33
- package/package.json +6 -4
- package/dist/components/error-boundary-client.d.ts +0 -49
- package/dist/components/error-boundary-client.d.ts.map +0 -1
- package/dist/components/error-boundary-client.js +0 -71
- package/dist/components/error-boundary.browser.d.ts +0 -8
- package/dist/components/error-boundary.browser.d.ts.map +0 -1
- package/dist/components/error-boundary.browser.js +0 -6
- package/dist/components/error.d.ts +0 -2
- package/dist/components/error.d.ts.map +0 -1
- package/dist/components/error.js +0 -5
- package/dist/components/not-found-activator.d.ts +0 -11
- package/dist/components/not-found-activator.d.ts.map +0 -1
- package/dist/components/not-found-activator.js +0 -26
- package/dist/components/not-found-boundary-client.d.ts +0 -3
- package/dist/components/not-found-boundary-client.d.ts.map +0 -1
- package/dist/components/not-found-boundary-client.js +0 -20
- package/dist/components/not-found-boundary.browser.d.ts +0 -8
- package/dist/components/not-found-boundary.browser.d.ts.map +0 -1
- package/dist/components/not-found-boundary.browser.js +0 -4
- package/dist/components/not-found-boundary.d.ts +0 -8
- package/dist/components/not-found-boundary.d.ts.map +0 -1
- package/dist/components/not-found-boundary.js +0 -9
- package/dist/components/not-found-thrower.d.ts +0 -2
- package/dist/components/not-found-thrower.d.ts.map +0 -1
- package/dist/components/not-found-thrower.js +0 -7
- package/dist/components/not-found.d.ts +0 -2
- package/dist/components/not-found.d.ts.map +0 -1
- package/dist/components/not-found.js +0 -5
- package/dist/components/status-page.d.ts +0 -6
- package/dist/components/status-page.d.ts.map +0 -1
- package/dist/components/status-page.js +0 -61
- package/dist/handler.d.ts +0 -12
- package/dist/handler.d.ts.map +0 -1
- package/dist/handler.js +0 -21
- package/dist/handlers/rsc/constants.d.ts +0 -3
- package/dist/handlers/rsc/constants.d.ts.map +0 -1
- package/dist/handlers/rsc/constants.js +0 -2
- package/dist/handlers/rsc/create-response.d.ts +0 -3
- package/dist/handlers/rsc/create-response.d.ts.map +0 -1
- package/dist/handlers/rsc/create-response.js +0 -378
- package/dist/handlers/rsc/render-with-retries.d.ts +0 -4
- package/dist/handlers/rsc/render-with-retries.d.ts.map +0 -1
- package/dist/handlers/rsc/render-with-retries.js +0 -154
- package/dist/handlers/rsc/retry-loop.d.ts +0 -3
- package/dist/handlers/rsc/retry-loop.d.ts.map +0 -1
- package/dist/handlers/rsc/retry-loop.js +0 -145
- package/dist/handlers/rsc/stream-rsc-payload.d.ts +0 -9
- package/dist/handlers/rsc/stream-rsc-payload.d.ts.map +0 -1
- package/dist/handlers/rsc/stream-rsc-payload.js +0 -20
- package/dist/handlers/rsc/types.d.ts +0 -26
- package/dist/handlers/rsc/types.d.ts.map +0 -1
- package/dist/handlers/rsc/types.js +0 -7
- package/dist/handlers/rsc.d.ts +0 -20
- package/dist/handlers/rsc.d.ts.map +0 -1
- package/dist/handlers/rsc.js +0 -872
- package/dist/integration.d.ts +0 -14
- package/dist/integration.d.ts.map +0 -1
- package/dist/integration.js +0 -9
- package/dist/lib/dev-module-load-race.d.ts +0 -8
- package/dist/lib/dev-module-load-race.d.ts.map +0 -1
- package/dist/lib/dev-module-load-race.js +0 -31
- package/dist/lib/dev-page-exports.d.ts +0 -5
- package/dist/lib/dev-page-exports.d.ts.map +0 -1
- package/dist/lib/dev-page-exports.js +0 -14
- package/dist/lib/environment-names.d.ts +0 -11
- package/dist/lib/environment-names.d.ts.map +0 -1
- package/dist/lib/environment-names.js +0 -10
- package/dist/lib/initial-hash-scroll.d.ts.map +0 -1
- package/dist/lib/not-found.d.ts +0 -5
- package/dist/lib/not-found.d.ts.map +0 -1
- package/dist/lib/not-found.js +0 -7
- package/dist/lib/page-exports.d.ts +0 -9
- package/dist/lib/page-exports.d.ts.map +0 -1
- package/dist/lib/page-exports.js +0 -47
- package/dist/lib/pattern-segments.d.ts +0 -8
- package/dist/lib/pattern-segments.d.ts.map +0 -1
- package/dist/lib/pattern-segments.js +0 -22
- package/dist/lib/ppr/cache-status.d.ts +0 -3
- package/dist/lib/ppr/cache-status.d.ts.map +0 -1
- package/dist/lib/ppr/cache-status.js +0 -5
- package/dist/lib/server-router-contract.d.ts +0 -42
- package/dist/lib/server-router-contract.d.ts.map +0 -1
- package/dist/lib/server-router-contract.js +0 -6
- package/dist/lib/server-router-loader.d.ts +0 -10
- package/dist/lib/server-router-loader.d.ts.map +0 -1
- package/dist/lib/server-router-loader.js +0 -180
- package/dist/lib/server-router.d.ts +0 -8
- package/dist/lib/server-router.d.ts.map +0 -1
- package/dist/lib/server-router.js +0 -173
- package/dist/plugins/ppr-upgrade.d.ts +0 -36
- package/dist/plugins/ppr-upgrade.d.ts.map +0 -1
- package/dist/plugins/ppr-upgrade.js +0 -32
- package/dist/plugins/server-router-fallback.d.ts +0 -15
- package/dist/plugins/server-router-fallback.d.ts.map +0 -1
- package/dist/plugins/server-router-fallback.js +0 -30
- package/dist/server.d.ts +0 -10
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -57
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import { injectRSCPayload } from "rsc-html-stream/server";
|
|
2
|
-
import { proxyPatterns } from "virtual:rebask/proxy-router";
|
|
3
|
-
import { errorModules } from "../../lib/app-manifest.js";
|
|
4
|
-
import { scheduleBackgroundRevalidation } from "../../lib/background-revalidation.js";
|
|
5
|
-
import {} from "../../lib/cache-context.js";
|
|
6
|
-
import { getDeploymentId, getDeploymentScopedCacheKey, REBASK_DEPLOYMENT_ID_HEADER, } from "../../lib/deployment-id.js";
|
|
7
|
-
import { sendDevWarning } from "../../lib/dev-server.js";
|
|
8
|
-
import { noPrerenderNotFoundError, noPrerenderWarning } from "../../lib/messages.js";
|
|
9
|
-
import { getCacheControlHeader, REBASK_PRERENDER_HEADER } from "../../lib/ppr/headers.js";
|
|
10
|
-
import { serializeResumeState } from "../../lib/ppr/postponed-state.js";
|
|
11
|
-
import { ResumeMode } from "../../lib/ppr/types.js";
|
|
12
|
-
import { prerenderPaths } from "../../lib/prerender-paths.js";
|
|
13
|
-
import { getActiveErrorBoundary, getNearestErrorBoundaryIndex, getNearestNotFoundBoundaryIndex, maybeAbort, RenderStorage, } from "../../lib/render-context.js";
|
|
14
|
-
import { cacheRscStream, createRscResponse, renderRsc } from "../../lib/rsc-request.js";
|
|
15
|
-
import { waitForMicrotaskDrain } from "../../lib/scheduler-patch.js";
|
|
16
|
-
import { encodeShellParams } from "../../lib/shell-params.js";
|
|
17
|
-
import { chainStreams } from "../../lib/stream-utils.js";
|
|
18
|
-
import { ActionErrorCode } from "../../lib/types.js";
|
|
19
|
-
import { getBoundaryError, getCacheLife, hasRenderError, hasRequestIO, isNotFound, markRenderError, mergeResponseHeaders, notFoundWasThrown, } from "../../request-context.js";
|
|
20
|
-
import { renderFullPageInBackground, renderPartialShellInBackground, withBackgroundHtmlWrite, } from "./background-render.js";
|
|
21
|
-
import { cacheHtml } from "./cache-html.js";
|
|
22
|
-
import { STATIC } from "./constants.js";
|
|
23
|
-
import { buildDefaultErrorRoute, buildErrorRoute, FallbackRouteError, onNotFound, RetryWithBoundaryError, RetryWithNotFoundBoundaryError, } from "./errors.js";
|
|
24
|
-
import { getSSREntryModule } from "./ssr-entry.js";
|
|
25
|
-
import { CacheLookupKind } from "./types.js";
|
|
26
|
-
function getResponseStatus(state) {
|
|
27
|
-
// If the action threw an error, we consider the response a 500.
|
|
28
|
-
if (state.postBody.returnValue?.ok === false)
|
|
29
|
-
return 500;
|
|
30
|
-
if (state.isErrorRoute || getActiveErrorBoundary() !== undefined)
|
|
31
|
-
return 500;
|
|
32
|
-
if (state.isNotFoundRoute || isNotFound())
|
|
33
|
-
return 404;
|
|
34
|
-
if (state.isRscRequest)
|
|
35
|
-
return 200;
|
|
36
|
-
if (state.postBody.actionError === ActionErrorCode.NotFound)
|
|
37
|
-
return 404;
|
|
38
|
-
return 200;
|
|
39
|
-
}
|
|
40
|
-
const closingTagsBytes = new TextEncoder().encode("</body></html>");
|
|
41
|
-
/** Stream RSC payload for ResumeMode.RSC. */
|
|
42
|
-
function streamRSCPayload(rscStream) {
|
|
43
|
-
const closingStream = new ReadableStream({
|
|
44
|
-
start(controller) {
|
|
45
|
-
controller.enqueue(closingTagsBytes);
|
|
46
|
-
controller.close();
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
// The transform reads the closing tags, waits for RSC data, and emits the RSC payload as script
|
|
50
|
-
// tags followed by the closing tags.
|
|
51
|
-
return closingStream.pipeThrough(injectRSCPayload(rscStream));
|
|
52
|
-
}
|
|
53
|
-
export async function renderToResponse(state, cacheContext, rscStream) {
|
|
54
|
-
if (state.isRscRequest) {
|
|
55
|
-
const rscStatus = getResponseStatus(state);
|
|
56
|
-
const isCacheableRsc = !state.isPost && !state.isErrorRoute && !state.resumeState;
|
|
57
|
-
const isCleanRender = !hasRequestIO() && !hasRenderError() && !isNotFound();
|
|
58
|
-
// See if the RSC can be cached
|
|
59
|
-
if (isCacheableRsc && isCleanRender) {
|
|
60
|
-
const [responseStream, cacheStream] = rscStream.tee();
|
|
61
|
-
cacheRscStream(state.url, cacheStream).catch((error) => console.error("[rebask] Failed to cache RSC:", error));
|
|
62
|
-
return createRscResponse(responseStream, {}, rscStatus);
|
|
63
|
-
}
|
|
64
|
-
return createRscResponse(rscStream, {}, rscStatus);
|
|
65
|
-
}
|
|
66
|
-
const ssrEntryModule = await getSSREntryModule();
|
|
67
|
-
state.ssrEntryModule = ssrEntryModule;
|
|
68
|
-
try {
|
|
69
|
-
let renderResult;
|
|
70
|
-
const { resumeState } = state;
|
|
71
|
-
if (resumeState?.type === ResumeMode.HTML) {
|
|
72
|
-
const [rscStream1, rscStream2] = rscStream.tee();
|
|
73
|
-
const cache = await ssrEntryModule.getRouterCache(rscStream1, state.routeTree);
|
|
74
|
-
const resumePromise = ssrEntryModule.resumeHTML(rscStream2, cache, resumeState.postponed, {
|
|
75
|
-
routeTree: state.routeTree,
|
|
76
|
-
});
|
|
77
|
-
// HTML resume from a cached PPR shell — stream the cached shell immediately,
|
|
78
|
-
// then resume prepares in the background and streams after the shell.
|
|
79
|
-
if (cacheContext.kind === CacheLookupKind.PprHit) {
|
|
80
|
-
const shellStream = new Response(cacheContext.entry.html).body;
|
|
81
|
-
const combinedStream = chainStreams(shellStream, resumePromise);
|
|
82
|
-
const responseStream = withBackgroundHtmlWrite(state, combinedStream, state.fullPageCacheKey, cacheContext.promotionResolvedParams);
|
|
83
|
-
renderResult = { responseStream, isPrerenderedResume: true };
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
// External resume request - just send resume content
|
|
87
|
-
renderResult = { responseStream: await resumePromise };
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (state.resumeState?.type === ResumeMode.RSC) {
|
|
91
|
-
// External PPR resume (RSC only).
|
|
92
|
-
//
|
|
93
|
-
// The client already has the full cached HTML document rendered, and is requesting fresh RSC
|
|
94
|
-
// data to reconcile the dynamic parts that were deferred. Unlike other resume modes, we
|
|
95
|
-
// bypass React's HTML renderer entirely because the shell is already on the client.
|
|
96
|
-
//
|
|
97
|
-
// The response is still `text/html`, so the browser needs a valid HTML document to parse.
|
|
98
|
-
// We create one with just the closing tags and the RSC script tags before them.
|
|
99
|
-
// The client's HTML parser extracts those scripts and React reconciles on the client.
|
|
100
|
-
renderResult = { responseStream: streamRSCPayload(rscStream) };
|
|
101
|
-
}
|
|
102
|
-
else if (state.shouldPrerender && (!state.isNoShellRoute || state.isBuildPrerender)) {
|
|
103
|
-
// We skip prerendering if we know the route has no shell, but not at build time.
|
|
104
|
-
renderResult = await prerenderBranch(state, rscStream);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
// Non-prerendering path: dynamic content, streaming
|
|
108
|
-
const [rscStream1, rscStream2] = rscStream.tee();
|
|
109
|
-
const cache = await ssrEntryModule.getRouterCache(rscStream1, state.routeTree);
|
|
110
|
-
let responseStream;
|
|
111
|
-
if (state.isBotRequest) {
|
|
112
|
-
const result = await ssrEntryModule.prerenderHTML(rscStream2, cache, {
|
|
113
|
-
renderToCompletion: true,
|
|
114
|
-
});
|
|
115
|
-
responseStream = result.prelude;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
responseStream = await ssrEntryModule.renderHTML(rscStream2, cache, {
|
|
119
|
-
formState: state.postBody.formState,
|
|
120
|
-
routeTree: state.routeTree,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
renderResult = { responseStream, isStatic: false, isPrerenderedResume: false };
|
|
124
|
-
}
|
|
125
|
-
const { responseStream, isStatic, isPrerenderedResume, cacheLife } = renderResult;
|
|
126
|
-
// Build Cache-Control header:
|
|
127
|
-
// - Static content: use aggregated cacheLife values (safe to cache at CDN)
|
|
128
|
-
// - Dynamic/streaming content (including prerendered resume): no caching
|
|
129
|
-
// because the dynamic parts change per-request
|
|
130
|
-
const cacheControl = isStatic
|
|
131
|
-
? getCacheControlHeader({
|
|
132
|
-
revalidate: cacheLife?.revalidate ?? STATIC,
|
|
133
|
-
expire: cacheLife?.expire,
|
|
134
|
-
})
|
|
135
|
-
: getCacheControlHeader({ revalidate: 0 });
|
|
136
|
-
const response = new Response(responseStream, {
|
|
137
|
-
status: getResponseStatus(state),
|
|
138
|
-
headers: mergeResponseHeaders({
|
|
139
|
-
"Content-Type": "text/html; charset=utf-8",
|
|
140
|
-
vary: "accept",
|
|
141
|
-
"Cache-Control": cacheControl,
|
|
142
|
-
...(state.isNotFoundRoute && { "x-robots-tag": "noindex" }),
|
|
143
|
-
"x-rebask-cache": state.isErrorRoute ? "MISS" : isPrerenderedResume ? "HIT" : "MISS",
|
|
144
|
-
...(isPrerenderedResume && { [REBASK_PRERENDER_HEADER]: "1" }),
|
|
145
|
-
...(getDeploymentId() ? { [REBASK_DEPLOYMENT_ID_HEADER]: getDeploymentId() } : {}),
|
|
146
|
-
}),
|
|
147
|
-
});
|
|
148
|
-
// Schedule background revalidations for stale or missing entries.
|
|
149
|
-
if (!state.isBuildPrerender &&
|
|
150
|
-
(cacheContext.kind === CacheLookupKind.PprHit || cacheContext.kind === CacheLookupKind.Miss)) {
|
|
151
|
-
for (const { key, resolvedParams } of cacheContext.revalidations) {
|
|
152
|
-
if (resolvedParams) {
|
|
153
|
-
scheduleBackgroundRevalidation(key, () => renderPartialShellInBackground(state, key, resolvedParams));
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
scheduleBackgroundRevalidation(key, () => renderFullPageInBackground(state, key));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return response;
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
markRenderError();
|
|
164
|
-
// We want to throw during prerendering, instead of rendering an error page.
|
|
165
|
-
if (state.isBuildPrerender && !isNotFound()) {
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
// Handle 404 if called before a Suspense boundary.
|
|
169
|
-
if (isNotFound()) {
|
|
170
|
-
// Render the nearest `NotFoundBoundary` only if the current render has called `notFound()`
|
|
171
|
-
if (notFoundWasThrown()) {
|
|
172
|
-
// `isNotFound()` is the sticky 404 status (persists across retries).
|
|
173
|
-
// `notFoundWasThrown()` is the per-render state.
|
|
174
|
-
const nextNotFoundIndex = getNearestNotFoundBoundaryIndex();
|
|
175
|
-
if (nextNotFoundIndex !== undefined) {
|
|
176
|
-
throw new RetryWithNotFoundBoundaryError(nextNotFoundIndex);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
// Fall back to the built-in default 404
|
|
180
|
-
throw new FallbackRouteError({
|
|
181
|
-
type: "not-found",
|
|
182
|
-
segments: [],
|
|
183
|
-
layouts: [],
|
|
184
|
-
errorPath: state.route.errorPath,
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
const nextBoundaryIndex = getNearestErrorBoundaryIndex();
|
|
188
|
-
if (!state.isErrorRoute && nextBoundaryIndex !== undefined) {
|
|
189
|
-
throw new RetryWithBoundaryError(nextBoundaryIndex, error);
|
|
190
|
-
}
|
|
191
|
-
const rootErrorPath = state.route.errorPath;
|
|
192
|
-
// Once a framework error route itself fails, fall back to the built-in default.
|
|
193
|
-
if (state.isErrorRoute) {
|
|
194
|
-
throw new FallbackRouteError(buildDefaultErrorRoute());
|
|
195
|
-
}
|
|
196
|
-
if (rootErrorPath && errorModules[rootErrorPath]) {
|
|
197
|
-
throw new FallbackRouteError(buildErrorRoute(rootErrorPath));
|
|
198
|
-
}
|
|
199
|
-
throw new FallbackRouteError(buildDefaultErrorRoute());
|
|
200
|
-
}
|
|
201
|
-
finally {
|
|
202
|
-
state.resolveShellInFlight?.();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
async function prerenderBranch(state, rscStream) {
|
|
206
|
-
const { temporaryReferences } = state.postBody;
|
|
207
|
-
const ssrEntryModule = state.ssrEntryModule;
|
|
208
|
-
// PPR: Prerender to capture static shell, then resume for dynamic content
|
|
209
|
-
const pprContext = RenderStorage.getStore()?.ppr;
|
|
210
|
-
const [rscStream1, rscStream2] = rscStream.tee();
|
|
211
|
-
const cache = await ssrEntryModule.getRouterCache(rscStream1, state.routeTree);
|
|
212
|
-
// Prerender to capture the static shell. Any suspended components
|
|
213
|
-
// (due to dynamic functions, async data) are captured as postponed state.
|
|
214
|
-
const result = ssrEntryModule.prerenderHTML(rscStream2, cache, {
|
|
215
|
-
signal: pprContext?.controller.signal,
|
|
216
|
-
onShell: () => {
|
|
217
|
-
maybeAbort("prerender");
|
|
218
|
-
},
|
|
219
|
-
// For upgrade renders we want the cached HTML to render the resolved Suspense content
|
|
220
|
-
// inline so a refresh shows real content immediately instead of using the fallback.
|
|
221
|
-
renderToCompletion: state.isPrerenderUpgrade,
|
|
222
|
-
});
|
|
223
|
-
// Wait for React's microtask queue to drain, indicating Fizz is idle
|
|
224
|
-
// and waiting at our hanging promise. Then abort to capture the static
|
|
225
|
-
// shell.
|
|
226
|
-
waitForMicrotaskDrain().then(() => {
|
|
227
|
-
maybeAbort("rsc");
|
|
228
|
-
});
|
|
229
|
-
const { prelude, postponed } = await result;
|
|
230
|
-
const [preludeForClient, preludeForCache] = prelude.tee();
|
|
231
|
-
const postponedState = postponed
|
|
232
|
-
? serializeResumeState({ type: ResumeMode.HTML, postponed })
|
|
233
|
-
: undefined;
|
|
234
|
-
// When replaySlots === -1, it means the ROOT was postponed (dynamic access
|
|
235
|
-
// happened at the top level without any Suspense boundary). In this case,
|
|
236
|
-
// there's no static shell worth caching.
|
|
237
|
-
// See: React's getPostponedState in ReactFizzServer.js
|
|
238
|
-
const rootPostponed = postponed
|
|
239
|
-
? postponed.replaySlots === -1
|
|
240
|
-
: false;
|
|
241
|
-
if (rootPostponed) {
|
|
242
|
-
if (state.isPageRoute) {
|
|
243
|
-
prerenderPaths.registerNoShell(state.route.filePath);
|
|
244
|
-
}
|
|
245
|
-
if (import.meta.env.DEV) {
|
|
246
|
-
const devWarningMessage = noPrerenderWarning(state.url.pathname);
|
|
247
|
-
console.warn(devWarningMessage);
|
|
248
|
-
sendDevWarning(devWarningMessage);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
// notFound() can be thrown inside a <Suspense> boundary, where it's captured as postponed
|
|
252
|
-
// content, so the prerender still produced a shell. When that happens, activate the next
|
|
253
|
-
// boundary and retry.
|
|
254
|
-
if (notFoundWasThrown()) {
|
|
255
|
-
const nextNotFoundIndex = getNearestNotFoundBoundaryIndex();
|
|
256
|
-
if (nextNotFoundIndex !== undefined) {
|
|
257
|
-
prelude.cancel().catch(console.error);
|
|
258
|
-
throw new RetryWithNotFoundBoundaryError(nextNotFoundIndex);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
let responseStream;
|
|
262
|
-
let isStatic = false;
|
|
263
|
-
if (postponed) {
|
|
264
|
-
// A valid shell exists if the root wasn't postponed
|
|
265
|
-
if (state.isBuildPrerender) {
|
|
266
|
-
// Build-time prerendering only needs the shell. Skip resume.
|
|
267
|
-
responseStream = preludeForClient;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
// PPR: There's postponed content (Suspense or async component suspended)
|
|
271
|
-
if (!state.seedData) {
|
|
272
|
-
throw new Error("Expected route seed data for PPR resume response.");
|
|
273
|
-
}
|
|
274
|
-
// Resume runs in a fresh RenderStorage context (preserving activated boundary indices)
|
|
275
|
-
// so stale registry state from the prerender doesn't leak into the resume.
|
|
276
|
-
const currentRenderContext = RenderStorage.getStore();
|
|
277
|
-
const [resumeRscStream1, resumeRscStream2] = RenderStorage.run({
|
|
278
|
-
errorBoundary: { activeIndex: currentRenderContext.errorBoundary.activeIndex },
|
|
279
|
-
notFoundBoundary: {
|
|
280
|
-
activeIndex: currentRenderContext.notFoundBoundary.activeIndex,
|
|
281
|
-
},
|
|
282
|
-
ppr: {
|
|
283
|
-
controller: new AbortController(),
|
|
284
|
-
abortOnDynamic: false,
|
|
285
|
-
resolvedParams: state.resolvedParams,
|
|
286
|
-
},
|
|
287
|
-
}, () => renderRsc({
|
|
288
|
-
seedData: state.seedData,
|
|
289
|
-
routeTree: state.routeTree,
|
|
290
|
-
...(state.routePrediction && { routePrediction: state.routePrediction }),
|
|
291
|
-
...(proxyPatterns && { proxyPatterns }),
|
|
292
|
-
}, { temporaryReferences }, onNotFound).tee());
|
|
293
|
-
const resumeCache = await ssrEntryModule.getRouterCache(resumeRscStream1, state.routeTree);
|
|
294
|
-
const resumeStream = await ssrEntryModule.resumeHTML(resumeRscStream2, resumeCache, postponed, { routeTree: state.routeTree });
|
|
295
|
-
if (rootPostponed) {
|
|
296
|
-
// Root was postponed - prelude is nothing (just closing tags).
|
|
297
|
-
// Use resume stream directly which contains complete HTML.
|
|
298
|
-
// Cancel the broken prelude to avoid resource leaks.
|
|
299
|
-
preludeForClient.cancel().catch(console.error);
|
|
300
|
-
preludeForCache.cancel().catch(console.error);
|
|
301
|
-
responseStream = resumeStream;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
// Concatenate: static shell + dynamic content
|
|
305
|
-
const combinedStream = chainStreams(preludeForClient, resumeStream);
|
|
306
|
-
if (state.fullPageCacheKey && state.resolvedParams.size === 0 && state.isPageRoute) {
|
|
307
|
-
responseStream = withBackgroundHtmlWrite(state, combinedStream, state.fullPageCacheKey, state.fullParamsSet);
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
responseStream = combinedStream;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
// Fully static - no dynamic content
|
|
317
|
-
isStatic = true;
|
|
318
|
-
responseStream = preludeForClient;
|
|
319
|
-
}
|
|
320
|
-
if (state.isBuildPrerender && rootPostponed && state.isNotFoundRoute) {
|
|
321
|
-
// Not-found pages must be prerenderable at build time
|
|
322
|
-
throw new Error(noPrerenderNotFoundError("(default)"));
|
|
323
|
-
}
|
|
324
|
-
// Capture aggregated cache life values from async context.
|
|
325
|
-
// This is done after prerendering completes when all cacheLife() calls
|
|
326
|
-
// have been processed. Applies to both fully static pages and postponed
|
|
327
|
-
// shells (shared + intermediate) so that tags/revalidate/expire are
|
|
328
|
-
// preserved on the cache entry.
|
|
329
|
-
const cacheLife = getCacheLife();
|
|
330
|
-
// A servable static shell does not exit when:
|
|
331
|
-
// - `rootPostponed`: dynamic data was accessed at the root with no <Suspense> to
|
|
332
|
-
// absorb it, so React produced no prelude.
|
|
333
|
-
// - `isNotFound()`: the render resolved to notFound(), which is never a servable shell.
|
|
334
|
-
// The router's catch-all route for unmatched URLs is the exception — a 404 is its
|
|
335
|
-
// shell. This is why pages must put `notFound()` behind dynamic IO inside <Suspense>.
|
|
336
|
-
const hasServableShell = !rootPostponed && (state.isNotFoundRoute || !isNotFound());
|
|
337
|
-
if (state.htmlCacheKey && hasServableShell && !getBoundaryError()) {
|
|
338
|
-
// Cache the static shell so future requests can resume from it.
|
|
339
|
-
// For fully static pages (no postponed content), `preludeForCache` is the
|
|
340
|
-
// complete HTML and gets cached with no postponed state.
|
|
341
|
-
const isSharedShell = !!postponedState &&
|
|
342
|
-
state.resolvedParams.size === 0 &&
|
|
343
|
-
(state.isPageRoute || state.isNotFoundRoute);
|
|
344
|
-
const isIntermediateShell = state.isPageRoute && !!postponedState && state.hasIntermediateShellParams;
|
|
345
|
-
let cacheKey = state.htmlCacheKey;
|
|
346
|
-
if (isIntermediateShell && state.isPageRoute) {
|
|
347
|
-
cacheKey = getDeploymentScopedCacheKey(`html:${state.route.filePath}:${encodeShellParams(state.route, state.shellParams, state.params)}`);
|
|
348
|
-
}
|
|
349
|
-
else if (isSharedShell && state.isPageRoute) {
|
|
350
|
-
cacheKey = getDeploymentScopedCacheKey(`html:${state.route.filePath}`);
|
|
351
|
-
}
|
|
352
|
-
const cacheWrite = new Response(preludeForCache)
|
|
353
|
-
.text()
|
|
354
|
-
.then((html) => cacheHtml(cacheKey, html, cacheLife, postponedState));
|
|
355
|
-
const resolve = state.resolveShellInFlight;
|
|
356
|
-
if (resolve) {
|
|
357
|
-
state.resolveShellInFlight = null;
|
|
358
|
-
cacheWrite.finally(() => resolve());
|
|
359
|
-
}
|
|
360
|
-
// Await the write only during the build, just so that `handlePageRoute` finishes
|
|
361
|
-
// when the cache has been written.
|
|
362
|
-
if (state.isBuildPrerender)
|
|
363
|
-
await cacheWrite;
|
|
364
|
-
}
|
|
365
|
-
if (state.isBuildPrerender && state.handleOptions?.onBuildPrerenderMeta) {
|
|
366
|
-
state.handleOptions.onBuildPrerenderMeta({
|
|
367
|
-
hasShell: hasServableShell,
|
|
368
|
-
postponedState,
|
|
369
|
-
...(cacheLife && {
|
|
370
|
-
cacheLife: {
|
|
371
|
-
revalidate: cacheLife.revalidate ?? STATIC,
|
|
372
|
-
expire: cacheLife.expire ?? cacheLife.revalidate ?? STATIC,
|
|
373
|
-
},
|
|
374
|
-
}),
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
return { responseStream, isStatic, isPrerenderedResume: false, cacheLife };
|
|
378
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type CacheLookupOutcome } from "./cache-lookup.js";
|
|
2
|
-
import type { RenderRequestState } from "./state.js";
|
|
3
|
-
export declare function renderWithRetries(state: RenderRequestState, cacheContext: CacheLookupOutcome): Promise<Response>;
|
|
4
|
-
//# sourceMappingURL=render-with-retries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-with-retries.d.ts","sourceRoot":"","sources":["../../../src/handlers/rsc/render-with-retries.ts"],"names":[],"mappings":"AAeA,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAS5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASpD,wBAAsB,iBAAiB,CACtC,KAAK,EAAE,kBAAkB,EACzB,YAAY,EAAE,kBAAkB,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAkKnB"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { proxyPatterns } from "virtual:rebask/proxy-router";
|
|
2
|
-
import { ResumeMode } from "../../lib/ppr/types.js";
|
|
3
|
-
import { prerenderPaths } from "../../lib/prerender-paths.js";
|
|
4
|
-
import {} from "../../lib/render-context.js";
|
|
5
|
-
import { renderPageSegment, renderRouteSegments } from "../../lib/route-renderer.js";
|
|
6
|
-
import { discardRscCacheWrite, renderRsc, runRscRequest } from "../../lib/rsc-request.js";
|
|
7
|
-
import { ActionErrorCode } from "../../lib/types.js";
|
|
8
|
-
import { getBoundaryError, markNotFound, markNotFoundThrown, OutgoingResponseHeaders, setBoundaryError, } from "../../request-context.js";
|
|
9
|
-
import { CacheLookupKind } from "./cache-lookup.js";
|
|
10
|
-
import { FallbackRouteError, onNotFound, RetryWithBoundaryError, RetryWithNotFoundBoundaryError, } from "./errors.js";
|
|
11
|
-
import { handlePageRoute } from "./index.js";
|
|
12
|
-
import { renderToResponse } from "./render-to-response.js";
|
|
13
|
-
export async function renderWithRetries(state, cacheContext) {
|
|
14
|
-
const { returnValue, formState, temporaryReferences, actionError, actionThrownError } = state.postBody;
|
|
15
|
-
const match = { route: state.route, params: state.params };
|
|
16
|
-
const shouldRenderRscSegment = state.isRscRequest && !state.isActionRscRequest;
|
|
17
|
-
// We're in PPR mode if we should prerender, this is not a resume request, we don't have a
|
|
18
|
-
// cached HTML entry already, and the route hasn't been flagged as having no shell
|
|
19
|
-
// (except at build time).
|
|
20
|
-
const isPpr = state.shouldPrerender &&
|
|
21
|
-
!state.isResumeRequest &&
|
|
22
|
-
cacheContext.kind !== CacheLookupKind.PprHit &&
|
|
23
|
-
(!state.isNoShellRoute || state.isBuildPrerender);
|
|
24
|
-
// Resuming a cached shell serves HTML that was rendered earlier, so this render must not
|
|
25
|
-
// regenerate the cached data that HTML already contains.
|
|
26
|
-
const isGeneratingCacheEntry = state.isStaticGen && cacheContext.kind !== CacheLookupKind.PprHit;
|
|
27
|
-
let attempt = {};
|
|
28
|
-
let response;
|
|
29
|
-
while (true) {
|
|
30
|
-
const abortOnDynamic = isPpr && attempt.activeErrorIndex === undefined;
|
|
31
|
-
const renderContext = {
|
|
32
|
-
errorBoundary: {
|
|
33
|
-
activeIndex: attempt.activeErrorIndex,
|
|
34
|
-
},
|
|
35
|
-
notFoundBoundary: {
|
|
36
|
-
activeIndex: attempt.activeNotFoundIndex,
|
|
37
|
-
},
|
|
38
|
-
...(isPpr && {
|
|
39
|
-
ppr: {
|
|
40
|
-
controller: new AbortController(),
|
|
41
|
-
abortOnDynamic,
|
|
42
|
-
// This render fills a cache rather than streaming to a user, so it waits for a hanging
|
|
43
|
-
// dynamic read instead of aborting as soon as the shell is ready.
|
|
44
|
-
isCachePrerender: state.isBuildPrerender || state.isPrerenderUpgrade,
|
|
45
|
-
resolvedParams: state.resolvedParams,
|
|
46
|
-
paramNames: state.fullParamsSet,
|
|
47
|
-
pendingShellWork: new Set(),
|
|
48
|
-
usedUnresolvedParams: new Set(),
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
};
|
|
52
|
-
try {
|
|
53
|
-
response = await runRscRequest({
|
|
54
|
-
input: {
|
|
55
|
-
request: state.request,
|
|
56
|
-
params: match.params,
|
|
57
|
-
isStaticGeneration: isGeneratingCacheEntry,
|
|
58
|
-
resumeData: state.resumeState?.type === ResumeMode.HTML
|
|
59
|
-
? state.resumeState.resumeData
|
|
60
|
-
: undefined,
|
|
61
|
-
},
|
|
62
|
-
response: { headers: new OutgoingResponseHeaders() },
|
|
63
|
-
}, renderContext, async () => {
|
|
64
|
-
if (attempt.boundaryError)
|
|
65
|
-
setBoundaryError(attempt.boundaryError);
|
|
66
|
-
if (attempt.notFound)
|
|
67
|
-
markNotFound();
|
|
68
|
-
if (!state.isBuildPrerender &&
|
|
69
|
-
state.isDynamicRoute &&
|
|
70
|
-
state.isPageRoute &&
|
|
71
|
-
(await prerenderPaths.isStaticPathMiss(state.route.filePath, state.url.pathname))) {
|
|
72
|
-
markNotFoundThrown();
|
|
73
|
-
}
|
|
74
|
-
// No-JS native forms cannot consume RSC streams, so they recurse to render the full HTML
|
|
75
|
-
// page. We bridge the action's 404 state here to ensure the subsequent page render knows
|
|
76
|
-
// to activate the not-found boundaries.
|
|
77
|
-
if (actionError === ActionErrorCode.NotFound && !state.isRscRequest) {
|
|
78
|
-
markNotFound();
|
|
79
|
-
}
|
|
80
|
-
// Build seedData inside the request scope so `renderPage` can read `isNotFound()`.
|
|
81
|
-
// For non-PPR routes this only needs to run once, but rebuilding is cheap because
|
|
82
|
-
// module loaders are cached.
|
|
83
|
-
state.seedData = shouldRenderRscSegment
|
|
84
|
-
? await renderPageSegment(match, attempt.boundaryError)
|
|
85
|
-
: state.isRscRequest
|
|
86
|
-
? undefined
|
|
87
|
-
: await renderRouteSegments(match, state.routeTree,
|
|
88
|
-
// Native no-JS form submissions execute the action before the main render starts.
|
|
89
|
-
// Re-inject unexpected action errors to activate the nearest error boundary
|
|
90
|
-
!attempt.boundaryError ? actionThrownError : undefined);
|
|
91
|
-
const boundaryError = getBoundaryError();
|
|
92
|
-
let payload;
|
|
93
|
-
if (state.isActionRscRequest) {
|
|
94
|
-
if (returnValue !== undefined) {
|
|
95
|
-
payload = { returnValue };
|
|
96
|
-
}
|
|
97
|
-
else if (formState !== undefined) {
|
|
98
|
-
payload = { formState };
|
|
99
|
-
}
|
|
100
|
-
else if (actionError !== undefined) {
|
|
101
|
-
payload = { actionError };
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
throw new Error("Expected an action result, form state, or action error for action RSC response.");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
if (!state.seedData) {
|
|
109
|
-
throw new Error("Expected route seed data for route RSC response.");
|
|
110
|
-
}
|
|
111
|
-
payload = {
|
|
112
|
-
seedData: state.seedData,
|
|
113
|
-
routeTree: state.routeTree,
|
|
114
|
-
...(state.routePrediction && { routePrediction: state.routePrediction }),
|
|
115
|
-
...(proxyPatterns && { proxyPatterns }),
|
|
116
|
-
...(formState !== undefined && { formState }),
|
|
117
|
-
...(boundaryError && { error: boundaryError }),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
const pprSignal = renderContext.ppr?.controller.signal;
|
|
121
|
-
// Renders that only fill a cache skip the resume phase, so pass them the PPR abort
|
|
122
|
-
// signal to stop the RSC stream hanging on data that will never arrive. A render that
|
|
123
|
-
// serves a user must not get it, because its RSC stream feeds the resume.
|
|
124
|
-
const rscOptions = state.isBuildPrerender || state.isPrerenderUpgrade
|
|
125
|
-
? { temporaryReferences, ...(pprSignal && { signal: pprSignal }) }
|
|
126
|
-
: { temporaryReferences };
|
|
127
|
-
const stream = state.isActionRscRequest
|
|
128
|
-
? renderRsc(payload, rscOptions)
|
|
129
|
-
: renderRsc(payload, rscOptions, onNotFound);
|
|
130
|
-
return await renderToResponse(state, cacheContext, stream);
|
|
131
|
-
});
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
if (error instanceof RetryWithBoundaryError) {
|
|
136
|
-
attempt.activeErrorIndex = error.boundaryIndex;
|
|
137
|
-
attempt.boundaryError = error.originalError;
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (error instanceof RetryWithNotFoundBoundaryError) {
|
|
141
|
-
attempt.activeNotFoundIndex = error.boundaryIndex;
|
|
142
|
-
attempt.notFound = true;
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
if (state.rscCacheWrite)
|
|
146
|
-
discardRscCacheWrite(state.rscCacheWrite);
|
|
147
|
-
if (error instanceof FallbackRouteError) {
|
|
148
|
-
return handlePageRoute(state.request, error.fallbackRoute, state.params, state.handleOptions);
|
|
149
|
-
}
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return response;
|
|
154
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retry-loop.d.ts","sourceRoot":"","sources":["../../../src/handlers/rsc/retry-loop.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAgB,MAAM,YAAY,CAAA;AAEtF,wBAAsB,iBAAiB,CACtC,KAAK,EAAE,kBAAkB,EACzB,YAAY,EAAE,kBAAkB,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAyJnB"}
|