@ecopages/react 0.2.1-beta.0 → 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 +164 -28
- package/package.json +67 -30
- package/src/app/client-only.js +10 -0
- package/src/app/dynamic.js +9 -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/{services/react-bundle.service.d.ts → bundling/bundle.d.ts} +29 -11
- 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.js +77 -0
- 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/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} +5 -1
- 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/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/{services/react-mdx-config-dependency.service.d.ts → mdx/mdx-config-dependency.d.ts} +9 -8
- 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.js +1 -0
- package/src/{react.plugin.d.ts → plugin/react.plugin.d.ts} +21 -27
- 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.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.js +52 -54
- package/src/eco-embed.js +0 -11
- package/src/react-hmr-strategy.d.ts +0 -230
- package/src/react-hmr-strategy.js +0 -657
- package/src/react-renderer.d.ts +0 -233
- package/src/react-renderer.js +0 -622
- package/src/react.constants.js +0 -4
- package/src/react.plugin.js +0 -205
- package/src/react.types.d.ts +0 -88
- package/src/react.types.js +0 -0
- package/src/router-adapter.js +0 -0
- package/src/services/pages-index.d.ts +0 -64
- package/src/services/pages-index.js +0 -73
- package/src/services/react-bundle.service.js +0 -86
- package/src/services/react-hmr-page-metadata-cache.js +0 -35
- package/src/services/react-hydration-asset.service.d.ts +0 -84
- package/src/services/react-hydration-asset.service.js +0 -217
- package/src/services/react-mdx-config-dependency.service.js +0 -122
- package/src/services/react-page-module.service.d.ts +0 -88
- package/src/services/react-page-module.service.js +0 -166
- package/src/services/react-page-payload.service.d.ts +0 -46
- package/src/services/react-page-payload.service.js +0 -67
- package/src/services/react-runtime-bundle.service.d.ts +0 -45
- package/src/services/react-runtime-bundle.service.js +0 -186
- package/src/utils/client-graph-boundary-cache.d.ts +0 -108
- package/src/utils/client-graph-boundary-cache.js +0 -116
- package/src/utils/client-graph-boundary-plugin.d.ts +0 -51
- package/src/utils/client-graph-boundary-plugin.js +0 -552
- package/src/utils/client-only.js +0 -19
- package/src/utils/component-config-traversal.js +0 -54
- package/src/utils/declared-modules.js +0 -47
- package/src/utils/dynamic.js +0 -12
- package/src/utils/dynamic.test.browser.js +0 -33
- 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 -92
- package/src/utils/hydration-scripts.js +0 -358
- package/src/utils/hydration-scripts.test.browser.js +0 -198
- 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 -38
- 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-alias-map.d.ts +0 -8
- package/src/utils/react-runtime-alias-map.js +0 -90
- /package/src/{utils → app}/client-only.d.ts +0 -0
- /package/src/{utils → app}/dynamic.d.ts +0 -0
- /package/src/{utils → app}/dynamic.test.browser.d.ts +0 -0
- /package/src/{utils → client-graph}/component-config-traversal.d.ts +0 -0
- /package/src/{utils → client-graph}/declared-modules.d.ts +0 -0
- /package/src/{declarations.d.ts → contracts/declarations.d.ts} +0 -0
- /package/src/{router-adapter.d.ts → contracts/router-adapter.d.ts} +0 -0
- /package/src/{utils/hydration-scripts.test.browser.d.ts → hydration/compiled-page-hydration-options.js} +0 -0
- /package/src/{react.constants.d.ts → plugin/react.constants.d.ts} +0 -0
- /package/src/{eco-embed.d.ts → render/eco-embed.d.ts} +0 -0
- /package/src/{utils → render}/html-boundary.d.ts +0 -0
package/README.md
CHANGED
|
@@ -14,15 +14,10 @@ bun add -d @types/react @types/react-dom
|
|
|
14
14
|
Configure the plugin in your `eco.config.ts`:
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
|
-
import {
|
|
17
|
+
import { defineConfig } from '@ecopages/core/config';
|
|
18
18
|
import { reactPlugin } from '@ecopages/react';
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
.setBaseUrl(import.meta.env.ECOPAGES_BASE_URL)
|
|
22
|
-
.setIntegrations([reactPlugin()])
|
|
23
|
-
.build();
|
|
24
|
-
|
|
25
|
-
export default config;
|
|
20
|
+
export default defineConfig({ integrations: [reactPlugin()] });
|
|
26
21
|
```
|
|
27
22
|
|
|
28
23
|
## Component-Level Islands
|
|
@@ -30,8 +25,9 @@ export default config;
|
|
|
30
25
|
For component-level islands, Ecopages React uses this contract:
|
|
31
26
|
|
|
32
27
|
- SSR output preserves the authored DOM structure (no unnecessary wrapper elements).
|
|
33
|
-
- A stable `data-eco-component-id
|
|
34
|
-
- The island
|
|
28
|
+
- A stable island host contract is stamped on the component SSR root via core (`data-eco-island`, `data-eco-island-integration`, `data-eco-component-id`, optional `data-eco-component-key` / `data-eco-props`).
|
|
29
|
+
- During non-HMR runtime rendering, island and lazy-entry client modules are built together from the page client plan, in one grouped browser build during route preparation. Static production export contributes React hydration and lazy entries, every Integration's Page Browser Graph entries, and HTML Page and `html.html` shell module scripts to compatible app-wide browser build groups. Hydration scripts import the recorded output URLs. Same-integration Page, Layout, and includes are hydrated by the page bootstrap. The Html shell is not an island, even when its Integration differs from the page owner. Only a React component whose Integration differs from its parent's, on another owner's page, receives a per-component island script. SSR stamps the host and attaches those assets; it does not start a per-island build.
|
|
30
|
+
- The island runtime keeps the SSR host and its children in place and hydrates that host with `hydrateRoot()`. The host uses `display: contents` so it does not introduce an extra layout box. Full-page hydration paths also use `hydrateRoot()`.
|
|
35
31
|
|
|
36
32
|
> [!TIP]
|
|
37
33
|
> **Full React SPA Routing:**
|
|
@@ -39,26 +35,23 @@ For component-level islands, Ecopages React uses this contract:
|
|
|
39
35
|
|
|
40
36
|
## MDX Support
|
|
41
37
|
|
|
42
|
-
The React plugin includes built-in MDX support.
|
|
38
|
+
The React plugin includes built-in MDX support. Add an `mdx` object to enable it; omit the property to disable MDX. You can write `.mdx` pages alongside `.tsx` pages with unified client-side routing, hydration, and HMR. Put `remarkPlugins`, `rehypePlugins`, and `recmaPlugins` next to `compilerOptions`, not inside it.
|
|
43
39
|
|
|
44
40
|
```ts
|
|
45
|
-
import {
|
|
41
|
+
import { defineConfig } from '@ecopages/core/config';
|
|
46
42
|
import { reactPlugin } from '@ecopages/react';
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
integrations: [
|
|
50
46
|
reactPlugin({
|
|
51
47
|
mdx: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
48
|
+
remarkPlugins: [],
|
|
49
|
+
rehypePlugins: [],
|
|
50
|
+
recmaPlugins: [],
|
|
56
51
|
},
|
|
57
52
|
}),
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export default config;
|
|
53
|
+
],
|
|
54
|
+
});
|
|
62
55
|
```
|
|
63
56
|
|
|
64
57
|
## Mixed Rendering
|
|
@@ -75,7 +68,11 @@ Important:
|
|
|
75
68
|
|
|
76
69
|
- Components that may render foreign children must declare those children in `config.dependencies.components`.
|
|
77
70
|
- Ecopages validates mixed-renderer ownership from declared dependencies during render preparation. It does not infer every foreign subtree from rendered HTML alone.
|
|
71
|
+
- Route-level dependency resolvers can supply Components at request time; React includes those resolved roots when deciding whether a Foreign Subtree needs handoff.
|
|
78
72
|
- React still keeps its own child transport and hydration rules for React-owned subtrees.
|
|
73
|
+
- React renderers use the required core `AssetProcessingService` to process declared component and MDX config dependencies.
|
|
74
|
+
|
|
75
|
+
React uses the shared core route and document-shell pipeline. Its renderer hooks supply the browser-safe page payload, unified React layout composition, document contributions and router ownership attributes.
|
|
79
76
|
|
|
80
77
|
## Server and Client Graph Contract
|
|
81
78
|
|
|
@@ -87,6 +84,10 @@ The React integration supports Node.js modules and server-only code **only on th
|
|
|
87
84
|
|
|
88
85
|
Keep server helpers close, but separate them physically or logically so they do not leak into the client bundle.
|
|
89
86
|
|
|
87
|
+
The `.server` naming rule comes from the browser-safe `@ecopages/core/build/contracts` entry. React applies it during import pruning before core's browser resolution guard runs. A Page that uses `.server.ts` imports only in server options such as `middleware` still builds: the imports and server options are removed before resolution.
|
|
88
|
+
|
|
89
|
+
For a hydratable Page that renders collection MDX, use `createCollectionComponentCache()` with the collection's `/browser` loader. Export `preload` from the Page so hydration, router navigation, and HMR load the current entry before synchronous render. The server may prime the same cache with `/server`'s `getComponent()` inside `staticProps`; `dependencies` remains server-only and is removed from the Page Browser Graph.
|
|
90
|
+
|
|
90
91
|
## Client Graph Boundary Architecture
|
|
91
92
|
|
|
92
93
|
This section explains the internal contract used to keep the browser bundle minimal while preventing server-only code and request-only configuration from leaking into client output.
|
|
@@ -109,6 +110,16 @@ Think about each React page as two related graphs:
|
|
|
109
110
|
|
|
110
111
|
The React integration builds the client graph conservatively. If a server-only module becomes reachable from the hydrated render path, the build should fail rather than silently shipping unsafe code.
|
|
111
112
|
|
|
113
|
+
The client-graph boundary analyzes project modules during each browser build and HMR rebuild; transform results and requested-export changes are not cached or replayed across builds. In grouped island builds, each entry file uses its own declared modules, while helper modules use the group's merged declarations because the build has one module instance for each helper. Set `ECO_AST_PROFILE=1` to emit one structured timing record per client-graph analysis while investigating a development rebuild.
|
|
114
|
+
|
|
115
|
+
### `explicitGraph` option
|
|
116
|
+
|
|
117
|
+
`reactPlugin({ explicitGraph: true })` forces the page browser graph (hydration assets) to emit for every React page, even when the page does not declare `dependencies.modules` and no router is configured.
|
|
118
|
+
|
|
119
|
+
It does **not** disable the client-graph AST boundary. Server-only `eco.page(...)` options such as `middleware` and `requires` are still stripped from browser bundles. With a router adapter, page hydration is already always on, so the option is redundant for SPA apps.
|
|
120
|
+
|
|
121
|
+
The option name is historical — it forces hydration asset emission, it does not mean “skip graph transforms.”
|
|
122
|
+
|
|
112
123
|
### What Stays and What Goes
|
|
113
124
|
|
|
114
125
|
The client bundle keeps:
|
|
@@ -131,7 +142,7 @@ Important:
|
|
|
131
142
|
|
|
132
143
|
### AST Pipeline Order
|
|
133
144
|
|
|
134
|
-
The browser-bound transform in [src/
|
|
145
|
+
The browser-bound transform in [src/client-graph/boundary-plugin.ts](src/client-graph/boundary-plugin.ts) follows this order:
|
|
135
146
|
|
|
136
147
|
1. Parse the module and build a reachability view of the client render graph.
|
|
137
148
|
2. Remove imports that are not allowed or not reachable from the client graph.
|
|
@@ -166,7 +177,7 @@ The fix is to strip server-only `eco.page(...)` options after import pruning, wh
|
|
|
166
177
|
|
|
167
178
|
The browser must not receive arbitrary request-scoped data.
|
|
168
179
|
|
|
169
|
-
The React renderer in [src/react-renderer.ts](src/react-renderer.ts) serializes only the top-level `locals` keys explicitly declared by `Page.requires`. If a page does not declare `requires`, no `locals` are serialized for hydration.
|
|
180
|
+
The React renderer in [src/render/react-renderer.ts](src/render/react-renderer.ts) serializes only the top-level `locals` keys explicitly declared by `Page.requires`. If a page does not declare `requires`, no `locals` are serialized for hydration.
|
|
170
181
|
|
|
171
182
|
Example:
|
|
172
183
|
|
|
@@ -191,7 +202,7 @@ Hydration must rebuild the same tree the server rendered.
|
|
|
191
202
|
|
|
192
203
|
That applies to both:
|
|
193
204
|
|
|
194
|
-
-
|
|
205
|
+
- page hydration lifecycle in [src/hydration/browser/page-hydration.ts](src/hydration/browser/page-hydration.ts)
|
|
195
206
|
- router-backed hydration in [../../react-router/src/router.ts](../../react-router/src/router.ts)
|
|
196
207
|
|
|
197
208
|
If the page render receives `locals` on the server and the layout also depends on those values, the client must pass the same serialized `locals` into the layout during hydration. Otherwise React will detect a mismatch.
|
|
@@ -200,9 +211,134 @@ If the page render receives `locals` on the server and the layout also depends o
|
|
|
200
211
|
|
|
201
212
|
The main regression coverage lives in:
|
|
202
213
|
|
|
203
|
-
- [src/
|
|
204
|
-
- [src/react-renderer.locals.test.ts](src/react-renderer.locals.test.ts): verifies only declared `requires` keys are serialized into hydration payloads.
|
|
205
|
-
- [src/
|
|
206
|
-
- [../../react-router/test/
|
|
214
|
+
- [src/client-graph/boundary-plugin.test.ts](src/client-graph/boundary-plugin.test.ts): verifies server-only `eco.page(...)` options are stripped from browser bundles.
|
|
215
|
+
- [src/render/react-renderer.locals.test.ts](src/render/react-renderer.locals.test.ts): verifies only declared `requires` keys are serialized into hydration payloads.
|
|
216
|
+
- [src/hydration/hydration-script-compiler.test.ts](src/hydration/hydration-script-compiler.test.ts): verifies editable browser sources compile to readable and minified entries.
|
|
217
|
+
- [../../react-router/test/layout-persistence.test.browser.ts](../../react-router/test/layout-persistence.test.browser.ts): verifies router-backed layout hydration receives `locals` with `persistLayouts` both enabled and disabled.
|
|
207
218
|
|
|
208
219
|
If you change the AST transform or hydration flow, update the corresponding tests in the same change.
|
|
220
|
+
|
|
221
|
+
### Nested layouts and unified SSR
|
|
222
|
+
|
|
223
|
+
Pages may declare `layout` as a single component or an **outer → inner** array on `eco.page()`. On the server, React-managed layout stacks compose through `composeDocumentShell` + `composeLayoutPageTree` so provider context reaches nested pages during SSR. On the client, `@ecopages/react-router` `PageContent` uses the same `composeLayoutPageTree` helper unless `persistLayouts` is enabled (then each tier is cached independently).
|
|
224
|
+
|
|
225
|
+
During SSR, `ReactRenderer` passes the app-resolved React runtime into `composeLayoutPageTree` via `options.react` so layout trees are built with the same module instance as `renderToString`. App code should import hooks and context from `react` normally; keep a single React version in the app dependency graph (avoid duplicate `react` copies in monorepos).
|
|
226
|
+
|
|
227
|
+
Layout prop factories receive `LayoutPropsContext` (`params`, `query`, `locals`). Route-scoped `locals` are passed to layout tiers via document-shell props during SSR; serialized `pageProps.locals` follow `Page.requires` and are intended for the page component.
|
|
228
|
+
|
|
229
|
+
- [src/render/layout-compose.ts](src/render/layout-compose.ts): shared client/SSR tree builder.
|
|
230
|
+
- [src/test/react-ssr-hydration-parity.test.tsx](src/test/react-ssr-hydration-parity.test.tsx): nested tier order parity between SSR and `composeLayoutPageTree`.
|
|
231
|
+
- [src/test/react-ssr-unified.test.tsx](src/test/react-ssr-unified.test.tsx): provider context through nested SSR layouts.
|
|
232
|
+
|
|
233
|
+
### Shared runtime vendors (SPA + persisted layouts)
|
|
234
|
+
|
|
235
|
+
With `ecoRouter()`, Ecopages keeps outer layout tiers mounted across client navigation (`persistLayouts` defaults to `true`). Each Page chunk still loads separately, while its Layout tiers can stay alive in the DOM.
|
|
236
|
+
|
|
237
|
+
A package imported by both a persisted Layout and multiple Page chunks must resolve to one browser module instance. Otherwise, a library with module-level state such as React context can be duplicated, and navigation can fail with errors such as `No QueryClient set`.
|
|
238
|
+
|
|
239
|
+
Register shared packages explicitly with `reactPlugin({ runtimeModules })`. Each listed package is built once into `/assets/vendors/*.js`, and browser graphs import that vendor URL. React, React DOM, and the configured router are already shared. Layout files do not add packages to `runtimeModules` automatically.
|
|
240
|
+
|
|
241
|
+
In `ecopages dev`, page modules are served from `/assets/__eco_dev__/` and should import `/assets/vendors/*` for shared packages instead of inlining `node_modules`. Kitchen-sink routes `/vendor-share/a` and `/vendor-share/b` (with `runtimeModules: ['zod']`) are the reference fixture; see `playground/kitchen-sink/e2e/shared-vendors.test.e2e.ts`.
|
|
242
|
+
|
|
243
|
+
#### Register shared packages
|
|
244
|
+
|
|
245
|
+
List the package specifier that Page or Layout code imports:
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import { defineConfig } from '@ecopages/core/config';
|
|
249
|
+
import { reactPlugin } from '@ecopages/react';
|
|
250
|
+
import { ecoRouter } from '@ecopages/react-router';
|
|
251
|
+
|
|
252
|
+
export default defineConfig({
|
|
253
|
+
integrations: [
|
|
254
|
+
reactPlugin({
|
|
255
|
+
router: ecoRouter(),
|
|
256
|
+
runtimeModules: ['@tanstack/react-query'],
|
|
257
|
+
}),
|
|
258
|
+
],
|
|
259
|
+
});
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Use the package root when all imports use that root. Import rewrites match exact specifiers, so add a separate entry for each package subpath used by app code.
|
|
263
|
+
|
|
264
|
+
**Migration from layout discovery:** remove `runtimeProvider` from layout options. Add each shared package the scanner previously supplied to `runtimeModules` using the exact specifier imported by app code.
|
|
265
|
+
|
|
266
|
+
`runtimeModules` also accepts objects with a custom vendor output name:
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
reactPlugin({
|
|
270
|
+
router: ecoRouter(),
|
|
271
|
+
runtimeModules: ['@tanstack/react-query', { specifier: '@acme/ui', outputName: 'acme-ui' }],
|
|
272
|
+
});
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Each vendor entry is built from the package's browser ESM surface: Ecopages follows an `exports` import target when present and otherwise prefers a package's legacy `module` field over CJS `main`. ESM files are re-exported with `export *`. CJS files (including React's published `index.js` / `jsx-runtime`) emit explicit named exports from that same file so the vendor can provide `jsx`.
|
|
276
|
+
|
|
277
|
+
Each vendor bundles its package dependencies. Imports whose exact specifiers are registered in `runtimeModules` are rewritten to the corresponding shared vendor URL; React and the configured router are shared automatically.
|
|
278
|
+
|
|
279
|
+
#### Singleton packages (MobX, Redux, Query client, audio engines)
|
|
280
|
+
|
|
281
|
+
React context, MobX observables, Redux stores, TanStack Query clients, and audio runtimes (for example Tone.js) depend on one module instance. Register a singleton package in `runtimeModules` when Page and Layout code must share its state.
|
|
282
|
+
|
|
283
|
+
**Library packaging:** ship singleton dependencies as `peerDependencies` and keep them external in the library build so `dist/` retains `import … from "mobx"` (or equivalent) instead of inlining a private copy.
|
|
284
|
+
|
|
285
|
+
**Ecopages app config:** register each singleton and library package as its own `runtimeModules` entry. Imports between those vendors are rewritten to the shared vendor URLs when their specifiers match:
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
reactPlugin({
|
|
289
|
+
router: ecoRouter(),
|
|
290
|
+
runtimeModules: [
|
|
291
|
+
{ specifier: 'mobx', outputName: 'mobx' },
|
|
292
|
+
{ specifier: 'mobx-react-lite', outputName: 'mobx-react-lite' },
|
|
293
|
+
{ specifier: '@acme/store-ui', outputName: 'acme-store-ui' },
|
|
294
|
+
],
|
|
295
|
+
});
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Registering only the library vendor or only the singleton is not enough when the published library still inlines the singleton. Peer the dependency in the library, externalize it in the library build, and register both the library and singleton specifiers in `runtimeModules`. Existing `externals` fields on runtime module entries should be removed; register each non-framework shared dependency as its own entry. React, React DOM, and the configured router are shared automatically. Rebuild vendors (and clear `.eco` / `dist/assets/vendors` in dev) after changing package entry points or `runtimeModules`.
|
|
299
|
+
|
|
300
|
+
#### Troubleshooting
|
|
301
|
+
|
|
302
|
+
| Symptom | Likely cause | Fix |
|
|
303
|
+
| --------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
304
|
+
| `No QueryClient set` after SPA navigation | Query client package is not shared by the Page and Layout graphs | Add `@tanstack/react-query` to `runtimeModules` and rebuild vendors |
|
|
305
|
+
| Duplicate React context / Tone init logs | Provider package is bundled through multiple client entrypoints | Import through the package root and register that root in `runtimeModules` |
|
|
306
|
+
| Store updates / `reaction` / `observer` no-op | Duplicate singleton (for example MobX) — a library inlines one copy and app code loads another | Peer the singleton in the library; register the library and singleton specifiers in `runtimeModules`; rebuild vendors |
|
|
307
|
+
| `@/` alias not followed | Missing or invalid tsconfig paths | Add `compilerOptions.paths`; ensure `include` globs are valid JSON (not broken by comment stripping) |
|
|
308
|
+
| Stale bootstrap script hash in dev | Rendered HTML cached before runtime vendors/bootstrap scripts changed | Rebuild or touch a route file; development HTML cache keys include browser-runtime generation |
|
|
309
|
+
| `MISSING_EXPORT` for names like `BasePlugin` | Vendor listed CJS enumerable keys that the ESM file does not export | Register the package root only; rebuild vendors. Subpath plugins are separate module contracts and must be bundled or declared themselves |
|
|
310
|
+
| `does not provide an export named 'jsx'` | Stale React vendor generated with `export *` from CJS `jsx-runtime` | Clear `.eco` / `dist/assets/vendors` and rebuild so the CJS entry lists `jsx` / `jsxs` explicitly |
|
|
311
|
+
| `Calling require for "/assets/vendors/…"` | A CJS vendor graph `require()`d another runtime module after URL rewrite | Prefer packages with an ESM/`module` entry; register sibling singletons as separate `runtimeModules` entries |
|
|
312
|
+
|
|
313
|
+
Use the dev toolbar **Deps** panel to inspect vendor URLs loaded by the active Page. See [Dev Toolbar](/docs/core/dev-toolbar).
|
|
314
|
+
|
|
315
|
+
#### Tests
|
|
316
|
+
|
|
317
|
+
- `src/bundling/runtime-modules.test.ts`: explicit entries, exact package specifiers, and vendor filename normalization.
|
|
318
|
+
- `src/bundling/runtime-bundle.test.ts`: vendor registration and manifest paths.
|
|
319
|
+
- `../../core/src/assets/asset-processing-service/browser-runtime-entry-resolution.test.ts`: ESM entry resolution and default-export policy for React vs TanStack Query.
|
|
320
|
+
- `../../../e2e/fixtures/react-router/persist-layouts.test.e2e.ts`: one QueryClient shared across Page navigation with an explicit `runtimeModules` entry.
|
|
321
|
+
|
|
322
|
+
### Client-only code in SSR trees
|
|
323
|
+
|
|
324
|
+
Pages and layouts SSR through `renderToString`, which does not support `<Suspense>`. Do not use `React.lazy()` + `<Suspense>` in `eco.page()` or `eco.layout()` trees.
|
|
325
|
+
|
|
326
|
+
Wrap browser-only UI in `ClientOnly`:
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
import { eco } from '@ecopages/core';
|
|
330
|
+
import { ClientOnly } from '@ecopages/react/utils/client-only';
|
|
331
|
+
|
|
332
|
+
export const RootLayout = eco.layout({
|
|
333
|
+
render: ({ children }) => (
|
|
334
|
+
<>
|
|
335
|
+
{children}
|
|
336
|
+
<ClientOnly fallback={null}>
|
|
337
|
+
<DevtoolsPanel />
|
|
338
|
+
</ClientOnly>
|
|
339
|
+
</>
|
|
340
|
+
),
|
|
341
|
+
});
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
For code-split client-only modules, `import()` inside `useEffect` within `ClientOnly` — not `lazy()`. `dynamic({ ssr: false })` must also stay inside `ClientOnly`; it renders `null` on the server and `lazy()` in the browser.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React integration for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -8,80 +8,117 @@
|
|
|
8
8
|
"plugin"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"main": "./src/react.plugin.js",
|
|
12
|
-
"types": "./src/react.plugin.d.ts",
|
|
11
|
+
"main": "./src/plugin/react.plugin.js",
|
|
12
|
+
"types": "./src/plugin/react.plugin.d.ts",
|
|
13
13
|
"type": "module",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
14
17
|
"exports": {
|
|
15
18
|
".": {
|
|
16
|
-
"default": "./src/react.plugin.js",
|
|
17
|
-
"types": "./src/react.plugin.d.ts"
|
|
19
|
+
"default": "./src/plugin/react.plugin.js",
|
|
20
|
+
"types": "./src/plugin/react.plugin.d.ts"
|
|
18
21
|
},
|
|
19
22
|
"./eco-embed": {
|
|
20
|
-
"default": "./src/eco-embed.js",
|
|
21
|
-
"types": "./src/eco-embed.d.ts"
|
|
23
|
+
"default": "./src/render/eco-embed.js",
|
|
24
|
+
"types": "./src/render/eco-embed.d.ts"
|
|
22
25
|
},
|
|
23
26
|
"./declarations": {
|
|
24
|
-
"types": "./src/declarations.d.ts"
|
|
27
|
+
"types": "./src/contracts/declarations.d.ts"
|
|
25
28
|
},
|
|
26
29
|
"./utils/dynamic": {
|
|
27
|
-
"types": "./src/
|
|
28
|
-
"default": "./src/
|
|
30
|
+
"types": "./src/app/dynamic.d.ts",
|
|
31
|
+
"default": "./src/app/dynamic.js"
|
|
29
32
|
},
|
|
30
33
|
"./utils/client-only": {
|
|
31
|
-
"types": "./src/
|
|
32
|
-
"default": "./src/
|
|
34
|
+
"types": "./src/app/client-only.d.ts",
|
|
35
|
+
"default": "./src/app/client-only.js"
|
|
33
36
|
},
|
|
34
37
|
"./runtime/use-sync-external-store-with-selector": {
|
|
35
38
|
"types": "./src/runtime/use-sync-external-store-with-selector.d.ts",
|
|
36
39
|
"default": "./src/runtime/use-sync-external-store-with-selector.js"
|
|
37
40
|
},
|
|
38
41
|
"./router-adapter": {
|
|
39
|
-
"types": "./src/router-adapter.d.ts",
|
|
40
|
-
"default": "./src/router-adapter.js"
|
|
42
|
+
"types": "./src/contracts/router-adapter.d.ts",
|
|
43
|
+
"default": "./src/contracts/router-adapter.js"
|
|
44
|
+
},
|
|
45
|
+
"./layout-compose": {
|
|
46
|
+
"types": "./src/render/layout-compose.d.ts",
|
|
47
|
+
"default": "./src/render/layout-compose.js"
|
|
48
|
+
},
|
|
49
|
+
"./collection-component-cache": {
|
|
50
|
+
"types": "./src/content/collection-component-cache.d.ts",
|
|
51
|
+
"default": "./src/content/collection-component-cache.js"
|
|
52
|
+
},
|
|
53
|
+
"./serialize-page-data-script": {
|
|
54
|
+
"types": "./src/hydration/serialize-page-data-script.d.ts",
|
|
55
|
+
"default": "./src/hydration/serialize-page-data-script.js"
|
|
56
|
+
},
|
|
57
|
+
"./page-data-reader": {
|
|
58
|
+
"types": "./src/hydration/page-data-reader.d.ts",
|
|
59
|
+
"default": "./src/hydration/page-data-reader.js"
|
|
41
60
|
},
|
|
42
61
|
"./eco-embed.ts": {
|
|
43
|
-
"default": "./src/eco-embed.js",
|
|
44
|
-
"types": "./src/eco-embed.d.ts"
|
|
62
|
+
"default": "./src/render/eco-embed.js",
|
|
63
|
+
"types": "./src/render/eco-embed.d.ts"
|
|
45
64
|
},
|
|
46
65
|
"./declarations.ts": {
|
|
47
|
-
"types": "./src/declarations.d.ts"
|
|
66
|
+
"types": "./src/contracts/declarations.d.ts"
|
|
48
67
|
},
|
|
49
68
|
"./utils/dynamic.ts": {
|
|
50
|
-
"types": "./src/
|
|
51
|
-
"default": "./src/
|
|
69
|
+
"types": "./src/app/dynamic.d.ts",
|
|
70
|
+
"default": "./src/app/dynamic.js"
|
|
52
71
|
},
|
|
53
72
|
"./utils/client-only.ts": {
|
|
54
|
-
"types": "./src/
|
|
55
|
-
"default": "./src/
|
|
73
|
+
"types": "./src/app/client-only.d.ts",
|
|
74
|
+
"default": "./src/app/client-only.js"
|
|
56
75
|
},
|
|
57
76
|
"./runtime/use-sync-external-store-with-selector.ts": {
|
|
58
77
|
"types": "./src/runtime/use-sync-external-store-with-selector.d.ts",
|
|
59
78
|
"default": "./src/runtime/use-sync-external-store-with-selector.js"
|
|
60
79
|
},
|
|
61
80
|
"./router-adapter.ts": {
|
|
62
|
-
"types": "./src/router-adapter.d.ts",
|
|
63
|
-
"default": "./src/router-adapter.js"
|
|
81
|
+
"types": "./src/contracts/router-adapter.d.ts",
|
|
82
|
+
"default": "./src/contracts/router-adapter.js"
|
|
83
|
+
},
|
|
84
|
+
"./layout-compose.ts": {
|
|
85
|
+
"types": "./src/render/layout-compose.d.ts",
|
|
86
|
+
"default": "./src/render/layout-compose.js"
|
|
87
|
+
},
|
|
88
|
+
"./collection-component-cache.ts": {
|
|
89
|
+
"types": "./src/content/collection-component-cache.d.ts",
|
|
90
|
+
"default": "./src/content/collection-component-cache.js"
|
|
91
|
+
},
|
|
92
|
+
"./serialize-page-data-script.ts": {
|
|
93
|
+
"types": "./src/hydration/serialize-page-data-script.d.ts",
|
|
94
|
+
"default": "./src/hydration/serialize-page-data-script.js"
|
|
95
|
+
},
|
|
96
|
+
"./page-data-reader.ts": {
|
|
97
|
+
"types": "./src/hydration/page-data-reader.d.ts",
|
|
98
|
+
"default": "./src/hydration/page-data-reader.js"
|
|
64
99
|
}
|
|
65
100
|
},
|
|
66
101
|
"repository": {
|
|
67
102
|
"type": "git",
|
|
68
|
-
"url": "https://github.com/ecopages/ecopages.git",
|
|
103
|
+
"url": "git+https://github.com/ecopages/ecopages.git",
|
|
69
104
|
"directory": "packages/integrations/react"
|
|
70
105
|
},
|
|
71
106
|
"peerDependencies": {
|
|
72
|
-
"@ecopages/core": "0.
|
|
107
|
+
"@ecopages/core": "0.3.0",
|
|
73
108
|
"@types/react": "^19",
|
|
74
109
|
"@types/react-dom": "^19",
|
|
75
110
|
"react": "^19",
|
|
76
111
|
"react-dom": "^19"
|
|
77
112
|
},
|
|
78
113
|
"dependencies": {
|
|
79
|
-
"@ecopages/file-system": "0.
|
|
114
|
+
"@ecopages/file-system": "0.3.0",
|
|
80
115
|
"@ecopages/logger": "^0.2.3",
|
|
116
|
+
"@ecopages/mdx": "0.3.0",
|
|
81
117
|
"@mdx-js/mdx": "^3.1.1",
|
|
82
|
-
"oxc-parser": "^0.
|
|
83
|
-
"oxc-transform": "^0.
|
|
84
|
-
"
|
|
118
|
+
"oxc-parser": "^0.141.0",
|
|
119
|
+
"oxc-transform": "^0.141.0",
|
|
120
|
+
"rolldown": "^1.1.0",
|
|
121
|
+
"source-map": "^0.8.0",
|
|
85
122
|
"vfile": "^6.0.3"
|
|
86
123
|
}
|
|
87
|
-
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
const emptySubscribe = () => () => { };
|
|
3
|
+
export const useIsClient = () => useSyncExternalStore(emptySubscribe, () => true, () => false);
|
|
4
|
+
export const ClientOnly = ({ children, fallback = null }) => {
|
|
5
|
+
const isClient = useIsClient();
|
|
6
|
+
if (!isClient) {
|
|
7
|
+
return fallback;
|
|
8
|
+
}
|
|
9
|
+
return children;
|
|
10
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
|
+
import { page } from 'vitest/browser';
|
|
6
|
+
import { dynamic } from './dynamic.js';
|
|
7
|
+
function createDeferredImport() {
|
|
8
|
+
let resolve;
|
|
9
|
+
const promise = new Promise((innerResolve) => {
|
|
10
|
+
resolve = innerResolve;
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
promise,
|
|
14
|
+
resolve,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
describe('dynamic', () => {
|
|
18
|
+
let container;
|
|
19
|
+
let root;
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
root.unmount();
|
|
22
|
+
container.remove();
|
|
23
|
+
});
|
|
24
|
+
it('returns a browser lazy component that resolves through Suspense', async () => {
|
|
25
|
+
const deferredImport = createDeferredImport();
|
|
26
|
+
const DynamicComponent = dynamic(() => deferredImport.promise);
|
|
27
|
+
container = document.createElement('div');
|
|
28
|
+
document.body.appendChild(container);
|
|
29
|
+
root = createRoot(container);
|
|
30
|
+
root.render(_jsx(Suspense, { fallback: _jsx("span", { children: "Loading dynamic component" }), children: _jsx(DynamicComponent, {}) }));
|
|
31
|
+
await expect.element(page.getByText('Loading dynamic component')).toBeInTheDocument();
|
|
32
|
+
deferredImport.resolve({
|
|
33
|
+
default: () => _jsx("span", { children: "Dynamic content" }),
|
|
34
|
+
});
|
|
35
|
+
await expect.element(page.getByText('Dynamic content')).toBeInTheDocument();
|
|
36
|
+
await expect.element(page.getByText('Loading dynamic component')).not.toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -6,18 +6,22 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import {
|
|
9
|
+
import type { EcoBuildPlugin, IntegrationRuntimeContext } from '@ecopages/core/integration';
|
|
10
|
+
import type { AssetProcessingIntegration, AssetProcessingService } from '@ecopages/core/integration';
|
|
11
|
+
import type { ReactRouterAdapter } from '../contracts/router-adapter.js';
|
|
12
|
+
import { type ReactRuntimeImports } from './runtime-bundle.js';
|
|
13
|
+
import type { ResolvedReactPluginRuntimeModule } from './runtime-modules.js';
|
|
12
14
|
/**
|
|
13
|
-
* Configuration for the
|
|
15
|
+
* Configuration for the BundleService.
|
|
14
16
|
*/
|
|
15
|
-
export interface
|
|
17
|
+
export interface BundleServiceConfig {
|
|
16
18
|
rootDir: string;
|
|
19
|
+
appConfig: IntegrationRuntimeContext['appConfig'];
|
|
20
|
+
assetProcessingIntegration?: AssetProcessingIntegration;
|
|
21
|
+
hostIntegrationName: string;
|
|
17
22
|
routerAdapter?: ReactRouterAdapter;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
jsxImportSource?: string;
|
|
23
|
+
runtimeModules?: ResolvedReactPluginRuntimeModule[];
|
|
24
|
+
getMdxLoaderPlugin?: () => EcoBuildPlugin;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Optional flags that adjust how a React client entry is bundled.
|
|
@@ -36,14 +40,26 @@ export interface ReactClientBundleOptions {
|
|
|
36
40
|
/**
|
|
37
41
|
* Manages bundle configuration and plugin creation for React page/component builds.
|
|
38
42
|
*/
|
|
39
|
-
export declare class
|
|
43
|
+
export declare class BundleService {
|
|
40
44
|
private readonly runtimeBundleService;
|
|
41
45
|
private readonly config;
|
|
42
|
-
|
|
46
|
+
private readonly foreignJsxOverridePlugin;
|
|
47
|
+
private readonly runtimeRewritePlugin;
|
|
48
|
+
private pageLayoutNormalizationVendorPromise;
|
|
49
|
+
private mdxLoaderPlugin;
|
|
50
|
+
constructor(config: BundleServiceConfig);
|
|
43
51
|
/**
|
|
44
52
|
* Returns resolved runtime import paths for the React runtime.
|
|
45
53
|
*/
|
|
46
54
|
getRuntimeImports(): ReactRuntimeImports;
|
|
55
|
+
/**
|
|
56
|
+
* Processes the MDX-only page-layout-normalization vendor once per BundleService instance.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Concurrent callers share the same in-flight promise. Asset processing itself caches
|
|
60
|
+
* by dependency key, so repeats after success remain cheap.
|
|
61
|
+
*/
|
|
62
|
+
ensurePageLayoutNormalizationVendorProcessed(assetProcessingService: Pick<AssetProcessingService, 'processDependencies'>): Promise<void>;
|
|
47
63
|
/**
|
|
48
64
|
* Creates bundle options for a page or component entry.
|
|
49
65
|
*
|
|
@@ -56,5 +72,7 @@ export declare class ReactBundleService {
|
|
|
56
72
|
* @param declaredModules - Explicitly declared browser module specifiers
|
|
57
73
|
* @returns Bundle options object for the build adapter
|
|
58
74
|
*/
|
|
59
|
-
createBundleOptions(componentName: string, isMdx: boolean, declaredModules: string[], bundleOptions?: ReactClientBundleOptions): Promise<Record<string, unknown>>;
|
|
75
|
+
createBundleOptions(componentName: string, isMdx: boolean, declaredModules: string[], bundleOptions?: ReactClientBundleOptions, entrypointFile?: string, groupedEntrypointFiles?: readonly string[], groupedDeclaredModules?: readonly string[]): Promise<Record<string, unknown>>;
|
|
76
|
+
private createClientBuildPlugins;
|
|
77
|
+
private getMdxLoaderPlugin;
|
|
60
78
|
}
|