vinext 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/client-build-config.d.ts +11 -2
- package/dist/build/client-build-config.js +17 -6
- package/dist/build/css-url-assets.d.ts +1 -1
- package/dist/build/css-url-assets.js +9 -7
- package/dist/build/prerender.js +3 -1
- package/dist/cache/cache-adapters-virtual.js +1 -1
- package/dist/client/pages-router-link-navigation.d.ts +33 -7
- package/dist/client/pages-router-link-navigation.js +32 -2
- package/dist/client/vinext-next-data.js +2 -0
- package/dist/cloudflare/src/cache/kv-data-adapter.runtime.d.ts +1 -1
- package/dist/config/config-matchers.d.ts +11 -1
- package/dist/config/config-matchers.js +14 -2
- package/dist/config/tsconfig-paths.js +14 -1
- package/dist/deploy.js +20 -13
- package/dist/entries/app-rsc-entry.js +27 -22
- package/dist/entries/pages-client-entry.js +14 -13
- package/dist/entries/pages-server-entry.js +8 -27
- package/dist/index.js +365 -147
- package/dist/plugins/css-data-url.js +30 -26
- package/dist/plugins/dynamic-preload-metadata.js +2 -4
- package/dist/plugins/extensionless-dynamic-import.js +27 -24
- package/dist/plugins/fonts.js +5 -4
- package/dist/plugins/import-meta-url.js +21 -15
- package/dist/plugins/instrumentation-client.js +1 -1
- package/dist/plugins/middleware-server-only.js +7 -6
- package/dist/plugins/og-assets.js +48 -46
- package/dist/plugins/optimize-imports.js +9 -3
- package/dist/plugins/remove-console.d.ts +7 -1
- package/dist/plugins/remove-console.js +4 -1
- package/dist/plugins/require-context.js +21 -20
- package/dist/plugins/strip-server-exports.d.ts +16 -8
- package/dist/plugins/strip-server-exports.js +496 -46
- package/dist/routing/app-route-graph.js +2 -2
- package/dist/server/app-bfcache-identity.d.ts +26 -0
- package/dist/server/app-bfcache-identity.js +127 -0
- package/dist/server/app-browser-action-result.js +1 -1
- package/dist/server/app-browser-entry.js +22 -12
- package/dist/server/app-browser-navigation-controller.d.ts +1 -1
- package/dist/server/app-browser-navigation-controller.js +1 -1
- package/dist/server/app-browser-state.d.ts +3 -22
- package/dist/server/app-browser-state.js +23 -139
- package/dist/server/app-browser-stream.js +1 -1
- package/dist/server/app-browser-visible-commit.d.ts +1 -1
- package/dist/server/app-browser-visible-commit.js +3 -2
- package/dist/server/app-fallback-renderer.d.ts +1 -1
- package/dist/server/app-layout-param-observation.d.ts +1 -1
- package/dist/server/app-layout-param-observation.js +1 -1
- package/dist/server/app-middleware.js +2 -1
- package/dist/server/app-page-boundary-render.d.ts +1 -1
- package/dist/server/app-page-boundary.js +1 -1
- package/dist/server/app-page-cache-finalizer.d.ts +62 -0
- package/dist/server/app-page-cache-finalizer.js +122 -0
- package/dist/server/app-page-cache-render.d.ts +2 -2
- package/dist/server/app-page-cache-render.js +1 -1
- package/dist/server/app-page-cache.d.ts +2 -53
- package/dist/server/app-page-cache.js +5 -131
- package/dist/server/app-page-dispatch.d.ts +2 -2
- package/dist/server/app-page-dispatch.js +10 -8
- package/dist/server/app-page-probe.js +3 -2
- package/dist/server/app-page-render-observation.js +2 -2
- package/dist/server/app-page-render.d.ts +3 -3
- package/dist/server/app-page-render.js +3 -2
- package/dist/server/app-page-stream.d.ts +2 -9
- package/dist/server/app-page-stream.js +1 -35
- package/dist/server/app-pages-bridge.d.ts +5 -1
- package/dist/server/app-pages-bridge.js +5 -13
- package/dist/server/app-request-context.d.ts +1 -2
- package/dist/server/app-request-context.js +2 -1
- package/dist/server/app-route-handler-dispatch.js +3 -2
- package/dist/server/app-route-handler-execution.d.ts +1 -1
- package/dist/server/app-route-handler-execution.js +1 -1
- package/dist/server/app-route-handler-response.d.ts +1 -1
- package/dist/server/app-router-entry.js +2 -1
- package/dist/server/app-rsc-handler.d.ts +3 -0
- package/dist/server/app-rsc-handler.js +73 -31
- package/dist/server/app-rsc-response-finalizer.js +1 -1
- package/dist/server/app-rsc-route-matching.js +6 -2
- package/dist/server/app-server-action-execution.d.ts +1 -1
- package/dist/server/app-server-action-execution.js +10 -6
- package/dist/server/app-ssr-entry.d.ts +1 -1
- package/dist/server/app-ssr-entry.js +12 -38
- package/dist/server/app-ssr-router-instance.d.ts +6 -0
- package/dist/server/app-ssr-router-instance.js +24 -0
- package/dist/server/app-ssr-stream.js +1 -1
- package/dist/server/artifact-compatibility.js +1 -1
- package/dist/server/before-interactive-head.d.ts +17 -0
- package/dist/server/before-interactive-head.js +35 -0
- package/dist/server/client-reuse-manifest.js +1 -1
- package/dist/server/csp.js +1 -4
- package/dist/server/defer-until-stream-consumed.d.ts +7 -0
- package/dist/server/defer-until-stream-consumed.js +34 -0
- package/dist/server/dev-server.js +82 -37
- package/dist/server/instrumentation.js +1 -1
- package/dist/server/isr-cache.d.ts +1 -1
- package/dist/server/isr-cache.js +1 -1
- package/dist/server/isr-decision.d.ts +1 -1
- package/dist/server/middleware-matcher.js +20 -9
- package/dist/server/middleware-runtime.d.ts +3 -4
- package/dist/server/middleware-runtime.js +4 -2
- package/dist/server/navigation-planner.d.ts +3 -12
- package/dist/server/navigation-planner.js +24 -0
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/navigation-trace.js +1 -0
- package/dist/server/open-redirect.d.ts +12 -0
- package/dist/server/open-redirect.js +21 -0
- package/dist/server/operation-token.d.ts +40 -0
- package/dist/server/operation-token.js +85 -0
- package/dist/server/pages-data-route.d.ts +1 -1
- package/dist/server/pages-data-route.js +7 -4
- package/dist/server/pages-dev-module-url.d.ts +4 -0
- package/dist/server/pages-dev-module-url.js +15 -0
- package/dist/server/pages-document-initial-props.d.ts +4 -15
- package/dist/server/pages-document-initial-props.js +27 -56
- package/dist/server/pages-i18n.js +2 -2
- package/dist/server/pages-page-data.d.ts +1 -1
- package/dist/server/pages-page-data.js +3 -1
- package/dist/server/pages-page-handler.js +3 -1
- package/dist/server/pages-page-response.d.ts +3 -1
- package/dist/server/pages-page-response.js +6 -6
- package/dist/server/pages-readiness.js +1 -1
- package/dist/server/pages-request-pipeline.d.ts +7 -7
- package/dist/server/pages-request-pipeline.js +63 -21
- package/dist/server/prod-server.d.ts +3 -1
- package/dist/server/prod-server.js +43 -11
- package/dist/server/request-pipeline.d.ts +1 -24
- package/dist/server/request-pipeline.js +1 -33
- package/dist/server/seed-cache.d.ts +1 -1
- package/dist/server/static-file-cache.js +16 -4
- package/dist/shims/before-interactive-context.d.ts +14 -3
- package/dist/shims/cache-handler.d.ts +106 -0
- package/dist/shims/cache-handler.js +176 -0
- package/dist/shims/cache-request-state.d.ts +47 -0
- package/dist/shims/cache-request-state.js +126 -0
- package/dist/shims/cache-runtime.d.ts +2 -2
- package/dist/shims/cache-runtime.js +3 -14
- package/dist/shims/cache.d.ts +3 -231
- package/dist/shims/cache.js +17 -383
- package/dist/shims/cdn-cache.d.ts +1 -1
- package/dist/shims/cdn-cache.js +1 -1
- package/dist/shims/document.d.ts +15 -20
- package/dist/shims/document.js +5 -8
- package/dist/shims/error-boundary-navigation.d.ts +7 -0
- package/dist/shims/error-boundary-navigation.js +44 -0
- package/dist/shims/error-boundary.js +10 -8
- package/dist/shims/error.js +2 -1
- package/dist/shims/fetch-cache.js +1 -1
- package/dist/shims/form.js +1 -1
- package/dist/shims/image.js +74 -9
- package/dist/shims/internal/app-page-props-cache-key.d.ts +5 -0
- package/dist/shims/internal/app-page-props-cache-key.js +16 -0
- package/dist/shims/internal/navigation-untracked.js +2 -1
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +6 -7
- package/dist/shims/internal/pages-data-fetch-dedup.js +67 -14
- package/dist/shims/internal/pages-data-target.js +1 -1
- package/dist/shims/layout-segment-context.d.ts +1 -1
- package/dist/shims/layout-segment-context.js +2 -1
- package/dist/shims/link.js +38 -17
- package/dist/shims/metadata.js +4 -4
- package/dist/shims/navigation-context-state.d.ts +40 -0
- package/dist/shims/navigation-context-state.js +116 -0
- package/dist/shims/navigation-errors.d.ts +55 -0
- package/dist/shims/navigation-errors.js +110 -0
- package/dist/shims/navigation-server.d.ts +3 -0
- package/dist/shims/navigation-server.js +3 -0
- package/dist/shims/navigation-state.d.ts +1 -2
- package/dist/shims/navigation-state.js +2 -1
- package/dist/shims/navigation.d.ts +3 -291
- package/dist/shims/navigation.js +16 -445
- package/dist/shims/navigation.react-server.d.ts +2 -2
- package/dist/shims/navigation.react-server.js +3 -1
- package/dist/shims/request-state-types.d.ts +3 -3
- package/dist/shims/router.d.ts +6 -2
- package/dist/shims/router.js +99 -20
- package/dist/shims/script.js +9 -5
- package/dist/shims/slot.js +3 -1
- package/dist/shims/unified-request-context.d.ts +2 -2
- package/dist/utils/has-trailing-comma.d.ts +24 -0
- package/dist/utils/has-trailing-comma.js +62 -0
- package/dist/utils/text-stream.d.ts +1 -1
- package/dist/utils/text-stream.js +2 -2
- package/dist/utils/virtual-module.d.ts +5 -0
- package/dist/utils/virtual-module.js +0 -0
- package/dist/utils/vite-version.d.ts +12 -1
- package/dist/utils/vite-version.js +9 -1
- package/package.json +5 -1
|
@@ -1,68 +1,518 @@
|
|
|
1
1
|
import { parseAst } from "vite";
|
|
2
2
|
import MagicString from "magic-string";
|
|
3
3
|
//#region src/plugins/strip-server-exports.ts
|
|
4
|
+
const SERVER_EXPORTS = new Set([
|
|
5
|
+
"getServerSideProps",
|
|
6
|
+
"getStaticProps",
|
|
7
|
+
"getStaticPaths",
|
|
8
|
+
"unstable_getServerProps",
|
|
9
|
+
"unstable_getServerSideProps",
|
|
10
|
+
"unstable_getStaticProps",
|
|
11
|
+
"unstable_getStaticPaths"
|
|
12
|
+
]);
|
|
13
|
+
const SERVER_PROPS_SSG_CONFLICT = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps";
|
|
14
|
+
const EXPORT_ALL_IN_PAGE_ERROR = "Using `export * from '...'` in a page is disallowed. Please use `export { default } from '...'` instead.\nRead more: https://nextjs.org/docs/messages/export-all-in-page";
|
|
15
|
+
function hasServerExportCandidate(code) {
|
|
16
|
+
return [...SERVER_EXPORTS].some((name) => code.includes(name));
|
|
17
|
+
}
|
|
18
|
+
function hasExportAllCandidate(code) {
|
|
19
|
+
let searchFrom = 0;
|
|
20
|
+
while (searchFrom < code.length) {
|
|
21
|
+
const exportStart = code.indexOf("export", searchFrom);
|
|
22
|
+
if (exportStart === -1) return false;
|
|
23
|
+
searchFrom = exportStart + 6;
|
|
24
|
+
const previous = code.charCodeAt(exportStart - 1);
|
|
25
|
+
const next = code.charCodeAt(searchFrom);
|
|
26
|
+
if (previous >= 48 && previous <= 57 || previous >= 65 && previous <= 90 || previous === 95 || previous >= 97 && previous <= 122 || next >= 48 && next <= 57 || next >= 65 && next <= 90 || next === 95 || next >= 97 && next <= 122) continue;
|
|
27
|
+
let position = searchFrom;
|
|
28
|
+
while (position < code.length) {
|
|
29
|
+
const char = code[position];
|
|
30
|
+
if (/\s/.test(char)) {
|
|
31
|
+
position++;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (char === "/" && code[position + 1] === "*") {
|
|
35
|
+
const commentEnd = code.indexOf("*/", position + 2);
|
|
36
|
+
if (commentEnd === -1) break;
|
|
37
|
+
position = commentEnd + 2;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (char === "/" && code[position + 1] === "/") {
|
|
41
|
+
const lineEnd = code.indexOf("\n", position + 2);
|
|
42
|
+
position = lineEnd === -1 ? code.length : lineEnd + 1;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (char === "*") return true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
function nodeName(node) {
|
|
52
|
+
if (!node || typeof node !== "object") return void 0;
|
|
53
|
+
const value = node;
|
|
54
|
+
return value.name ?? value.value;
|
|
55
|
+
}
|
|
56
|
+
function isInsideRanges(position, ranges) {
|
|
57
|
+
return ranges.some((range) => position >= range.start && position < range.end);
|
|
58
|
+
}
|
|
59
|
+
function bindingNames(pattern) {
|
|
60
|
+
if (!pattern) return [];
|
|
61
|
+
if (pattern.type === "Identifier") return [pattern.name];
|
|
62
|
+
if (pattern.type === "RestElement") return bindingNames(pattern.argument);
|
|
63
|
+
if (pattern.type === "AssignmentPattern") return bindingNames(pattern.left);
|
|
64
|
+
if (pattern.type === "ArrayPattern") return pattern.elements.flatMap((element) => bindingNames(element));
|
|
65
|
+
if (pattern.type === "ObjectPattern") return pattern.properties.flatMap((property) => {
|
|
66
|
+
if (property.type === "RestElement") return bindingNames(property.argument);
|
|
67
|
+
return bindingNames(property.value);
|
|
68
|
+
});
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
function bindingIdentifiers(pattern) {
|
|
72
|
+
if (!pattern) return [];
|
|
73
|
+
if (pattern.type === "Identifier") return [pattern];
|
|
74
|
+
if (pattern.type === "RestElement") return bindingIdentifiers(pattern.argument);
|
|
75
|
+
if (pattern.type === "AssignmentPattern") return bindingIdentifiers(pattern.left);
|
|
76
|
+
if (pattern.type === "ArrayPattern") return pattern.elements.flatMap((element) => bindingIdentifiers(element));
|
|
77
|
+
if (pattern.type === "ObjectPattern") return pattern.properties.flatMap((property) => {
|
|
78
|
+
if (property.type === "RestElement") return bindingIdentifiers(property.argument);
|
|
79
|
+
return bindingIdentifiers(property.value);
|
|
80
|
+
});
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
function isReferenceIdentifier(node, parent) {
|
|
84
|
+
if (node.type !== "Identifier" || !parent) return false;
|
|
85
|
+
if ((parent.type === "FunctionDeclaration" || parent.type === "FunctionExpression" || parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.id === node) return false;
|
|
86
|
+
if (parent.type === "VariableDeclarator" && parent.id === node) return false;
|
|
87
|
+
if (parent.type === "ImportSpecifier" || parent.type === "ImportDefaultSpecifier" || parent.type === "ImportNamespaceSpecifier") return false;
|
|
88
|
+
if (parent.type === "ExportSpecifier") return false;
|
|
89
|
+
if (parent.type === "MemberExpression" && parent.property === node && !parent.computed) return false;
|
|
90
|
+
if ((parent.type === "Property" || parent.type === "MethodDefinition") && parent.key === node && !parent.computed && !(parent.type === "Property" && parent.shorthand)) return false;
|
|
91
|
+
if ((parent.type === "LabeledStatement" || parent.type === "BreakStatement" || parent.type === "ContinueStatement") && parent.label === node) return false;
|
|
92
|
+
const parameters = "params" in parent ? parent.params : void 0;
|
|
93
|
+
if (Array.isArray(parameters) && parameters.includes(node)) return false;
|
|
94
|
+
if (parent.type === "CatchClause" && parent.param === node) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
function walkAst(node, visit, parent, ancestors = []) {
|
|
98
|
+
if (!node || typeof node !== "object") return;
|
|
99
|
+
if (Array.isArray(node)) {
|
|
100
|
+
for (const child of node) walkAst(child, visit, parent, ancestors);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const current = node;
|
|
104
|
+
if (typeof current.type !== "string") return;
|
|
105
|
+
visit(current, parent, ancestors);
|
|
106
|
+
const childAncestors = [...ancestors, current];
|
|
107
|
+
for (const [key, value] of Object.entries(current)) {
|
|
108
|
+
if (key === "parent" || key === "loc" || key === "start" || key === "end") continue;
|
|
109
|
+
if (Array.isArray(value)) for (const child of value) walkAst(child, visit, current, childAncestors);
|
|
110
|
+
else if (value && typeof value === "object") walkAst(value, visit, current, childAncestors);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function renderImportDeclaration(code, statement, removed) {
|
|
114
|
+
const kept = statement.specifiers.filter((specifier) => !removed.has(specifier));
|
|
115
|
+
if (kept.length === 0) return "";
|
|
116
|
+
const defaultSpecifier = kept.find((specifier) => specifier.type === "ImportDefaultSpecifier");
|
|
117
|
+
const namespaceSpecifier = kept.find((specifier) => specifier.type === "ImportNamespaceSpecifier");
|
|
118
|
+
const namedSpecifiers = kept.filter((specifier) => specifier.type === "ImportSpecifier");
|
|
119
|
+
const clauses = [];
|
|
120
|
+
if (defaultSpecifier) clauses.push(code.slice(defaultSpecifier.start, defaultSpecifier.end));
|
|
121
|
+
if (namespaceSpecifier) clauses.push(code.slice(namespaceSpecifier.start, namespaceSpecifier.end));
|
|
122
|
+
if (namedSpecifiers.length > 0) clauses.push(`{ ${namedSpecifiers.map((specifier) => code.slice(specifier.start, specifier.end)).join(", ")} }`);
|
|
123
|
+
return `import ${clauses.join(", ")} from ${code.slice(statement.source.start, statement.end)}`;
|
|
124
|
+
}
|
|
125
|
+
function renderExportDeclaration(code, statement, removed) {
|
|
126
|
+
const kept = statement.specifiers.filter((specifier) => !removed.has(specifier));
|
|
127
|
+
if (kept.length === 0) return "";
|
|
128
|
+
return `export { ${kept.map((specifier) => code.slice(specifier.start, specifier.end)).join(", ")} }${statement.source ? ` from ${code.slice(statement.source.start, statement.end)}` : ";"}`;
|
|
129
|
+
}
|
|
130
|
+
function renderBindingPattern(code, pattern, removedNames) {
|
|
131
|
+
if (pattern.type === "Identifier") return removedNames.has(pattern.name) ? null : pattern.name;
|
|
132
|
+
if (pattern.type === "RestElement") {
|
|
133
|
+
const argument = renderBindingPattern(code, pattern.argument, removedNames);
|
|
134
|
+
return argument ? `...${argument}` : null;
|
|
135
|
+
}
|
|
136
|
+
if (pattern.type === "AssignmentPattern") {
|
|
137
|
+
const left = renderBindingPattern(code, pattern.left, removedNames);
|
|
138
|
+
return left ? `${left} = ${code.slice(pattern.right.start, pattern.right.end)}` : null;
|
|
139
|
+
}
|
|
140
|
+
if (pattern.type === "ObjectPattern") {
|
|
141
|
+
const properties = pattern.properties.flatMap((property) => {
|
|
142
|
+
if (property.type === "RestElement") {
|
|
143
|
+
const rendered = renderBindingPattern(code, property, removedNames);
|
|
144
|
+
return rendered ? [rendered] : [];
|
|
145
|
+
}
|
|
146
|
+
const value = renderBindingPattern(code, property.value, removedNames);
|
|
147
|
+
if (!value) return [];
|
|
148
|
+
if (property.shorthand && property.value.type === "Identifier") return [value];
|
|
149
|
+
const key = code.slice(property.key.start, property.key.end);
|
|
150
|
+
return [`${property.computed ? `[${key}]` : key}: ${value}`];
|
|
151
|
+
});
|
|
152
|
+
return properties.length > 0 ? `{ ${properties.join(", ")} }` : null;
|
|
153
|
+
}
|
|
154
|
+
if (pattern.type === "ArrayPattern") {
|
|
155
|
+
const elements = pattern.elements.map((element) => element ? renderBindingPattern(code, element, removedNames) : null);
|
|
156
|
+
while (elements.length > 0 && elements.at(-1) === null) elements.pop();
|
|
157
|
+
return elements.length > 0 ? `[${elements.map((element) => element ?? "").join(", ")}]` : null;
|
|
158
|
+
}
|
|
159
|
+
return code.slice(pattern.start, pattern.end);
|
|
160
|
+
}
|
|
161
|
+
function assignmentRootName(node) {
|
|
162
|
+
if (node.type === "Identifier") return node.name;
|
|
163
|
+
if (node.type === "MemberExpression") return assignmentRootName(node.object);
|
|
164
|
+
}
|
|
165
|
+
function assignmentBindingNames(node) {
|
|
166
|
+
if (node.type === "ArrayPattern" || node.type === "ObjectPattern") return bindingNames(node);
|
|
167
|
+
const rootName = assignmentRootName(node);
|
|
168
|
+
return rootName ? [rootName] : [];
|
|
169
|
+
}
|
|
170
|
+
function isAssignmentTargetIdentifier(node, left) {
|
|
171
|
+
if (left.type === "Identifier") return node.start === left.start;
|
|
172
|
+
if (left.type === "ArrayPattern" || left.type === "ObjectPattern") return bindingIdentifiers(left).some((identifier) => identifier.start === node.start);
|
|
173
|
+
if (left.type === "MemberExpression") {
|
|
174
|
+
let object = left.object;
|
|
175
|
+
while (object.type === "MemberExpression") object = object.object;
|
|
176
|
+
return object.type === "Identifier" && object.start === node.start;
|
|
177
|
+
}
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
function findLexicalScope(ancestors) {
|
|
181
|
+
return [...ancestors].reverse().find((ancestor) => [
|
|
182
|
+
"BlockStatement",
|
|
183
|
+
"SwitchStatement",
|
|
184
|
+
"ForStatement",
|
|
185
|
+
"ForInStatement",
|
|
186
|
+
"ForOfStatement"
|
|
187
|
+
].includes(ancestor.type));
|
|
188
|
+
}
|
|
189
|
+
function validatePageExports(code) {
|
|
190
|
+
if (!hasExportAllCandidate(code)) return;
|
|
191
|
+
let ast;
|
|
192
|
+
try {
|
|
193
|
+
ast = parseAst(code);
|
|
194
|
+
} catch {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (ast.body.some((statement) => statement.type === "ExportAllDeclaration")) throw new Error(EXPORT_ALL_IN_PAGE_ERROR);
|
|
198
|
+
}
|
|
4
199
|
/**
|
|
5
|
-
* Strip server-only data-fetching exports
|
|
6
|
-
*
|
|
7
|
-
* bundle. Uses Vite's parseAst (Rollup/acorn) for correct handling
|
|
8
|
-
* of all export patterns including function expressions, arrow
|
|
9
|
-
* functions with TS return types, and re-exports.
|
|
200
|
+
* Strip server-only Pages Router data-fetching exports and their unique
|
|
201
|
+
* dependency graph from browser bundles.
|
|
10
202
|
*
|
|
11
|
-
*
|
|
203
|
+
* Ported from Next.js:
|
|
204
|
+
* - test/unit/babel-plugin-next-ssg-transform.test.ts
|
|
205
|
+
* - crates/next-custom-transforms/src/transforms/strip_page_exports.rs
|
|
12
206
|
*/
|
|
13
207
|
function stripServerExports(code) {
|
|
14
|
-
|
|
15
|
-
"getServerSideProps",
|
|
16
|
-
"getStaticProps",
|
|
17
|
-
"getStaticPaths"
|
|
18
|
-
]);
|
|
19
|
-
if (![...SERVER_EXPORTS].some((name) => code.includes(name))) return null;
|
|
208
|
+
if (!hasServerExportCandidate(code) && !hasExportAllCandidate(code)) return null;
|
|
20
209
|
let ast;
|
|
21
210
|
try {
|
|
22
211
|
ast = parseAst(code);
|
|
23
212
|
} catch {
|
|
24
213
|
return null;
|
|
25
214
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
215
|
+
const statements = ast.body;
|
|
216
|
+
validatePageExports(code);
|
|
217
|
+
const edits = [];
|
|
218
|
+
const deadRanges = [];
|
|
219
|
+
const deadRangeKeys = /* @__PURE__ */ new Set();
|
|
220
|
+
const addDeadRange = (range) => {
|
|
221
|
+
const key = `${range.start}:${range.end}`;
|
|
222
|
+
if (deadRangeKeys.has(key)) return false;
|
|
223
|
+
deadRangeKeys.add(key);
|
|
224
|
+
deadRanges.push(range);
|
|
225
|
+
return true;
|
|
226
|
+
};
|
|
227
|
+
const forcedBindings = /* @__PURE__ */ new Set();
|
|
228
|
+
const candidateBindings = /* @__PURE__ */ new Set();
|
|
229
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
230
|
+
const bindingPositions = /* @__PURE__ */ new Set();
|
|
231
|
+
const references = /* @__PURE__ */ new Map();
|
|
232
|
+
const shadowRanges = /* @__PURE__ */ new Map();
|
|
233
|
+
const exportSpecifierRemovals = /* @__PURE__ */ new Map();
|
|
234
|
+
const variableRemovals = /* @__PURE__ */ new Map();
|
|
235
|
+
const importRemovals = /* @__PURE__ */ new Map();
|
|
236
|
+
const assignmentStatements = [];
|
|
237
|
+
const removedAssignments = /* @__PURE__ */ new Set();
|
|
238
|
+
for (const statement of statements) {
|
|
239
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
240
|
+
if (declaration?.type === "FunctionDeclaration" && declaration.id) {
|
|
241
|
+
bindingPositions.add(declaration.id.start);
|
|
242
|
+
bindings.set(declaration.id.name, {
|
|
243
|
+
name: declaration.id.name,
|
|
244
|
+
node: declaration,
|
|
245
|
+
parent: statement,
|
|
246
|
+
kind: "function",
|
|
247
|
+
implementation: declaration,
|
|
248
|
+
declaredNames: [declaration.id.name]
|
|
249
|
+
});
|
|
250
|
+
} else if (declaration?.type === "ClassDeclaration" && declaration.id) {
|
|
251
|
+
bindingPositions.add(declaration.id.start);
|
|
252
|
+
bindings.set(declaration.id.name, {
|
|
253
|
+
name: declaration.id.name,
|
|
254
|
+
node: declaration,
|
|
255
|
+
parent: statement,
|
|
256
|
+
kind: "class",
|
|
257
|
+
implementation: declaration,
|
|
258
|
+
declaredNames: [declaration.id.name]
|
|
259
|
+
});
|
|
260
|
+
} else if (declaration?.type === "VariableDeclaration") for (const declarator of declaration.declarations) {
|
|
261
|
+
const declaredNames = bindingNames(declarator.id);
|
|
262
|
+
for (const identifier of bindingIdentifiers(declarator.id)) bindingPositions.add(identifier.start);
|
|
263
|
+
for (const name of declaredNames) bindings.set(name, {
|
|
264
|
+
name,
|
|
265
|
+
node: declarator,
|
|
266
|
+
parent: declaration,
|
|
267
|
+
kind: "variable",
|
|
268
|
+
implementation: declarator.init ?? declarator,
|
|
269
|
+
declaredNames
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
else if (statement.type === "ImportDeclaration") for (const specifier of statement.specifiers) {
|
|
273
|
+
const name = nodeName(specifier.local);
|
|
274
|
+
if (!name) continue;
|
|
275
|
+
bindingPositions.add(specifier.local.start);
|
|
276
|
+
bindings.set(name, {
|
|
277
|
+
name,
|
|
278
|
+
node: specifier,
|
|
279
|
+
parent: statement,
|
|
280
|
+
kind: "import",
|
|
281
|
+
implementation: specifier,
|
|
282
|
+
declaredNames: [name]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
else if (statement.type === "ExpressionStatement") {
|
|
286
|
+
const expression = statement.expression;
|
|
287
|
+
if (expression.type === "AssignmentExpression") {
|
|
288
|
+
const left = expression.left;
|
|
289
|
+
const names = assignmentBindingNames(left);
|
|
290
|
+
if (names.length > 0) assignmentStatements.push({
|
|
291
|
+
statement,
|
|
292
|
+
left,
|
|
293
|
+
bindingNames: names
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const addShadowRange = (name, range) => {
|
|
299
|
+
if (!range || range.type === "Program") return;
|
|
300
|
+
const ranges = shadowRanges.get(name) ?? [];
|
|
301
|
+
ranges.push(range);
|
|
302
|
+
shadowRanges.set(name, ranges);
|
|
303
|
+
};
|
|
304
|
+
walkAst(ast.body, (node, parent, ancestors = []) => {
|
|
305
|
+
if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") {
|
|
306
|
+
for (const parameter of node.params) for (const name of bindingNames(parameter)) addShadowRange(name, node);
|
|
307
|
+
if (node.type === "FunctionDeclaration" && node.id) addShadowRange(node.id.name, findLexicalScope(ancestors));
|
|
308
|
+
else if (node.type === "FunctionExpression" && node.id) addShadowRange(node.id.name, node);
|
|
309
|
+
} else if (node.type === "ClassDeclaration" && node.id) addShadowRange(node.id.name, findLexicalScope(ancestors));
|
|
310
|
+
else if (node.type === "ClassExpression" && node.id) addShadowRange(node.id.name, node);
|
|
311
|
+
else if (node.type === "CatchClause" && node.param) for (const name of bindingNames(node.param)) addShadowRange(name, node.body);
|
|
312
|
+
else if (node.type === "VariableDeclarator" && parent?.type === "VariableDeclaration") {
|
|
313
|
+
const scope = parent.kind === "var" ? [...ancestors].reverse().find((ancestor) => [
|
|
314
|
+
"FunctionDeclaration",
|
|
315
|
+
"FunctionExpression",
|
|
316
|
+
"ArrowFunctionExpression"
|
|
317
|
+
].includes(ancestor.type)) : findLexicalScope(ancestors);
|
|
318
|
+
for (const name of bindingNames(node.id)) addShadowRange(name, scope);
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
walkAst(ast.body, (node, parent, ancestors = []) => {
|
|
322
|
+
if (!isReferenceIdentifier(node, parent)) return;
|
|
323
|
+
if (bindingPositions.has(node.start)) return;
|
|
324
|
+
if (isInsideRanges(node.start, shadowRanges.get(node.name) ?? [])) return;
|
|
325
|
+
const assignment = [...ancestors].reverse().find((ancestor) => ancestor.type === "AssignmentExpression");
|
|
326
|
+
if (assignment && isAssignmentTargetIdentifier(node, assignment.left)) return;
|
|
327
|
+
const positions = references.get(node.name) ?? [];
|
|
328
|
+
positions.push(node.start);
|
|
329
|
+
references.set(node.name, positions);
|
|
330
|
+
});
|
|
331
|
+
let hasServerProps = false;
|
|
332
|
+
let hasStaticProps = false;
|
|
333
|
+
const noteDataExport = (name) => {
|
|
334
|
+
if (name === "getServerSideProps") hasServerProps = true;
|
|
335
|
+
else hasStaticProps = true;
|
|
336
|
+
if (hasServerProps && hasStaticProps) throw new Error(SERVER_PROPS_SSG_CONFLICT);
|
|
337
|
+
};
|
|
338
|
+
for (const statement of statements) {
|
|
339
|
+
if (statement.type !== "ExportNamedDeclaration") continue;
|
|
340
|
+
if (statement.declaration?.type === "FunctionDeclaration" && statement.declaration.id) {
|
|
341
|
+
const name = statement.declaration.id.name;
|
|
342
|
+
if (SERVER_EXPORTS.has(name)) {
|
|
343
|
+
noteDataExport(name);
|
|
344
|
+
forcedBindings.add(name);
|
|
345
|
+
addDeadRange(statement.declaration);
|
|
346
|
+
edits.push({
|
|
347
|
+
start: statement.start,
|
|
348
|
+
end: statement.end,
|
|
349
|
+
replacement: ""
|
|
350
|
+
});
|
|
40
351
|
}
|
|
41
352
|
continue;
|
|
42
353
|
}
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
354
|
+
if (statement.declaration?.type === "VariableDeclaration") {
|
|
355
|
+
for (const declarator of statement.declaration.declarations) for (const name of bindingNames(declarator.id)) {
|
|
356
|
+
if (!SERVER_EXPORTS.has(name)) continue;
|
|
357
|
+
noteDataExport(name);
|
|
358
|
+
forcedBindings.add(name);
|
|
359
|
+
if (declarator.init) addDeadRange(declarator.init);
|
|
360
|
+
const removals = variableRemovals.get(statement.declaration) ?? /* @__PURE__ */ new Set();
|
|
361
|
+
removals.add(declarator);
|
|
362
|
+
variableRemovals.set(statement.declaration, removals);
|
|
363
|
+
}
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
const removed = /* @__PURE__ */ new Set();
|
|
367
|
+
for (const specifier of statement.specifiers) {
|
|
368
|
+
const exportedName = nodeName(specifier.exported);
|
|
369
|
+
if (exportedName && SERVER_EXPORTS.has(exportedName)) {
|
|
370
|
+
noteDataExport(exportedName);
|
|
371
|
+
removed.add(specifier);
|
|
372
|
+
if (!statement.source) {
|
|
373
|
+
const localName = nodeName(specifier.local);
|
|
374
|
+
if (localName) candidateBindings.add(localName);
|
|
375
|
+
}
|
|
376
|
+
} else if (!statement.source) {
|
|
377
|
+
const localName = nodeName(specifier.local);
|
|
378
|
+
if (localName) {
|
|
379
|
+
const positions = references.get(localName) ?? [];
|
|
380
|
+
positions.push(specifier.local.start);
|
|
381
|
+
references.set(localName, positions);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (removed.size > 0) exportSpecifierRemovals.set(statement, removed);
|
|
386
|
+
}
|
|
387
|
+
const deadBindings = /* @__PURE__ */ new Set();
|
|
388
|
+
let changed = true;
|
|
389
|
+
while (changed) {
|
|
390
|
+
changed = false;
|
|
391
|
+
for (const { statement, left, bindingNames: names } of assignmentStatements) {
|
|
392
|
+
const removableNames = new Set(names.filter((name) => forcedBindings.has(name) || deadBindings.has(name)));
|
|
393
|
+
if (removableNames.size === 0) continue;
|
|
394
|
+
if (removedAssignments.has(statement)) continue;
|
|
395
|
+
const expression = statement.expression;
|
|
396
|
+
const renderedLeft = left.type === "ArrayPattern" || left.type === "ObjectPattern" ? renderBindingPattern(code, left, removableNames) : null;
|
|
397
|
+
removedAssignments.add(statement);
|
|
398
|
+
edits.push({
|
|
399
|
+
start: statement.start,
|
|
400
|
+
end: statement.end,
|
|
401
|
+
replacement: renderedLeft ? `${left.type === "ObjectPattern" ? `(${renderedLeft} ${expression.operator} ${code.slice(expression.right.start, expression.right.end)})` : `${renderedLeft} ${expression.operator} ${code.slice(expression.right.start, expression.right.end)}`};` : ""
|
|
402
|
+
});
|
|
403
|
+
if (!renderedLeft && addDeadRange(statement)) changed = true;
|
|
404
|
+
}
|
|
405
|
+
const removableBindings = /* @__PURE__ */ new Set();
|
|
406
|
+
for (const [name] of bindings) if (forcedBindings.has(name) || candidateBindings.has(name) || (references.get(name) ?? []).some((position) => isInsideRanges(position, deadRanges))) removableBindings.add(name);
|
|
407
|
+
let closureChanged = true;
|
|
408
|
+
while (closureChanged) {
|
|
409
|
+
closureChanged = false;
|
|
410
|
+
const implementations = [...removableBindings].map((name) => bindings.get(name)?.implementation).filter((implementation) => Boolean(implementation));
|
|
411
|
+
for (const [name] of bindings) {
|
|
412
|
+
if (removableBindings.has(name)) continue;
|
|
413
|
+
if ((references.get(name) ?? []).some((position) => isInsideRanges(position, implementations))) {
|
|
414
|
+
removableBindings.add(name);
|
|
415
|
+
closureChanged = true;
|
|
416
|
+
}
|
|
50
417
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
418
|
+
}
|
|
419
|
+
let pruneChanged = true;
|
|
420
|
+
while (pruneChanged) {
|
|
421
|
+
pruneChanged = false;
|
|
422
|
+
const implementations = [...removableBindings].map((name) => bindings.get(name)?.implementation).filter((implementation) => Boolean(implementation));
|
|
423
|
+
for (const name of removableBindings) {
|
|
424
|
+
if (forcedBindings.has(name)) continue;
|
|
425
|
+
if ((references.get(name) ?? []).some((position) => !isInsideRanges(position, deadRanges) && !isInsideRanges(position, implementations))) {
|
|
426
|
+
removableBindings.delete(name);
|
|
427
|
+
pruneChanged = true;
|
|
428
|
+
}
|
|
61
429
|
}
|
|
62
430
|
}
|
|
431
|
+
for (const name of removableBindings) {
|
|
432
|
+
if (deadBindings.has(name)) continue;
|
|
433
|
+
const binding = bindings.get(name);
|
|
434
|
+
if (!binding) continue;
|
|
435
|
+
deadBindings.add(name);
|
|
436
|
+
changed = true;
|
|
437
|
+
if (binding.kind === "function" || binding.kind === "class") addDeadRange(binding.implementation);
|
|
438
|
+
}
|
|
439
|
+
for (const binding of new Set(bindings.values())) {
|
|
440
|
+
if (binding.kind !== "variable") continue;
|
|
441
|
+
if (!binding.declaredNames.every((name) => deadBindings.has(name))) continue;
|
|
442
|
+
if (addDeadRange(binding.implementation)) changed = true;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
for (const name of deadBindings) {
|
|
446
|
+
const binding = bindings.get(name);
|
|
447
|
+
if (!binding) continue;
|
|
448
|
+
if (forcedBindings.has(name)) {
|
|
449
|
+
if ((binding.kind === "function" || binding.kind === "class") && binding.parent.type !== "ExportNamedDeclaration") edits.push({
|
|
450
|
+
start: binding.node.start,
|
|
451
|
+
end: binding.node.end,
|
|
452
|
+
replacement: binding.kind === "function" ? `function ${name}() {}` : `class ${name} {}`
|
|
453
|
+
});
|
|
454
|
+
else if (binding.kind === "variable" && binding.parent.type !== "ExportNamedDeclaration") {
|
|
455
|
+
const removals = variableRemovals.get(binding.parent) ?? /* @__PURE__ */ new Set();
|
|
456
|
+
removals.add(binding.node);
|
|
457
|
+
variableRemovals.set(binding.parent, removals);
|
|
458
|
+
} else if (binding.kind === "import") {
|
|
459
|
+
const removals = importRemovals.get(binding.parent) ?? /* @__PURE__ */ new Set();
|
|
460
|
+
removals.add(binding.node);
|
|
461
|
+
importRemovals.set(binding.parent, removals);
|
|
462
|
+
}
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
if (binding.kind === "import") {
|
|
466
|
+
const removals = importRemovals.get(binding.parent) ?? /* @__PURE__ */ new Set();
|
|
467
|
+
removals.add(binding.node);
|
|
468
|
+
importRemovals.set(binding.parent, removals);
|
|
469
|
+
} else if (binding.kind === "variable") {
|
|
470
|
+
const removals = variableRemovals.get(binding.parent) ?? /* @__PURE__ */ new Set();
|
|
471
|
+
removals.add(binding.node);
|
|
472
|
+
variableRemovals.set(binding.parent, removals);
|
|
473
|
+
} else edits.push({
|
|
474
|
+
start: binding.parent.start,
|
|
475
|
+
end: binding.parent.end,
|
|
476
|
+
replacement: ""
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
for (const [statement, removed] of exportSpecifierRemovals) edits.push({
|
|
480
|
+
start: statement.start,
|
|
481
|
+
end: statement.end,
|
|
482
|
+
replacement: renderExportDeclaration(code, statement, removed)
|
|
483
|
+
});
|
|
484
|
+
for (const [declaration, removed] of variableRemovals) {
|
|
485
|
+
const rendered = declaration.declarations.flatMap((declarator) => {
|
|
486
|
+
if (!removed.has(declarator)) return [code.slice(declarator.start, declarator.end)];
|
|
487
|
+
const pattern = renderBindingPattern(code, declarator.id, deadBindings);
|
|
488
|
+
if (!pattern) return [];
|
|
489
|
+
return [`${pattern}${declarator.init ? ` = ${code.slice(declarator.init.start, declarator.init.end)}` : ""}`];
|
|
490
|
+
});
|
|
491
|
+
const exportStatement = statements.find((statement) => statement.type === "ExportNamedDeclaration" && statement.declaration === declaration);
|
|
492
|
+
edits.push({
|
|
493
|
+
start: exportStatement?.start ?? declaration.start,
|
|
494
|
+
end: declaration.end,
|
|
495
|
+
replacement: rendered.length > 0 ? `${exportStatement ? "export " : ""}${declaration.kind} ${rendered.join(", ")};` : ""
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
for (const [statement, removed] of importRemovals) edits.push({
|
|
499
|
+
start: statement.start,
|
|
500
|
+
end: statement.end,
|
|
501
|
+
replacement: renderImportDeclaration(code, statement, removed)
|
|
502
|
+
});
|
|
503
|
+
if (edits.length === 0) return null;
|
|
504
|
+
const string = new MagicString(code);
|
|
505
|
+
const uniqueEdits = [...new Map(edits.map((edit) => [`${edit.start}:${edit.end}`, edit])).values()].sort((left, right) => right.start - left.start || right.end - left.end);
|
|
506
|
+
let lastStart = Number.POSITIVE_INFINITY;
|
|
507
|
+
for (const edit of uniqueEdits) {
|
|
508
|
+
if (edit.end > lastStart) continue;
|
|
509
|
+
string.overwrite(edit.start, edit.end, edit.replacement);
|
|
510
|
+
lastStart = edit.start;
|
|
63
511
|
}
|
|
64
|
-
|
|
65
|
-
|
|
512
|
+
return {
|
|
513
|
+
code: string.toString(),
|
|
514
|
+
map: string.generateMap({ hires: "boundary" })
|
|
515
|
+
};
|
|
66
516
|
}
|
|
67
517
|
//#endregion
|
|
68
|
-
export { stripServerExports };
|
|
518
|
+
export { hasExportAllCandidate, hasServerExportCandidate, stripServerExports, validatePageExports };
|
|
@@ -886,11 +886,11 @@ function discoverInheritedParallelSlots(segments, appDir, routeDir, matcher) {
|
|
|
886
886
|
const routeHasLayout = layoutIdx >= 0;
|
|
887
887
|
for (const { dir, layoutIdx: lvlLayoutIdx, segmentIndex } of dirsToCheck) {
|
|
888
888
|
if (lvlLayoutIdx < 0 && routeHasLayout) continue;
|
|
889
|
-
const isOwnDir = dir === routeDir;
|
|
890
889
|
const slotLayoutIdx = Math.max(lvlLayoutIdx, 0);
|
|
891
890
|
const slotsAtLevel = discoverParallelSlots(dir, appDir, matcher);
|
|
892
891
|
const segmentsBelow = segments.slice(segmentIndex);
|
|
893
|
-
|
|
892
|
+
const isActiveUrlLevel = dir === routeDir || segmentsBelow.every(isInvisibleSegment);
|
|
893
|
+
for (const slot of slotsAtLevel) if (isActiveUrlLevel) {
|
|
894
894
|
slot.layoutIndex = slotLayoutIdx;
|
|
895
895
|
slotMap.set(slot.key, slot);
|
|
896
896
|
} else {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppElements } from "./app-elements-wire.js";
|
|
2
|
+
import { BfcacheIdMap } from "./app-history-state.js";
|
|
3
|
+
|
|
4
|
+
//#region src/server/app-bfcache-identity.d.ts
|
|
5
|
+
type BfcacheStateKeyMap = Readonly<Record<string, string>>;
|
|
6
|
+
declare function createInitialBfcacheIdMap(elements: AppElements): BfcacheIdMap;
|
|
7
|
+
declare function createBfcacheSegmentStateKeyMap(options: {
|
|
8
|
+
elements: AppElements;
|
|
9
|
+
pathname: string;
|
|
10
|
+
}): BfcacheStateKeyMap;
|
|
11
|
+
declare function createNextBfcacheIdMap(options: {
|
|
12
|
+
current: BfcacheIdMap;
|
|
13
|
+
currentElements: AppElements;
|
|
14
|
+
currentPathname: string;
|
|
15
|
+
elements: AppElements;
|
|
16
|
+
nextPathname: string;
|
|
17
|
+
restored?: BfcacheIdMap | null;
|
|
18
|
+
reuseCurrent?: boolean;
|
|
19
|
+
}): BfcacheIdMap;
|
|
20
|
+
declare function preserveBfcacheIdsForMergedElements(options: {
|
|
21
|
+
elements: AppElements;
|
|
22
|
+
next: BfcacheIdMap;
|
|
23
|
+
previous: BfcacheIdMap;
|
|
24
|
+
}): BfcacheIdMap;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { BfcacheStateKeyMap, createBfcacheSegmentStateKeyMap, createInitialBfcacheIdMap, createNextBfcacheIdMap, preserveBfcacheIdsForMergedElements };
|