veryfront 0.1.1136 → 0.1.1142
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/esm/deno.js +1 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.js +3 -0
- package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/renderer.js +23 -0
- package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +23 -0
- package/esm/src/html/hydration-script-builder/types.d.ts +2 -0
- package/esm/src/html/hydration-script-builder/types.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.d.ts +4 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +2 -0
- package/esm/src/rendering/app-reserved.d.ts +10 -1
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +13 -3
- package/esm/src/rendering/orchestrator/html.d.ts +15 -0
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +66 -1
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +16 -0
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +9 -0
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.js +96 -8
- package/esm/src/rendering/orchestrator/ssr.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr.js +1 -0
- package/esm/src/rendering/orchestrator/types.d.ts +4 -0
- package/esm/src/rendering/orchestrator/types.d.ts.map +1 -1
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +1 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts +1 -1
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +13 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration-data-generator.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/hydration-data-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAyCzD,KAAK,gBAAgB,GAAG,qBAAqB,GAAG;IAC9C,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EACzC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,gBAAgB,EACzB,gBAAgB,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,MAAM,
|
|
1
|
+
{"version":3,"file":"hydration-data-generator.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/hydration-data-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAyCzD,KAAK,gBAAgB,GAAG,qBAAqB,GAAG;IAC9C,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EACzC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,gBAAgB,EACzB,gBAAgB,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,MAAM,CA0DR"}
|
|
@@ -49,6 +49,9 @@ export function generateHydrationData(slug, params, props, options, serializeOpt
|
|
|
49
49
|
appPath: options.appPath
|
|
50
50
|
? toProjectRelativePath(options.appPath, options.projectDir) || undefined
|
|
51
51
|
: undefined,
|
|
52
|
+
errorPath: options.errorPath
|
|
53
|
+
? toProjectRelativePath(options.errorPath, options.projectDir) || undefined
|
|
54
|
+
: undefined,
|
|
52
55
|
appRouterRoot: toProjectRelativePath(options.config?.directories?.app ?? "app", options.projectDir).replace(/^\/+|\/+$/g, ""),
|
|
53
56
|
isolatedClientPage: options.isolatedClientPage,
|
|
54
57
|
pagePath: options.pagePath
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/renderer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/renderer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,cA4U7B,CAAC"}
|
|
@@ -224,6 +224,29 @@ export const getRendererScript = () => `
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
// App-router error.tsx boundary. Wraps the page (inside the providers,
|
|
228
|
+
// matching the server wrap) so a throw during render/hydration is caught
|
|
229
|
+
// on the client and error.tsx renders — with a working reset().
|
|
230
|
+
if (data.errorPath) {
|
|
231
|
+
const ErrorComponent = await loadHydrationComponent(data.errorPath, shouldRenderRscClientPage);
|
|
232
|
+
if (ErrorComponent) {
|
|
233
|
+
class AppRouterErrorBoundary extends React.Component {
|
|
234
|
+
constructor(props) { super(props); this.state = { hasError: false, error: null }; }
|
|
235
|
+
static getDerivedStateFromError(error) { return { hasError: true, error: error }; }
|
|
236
|
+
render() {
|
|
237
|
+
if (this.state.hasError) {
|
|
238
|
+
return React.createElement(ErrorComponent, {
|
|
239
|
+
error: this.state.error,
|
|
240
|
+
reset: () => this.setState({ hasError: false, error: null }),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return this.props.children;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
tree = React.createElement(AppRouterErrorBoundary, null, tree);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
227
250
|
const headings = data.headings || [];
|
|
228
251
|
const pageContext = {
|
|
229
252
|
slug: data.slug || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAswC3B,CAAC"}
|
|
@@ -737,6 +737,8 @@ export const getRouterScript = () => `
|
|
|
737
737
|
perfEnd('render:loadAll');
|
|
738
738
|
|
|
739
739
|
const [PageComponent, ...rest] = components;
|
|
740
|
+
// errorPath is pushed last in getPageDataModulePaths, so pop it first.
|
|
741
|
+
const ErrorComponent = pageData.errorPath ? rest.pop() : null;
|
|
740
742
|
const AppComponent = pageData.appPath ? rest.pop() : null;
|
|
741
743
|
const LayoutComponents = rest;
|
|
742
744
|
|
|
@@ -801,6 +803,26 @@ export const getRouterScript = () => `
|
|
|
801
803
|
log('Wrapped with App component for SPA navigation');
|
|
802
804
|
}
|
|
803
805
|
|
|
806
|
+
// App-router error.tsx boundary — wraps the page so a throw during a
|
|
807
|
+
// client-side navigation render is caught and error.tsx renders (matching
|
|
808
|
+
// the server + initial-hydration boundary), with a working reset().
|
|
809
|
+
if (ErrorComponent) {
|
|
810
|
+
class AppRouterErrorBoundary extends React.Component {
|
|
811
|
+
constructor(props) { super(props); this.state = { hasError: false, error: null }; }
|
|
812
|
+
static getDerivedStateFromError(error) { return { hasError: true, error: error }; }
|
|
813
|
+
render() {
|
|
814
|
+
if (this.state.hasError) {
|
|
815
|
+
return React.createElement(ErrorComponent, {
|
|
816
|
+
error: this.state.error,
|
|
817
|
+
reset: () => this.setState({ hasError: false, error: null }),
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
return this.props.children;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
tree = React.createElement(AppRouterErrorBoundary, null, tree);
|
|
824
|
+
}
|
|
825
|
+
|
|
804
826
|
const headingsArray = pageData.headings || [];
|
|
805
827
|
const pageContext = {
|
|
806
828
|
slug: pageData.slug || '',
|
|
@@ -876,6 +898,7 @@ export const getRouterScript = () => `
|
|
|
876
898
|
const allPaths = [pageData.pagePath, ...layoutPaths].filter(Boolean);
|
|
877
899
|
|
|
878
900
|
if (pageData.appPath) allPaths.push(pageData.appPath);
|
|
901
|
+
if (pageData.errorPath) allPaths.push(pageData.errorPath);
|
|
879
902
|
|
|
880
903
|
return allPaths;
|
|
881
904
|
}
|
|
@@ -9,6 +9,8 @@ export interface HydrationDataStructure {
|
|
|
9
9
|
params: Record<string, string | string[]>;
|
|
10
10
|
layouts: HydrationLayout[];
|
|
11
11
|
appPath?: string;
|
|
12
|
+
/** Project-relative path to the app-router error.tsx that wraps the page (client boundary). */
|
|
13
|
+
errorPath?: string;
|
|
12
14
|
/** Project-relative directory that contains App Router routes. */
|
|
13
15
|
appRouterRoot?: string;
|
|
14
16
|
/** The page and advertised client layouts mount inside a server-owned layout island. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","source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,OAAO,CAAC,CAAC,CAAC;IACtD;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -13,6 +13,7 @@ export declare const getHTMLGenerationOptionsSchema: () => import("../../interna
|
|
|
13
13
|
componentPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
14
14
|
}>[] | undefined>;
|
|
15
15
|
appPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
16
|
+
errorPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
16
17
|
appRouterRoot: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
17
18
|
isolatedClientPage: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
18
19
|
pagePath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
@@ -51,6 +52,7 @@ export declare const getHydrationDataSchema: () => import("../../internal-agents
|
|
|
51
52
|
path: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
52
53
|
}>[]>;
|
|
53
54
|
appPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
55
|
+
errorPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
54
56
|
appRouterRoot: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
55
57
|
isolatedClientPage: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
56
58
|
layoutProps: import("../../internal-agents/schema.js").Schema<Record<string, Record<string, unknown>> | undefined>;
|
|
@@ -73,6 +75,7 @@ export declare const HTMLGenerationOptionsSchema: import("../../internal-agents/
|
|
|
73
75
|
componentPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
74
76
|
}>[] | undefined>;
|
|
75
77
|
appPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
78
|
+
errorPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
76
79
|
appRouterRoot: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
77
80
|
isolatedClientPage: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
78
81
|
pagePath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
@@ -111,6 +114,7 @@ export declare const HydrationDataSchema: import("../../internal-agents/schema.j
|
|
|
111
114
|
path: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
112
115
|
}>[]>;
|
|
113
116
|
appPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
117
|
+
errorPath: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
114
118
|
appRouterRoot: import("../../internal-agents/schema.js").Schema<string | undefined>;
|
|
115
119
|
isolatedClientPage: import("../../internal-agents/schema.js").Schema<boolean | undefined>;
|
|
116
120
|
layoutProps: import("../../internal-agents/schema.js").Schema<Record<string, Record<string, unknown>> | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/html/schemas/html.schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,eAAO,MAAM,oBAAoB,gEAAiD,CAAC;AAEnF,eAAO,MAAM,oBAAoB,gEAAyD,CAAC;AAE3F,eAAO,MAAM,iBAAiB,gEAE7B,CAAC;AACF,eAAO,MAAM,6BAA6B,gEAAoD,CAAC;AAE/F,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"html.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/html/schemas/html.schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,eAAO,MAAM,oBAAoB,gEAAiD,CAAC;AAEnF,eAAO,MAAM,oBAAoB,gEAAyD,CAAC;AAE3F,eAAO,MAAM,iBAAiB,gEAE7B,CAAC;AACF,eAAO,MAAM,6BAA6B,gEAAoD,CAAC;AAE/F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkD1C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;GAmBlC,CAAC;AAGF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,CAAC;AACnG,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC;AAGnF,eAAO,MAAM,iBAAiB,0DAAmC,CAAC;AAClE,eAAO,MAAM,iBAAiB,0DAAmC,CAAC;AAClE,eAAO,MAAM,cAAc,0DAAgC,CAAC;AAC5D,eAAO,MAAM,0BAA0B,0DAA4C,CAAC;AACpF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACtF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;GAAqC,CAAC"}
|
|
@@ -16,6 +16,7 @@ export const getHTMLGenerationOptionsSchema = defineSchema((v) => v.object({
|
|
|
16
16
|
}))
|
|
17
17
|
.optional(),
|
|
18
18
|
appPath: v.string().optional(),
|
|
19
|
+
errorPath: v.string().optional(),
|
|
19
20
|
appRouterRoot: v.string().optional(),
|
|
20
21
|
isolatedClientPage: v.boolean().optional(),
|
|
21
22
|
pagePath: v.string().optional(),
|
|
@@ -56,6 +57,7 @@ export const getHydrationDataSchema = defineSchema((v) => v.object({
|
|
|
56
57
|
path: v.string().optional(),
|
|
57
58
|
})),
|
|
58
59
|
appPath: v.string().optional(),
|
|
60
|
+
errorPath: v.string().optional(),
|
|
59
61
|
appRouterRoot: v.string().optional(),
|
|
60
62
|
isolatedClientPage: v.boolean().optional(),
|
|
61
63
|
layoutProps: v.record(v.string(), v.record(v.string(), v.unknown())).optional(),
|
|
@@ -21,6 +21,15 @@ type ReactLike = {
|
|
|
21
21
|
createElement: typeof BundledReact.createElement;
|
|
22
22
|
};
|
|
23
23
|
export declare function createErrorBoundary(ErrorComponent: ReservedComponent, ReactLib?: ReactLike): typeof BundledReact.Component<ErrorBoundaryProps, ErrorBoundaryState>;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Like {@link tryLoadReservedInDirs}, but also returns the absolute source path
|
|
26
|
+
* of the file that was loaded — the client hydration bundle needs the path (in
|
|
27
|
+
* the same absolute form as `appPath`) to load the same component in the browser.
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadReservedWithPath(dirs: string[], which: keyof typeof RESERVED_COMPONENTS, projectDir: string, _mode: "development" | "production", adapter: RuntimeAdapter, projectId?: string, contentSourceId?: string, reactVersion?: string): Promise<{
|
|
30
|
+
component: ReservedComponent;
|
|
31
|
+
filePath: string;
|
|
32
|
+
} | null>;
|
|
33
|
+
export declare function tryLoadReservedInDirs(dirs: string[], which: keyof typeof RESERVED_COMPONENTS, projectDir: string, mode: "development" | "production", adapter: RuntimeAdapter, projectId?: string, contentSourceId?: string, reactVersion?: string): Promise<ReservedComponent | null>;
|
|
25
34
|
export {};
|
|
26
35
|
//# sourceMappingURL=app-reserved.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-reserved.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/app-reserved.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,KAAK,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAE3F,eAAO,MAAM,mB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AY,CAAC,aAAa,CAAC;CAClD,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,iBAAiB,EACjC,QAAQ,GAAE,SAAwB,GACjC,OAAO,YAAY,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAyBvE;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,OAAO,mBAAmB,EACvC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,GAAG,YAAY,EACnC,OAAO,EAAE,cAAc,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,SAAS,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA4BpE;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,OAAO,mBAAmB,EACvC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,aAAa,GAAG,YAAY,EAClC,OAAO,EAAE,cAAc,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAYnC"}
|
|
@@ -42,7 +42,12 @@ export function createErrorBoundary(ErrorComponent, ReactLib = BundledReact) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Like {@link tryLoadReservedInDirs}, but also returns the absolute source path
|
|
47
|
+
* of the file that was loaded — the client hydration bundle needs the path (in
|
|
48
|
+
* the same absolute form as `appPath`) to load the same component in the browser.
|
|
49
|
+
*/
|
|
50
|
+
export async function loadReservedWithPath(dirs, which, projectDir, _mode, adapter, projectId, contentSourceId, reactVersion) {
|
|
46
51
|
const join = (a, b) => `${a.replace(/\/$/, "")}/${b.replace(/^\//, "")}`;
|
|
47
52
|
const candidateName = RESERVED_COMPONENTS[which];
|
|
48
53
|
const { loadComponentFromSource } = await import("../modules/react-loader/component-loader.js");
|
|
@@ -57,8 +62,9 @@ export async function tryLoadReservedInDirs(dirs, which, projectDir, _mode, adap
|
|
|
57
62
|
contentSourceId,
|
|
58
63
|
reactVersion,
|
|
59
64
|
});
|
|
60
|
-
if (typeof Cmp === "function")
|
|
61
|
-
return Cmp;
|
|
65
|
+
if (typeof Cmp === "function") {
|
|
66
|
+
return { component: Cmp, filePath: file };
|
|
67
|
+
}
|
|
62
68
|
}
|
|
63
69
|
catch (_) {
|
|
64
70
|
/* expected: component not found in this path, continue to next */
|
|
@@ -67,3 +73,7 @@ export async function tryLoadReservedInDirs(dirs, which, projectDir, _mode, adap
|
|
|
67
73
|
}
|
|
68
74
|
return null;
|
|
69
75
|
}
|
|
76
|
+
export async function tryLoadReservedInDirs(dirs, which, projectDir, mode, adapter, projectId, contentSourceId, reactVersion) {
|
|
77
|
+
const loaded = await loadReservedWithPath(dirs, which, projectDir, mode, adapter, projectId, contentSourceId, reactVersion);
|
|
78
|
+
return loaded?.component ?? null;
|
|
79
|
+
}
|
|
@@ -11,6 +11,21 @@ export declare class HTMLGenerator {
|
|
|
11
11
|
private wrapHTMLFragment;
|
|
12
12
|
private generateShellParts;
|
|
13
13
|
private resolveAppPath;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve + load the nearest app-router `error.tsx` for the route's segment and
|
|
16
|
+
* build a ready-to-render element with the caught error. Returns the element
|
|
17
|
+
* (for the SSR error render) and the boundary's absolute source path (embedded
|
|
18
|
+
* as `errorPath` so the client hydration bundle wraps the same boundary and it
|
|
19
|
+
* hydrates). Null when the project has no matching `error.tsx`.
|
|
20
|
+
*/
|
|
21
|
+
resolveErrorComponent(context: HTMLGenerationContext, error: Error): Promise<{
|
|
22
|
+
element: unknown;
|
|
23
|
+
path: string;
|
|
24
|
+
} | null>;
|
|
25
|
+
resolveErrorComponentPath(context: HTMLGenerationContext): Promise<{
|
|
26
|
+
component: unknown;
|
|
27
|
+
path: string;
|
|
28
|
+
} | null>;
|
|
14
29
|
private loadProjectFile;
|
|
15
30
|
private buildHTMLOptions;
|
|
16
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAmIlF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,EAAE,mBAAmB;IAIjC,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBjE,kBAAkB,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,cAAc,CAAC;YAkEZ,sBAAsB;YA6DtB,4BAA4B;YAiB5B,wBAAwB;YAmBxB,gBAAgB;YAyBhB,kBAAkB;IAwDhC,OAAO,CAAC,cAAc;IAQtB;;;;;;OAMG;IACG,qBAAqB,CACzB,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAwB/C,yBAAyB,CAC7B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;YAqDzC,eAAe;YAkBf,gBAAgB;IA+G9B;;;;OAIG;YACW,gBAAgB;CAc/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join } from "../../platform/compat/path/index.js";
|
|
1
|
+
import { dirname, join } from "../../platform/compat/path/index.js";
|
|
2
2
|
import { getExtensionName } from "../../utils/path-utils.js";
|
|
3
3
|
import { buildImportMapJson, extractHTMLMetadata, generateHTMLShellParts, injectHTMLContent, isFullHTMLDocument, } from "../../html/index.js";
|
|
4
4
|
import { buildNonceAttribute } from "../../html/html-escape.js";
|
|
@@ -10,6 +10,7 @@ import { extractRelativePath } from "../../utils/route-path-utils.js";
|
|
|
10
10
|
import { hasUseClientDirective } from "../rsc/page-island.js";
|
|
11
11
|
import { getReadyManifestForRenderAsync } from "../../release-assets/manifest-cache.js";
|
|
12
12
|
import { resolveAppComponentPath } from "../layouts/utils/app-resolver.js";
|
|
13
|
+
import { resolveProjectReactVersion } from "../../transforms/esm/package-registry.js";
|
|
13
14
|
import { StreamTimeoutError, streamToString } from "../utils/stream-utils.js";
|
|
14
15
|
import { profilePhase, profileSyncPhase } from "../../observability/index.js";
|
|
15
16
|
import { extractProjectClassesForRoute, startPreparedCSSWarmup, startProjectCSSPreparation, } from "./html-project-css.js";
|
|
@@ -285,6 +286,67 @@ export class HTMLGenerator {
|
|
|
285
286
|
resolveAppPath() {
|
|
286
287
|
return resolveAppComponentPath(this.config.projectDir, this.config.adapter, this.config.config);
|
|
287
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Resolve + load the nearest app-router `error.tsx` for the route's segment and
|
|
291
|
+
* build a ready-to-render element with the caught error. Returns the element
|
|
292
|
+
* (for the SSR error render) and the boundary's absolute source path (embedded
|
|
293
|
+
* as `errorPath` so the client hydration bundle wraps the same boundary and it
|
|
294
|
+
* hydrates). Null when the project has no matching `error.tsx`.
|
|
295
|
+
*/
|
|
296
|
+
async resolveErrorComponent(context, error) {
|
|
297
|
+
const loaded = await this.resolveErrorComponentPath(context);
|
|
298
|
+
if (!loaded)
|
|
299
|
+
return null;
|
|
300
|
+
try {
|
|
301
|
+
const reactVersion = await resolveProjectReactVersion({
|
|
302
|
+
projectDir: this.config.projectDir,
|
|
303
|
+
config: this.config.config,
|
|
304
|
+
});
|
|
305
|
+
const { getProjectReact } = await import("../../react/compat/ssr-adapter/index.js");
|
|
306
|
+
const React = await getProjectReact(reactVersion);
|
|
307
|
+
const createElement = React.createElement;
|
|
308
|
+
const element = createElement(loaded.component, { error, reset: () => { } });
|
|
309
|
+
return { element, path: loaded.path };
|
|
310
|
+
}
|
|
311
|
+
catch (_) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
async resolveErrorComponentPath(context) {
|
|
316
|
+
try {
|
|
317
|
+
const appRoot = join(this.config.projectDir, this.config.config?.directories?.app ?? "app");
|
|
318
|
+
try {
|
|
319
|
+
const st = await this.config.adapter.fs.stat(appRoot);
|
|
320
|
+
if (!st.isDirectory)
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
catch (_) {
|
|
324
|
+
return null; // no app directory
|
|
325
|
+
}
|
|
326
|
+
const { collectAncestorDirs, loadReservedWithPath } = await import("../app-reserved.js");
|
|
327
|
+
const matchedPath = context.pageInfo?.entity?.path;
|
|
328
|
+
const absolutePagePath = matchedPath
|
|
329
|
+
? matchedPath.startsWith(this.config.projectDir)
|
|
330
|
+
? matchedPath
|
|
331
|
+
: join(this.config.projectDir, matchedPath)
|
|
332
|
+
: appRoot;
|
|
333
|
+
const segmentDir = matchedPath ? dirname(absolutePagePath) : appRoot;
|
|
334
|
+
const dirs = await collectAncestorDirs(segmentDir, appRoot);
|
|
335
|
+
const reactVersion = await resolveProjectReactVersion({
|
|
336
|
+
projectDir: this.config.projectDir,
|
|
337
|
+
config: this.config.config,
|
|
338
|
+
});
|
|
339
|
+
const { computeContentSourceId } = await import("../../cache/keys.js");
|
|
340
|
+
const contentSourceId = computeContentSourceId(this.config.isLocalProject === true, context.options?.environment ?? "preview", null, context.options?.releaseId);
|
|
341
|
+
const loaded = await loadReservedWithPath(dirs, "error", this.config.projectDir, this.config.mode, this.config.adapter, context.options?.projectId, contentSourceId, reactVersion);
|
|
342
|
+
if (!loaded)
|
|
343
|
+
return null;
|
|
344
|
+
return { component: loaded.component, path: loaded.filePath };
|
|
345
|
+
}
|
|
346
|
+
catch (_) {
|
|
347
|
+
return null; // error.tsx resolution is best-effort
|
|
348
|
+
}
|
|
349
|
+
}
|
|
288
350
|
async loadProjectFile(filename) {
|
|
289
351
|
try {
|
|
290
352
|
const filePath = join(this.config.projectDir, filename);
|
|
@@ -342,6 +404,9 @@ export class HTMLGenerator {
|
|
|
342
404
|
componentPath: l.componentPath,
|
|
343
405
|
})),
|
|
344
406
|
appPath: context.options?.clientPageIsland ? undefined : appComponentPath,
|
|
407
|
+
// Set on the SSR error path so the client hydration bundle wraps the page
|
|
408
|
+
// in the same app-router error boundary that rendered error.tsx on the server.
|
|
409
|
+
errorPath: context.options?.errorPath,
|
|
345
410
|
isolatedClientPage: context.options?.clientPageIsland ? true : undefined,
|
|
346
411
|
layoutProps: hydrationLayoutProps,
|
|
347
412
|
pagePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AASzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,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KxB,OAAO,CAAC,UAAU;YAOJ,0BAA0B;IAaxC;;;;;;;;;OASG;YACW,qBAAqB;IAiFnC;;;OAGG;YACW,mBAAmB;IAqHjC,OAAO,CAAC,uBAAuB;IAkCzB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAuU9E,+EAA+E;IACzE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAwIzE,kBAAkB;YA2ClB,cAAc;IAW5B,OAAO,CAAC,uBAAuB;YAYjB,kBAAkB;IA6FhC,OAAO,CAAC,kBAAkB;YAQZ,uBAAuB;IAmBrC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -440,6 +440,7 @@ export class RenderPipeline {
|
|
|
440
440
|
collectedMetadata: pageBundleResult.collectedMetadata,
|
|
441
441
|
slug,
|
|
442
442
|
cssImports: collectedCSSImports,
|
|
443
|
+
options: renderOptions,
|
|
443
444
|
}, renderOptions), SSR_RENDER_TIMEOUT_MS, `SSR rendering for ${slug}`), { "render.slug": slug, "render.delivery": mergedOptions?.delivery || "full" }));
|
|
444
445
|
timing.ssr = Math.round(performance.now() - ssrStart);
|
|
445
446
|
if (collectedCSSImports.length > 0) {
|
|
@@ -534,6 +535,19 @@ export class RenderPipeline {
|
|
|
534
535
|
const appPath = pageIslandPlan
|
|
535
536
|
? undefined
|
|
536
537
|
: await profilePhase("page_data.resolve_app_path", () => this.resolveAppPath());
|
|
538
|
+
const errorPath = await profilePhase("page_data.resolve_error_path", async () => {
|
|
539
|
+
const resolved = await this.config.ssrOrchestrator.resolveErrorComponentPath({
|
|
540
|
+
pageInfo,
|
|
541
|
+
pageBundle: {},
|
|
542
|
+
layoutBundle: layoutResult.layoutBundle,
|
|
543
|
+
nestedLayouts: layoutResult.nestedLayouts,
|
|
544
|
+
collectedMetadata: {},
|
|
545
|
+
slug,
|
|
546
|
+
cssImports: [],
|
|
547
|
+
options,
|
|
548
|
+
});
|
|
549
|
+
return resolved ? extractRelativePathShared(resolved, this.config.projectDir) : undefined;
|
|
550
|
+
});
|
|
537
551
|
const { css, cssAction, cssError } = await profilePhase("page_data.resolve_css", () => this.resolvePageDataCss(slug, options, projectUpdatedAt, dataResolution));
|
|
538
552
|
resolvePageDataLog.debug("Resolved page data", {
|
|
539
553
|
slug,
|
|
@@ -541,6 +555,7 @@ export class RenderPipeline {
|
|
|
541
555
|
pageType,
|
|
542
556
|
layoutCount: layouts.length,
|
|
543
557
|
appPath,
|
|
558
|
+
errorPath,
|
|
544
559
|
isolatedClientPage: pageIslandPlan ? true : undefined,
|
|
545
560
|
requiresFullDocumentNavigation: pageIslandPlan?.serverLayouts.length ? true : undefined,
|
|
546
561
|
headingsCount: headings.length,
|
|
@@ -560,6 +575,7 @@ export class RenderPipeline {
|
|
|
560
575
|
layoutProps,
|
|
561
576
|
buildVersion: createBuildVersion(projectUpdatedAt),
|
|
562
577
|
appPath,
|
|
578
|
+
errorPath,
|
|
563
579
|
isolatedClientPage: pageIslandPlan ? true : undefined,
|
|
564
580
|
requiresFullDocumentNavigation: pageIslandPlan?.serverLayouts.length ? true : undefined,
|
|
565
581
|
releaseId: options?.releaseId,
|
|
@@ -2,6 +2,7 @@ import type * as React from "react";
|
|
|
2
2
|
import type { ElementValidator } from "../element-validator/index.js";
|
|
3
3
|
import type { SSRRenderer } from "../ssr-renderer.js";
|
|
4
4
|
import type { HTMLGenerationContext, HTMLGenerator } from "./html.js";
|
|
5
|
+
import type { LayoutOrchestrator } from "./layout.js";
|
|
5
6
|
import type { RenderOptions } from "./types.js";
|
|
6
7
|
export interface SSROrchestratorConfig {
|
|
7
8
|
mode: "development" | "production";
|
|
@@ -9,6 +10,7 @@ export interface SSROrchestratorConfig {
|
|
|
9
10
|
elementValidator: ElementValidator;
|
|
10
11
|
ssrRenderer: SSRRenderer;
|
|
11
12
|
htmlGenerator: HTMLGenerator;
|
|
13
|
+
layoutOrchestrator?: Pick<LayoutOrchestrator, "applyLayoutsAndWrappers">;
|
|
12
14
|
}
|
|
13
15
|
export interface SSRRenderingResult {
|
|
14
16
|
fullHtml: string;
|
|
@@ -35,7 +37,14 @@ export interface SSRIsolationOptions {
|
|
|
35
37
|
export declare class SSROrchestrator {
|
|
36
38
|
private config;
|
|
37
39
|
constructor(config: SSROrchestratorConfig);
|
|
40
|
+
resolveErrorComponentPath(generationContext: Omit<HTMLGenerationContext, "html" | "ssrHash">): Promise<string | null>;
|
|
38
41
|
performSSRRendering(pageElement: React.ReactElement, generationContext: Omit<HTMLGenerationContext, "html" | "ssrHash">, options?: RenderOptions, isolationOptions?: SSRIsolationOptions): Promise<SSRRenderingResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Render the segment's app-router error.tsx as the page body for a caught SSR
|
|
44
|
+
* render throw. Returns the rendered result + the boundary's source path (for
|
|
45
|
+
* the client hydration bundle), or null when the segment has no error.tsx.
|
|
46
|
+
*/
|
|
47
|
+
private renderErrorBoundaryFallback;
|
|
39
48
|
/**
|
|
40
49
|
* Perform SSR rendering in an isolated per-project Worker.
|
|
41
50
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/ssr-orchestrator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr-orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/src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AInC,yBAAyB,CAC7B,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC,GACjE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAOnB,mBAAmB,CACvB,WAAW,EAAE,KAAK,CAAC,YAAY,EAC/B,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC,EAClE,OAAO,CAAC,EAAE,aAAa,EACvB,gBAAgB,CAAC,EAAE,mBAAmB,GACrC,OAAO,CAAC,kBAAkB,CAAC;IA4I9B;;;;OAIG;YACW,2BAA2B;IAqDzC;;;;;;OAMG;YACW,kBAAkB;IAmFhC,OAAO,CAAC,YAAY;CAerB"}
|
|
@@ -8,7 +8,26 @@ import { runWithHeadCollector } from "../../react/head-collector.js";
|
|
|
8
8
|
import { getWorkerPool, isSSRIsolationEnabled } from "../../security/sandbox/worker-pool.js";
|
|
9
9
|
import { requireActiveSourceIntegrationPolicy } from "../../integrations/source-policy-context.js";
|
|
10
10
|
import { endRenderSession, hasRenderSession, } from "../../transforms/mdx/esm-module-loader/module-fetcher/index.js";
|
|
11
|
+
import { isDataControlResult } from "../../data/helpers.js";
|
|
11
12
|
const logger = rendererLogger.component("ssr-orchestrator");
|
|
13
|
+
/** True when the thrown value is (or wraps) a notFound()/redirect() control result. */
|
|
14
|
+
function isThrownControlResult(error) {
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
const stack = [error];
|
|
17
|
+
while (stack.length > 0) {
|
|
18
|
+
const current = stack.pop();
|
|
19
|
+
if (!current || typeof current !== "object" || seen.has(current))
|
|
20
|
+
continue;
|
|
21
|
+
if (isDataControlResult(current))
|
|
22
|
+
return true;
|
|
23
|
+
seen.add(current);
|
|
24
|
+
stack.push(current.cause);
|
|
25
|
+
const aggregated = current.errors;
|
|
26
|
+
if (Array.isArray(aggregated))
|
|
27
|
+
stack.push(...aggregated);
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
12
31
|
function getElementTypeName(el) {
|
|
13
32
|
if (!el?.type)
|
|
14
33
|
return "unknown";
|
|
@@ -22,11 +41,18 @@ export class SSROrchestrator {
|
|
|
22
41
|
constructor(config) {
|
|
23
42
|
this.config = config;
|
|
24
43
|
}
|
|
44
|
+
async resolveErrorComponentPath(generationContext) {
|
|
45
|
+
const resolved = await this.config.htmlGenerator.resolveErrorComponentPath({ ...generationContext, html: "", ssrHash: "" });
|
|
46
|
+
return resolved?.path ?? null;
|
|
47
|
+
}
|
|
25
48
|
async performSSRRendering(pageElement, generationContext, options, isolationOptions) {
|
|
26
49
|
// Isolated SSR path: render in per-project Worker
|
|
27
50
|
if (isSSRIsolationEnabled() &&
|
|
28
51
|
isolationOptions?.pageModulePath &&
|
|
29
52
|
isolationOptions?.projectDir) {
|
|
53
|
+
// NOTE: the app-router error.tsx catch below is scoped to the main-process
|
|
54
|
+
// render path. Under SSR isolation (per-project Worker) a page throw is not
|
|
55
|
+
// yet routed to error.tsx — a follow-up, isolation being off by default.
|
|
30
56
|
return this.performIsolatedSSR(generationContext, options, isolationOptions);
|
|
31
57
|
}
|
|
32
58
|
// Default path: render in main process
|
|
@@ -40,14 +66,36 @@ export class SSROrchestrator {
|
|
|
40
66
|
});
|
|
41
67
|
const wantsStream = options?.delivery === "stream";
|
|
42
68
|
// Use AsyncLocalStorage-based head collection for multi-tenant safety
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
let renderResult;
|
|
70
|
+
let collectedHead;
|
|
71
|
+
let errorBoundaryPath;
|
|
72
|
+
try {
|
|
73
|
+
const rendered = await runWithHeadCollector(() => withSpan(SpanNames.SSR_ORCHESTRATOR_RENDER, () => this.config.ssrRenderer.renderToHTML(validatedElement, {
|
|
74
|
+
mode: this.config.mode,
|
|
75
|
+
wantsStream,
|
|
76
|
+
debugMode: this.config.debugMode,
|
|
77
|
+
}), {
|
|
78
|
+
"ssr.wants_stream": wantsStream,
|
|
79
|
+
"ssr.mode": this.config.mode,
|
|
80
|
+
}));
|
|
81
|
+
renderResult = rendered.result;
|
|
82
|
+
collectedHead = rendered.head;
|
|
83
|
+
}
|
|
84
|
+
catch (renderError) {
|
|
85
|
+
// A thrown notFound()/redirect() control result is NOT a render error —
|
|
86
|
+
// let it propagate to the SSR error handler (→ 404 / redirect).
|
|
87
|
+
if (isThrownControlResult(renderError))
|
|
88
|
+
throw renderError;
|
|
89
|
+
// The page threw during SSR (React error boundaries don't catch SSR render
|
|
90
|
+
// throws). Render the segment's app-router error.tsx instead, if present;
|
|
91
|
+
// otherwise re-throw for the normal 500 / dev-overlay path.
|
|
92
|
+
const fallback = await this.renderErrorBoundaryFallback(generationContext, renderError);
|
|
93
|
+
if (!fallback)
|
|
94
|
+
throw renderError;
|
|
95
|
+
renderResult = fallback.result;
|
|
96
|
+
collectedHead = fallback.head;
|
|
97
|
+
errorBoundaryPath = fallback.errorPath;
|
|
98
|
+
}
|
|
51
99
|
const { html, stream } = renderResult;
|
|
52
100
|
if (options?.renderSessionId && hasRenderSession(options.renderSessionId)) {
|
|
53
101
|
endRenderSession(options.renderSessionId);
|
|
@@ -59,6 +107,8 @@ export class SSROrchestrator {
|
|
|
59
107
|
...generationContext.options?.props,
|
|
60
108
|
...options?.props,
|
|
61
109
|
},
|
|
110
|
+
// Present only on the error path: the client bundle wraps this boundary.
|
|
111
|
+
...(errorBoundaryPath ? { errorPath: errorBoundaryPath } : {}),
|
|
62
112
|
};
|
|
63
113
|
if (stream && wantsStream) {
|
|
64
114
|
const ssrHash = html ? await computeHash(html) : `stream-${Date.now()}`;
|
|
@@ -84,12 +134,50 @@ export class SSROrchestrator {
|
|
|
84
134
|
options: mergedOptions,
|
|
85
135
|
collectedHead,
|
|
86
136
|
}), { "ssr.hash": ssrHash });
|
|
137
|
+
if (errorBoundaryPath) {
|
|
138
|
+
// The page threw and its app-router error.tsx rendered as the response
|
|
139
|
+
// body. Signal a 500 and bypass caching (an errored page must not cache)
|
|
140
|
+
// by throwing the already-built document; the SSR error handler returns it.
|
|
141
|
+
const signal = new Error("app-router-error-boundary-rendered");
|
|
142
|
+
signal.errorBoundaryHtml = fullHtml;
|
|
143
|
+
signal.errorBoundarySsrHash = ssrHash;
|
|
144
|
+
throw signal;
|
|
145
|
+
}
|
|
87
146
|
return {
|
|
88
147
|
fullHtml,
|
|
89
148
|
finalStream: wantsStream ? this.createStream(fullHtml) : null,
|
|
90
149
|
ssrHash,
|
|
91
150
|
};
|
|
92
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Render the segment's app-router error.tsx as the page body for a caught SSR
|
|
154
|
+
* render throw. Returns the rendered result + the boundary's source path (for
|
|
155
|
+
* the client hydration bundle), or null when the segment has no error.tsx.
|
|
156
|
+
*/
|
|
157
|
+
async renderErrorBoundaryFallback(generationContext, renderError) {
|
|
158
|
+
const err = renderError instanceof Error ? renderError : new Error(String(renderError));
|
|
159
|
+
const errorInfo = await this.config.htmlGenerator.resolveErrorComponent({ ...generationContext, html: "", ssrHash: "" }, err);
|
|
160
|
+
if (!errorInfo)
|
|
161
|
+
return null;
|
|
162
|
+
const renderOptions = generationContext.options;
|
|
163
|
+
const mergedFrontmatter = {
|
|
164
|
+
...generationContext.pageInfo?.entity?.frontmatter,
|
|
165
|
+
...generationContext.pageBundle?.frontmatter,
|
|
166
|
+
};
|
|
167
|
+
const fallbackElement = this.config.layoutOrchestrator
|
|
168
|
+
? await this.config.layoutOrchestrator.applyLayoutsAndWrappers(errorInfo.element, generationContext.pageInfo, generationContext.layoutBundle, generationContext.nestedLayouts, undefined, renderOptions?.url, renderOptions?.params, mergedFrontmatter, generationContext.pageBundle?.headings, renderOptions?.projectSlug, renderOptions?.clientPageIsland, renderOptions?.props)
|
|
169
|
+
: errorInfo.element;
|
|
170
|
+
const rendered = await runWithHeadCollector(() => this.config.ssrRenderer.renderToHTML(fallbackElement, {
|
|
171
|
+
mode: this.config.mode,
|
|
172
|
+
wantsStream: false,
|
|
173
|
+
debugMode: this.config.debugMode,
|
|
174
|
+
}));
|
|
175
|
+
logger.debug("Rendered app-router error.tsx for a page throw", {
|
|
176
|
+
errorPath: errorInfo.path,
|
|
177
|
+
error: err.message,
|
|
178
|
+
});
|
|
179
|
+
return { result: rendered.result, head: rendered.head, errorPath: errorInfo.path };
|
|
180
|
+
}
|
|
93
181
|
/**
|
|
94
182
|
* Perform SSR rendering in an isolated per-project Worker.
|
|
95
183
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/ssr.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGjG,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjG,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,OAAO,CAAC,CAAiB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,IAAI,CAA+B;IAC3C,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,cAAc,CAAkB;gBAE5B,OAAO,EAA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AE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAWxE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWjF,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAS/B,aAAa,IAAI,IAAI;IAKrB,sBAAsB;IAIhB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3C,UAAU,CACR,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,sBAAsB,EAAE,SAAS,CAAC;IAIpD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzB;AAED,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -118,6 +118,7 @@ export class VeryfrontRenderer {
|
|
|
118
118
|
elementValidator: this.services.elementValidator,
|
|
119
119
|
ssrRenderer: this.services.ssrRenderer,
|
|
120
120
|
htmlGenerator: this.htmlGenerator,
|
|
121
|
+
layoutOrchestrator: this.layoutOrchestrator,
|
|
121
122
|
});
|
|
122
123
|
this.renderPipeline = new RenderPipeline({
|
|
123
124
|
pageResolver: this.services.pageResolver,
|
|
@@ -29,6 +29,8 @@ export interface RenderOptions {
|
|
|
29
29
|
params?: Record<string, string | string[]>;
|
|
30
30
|
props?: Record<string, unknown>;
|
|
31
31
|
delivery?: "string" | "stream";
|
|
32
|
+
/** Set on the SSR error path: absolute path to the app-router error.tsx to hydrate. */
|
|
33
|
+
errorPath?: string;
|
|
32
34
|
request?: Request;
|
|
33
35
|
/** Internal signal for the render owner's total deadline. */
|
|
34
36
|
abortSignal?: AbortSignal;
|
|
@@ -94,6 +96,8 @@ export interface PageDataResponse {
|
|
|
94
96
|
layoutProps: Record<string, Record<string, unknown>>;
|
|
95
97
|
buildVersion: BuildVersion;
|
|
96
98
|
appPath?: string;
|
|
99
|
+
/** Project-relative path to the app-router error.tsx that wraps the page (client boundary). */
|
|
100
|
+
errorPath?: string;
|
|
97
101
|
/** Page and client layout modules render inside a server-owned layout island. */
|
|
98
102
|
isolatedClientPage?: boolean;
|
|
99
103
|
/** Server-owned layout markup requires a document navigation for this target. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE;QACZ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AAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B,OAAO,CAAC,wBAAwB;CAmGjC;AAED,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GACnB,CAAC;AAMF,wBAAgB,WAAW,IAAI,QAAQ,CAOtC;AAED,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsBrF;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAED,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnF;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,cAAc,CAAC,EAAE,0BAA0B,GAC1C,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
|
@@ -25,7 +25,7 @@ export interface SSRRenderResult {
|
|
|
25
25
|
etag?: string;
|
|
26
26
|
cacheStrategy: "no-cache" | "short";
|
|
27
27
|
error?: Error;
|
|
28
|
-
errorType?: "not-found" | "undeployed" | "redirect" | "server-error" | "runtime";
|
|
28
|
+
errorType?: "not-found" | "undeployed" | "redirect" | "server-error" | "runtime" | "app-router-error-boundary";
|
|
29
29
|
showDevOverlay?: boolean;
|
|
30
30
|
redirectLocation?: string;
|
|
31
31
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.service.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/services/rendering/ssr.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,kCAAkC,CAAC;AAsB1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAItE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,mBAAmB,IAAI,YAAY,CAAC;IACpC,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACrF,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;CAC3D;AAUD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,UAAU,GAAG,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"ssr.service.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/services/rendering/ssr.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,kCAAkC,CAAC;AAsB1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAItE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,mBAAmB,IAAI,YAAY,CAAC;IACpC,UAAU,CAAC,GAAG,EAAE,cAAc,E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AgB,CAAmB;gBAExC,OAAO,CAAC,EAAE;QACpB,SAAS,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC;IAKD,mBAAmB,IAAI,YAAY;IAW7B,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAI1D,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IA+G1F,OAAO,CAAC,iBAAiB;IAuIzB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe;CAS1D"}
|
|
@@ -131,6 +131,19 @@ export class SSRService {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
handleRenderError(error, ctx, slug, request, nonce) {
|
|
134
|
+
// The page threw and its app-router error.tsx already rendered a full,
|
|
135
|
+
// hydrating document (the boundary UI). Serve it as a 500 without caching.
|
|
136
|
+
const errorBoundaryHtml = error?.errorBoundaryHtml;
|
|
137
|
+
if (typeof errorBoundaryHtml === "string") {
|
|
138
|
+
return {
|
|
139
|
+
status: HTTP_INTERNAL_SERVER_ERROR,
|
|
140
|
+
html: errorBoundaryHtml,
|
|
141
|
+
isStreaming: false,
|
|
142
|
+
cacheStrategy: "no-cache",
|
|
143
|
+
errorType: "app-router-error-boundary",
|
|
144
|
+
slug,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
134
147
|
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
135
148
|
// Dev-only overlay (full stack, absolute paths, line numbers) must never
|
|
136
149
|
// be exposed outside a local project — including remote preview, which is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1142",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -332,10 +332,10 @@
|
|
|
332
332
|
"@types/react": "19.2.14",
|
|
333
333
|
"@types/react-dom": "19.2.3",
|
|
334
334
|
"ws": "8.21.0",
|
|
335
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
336
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
337
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
338
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
335
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1142",
|
|
336
|
+
"@veryfront/ext-content-mdx": "0.1.1142",
|
|
337
|
+
"@veryfront/ext-css-tailwind": "0.1.1142",
|
|
338
|
+
"@veryfront/ext-parser-babel": "0.1.1142"
|
|
339
339
|
},
|
|
340
340
|
"devDependencies": {
|
|
341
341
|
"@types/node": "20.9.0"
|