@ecopages/ecopages-jsx 0.2.0-rc.6 → 0.2.0-rc.7
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 +7 -0
- package/package.json +5 -5
- package/src/ecopages-jsx-renderer.js +6 -0
package/README.md
CHANGED
|
@@ -53,6 +53,12 @@ Radiant support is enabled by default. When `radiant: true`, the plugin keeps th
|
|
|
53
53
|
|
|
54
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.
|
|
55
55
|
|
|
56
|
+
### Hydration Semantics: RadiantElement vs. RadiantController
|
|
57
|
+
|
|
58
|
+
- **`RadiantElement` (DOM Preservation)**: Custom elements extending `RadiantElement` support true in-place hydration. When `@ecopages/radiant/client/install-hydrator` executes before elements connect, existing light-DOM SSR nodes are preserved, retaining DOM node identity, form input state, active focus, and media playback.
|
|
59
|
+
- **`RadiantController` (Activation / Template Re-mount)**: Controllers attached via `[data-controller]` activate when `startControllers(document)` is called. Activation executes the controller's `render()` method and mounts its template fresh into the host container, replacing server-rendered child nodes. Reactive properties and signal bindings remain fully interactive, but individual child DOM nodes are reconstructed.
|
|
60
|
+
- **Guidance**: Use `RadiantElement` when in-place preservation of SSR nodes (e.g., focused inputs, media elements, or CSS transitions) is required. Use `RadiantController` for Stimulus-style progressive enhancement on arbitrary markup where child DOM reconstruction is acceptable.
|
|
61
|
+
|
|
56
62
|
```ts
|
|
57
63
|
ecopagesJsxPlugin({
|
|
58
64
|
radiant: true,
|
|
@@ -103,4 +109,5 @@ Important:
|
|
|
103
109
|
- Cross-integration shell stacks should use `EcoEmbed` from `@ecopages/ecopages-jsx/eco-embed` (or the matching integration adapter). Plain opaque objects fail fast at core foreign-subtree queue boundaries; they are not coerced with `String(object)`. Pass already-serialized HTML when `EcoEmbed` is not needed.
|
|
104
110
|
- Components that may render foreign children must declare those children in `config.dependencies.components`.
|
|
105
111
|
- Ecopages validates mixed-renderer ownership from declared dependencies during render preparation. It does not treat rendered HTML alone as the source of truth.
|
|
112
|
+
- Route-level dependency resolvers can supply Components at request time; Ecopages JSX includes those resolved roots when deciding whether a Foreign Subtree needs handoff.
|
|
106
113
|
- Ecopages JSX keeps raw-markup preservation and asset collection inside the JSX renderer.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/ecopages-jsx",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.7",
|
|
4
4
|
"description": "JSX integration plugin for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"directory": "packages/integrations/ecopages-jsx"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ecopages/mdx": "0.2.0-rc.
|
|
37
|
+
"@ecopages/mdx": "0.2.0-rc.7",
|
|
38
38
|
"@mdx-js/mdx": "^3.1.1",
|
|
39
39
|
"vfile": "^6.0.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@ecopages/core": "0.2.0-rc.
|
|
43
|
-
"@ecopages/jsx": "^0.3.0-rc.
|
|
44
|
-
"@ecopages/radiant": "^0.3.0-rc.
|
|
42
|
+
"@ecopages/core": "0.2.0-rc.7",
|
|
43
|
+
"@ecopages/jsx": "^0.3.0-rc.9",
|
|
44
|
+
"@ecopages/radiant": "^0.3.0-rc.9"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -146,6 +146,12 @@ export class EcopagesJsxRenderer extends IntegrationRenderer {
|
|
|
146
146
|
locals: options.pageLocals,
|
|
147
147
|
},
|
|
148
148
|
},
|
|
149
|
+
/**
|
|
150
|
+
* @remarks Content components supplied by the Page dependency
|
|
151
|
+
* resolver (for example the active MDX entry) carry foreign
|
|
152
|
+
* ownership the static Page config cannot declare.
|
|
153
|
+
*/
|
|
154
|
+
foreignChildRoots: options.resolvedPageDependencyComponents,
|
|
149
155
|
layouts: resolveDocumentShellLayouts({
|
|
150
156
|
layout: options.Layout,
|
|
151
157
|
layoutEntries: options.layoutEntries,
|