@ecopages/ecopages-jsx 0.2.0-beta.38 → 0.2.0-beta.39
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
CHANGED
|
@@ -48,6 +48,7 @@ Radiant support is enabled by default. When `radiant: true`, the plugin keeps th
|
|
|
48
48
|
|
|
49
49
|
- Ecopages JSX owns page-level JSX SSR and container hydration.
|
|
50
50
|
- Radiant SSR is activated on the server through `@ecopages/radiant/server/render-component`.
|
|
51
|
+
- The server reuses Radiant's complete light-DOM surface, replacing partial globals before Radiant elements are imported.
|
|
51
52
|
- Radiant host hydration is activated on the client through an explicit head bootstrap that imports `@ecopages/radiant/client/install-hydrator` before intrinsic custom-element modules load.
|
|
52
53
|
|
|
53
54
|
That means server-rendered `RadiantElement` hosts hydrate in place only when both the SSR markers and the explicit client hydrator are present. Without the client hydrator, Radiant intentionally falls back to a fresh client render on first connect.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/ecopages-jsx",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.39",
|
|
4
4
|
"description": "JSX integration plugin for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"directory": "packages/integrations/ecopages-jsx"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ecopages/mdx": "0.2.0-beta.
|
|
34
|
+
"@ecopages/mdx": "0.2.0-beta.39",
|
|
35
35
|
"@mdx-js/mdx": "^3.1.1",
|
|
36
36
|
"vfile": "^6.0.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@ecopages/core": "0.2.0-beta.
|
|
40
|
-
"@ecopages/jsx": "0.3.0-beta.
|
|
41
|
-
"@ecopages/radiant": "0.3.0-beta.
|
|
39
|
+
"@ecopages/core": "0.2.0-beta.39",
|
|
40
|
+
"@ecopages/jsx": "0.3.0-beta.6",
|
|
41
|
+
"@ecopages/radiant": "0.3.0-beta.6"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -25,7 +25,7 @@ export declare function getEjsxHmrOwnership(): EjsxHmrOwnershipState;
|
|
|
25
25
|
* Updates the active render tree from one or more root components.
|
|
26
26
|
*
|
|
27
27
|
* @remarks
|
|
28
|
-
* Walks each root
|
|
28
|
+
* Walks each root through `getComponentIdentity`, `config.dependencies.components[*].config`,
|
|
29
29
|
* and `config.layouts[*].config` recursively, collecting every file path. The
|
|
30
30
|
* state is replaced only when the resulting file set has a different hash, so
|
|
31
31
|
* the renderer's per-render hook is free in the steady state.
|
|
@@ -29,7 +29,7 @@ export function getEjsxHmrOwnership() {
|
|
|
29
29
|
* Updates the active render tree from one or more root components.
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Walks each root
|
|
32
|
+
* Walks each root through `getComponentIdentity`, `config.dependencies.components[*].config`,
|
|
33
33
|
* and `config.layouts[*].config` recursively, collecting every file path. The
|
|
34
34
|
* state is replaced only when the resulting file set has a different hash, so
|
|
35
35
|
* the renderer's per-render hook is free in the steady state.
|
package/src/ecopages-jsx-mdx.js
CHANGED
|
@@ -46,8 +46,8 @@ export const normalizeMdxPageModule = (file, module) => {
|
|
|
46
46
|
const Page = module.default;
|
|
47
47
|
const normalizedConfig = {
|
|
48
48
|
...(module.config ?? Page.config ?? {}),
|
|
49
|
-
|
|
50
|
-
Page.config?.
|
|
49
|
+
identity: module.config?.identity ??
|
|
50
|
+
Page.config?.identity ?? {
|
|
51
51
|
id: String(rapidhash(file)),
|
|
52
52
|
file,
|
|
53
53
|
integration: ECOPAGES_JSX_PLUGIN_NAME,
|
|
@@ -7,7 +7,8 @@ import { createMarkupNodeLike } from '@ecopages/jsx';
|
|
|
7
7
|
* renders do not need them. Resolved runtime modules are cached on the policy
|
|
8
8
|
* instance so repeated renders on the same renderer reuse one load without
|
|
9
9
|
* process-wide mutable class state. Light-DOM constructor installation remains
|
|
10
|
-
* process-global and idempotent via {@link ensureRadiantLightDomGlobals}
|
|
10
|
+
* process-global and idempotent via {@link ensureRadiantLightDomGlobals}; the
|
|
11
|
+
* Radiant installer also repairs incomplete DOM globals left by another runtime.
|
|
11
12
|
*/
|
|
12
13
|
export declare class EcopagesJsxRadiantSsrPolicy {
|
|
13
14
|
private runtimeModules;
|
|
@@ -8,7 +8,8 @@ import { createServerHydrationBindingState, withServerHydrationBindingState } fr
|
|
|
8
8
|
* renders do not need them. Resolved runtime modules are cached on the policy
|
|
9
9
|
* instance so repeated renders on the same renderer reuse one load without
|
|
10
10
|
* process-wide mutable class state. Light-DOM constructor installation remains
|
|
11
|
-
* process-global and idempotent via {@link ensureRadiantLightDomGlobals}
|
|
11
|
+
* process-global and idempotent via {@link ensureRadiantLightDomGlobals}; the
|
|
12
|
+
* Radiant installer also repairs incomplete DOM globals left by another runtime.
|
|
12
13
|
*/
|
|
13
14
|
export class EcopagesJsxRadiantSsrPolicy {
|
|
14
15
|
runtimeModules;
|
|
@@ -61,10 +62,10 @@ export class EcopagesJsxRadiantSsrPolicy {
|
|
|
61
62
|
const radiantElementSsrRuntimeModuleUrl = new URL('./radiant-element-ssr-bridge.js', radiantLightDomShimEntry).href;
|
|
62
63
|
this.runtimeModulesPromise = (async () => {
|
|
63
64
|
const lightDomShimModule = await import(radiantLightDomShimEntry);
|
|
64
|
-
ensureRadiantLightDomGlobals(lightDomShimModule.
|
|
65
|
+
ensureRadiantLightDomGlobals(lightDomShimModule.ensureLightDomShim);
|
|
65
66
|
const radiantElementSsrRuntimeModule = (await import(radiantElementSsrRuntimeModuleUrl));
|
|
66
67
|
const modules = {
|
|
67
|
-
|
|
68
|
+
ensureLightDomShim: lightDomShimModule.ensureLightDomShim,
|
|
68
69
|
resolveRadiantElementRenderBridge: radiantElementSsrRuntimeModule.resolveRadiantElementRenderBridge,
|
|
69
70
|
withServerRadiantElementSsrRuntime: radiantElementSsrRuntimeModule.withServerRadiantElementSsrRuntime,
|
|
70
71
|
};
|
|
@@ -75,7 +76,7 @@ export class EcopagesJsxRadiantSsrPolicy {
|
|
|
75
76
|
await this.runtimeModulesPromise;
|
|
76
77
|
const lightDomShimModule = this.runtimeModules;
|
|
77
78
|
if (lightDomShimModule) {
|
|
78
|
-
ensureRadiantLightDomGlobals(lightDomShimModule.
|
|
79
|
+
ensureRadiantLightDomGlobals(lightDomShimModule.ensureLightDomShim);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
}
|
|
@@ -85,13 +86,11 @@ export class EcopagesJsxRadiantSsrPolicy {
|
|
|
85
86
|
* @remarks
|
|
86
87
|
* Custom-element constructors must be process-global; undoing them between tests
|
|
87
88
|
* is unsafe. Callers that clear globals for isolation must rely on a fresh policy
|
|
88
|
-
* instance so {@link EcopagesJsxRadiantSsrPolicy.prepareRuntime} re-runs
|
|
89
|
+
* instance so {@link EcopagesJsxRadiantSsrPolicy.prepareRuntime} re-runs the
|
|
90
|
+
* completeness check.
|
|
89
91
|
*/
|
|
90
|
-
function ensureRadiantLightDomGlobals(
|
|
91
|
-
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const window = installLightDomShim();
|
|
92
|
+
function ensureRadiantLightDomGlobals(ensureLightDomShim) {
|
|
93
|
+
const window = ensureLightDomShim();
|
|
95
94
|
if (!window) {
|
|
96
95
|
return;
|
|
97
96
|
}
|
|
@@ -107,6 +106,8 @@ function ensureRadiantLightDomGlobals(installLightDomShim) {
|
|
|
107
106
|
Node: window.Node,
|
|
108
107
|
document: window.document,
|
|
109
108
|
customElements: window.customElements,
|
|
109
|
+
requestAnimationFrame: window.requestAnimationFrame,
|
|
110
|
+
cancelAnimationFrame: window.cancelAnimationFrame,
|
|
110
111
|
window,
|
|
111
112
|
});
|
|
112
113
|
}
|