@ecopages/react 0.2.1 → 0.3.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/README.md +178 -35
- package/package.json +80 -32
- package/src/app/client-only.js +10 -0
- package/src/app/dynamic.js +9 -0
- package/src/app/dynamic.test.browser.d.ts +1 -0
- package/src/app/dynamic.test.browser.js +38 -0
- package/src/bundling/bootstrap-package-paths.d.ts +5 -0
- package/src/bundling/bootstrap-package-paths.js +5 -0
- package/src/bundling/bundle.d.ts +78 -0
- package/src/bundling/bundle.js +130 -0
- package/src/bundling/runtime-alias-map.d.ts +12 -0
- package/src/bundling/runtime-alias-map.js +110 -0
- package/src/bundling/runtime-bundle.d.ts +70 -0
- package/src/bundling/runtime-bundle.js +233 -0
- package/src/{utils/react-dom-runtime-interop-plugin.d.ts → bundling/runtime-interop-plugin.d.ts} +1 -1
- package/src/bundling/runtime-interop-plugin.js +32 -0
- package/src/bundling/runtime-mode.d.ts +1 -0
- package/src/bundling/runtime-mode.js +10 -0
- package/src/bundling/runtime-modules.d.ts +21 -0
- package/src/bundling/runtime-modules.js +28 -0
- package/src/client-graph/ast-transform-eco-page.d.ts +10 -0
- package/src/client-graph/ast-transform-eco-page.js +71 -0
- package/src/client-graph/ast-transform-import-edits.d.ts +13 -0
- package/src/client-graph/ast-transform-import-edits.js +75 -0
- package/src/client-graph/ast-transform-walk-imports.d.ts +20 -0
- package/src/client-graph/ast-transform-walk-imports.js +105 -0
- package/src/client-graph/ast-transform.d.ts +12 -0
- package/src/client-graph/ast-transform.js +91 -0
- package/src/client-graph/ast-walk.d.ts +10 -0
- package/src/client-graph/ast-walk.js +26 -0
- package/src/client-graph/boundary-plugin-read-file-inline.d.ts +7 -0
- package/src/client-graph/boundary-plugin-read-file-inline.js +43 -0
- package/src/client-graph/boundary-plugin-transform.d.ts +16 -0
- package/src/client-graph/boundary-plugin-transform.js +31 -0
- package/src/client-graph/boundary-plugin.d.ts +23 -0
- package/src/client-graph/boundary-plugin.js +177 -0
- package/src/client-graph/component-config-traversal.d.ts +36 -0
- package/src/client-graph/component-config-traversal.js +77 -0
- package/src/{utils → client-graph}/declared-modules.d.ts +1 -1
- package/src/client-graph/declared-modules.js +69 -0
- package/src/client-graph/module-classification.d.ts +3 -0
- package/src/client-graph/module-classification.js +43 -0
- package/src/client-graph/reachability-analyzer.d.ts +26 -0
- package/src/client-graph/reachability-analyzer.js +55 -0
- package/src/client-graph/reachability-client-roots.d.ts +8 -0
- package/src/client-graph/reachability-client-roots.js +59 -0
- package/src/client-graph/reachability-export-names.d.ts +5 -0
- package/src/client-graph/reachability-export-names.js +34 -0
- package/src/client-graph/reachability-fallback-roots.d.ts +3 -0
- package/src/client-graph/reachability-fallback-roots.js +71 -0
- package/src/client-graph/reachability-preload.d.ts +10 -0
- package/src/client-graph/reachability-preload.js +30 -0
- package/src/client-graph/reachability-top-level-index.d.ts +14 -0
- package/src/client-graph/reachability-top-level-index.js +93 -0
- package/src/client-graph/reachability-traverse.d.ts +7 -0
- package/src/client-graph/reachability-traverse.js +201 -0
- package/src/client-graph/specifier-classification.d.ts +74 -0
- package/src/client-graph/specifier-classification.js +191 -0
- package/src/content/collection-component-cache.d.ts +25 -0
- package/src/content/collection-component-cache.js +62 -0
- package/src/{router-adapter.d.ts → contracts/router-adapter.d.ts} +7 -14
- package/src/contracts/router-adapter.js +6 -0
- package/src/dev-transform/react-dev-transform-contributor.d.ts +17 -0
- package/src/dev-transform/react-dev-transform-contributor.js +22 -0
- package/src/hmr/hmr-strategy-process.d.ts +34 -0
- package/src/hmr/hmr-strategy-process.js +83 -0
- package/src/hmr/hmr-strategy.d.ts +67 -0
- package/src/hmr/hmr-strategy.js +306 -0
- package/src/{services/react-hmr-page-metadata-cache.d.ts → hmr/page-metadata-cache.d.ts} +6 -2
- package/src/hmr/page-metadata-cache.js +44 -0
- package/src/hmr/react-hmr-dev-transform-plugins.d.ts +22 -0
- package/src/hmr/react-hmr-dev-transform-plugins.js +19 -0
- package/src/hydration/assert-no-bare-ecopages-imports.d.ts +4 -0
- package/src/hydration/assert-no-bare-ecopages-imports.js +7 -0
- package/src/hydration/bootstrap-imports.d.ts +25 -0
- package/src/hydration/bootstrap-imports.js +33 -0
- package/src/hydration/browser/island-hydration.d.ts +82 -0
- package/src/hydration/browser/island-hydration.js +251 -0
- package/src/hydration/browser/page-hydration-hmr.d.ts +11 -0
- package/src/hydration/browser/page-hydration-hmr.js +56 -0
- package/src/hydration/browser/page-hydration-module.d.ts +8 -0
- package/src/hydration/browser/page-hydration-module.js +17 -0
- package/src/hydration/browser/page-hydration.d.ts +54 -0
- package/src/hydration/browser/page-hydration.js +177 -0
- package/src/hydration/compiled-page-hydration-options.d.ts +20 -0
- package/src/hydration/compiled-page-hydration-options.js +1 -0
- package/src/hydration/hydration-asset.d.ts +127 -0
- package/src/hydration/hydration-asset.js +379 -0
- package/src/hydration/hydration-lifecycle.test.browser.d.ts +1 -0
- package/src/hydration/hydration-lifecycle.test.browser.js +461 -0
- package/src/hydration/hydration-page-entry-source.d.ts +5 -0
- package/src/hydration/hydration-page-entry-source.js +87 -0
- package/src/hydration/hydration-script-compiler.d.ts +48 -0
- package/src/hydration/hydration-script-compiler.js +213 -0
- package/src/hydration/page-data-manifest.d.ts +58 -0
- package/src/hydration/page-data-manifest.js +97 -0
- package/src/hydration/page-data-reader.d.ts +17 -0
- package/src/hydration/page-data-reader.js +31 -0
- package/src/hydration/page-payload.d.ts +68 -0
- package/src/hydration/page-payload.js +106 -0
- package/src/hydration/serialize-page-data-script.d.ts +27 -0
- package/src/hydration/serialize-page-data-script.js +30 -0
- package/src/mdx/mdx-config-dependency.d.ts +37 -0
- package/src/mdx/mdx-config-dependency.js +107 -0
- package/src/mdx/mdx-loader-plugin.d.ts +8 -0
- package/src/mdx/mdx-loader-plugin.js +11 -0
- package/src/page/page-module.d.ts +46 -0
- package/src/page/page-module.js +74 -0
- package/src/plugin/react.constants.d.ts +1 -0
- package/src/plugin/react.constants.js +1 -0
- package/src/plugin/react.plugin.d.ts +71 -0
- package/src/plugin/react.plugin.js +210 -0
- package/src/plugin/react.types.d.ts +106 -0
- package/src/plugin/react.types.js +1 -0
- package/src/render/component-ownership.d.ts +49 -0
- package/src/render/component-ownership.js +47 -0
- package/src/render/component-ssr.d.ts +59 -0
- package/src/render/component-ssr.js +76 -0
- package/src/render/eco-embed.d.ts +11 -0
- package/src/render/eco-embed.js +9 -0
- package/src/render/errors.d.ts +16 -0
- package/src/render/errors.js +23 -0
- package/src/render/html-boundary.js +59 -0
- package/src/render/layout-compose.d.ts +66 -0
- package/src/render/layout-compose.js +134 -0
- package/src/render/react-renderer.d.ts +114 -0
- package/src/render/react-renderer.js +490 -0
- package/src/render/react-runtime.d.ts +13 -0
- package/src/render/react-runtime.js +26 -0
- package/src/render/unified-layout-composition.d.ts +22 -0
- package/src/render/unified-layout-composition.js +31 -0
- package/src/runtime/use-sync-external-store-with-selector.d.ts +3 -0
- package/src/runtime/use-sync-external-store-with-selector.js +54 -0
- package/CHANGELOG.md +0 -29
- package/src/react-hmr-strategy.d.ts +0 -148
- package/src/react-hmr-strategy.js +0 -313
- package/src/react-renderer.d.ts +0 -213
- package/src/react-renderer.js +0 -654
- package/src/react.plugin.d.ts +0 -147
- package/src/react.plugin.js +0 -146
- package/src/router-adapter.js +0 -0
- package/src/services/react-bundle.service.d.ts +0 -47
- package/src/services/react-bundle.service.js +0 -93
- package/src/services/react-hmr-page-metadata-cache.js +0 -35
- package/src/services/react-hydration-asset.service.d.ts +0 -76
- package/src/services/react-hydration-asset.service.js +0 -210
- package/src/services/react-page-module.service.d.ts +0 -83
- package/src/services/react-page-module.service.js +0 -162
- package/src/services/react-runtime-bundle.service.d.ts +0 -40
- package/src/services/react-runtime-bundle.service.js +0 -130
- package/src/utils/client-graph-boundary-plugin.d.ts +0 -43
- package/src/utils/client-graph-boundary-plugin.js +0 -494
- package/src/utils/client-only.js +0 -19
- package/src/utils/declared-modules.js +0 -59
- package/src/utils/dynamic.js +0 -12
- package/src/utils/hmr-scripts.d.ts +0 -18
- package/src/utils/hmr-scripts.js +0 -31
- package/src/utils/html-boundary.js +0 -55
- package/src/utils/hydration-scripts.d.ts +0 -86
- package/src/utils/hydration-scripts.js +0 -285
- package/src/utils/reachability-analyzer.d.ts +0 -66
- package/src/utils/reachability-analyzer.js +0 -339
- package/src/utils/react-dom-runtime-interop-plugin.js +0 -29
- package/src/utils/react-mdx-loader-plugin.d.ts +0 -3
- package/src/utils/react-mdx-loader-plugin.js +0 -45
- package/src/utils/react-runtime-specifier-map.d.ts +0 -6
- package/src/utils/react-runtime-specifier-map.js +0 -37
- package/src/utils/use-sync-external-store-shim-plugin.d.ts +0 -5
- package/src/utils/use-sync-external-store-shim-plugin.js +0 -41
- /package/src/{utils → app}/client-only.d.ts +0 -0
- /package/src/{utils → app}/dynamic.d.ts +0 -0
- /package/src/{declarations.d.ts → contracts/declarations.d.ts} +0 -0
- /package/src/{utils → render}/html-boundary.d.ts +0 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { createElement, useEffect } from 'react';
|
|
3
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
4
|
+
import { mountIslands, updateIslands } from './browser/island-hydration.js';
|
|
5
|
+
import { startPageHydration } from './browser/page-hydration.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolves after the browser has run every task queued before the call.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* For asserting that something did not happen. A message-channel round trip runs after all pending
|
|
11
|
+
* promise reactions without a timer, so it cannot be mistaken for waiting out a delay.
|
|
12
|
+
*/
|
|
13
|
+
function flushTasks() {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
const channel = new MessageChannel();
|
|
16
|
+
channel.port1.onmessage = () => resolve();
|
|
17
|
+
channel.port2.postMessage(null);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function createPageOptions(testWindow, router, pageRoot) {
|
|
21
|
+
const runtime = testWindow.__ECO_REACT_HYDRATION_TEST__;
|
|
22
|
+
const Page = () => null;
|
|
23
|
+
const reactRuntime = {
|
|
24
|
+
hydrateRoot: (target, tree, options) => {
|
|
25
|
+
runtime.hydrateCalls.push({
|
|
26
|
+
containerTag: target.tagName,
|
|
27
|
+
hasRecoverableErrorHandler: typeof options?.onRecoverableError === 'function',
|
|
28
|
+
tree,
|
|
29
|
+
});
|
|
30
|
+
return (pageRoot ?? {
|
|
31
|
+
render: (nextTree) => runtime.renderCalls.push(nextTree),
|
|
32
|
+
unmount: () => {
|
|
33
|
+
runtime.unmountCount += 1;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
createElement: (...args) => ({ args }),
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
scriptId: 'ecopages-react-page',
|
|
41
|
+
pageModuleUrl: '/assets/page.js',
|
|
42
|
+
Page,
|
|
43
|
+
pageDataReader: {
|
|
44
|
+
readPageDataDocument: () => ({ props: { title: 'Hello React', locals: { theme: 'dark' } } }),
|
|
45
|
+
getPageDataFromDocument: () => ({ title: 'Hello React' }),
|
|
46
|
+
},
|
|
47
|
+
runtime: reactRuntime,
|
|
48
|
+
createTree: (Component, props) => ({ Component, props }),
|
|
49
|
+
hasRouter: router,
|
|
50
|
+
isMdx: false,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
describe('React page lifecycle', () => {
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
document.body.innerHTML = '';
|
|
56
|
+
delete window.__ECO_PAGES__;
|
|
57
|
+
delete window.__ECO_REACT_HYDRATION_TEST__;
|
|
58
|
+
});
|
|
59
|
+
it('registers router ownership and cleanup', async () => {
|
|
60
|
+
const testWindow = window;
|
|
61
|
+
const testState = {
|
|
62
|
+
hydrateCalls: [],
|
|
63
|
+
renderCalls: [],
|
|
64
|
+
claimedOwners: [],
|
|
65
|
+
releasedOwners: [],
|
|
66
|
+
registrations: [],
|
|
67
|
+
unmountCount: 0,
|
|
68
|
+
};
|
|
69
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = testState;
|
|
70
|
+
testWindow.__ECO_PAGES__ = {
|
|
71
|
+
navigation: {
|
|
72
|
+
getOwnerState: () => ({ owner: 'html', canHandleSpaNavigation: false }),
|
|
73
|
+
register: (registration) => testState.registrations.push(registration),
|
|
74
|
+
claimOwnership: (owner) => testState.claimedOwners.push(owner),
|
|
75
|
+
releaseOwnership: (owner) => testState.releasedOwners.push(owner),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
79
|
+
startPageHydration(createPageOptions(testWindow, true));
|
|
80
|
+
await vi.waitFor(() => expect(testState.hydrateCalls).toHaveLength(1), { interval: 1 });
|
|
81
|
+
expect(testState.hydrateCalls).toHaveLength(1);
|
|
82
|
+
expect(testState.hydrateCalls[0].containerTag).toBe('BODY');
|
|
83
|
+
expect(testState.hydrateCalls[0].hasRecoverableErrorHandler).toBe(true);
|
|
84
|
+
expect(testState.claimedOwners).toEqual(['react-router']);
|
|
85
|
+
expect(testState.registrations).toHaveLength(1);
|
|
86
|
+
expect(typeof testWindow.__ECO_PAGES__?.react?.cleanupPageRoot).toBe('function');
|
|
87
|
+
await testWindow.__ECO_PAGES__?.react?.cleanupPageRoot?.();
|
|
88
|
+
expect(testState.unmountCount).toBe(1);
|
|
89
|
+
expect(testState.releasedOwners).toEqual(['react-router']);
|
|
90
|
+
expect(testWindow.__ECO_PAGES__?.page).toBeUndefined();
|
|
91
|
+
expect(testWindow.__ECO_PAGES__?.react?.pageRoot).toBeNull();
|
|
92
|
+
});
|
|
93
|
+
it('reuses an existing router-owned page root on rerun', async () => {
|
|
94
|
+
const testWindow = window;
|
|
95
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = {
|
|
96
|
+
hydrateCalls: [],
|
|
97
|
+
renderCalls: [],
|
|
98
|
+
claimedOwners: [],
|
|
99
|
+
releasedOwners: [],
|
|
100
|
+
registrations: [],
|
|
101
|
+
unmountCount: 0,
|
|
102
|
+
};
|
|
103
|
+
const existingRoot = {
|
|
104
|
+
render: (tree) => testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls.push(tree),
|
|
105
|
+
unmount: () => {
|
|
106
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__.unmountCount += 1;
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
testWindow.__ECO_PAGES__ = {
|
|
110
|
+
navigation: {
|
|
111
|
+
getOwnerState: () => ({ owner: 'react-router', canHandleSpaNavigation: true }),
|
|
112
|
+
},
|
|
113
|
+
react: { pageRoot: existingRoot },
|
|
114
|
+
};
|
|
115
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
116
|
+
startPageHydration(createPageOptions(testWindow, true, existingRoot));
|
|
117
|
+
await flushTasks();
|
|
118
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(0);
|
|
119
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls).toHaveLength(0);
|
|
120
|
+
expect(testWindow.__ECO_PAGES__?.react?.pageRoot).toBe(existingRoot);
|
|
121
|
+
});
|
|
122
|
+
it('coalesces concurrent startup and cancels a preload after cleanup', async () => {
|
|
123
|
+
const testWindow = window;
|
|
124
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = {
|
|
125
|
+
hydrateCalls: [],
|
|
126
|
+
renderCalls: [],
|
|
127
|
+
claimedOwners: [],
|
|
128
|
+
releasedOwners: [],
|
|
129
|
+
registrations: [],
|
|
130
|
+
unmountCount: 0,
|
|
131
|
+
};
|
|
132
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
133
|
+
let resolvePreload;
|
|
134
|
+
const preload = new Promise((resolve) => {
|
|
135
|
+
resolvePreload = resolve;
|
|
136
|
+
});
|
|
137
|
+
const options = createPageOptions(testWindow, false);
|
|
138
|
+
options.preload = () => preload;
|
|
139
|
+
options.hmr = { importPath: '/assets/page.js' };
|
|
140
|
+
startPageHydration(options);
|
|
141
|
+
expect(typeof testWindow.__ECO_PAGES__?.hmrHandlers?.['/assets/page.js']).toBe('function');
|
|
142
|
+
const rerun = testWindow.__ECO_PAGES__?.rerunScripts?.['ecopages-react-page'];
|
|
143
|
+
rerun?.();
|
|
144
|
+
await Promise.resolve();
|
|
145
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(0);
|
|
146
|
+
await testWindow.__ECO_PAGES__?.react?.cleanupPageRoot?.();
|
|
147
|
+
resolvePreload();
|
|
148
|
+
await flushTasks();
|
|
149
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(0);
|
|
150
|
+
});
|
|
151
|
+
it('ignores an HMR update that settles after navigation cleanup', async () => {
|
|
152
|
+
const testWindow = window;
|
|
153
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = {
|
|
154
|
+
hydrateCalls: [],
|
|
155
|
+
renderCalls: [],
|
|
156
|
+
claimedOwners: [],
|
|
157
|
+
releasedOwners: [],
|
|
158
|
+
registrations: [],
|
|
159
|
+
unmountCount: 0,
|
|
160
|
+
};
|
|
161
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
162
|
+
const options = createPageOptions(testWindow, false);
|
|
163
|
+
options.hmr = { importPath: '/assets/page.js' };
|
|
164
|
+
startPageHydration(options);
|
|
165
|
+
await vi.waitFor(() => expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(1), {
|
|
166
|
+
interval: 1,
|
|
167
|
+
});
|
|
168
|
+
let resolveUpdate;
|
|
169
|
+
globalThis.__ECO_TEST_HMR_RELEASE__ = new Promise((resolve) => {
|
|
170
|
+
resolveUpdate = resolve;
|
|
171
|
+
});
|
|
172
|
+
const source = [
|
|
173
|
+
'export default function UpdatedPage() {}',
|
|
174
|
+
'export async function preload() {',
|
|
175
|
+
' globalThis.__ECO_TEST_HMR_PRELOAD_STARTED__ = true',
|
|
176
|
+
' await globalThis.__ECO_TEST_HMR_RELEASE__',
|
|
177
|
+
'}',
|
|
178
|
+
].join('\n');
|
|
179
|
+
const hmrHandler = testWindow.__ECO_PAGES__?.hmrHandlers?.['/assets/page.js'];
|
|
180
|
+
expect(hmrHandler).toBeDefined();
|
|
181
|
+
const update = hmrHandler?.(`data:text/javascript;charset=utf-8,${encodeURIComponent(source)}`);
|
|
182
|
+
await vi.waitFor(() => expect(globalThis.__ECO_TEST_HMR_PRELOAD_STARTED__).toBe(true), {
|
|
183
|
+
interval: 1,
|
|
184
|
+
});
|
|
185
|
+
await testWindow.__ECO_PAGES__?.react?.cleanupPageRoot?.();
|
|
186
|
+
const replacementRoot = {
|
|
187
|
+
render: (tree) => testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls.push(tree),
|
|
188
|
+
unmount: () => undefined,
|
|
189
|
+
};
|
|
190
|
+
testWindow.__ECO_PAGES__.react.pageRoot = replacementRoot;
|
|
191
|
+
resolveUpdate();
|
|
192
|
+
await update;
|
|
193
|
+
await hmrHandler?.('data:text/javascript,export default function RemovedPage() {}');
|
|
194
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls).toHaveLength(0);
|
|
195
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.unmountCount).toBe(1);
|
|
196
|
+
delete globalThis.__ECO_TEST_HMR_RELEASE__;
|
|
197
|
+
delete globalThis.__ECO_TEST_HMR_PRELOAD_STARTED__;
|
|
198
|
+
});
|
|
199
|
+
it('restores HMR handler with updated generation on page reactivation after cleanup', async () => {
|
|
200
|
+
const testWindow = window;
|
|
201
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = {
|
|
202
|
+
hydrateCalls: [],
|
|
203
|
+
renderCalls: [],
|
|
204
|
+
claimedOwners: [],
|
|
205
|
+
releasedOwners: [],
|
|
206
|
+
registrations: [],
|
|
207
|
+
unmountCount: 0,
|
|
208
|
+
};
|
|
209
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
210
|
+
const options = createPageOptions(testWindow, false);
|
|
211
|
+
options.hmr = { importPath: '/assets/page.js' };
|
|
212
|
+
startPageHydration(options);
|
|
213
|
+
await vi.waitFor(() => expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(1), {
|
|
214
|
+
interval: 1,
|
|
215
|
+
});
|
|
216
|
+
const initialHmr = testWindow.__ECO_PAGES__?.hmrHandlers?.['/assets/page.js'];
|
|
217
|
+
expect(initialHmr).toBeDefined();
|
|
218
|
+
await testWindow.__ECO_PAGES__?.react?.cleanupPageRoot?.();
|
|
219
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.unmountCount).toBe(1);
|
|
220
|
+
await initialHmr?.('data:text/javascript,export default function IgnoredPage() {}');
|
|
221
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls).toHaveLength(0);
|
|
222
|
+
await testWindow.__ECO_PAGES__.rerunScripts['ecopages-react-page']();
|
|
223
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.hydrateCalls).toHaveLength(2);
|
|
224
|
+
const restoredHmr = testWindow.__ECO_PAGES__?.hmrHandlers?.['/assets/page.js'];
|
|
225
|
+
expect(restoredHmr).toBeDefined();
|
|
226
|
+
await restoredHmr?.('data:text/javascript,export default function UpdatedPage() {}');
|
|
227
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__?.renderCalls).toHaveLength(1);
|
|
228
|
+
});
|
|
229
|
+
it('publishes a replacement only after its preload completes', async () => {
|
|
230
|
+
const testWindow = window;
|
|
231
|
+
testWindow.__ECO_REACT_HYDRATION_TEST__ = {
|
|
232
|
+
hydrateCalls: [],
|
|
233
|
+
renderCalls: [],
|
|
234
|
+
claimedOwners: [],
|
|
235
|
+
releasedOwners: [],
|
|
236
|
+
registrations: [],
|
|
237
|
+
unmountCount: 0,
|
|
238
|
+
};
|
|
239
|
+
document.body.innerHTML = '<script data-eco-script-id="ecopages-react-page"></script>';
|
|
240
|
+
let releaseInitial;
|
|
241
|
+
let releaseUpdate;
|
|
242
|
+
let signalUpdate;
|
|
243
|
+
const initialPreload = new Promise((resolve) => {
|
|
244
|
+
releaseInitial = resolve;
|
|
245
|
+
});
|
|
246
|
+
const updateStarted = new Promise((resolve) => {
|
|
247
|
+
signalUpdate = resolve;
|
|
248
|
+
});
|
|
249
|
+
const updatePreload = new Promise((resolve) => {
|
|
250
|
+
releaseUpdate = resolve;
|
|
251
|
+
});
|
|
252
|
+
const testGlobals = globalThis;
|
|
253
|
+
testGlobals.__ECO_TEST_PENDING_PRELOAD__ = () => {
|
|
254
|
+
signalUpdate();
|
|
255
|
+
return updatePreload;
|
|
256
|
+
};
|
|
257
|
+
const options = createPageOptions(testWindow, false);
|
|
258
|
+
const initialPage = options.Page;
|
|
259
|
+
options.preload = () => initialPreload;
|
|
260
|
+
options.hmr = { importPath: '/assets/page.js' };
|
|
261
|
+
try {
|
|
262
|
+
startPageHydration(options);
|
|
263
|
+
const handler = testWindow.__ECO_PAGES__.hmrHandlers['/assets/page.js'];
|
|
264
|
+
const source = 'export default function ReadyPage() {} export const preload = () => globalThis.__ECO_TEST_PENDING_PRELOAD__();';
|
|
265
|
+
const update = handler(`data:text/javascript,${encodeURIComponent(source)}`);
|
|
266
|
+
await updateStarted;
|
|
267
|
+
expect(options.Page).toBe(initialPage);
|
|
268
|
+
releaseInitial();
|
|
269
|
+
await testWindow.__ECO_PAGES__.rerunScripts['ecopages-react-page']();
|
|
270
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__.hydrateCalls[0]?.tree).toMatchObject({
|
|
271
|
+
Component: initialPage,
|
|
272
|
+
});
|
|
273
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__.renderCalls).toHaveLength(0);
|
|
274
|
+
releaseUpdate();
|
|
275
|
+
await update;
|
|
276
|
+
expect(options.Page).not.toBe(initialPage);
|
|
277
|
+
expect(testWindow.__ECO_REACT_HYDRATION_TEST__.renderCalls).toEqual([
|
|
278
|
+
{ Component: options.Page, props: { title: 'Hello React' } },
|
|
279
|
+
]);
|
|
280
|
+
}
|
|
281
|
+
finally {
|
|
282
|
+
releaseInitial();
|
|
283
|
+
releaseUpdate();
|
|
284
|
+
delete testGlobals.__ECO_TEST_PENDING_PRELOAD__;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
describe('React Island Host lifecycle', () => {
|
|
289
|
+
afterEach(() => {
|
|
290
|
+
document.body.innerHTML = '';
|
|
291
|
+
});
|
|
292
|
+
it('hydrates in place, ignores repeated startup, and releases removed hosts', async () => {
|
|
293
|
+
const host = document.createElement('eco-island');
|
|
294
|
+
host.setAttribute('data-eco-island', '');
|
|
295
|
+
host.setAttribute('data-eco-island-integration', 'react');
|
|
296
|
+
host.setAttribute('data-eco-component-id', 'instance-1');
|
|
297
|
+
host.setAttribute('data-eco-component-key', 'component-1');
|
|
298
|
+
host.setAttribute('data-eco-props', btoa(JSON.stringify({ value: 'server' })));
|
|
299
|
+
const child = document.createElement('input');
|
|
300
|
+
child.value = 'typed before hydration';
|
|
301
|
+
host.appendChild(child);
|
|
302
|
+
document.body.appendChild(host);
|
|
303
|
+
const calls = { hydrate: 0, render: 0, unmount: 0, recoverableErrors: 0 };
|
|
304
|
+
const hydratedComponents = [];
|
|
305
|
+
const runtime = { islandRoots: {}, islandComponents: {} };
|
|
306
|
+
const reactRuntime = {
|
|
307
|
+
hydrateRoot: (target, tree, options) => {
|
|
308
|
+
calls.hydrate += 1;
|
|
309
|
+
if (options?.onRecoverableError)
|
|
310
|
+
calls.recoverableErrors += 1;
|
|
311
|
+
hydratedComponents.push(tree.props.Component);
|
|
312
|
+
const root = {
|
|
313
|
+
render: (nextTree) => {
|
|
314
|
+
calls.render += 1;
|
|
315
|
+
hydratedComponents.push(nextTree.props.Component);
|
|
316
|
+
},
|
|
317
|
+
unmount: () => {
|
|
318
|
+
calls.unmount += 1;
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
tree.type(tree.props);
|
|
322
|
+
void target;
|
|
323
|
+
return root;
|
|
324
|
+
},
|
|
325
|
+
createElement: (type, props) => ({ type, props }),
|
|
326
|
+
useEffect: (effect) => queueMicrotask(effect),
|
|
327
|
+
};
|
|
328
|
+
const Component = () => null;
|
|
329
|
+
const options = {
|
|
330
|
+
targetSelector: '[data-eco-component-key="component-1"]',
|
|
331
|
+
componentModule: { default: Component },
|
|
332
|
+
scriptId: 'island-script',
|
|
333
|
+
runtime: reactRuntime,
|
|
334
|
+
runtimeState: runtime,
|
|
335
|
+
};
|
|
336
|
+
mountIslands(options);
|
|
337
|
+
mountIslands(options);
|
|
338
|
+
await flushTasks();
|
|
339
|
+
expect(calls.hydrate).toBe(1);
|
|
340
|
+
expect(host.firstElementChild).toBe(child);
|
|
341
|
+
expect(host.getAttribute('data-eco-hydrated')).toBe('true');
|
|
342
|
+
expect(calls.recoverableErrors).toBe(1);
|
|
343
|
+
const NextComponent = () => null;
|
|
344
|
+
updateIslands(options, { default: NextComponent });
|
|
345
|
+
expect(calls.render).toBe(1);
|
|
346
|
+
expect(hydratedComponents[hydratedComponents.length - 1]).toBe(NextComponent);
|
|
347
|
+
const secondHost = host.cloneNode(false);
|
|
348
|
+
document.body.appendChild(secondHost);
|
|
349
|
+
mountIslands(options);
|
|
350
|
+
expect(calls.hydrate).toBe(2);
|
|
351
|
+
expect(hydratedComponents[hydratedComponents.length - 1]).toBe(NextComponent);
|
|
352
|
+
host.remove();
|
|
353
|
+
await vi.waitFor(() => expect(calls.unmount).toBe(1), { interval: 1 });
|
|
354
|
+
runtime.observer?.disconnect();
|
|
355
|
+
});
|
|
356
|
+
it('hydrates with props that contain non-Latin-1 text', () => {
|
|
357
|
+
const host = document.createElement('eco-island');
|
|
358
|
+
host.setAttribute('data-eco-island', '');
|
|
359
|
+
host.setAttribute('data-eco-component-key', 'component-unicode');
|
|
360
|
+
/** Props `{ label: '10 €', city: '東京', icon: '🙂' }` as core's `encodeIslandProps` writes them. */
|
|
361
|
+
host.setAttribute('data-eco-props', 'eyJsYWJlbCI6IjEwIOKCrCIsImNpdHkiOiLmnbHkuqwiLCJpY29uIjoi8J+ZgiJ9');
|
|
362
|
+
document.body.appendChild(host);
|
|
363
|
+
const Component = () => null;
|
|
364
|
+
const renderedProps = [];
|
|
365
|
+
const runtime = { islandRoots: {}, islandComponents: {} };
|
|
366
|
+
mountIslands({
|
|
367
|
+
targetSelector: '[data-eco-component-key="component-unicode"]',
|
|
368
|
+
componentModule: { default: Component },
|
|
369
|
+
scriptId: 'island-script-unicode',
|
|
370
|
+
runtimeState: runtime,
|
|
371
|
+
runtime: {
|
|
372
|
+
hydrateRoot: (_target, tree) => {
|
|
373
|
+
const element = tree;
|
|
374
|
+
element.type(element.props);
|
|
375
|
+
return { render: () => { }, unmount: () => { } };
|
|
376
|
+
},
|
|
377
|
+
createElement: (type, elementProps) => {
|
|
378
|
+
if (type === Component)
|
|
379
|
+
renderedProps.push(elementProps);
|
|
380
|
+
return { type, props: elementProps };
|
|
381
|
+
},
|
|
382
|
+
useEffect: () => { },
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
expect(renderedProps).toEqual([{ label: '10 €', city: '東京', icon: '🙂' }]);
|
|
386
|
+
runtime.observer?.disconnect();
|
|
387
|
+
});
|
|
388
|
+
it('preserves a focused uncontrolled input with the real React hydrator', async () => {
|
|
389
|
+
const host = document.createElement('eco-island');
|
|
390
|
+
host.setAttribute('data-eco-island', '');
|
|
391
|
+
host.setAttribute('data-eco-component-id', 'real-instance');
|
|
392
|
+
host.setAttribute('data-eco-component-key', 'real-component');
|
|
393
|
+
host.setAttribute('data-eco-props', btoa(JSON.stringify({ value: 'server value' })));
|
|
394
|
+
const input = document.createElement('input');
|
|
395
|
+
input.defaultValue = 'server value';
|
|
396
|
+
input.value = 'typed before hydration';
|
|
397
|
+
host.appendChild(input);
|
|
398
|
+
document.body.appendChild(host);
|
|
399
|
+
input.focus();
|
|
400
|
+
const Component = (props) => createElement('input', { defaultValue: String(props.value ?? '') });
|
|
401
|
+
const reactRuntime = {
|
|
402
|
+
hydrateRoot: (target, tree, options) => {
|
|
403
|
+
const root = hydrateRoot(target, tree, options);
|
|
404
|
+
return {
|
|
405
|
+
render: (nextTree) => root.render(nextTree),
|
|
406
|
+
unmount: () => root.unmount(),
|
|
407
|
+
};
|
|
408
|
+
},
|
|
409
|
+
createElement: (type, props) => createElement(type, props),
|
|
410
|
+
useEffect: (effect) => {
|
|
411
|
+
useEffect(effect);
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
const runtime = { islandRoots: {}, islandComponents: {} };
|
|
415
|
+
mountIslands({
|
|
416
|
+
targetSelector: '[data-eco-component-key="real-component"]',
|
|
417
|
+
componentModule: { default: Component },
|
|
418
|
+
scriptId: 'real-island-script',
|
|
419
|
+
runtime: reactRuntime,
|
|
420
|
+
runtimeState: runtime,
|
|
421
|
+
});
|
|
422
|
+
await vi.waitFor(() => expect(host.getAttribute('data-eco-hydrated')).toBe('true'), { interval: 1 });
|
|
423
|
+
expect(host.firstElementChild).toBe(input);
|
|
424
|
+
expect(input.value).toBe('typed before hydration');
|
|
425
|
+
expect(document.activeElement).toBe(input);
|
|
426
|
+
expect(host.getAttribute('data-eco-hydrated')).toBe('true');
|
|
427
|
+
runtime.observer?.disconnect();
|
|
428
|
+
});
|
|
429
|
+
it('resolves the component matching componentRef when a module exports multiple components from the same file', async () => {
|
|
430
|
+
const host = document.createElement('eco-island');
|
|
431
|
+
host.setAttribute('data-eco-island', '');
|
|
432
|
+
host.setAttribute('data-eco-component-id', 'multi-instance');
|
|
433
|
+
host.setAttribute('data-eco-component-key', 'multi-component');
|
|
434
|
+
document.body.appendChild(host);
|
|
435
|
+
const Helper = () => null;
|
|
436
|
+
Helper.config = { identity: { id: 'Helper', file: '/app/Counter.tsx' } };
|
|
437
|
+
const Target = () => null;
|
|
438
|
+
Target.config = { identity: { id: 'Target', file: '/app/Counter.tsx' } };
|
|
439
|
+
let hydratedComponent;
|
|
440
|
+
const reactRuntime = {
|
|
441
|
+
hydrateRoot: (_target, tree) => {
|
|
442
|
+
hydratedComponent = tree.props.Component;
|
|
443
|
+
return { render: () => { }, unmount: () => { } };
|
|
444
|
+
},
|
|
445
|
+
createElement: (type, props) => ({ type, props }),
|
|
446
|
+
useEffect: () => { },
|
|
447
|
+
};
|
|
448
|
+
const runtime = { islandRoots: {}, islandComponents: {} };
|
|
449
|
+
mountIslands({
|
|
450
|
+
targetSelector: '[data-eco-component-key="multi-component"]',
|
|
451
|
+
componentModule: { Helper, Target },
|
|
452
|
+
componentRef: 'Target',
|
|
453
|
+
componentFile: '/app/Counter.tsx',
|
|
454
|
+
scriptId: 'multi-island-script',
|
|
455
|
+
runtime: reactRuntime,
|
|
456
|
+
runtimeState: runtime,
|
|
457
|
+
});
|
|
458
|
+
expect(hydratedComponent).toBe(Target);
|
|
459
|
+
runtime.observer?.disconnect();
|
|
460
|
+
});
|
|
461
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function assertRouterConfiguration(options) {
|
|
2
|
+
if (options.routerComponents && !options.routerImportPath) {
|
|
3
|
+
throw new Error('routerImportPath is required when router components are configured');
|
|
4
|
+
}
|
|
5
|
+
if (options.routerComponents && !options.routerPropsExpression) {
|
|
6
|
+
throw new Error('routerPropsExpression is required when router components are configured');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function buildPageImport(options) {
|
|
10
|
+
if (options.isMdx || options.hasPagePreload) {
|
|
11
|
+
return `import * as PageModule from ${JSON.stringify(options.importPath)};`;
|
|
12
|
+
}
|
|
13
|
+
return `import Page from ${JSON.stringify(options.importPath)};`;
|
|
14
|
+
}
|
|
15
|
+
function buildInitialPageBinding(options) {
|
|
16
|
+
if (options.isMdx || options.hasPagePreload) {
|
|
17
|
+
return `const initialPage = resolvePageModule(PageModule, ${options.isMdx}, ${options.isMdx ? 'ensurePageConfigLayouts' : 'undefined'});`;
|
|
18
|
+
}
|
|
19
|
+
return `const initialPage = resolvePageModule({ default: Page }, false);`;
|
|
20
|
+
}
|
|
21
|
+
function buildRouterImports(options) {
|
|
22
|
+
if (!options.routerComponents)
|
|
23
|
+
return '';
|
|
24
|
+
return `import { ${options.routerComponents.router}, ${options.routerComponents.pageContent} } from ${JSON.stringify(options.routerImportPath)};`;
|
|
25
|
+
}
|
|
26
|
+
function buildRouterTree(options) {
|
|
27
|
+
if (!options.routerComponents) {
|
|
28
|
+
return 'const createTree = (Page, props) => composeLayoutPageTree(Page, props);';
|
|
29
|
+
}
|
|
30
|
+
return `const createTree = (Page, props) => {
|
|
31
|
+
const pageContent = createElement(${options.routerComponents.pageContent});
|
|
32
|
+
return createElement(${options.routerComponents.router}, ${options.routerPropsExpression}, pageContent);
|
|
33
|
+
};`;
|
|
34
|
+
}
|
|
35
|
+
function buildNormalizationImport(options) {
|
|
36
|
+
if (!options.isMdx)
|
|
37
|
+
return '';
|
|
38
|
+
return `import { ensurePageConfigLayouts } from ${JSON.stringify(options.pageLayoutNormalizationImportPath)};`;
|
|
39
|
+
}
|
|
40
|
+
function buildHmrOptions(options) {
|
|
41
|
+
if (!options.hmrEnabled)
|
|
42
|
+
return '';
|
|
43
|
+
const layoutStack = options.routerComponents
|
|
44
|
+
? 'getLayoutStack: (Page) => (Page.config?.layouts ?? []).map((layout) => layout?.config?.identity?.file ?? "").join("|"),'
|
|
45
|
+
: '';
|
|
46
|
+
return `hmr: {
|
|
47
|
+
importPath: ${JSON.stringify(options.importPath)},
|
|
48
|
+
${layoutStack}
|
|
49
|
+
},`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates the Page entry contract consumed by the browser lifecycle.
|
|
53
|
+
*/
|
|
54
|
+
export function createPageEntrySource(options) {
|
|
55
|
+
assertRouterConfiguration(options);
|
|
56
|
+
const pageBootstrapId = '\0ecopages-react-page-bootstrap';
|
|
57
|
+
const pageDataReaderId = '\0ecopages-react-page-data-reader';
|
|
58
|
+
return `
|
|
59
|
+
import { hydrateRoot } from ${JSON.stringify(options.reactDomClientImportPath)};
|
|
60
|
+
import { createElement } from ${JSON.stringify(options.reactImportPath)};
|
|
61
|
+
import { resolvePageModule, startPageHydration } from ${JSON.stringify(pageBootstrapId)};
|
|
62
|
+
import { readPageDataDocument, getPageDataFromDocument } from ${JSON.stringify(pageDataReaderId)};
|
|
63
|
+
${options.routerComponents ? '' : `import { composeLayoutPageTree } from ${JSON.stringify(options.layoutComposeImportPath)};`}
|
|
64
|
+
${buildRouterImports(options)}
|
|
65
|
+
${buildNormalizationImport(options)}
|
|
66
|
+
${buildPageImport(options)}
|
|
67
|
+
const pageModuleUrl = ${options.pageModuleUrlExpression};
|
|
68
|
+
${buildInitialPageBinding(options)}
|
|
69
|
+
${buildRouterTree(options)}
|
|
70
|
+
export default initialPage.Page;
|
|
71
|
+
${options.hasPagePreload ? 'export const preload = initialPage.preload;' : ''}
|
|
72
|
+
export const config = initialPage.Page.config;
|
|
73
|
+
startPageHydration({
|
|
74
|
+
scriptId: ${JSON.stringify(options.scriptId)},
|
|
75
|
+
pageModuleUrl,
|
|
76
|
+
Page: initialPage.Page,
|
|
77
|
+
pageDataReader: { readPageDataDocument, getPageDataFromDocument },
|
|
78
|
+
runtime: { hydrateRoot, createElement },
|
|
79
|
+
createTree,
|
|
80
|
+
hasRouter: ${Boolean(options.routerComponents)},
|
|
81
|
+
isMdx: ${options.isMdx},
|
|
82
|
+
${options.isMdx ? 'normalizePageConfig: ensurePageConfigLayouts,' : ''}
|
|
83
|
+
${options.hasPagePreload ? 'preload: initialPage.preload,' : ''}
|
|
84
|
+
${buildHmrOptions(options)}
|
|
85
|
+
});
|
|
86
|
+
`.trim();
|
|
87
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Complete inputs that affect an Island Host script's generated source. */
|
|
2
|
+
export type CompiledIslandHydrationOptions = {
|
|
3
|
+
importPath: string;
|
|
4
|
+
scriptId: string;
|
|
5
|
+
reactImportPath: string;
|
|
6
|
+
reactDomClientImportPath: string;
|
|
7
|
+
targetSelector: string;
|
|
8
|
+
componentRef?: string;
|
|
9
|
+
componentFile?: string;
|
|
10
|
+
minify: boolean;
|
|
11
|
+
hmrEnabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type { CompiledPageHydrationOptions } from './compiled-page-hydration-options.js';
|
|
14
|
+
import type { CompiledPageHydrationOptions } from './compiled-page-hydration-options.js';
|
|
15
|
+
/**
|
|
16
|
+
* Compiles the editable React Island Host lifecycle into a browser ESM string.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Compilation is cached by the complete entry configuration. Rejected promises
|
|
20
|
+
* are removed so a transient filesystem or bundler error can recover.
|
|
21
|
+
*/
|
|
22
|
+
export declare class IslandHydrationScriptCompiler {
|
|
23
|
+
private readonly compilationCache;
|
|
24
|
+
/**
|
|
25
|
+
* Compiles and caches one readable or minified Island Host entry.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Complete entry imports, selector, identity, and output mode.
|
|
28
|
+
* @returns A browser ESM source string.
|
|
29
|
+
*/
|
|
30
|
+
compile(options: CompiledIslandHydrationOptions): Promise<string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compiles editable Page lifecycle modules into browser ESM strings.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* The cache belongs to the service instance, allowing development restarts to
|
|
37
|
+
* discard framework-source changes without sharing stale output globally.
|
|
38
|
+
*/
|
|
39
|
+
export declare class PageHydrationScriptCompiler {
|
|
40
|
+
private readonly compilationCache;
|
|
41
|
+
/**
|
|
42
|
+
* Compiles and caches one readable or minified Page entry.
|
|
43
|
+
*
|
|
44
|
+
* @param options - Complete page imports, router contract, and output mode.
|
|
45
|
+
* @returns A browser ESM source string.
|
|
46
|
+
*/
|
|
47
|
+
compile(options: CompiledPageHydrationOptions): Promise<string>;
|
|
48
|
+
}
|