@mandujs/core 0.5.3 → 0.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/core",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -122,7 +122,8 @@ function scheduleHydration(element, id, priority, data) {
122
122
  }
123
123
 
124
124
  /**
125
- * 단일 Island hydrate
125
+ * 단일 Island hydrate (또는 mount)
126
+ * SSR 플레이스홀더를 Island 컴포넌트로 교체
126
127
  */
127
128
  async function hydrateIsland(element, id, data) {
128
129
  const loader = islandRegistry.get(id);
@@ -141,7 +142,7 @@ async function hydrateIsland(element, id, data) {
141
142
  }
142
143
 
143
144
  const { definition } = islandDef;
144
- const { hydrateRoot } = await import('react-dom/client');
145
+ const { createRoot } = await import('react-dom/client');
145
146
  const React = await import('react');
146
147
 
147
148
  // Island 컴포넌트
@@ -150,8 +151,10 @@ async function hydrateIsland(element, id, data) {
150
151
  return definition.render(setupResult);
151
152
  }
152
153
 
153
- // Hydrate
154
- const root = hydrateRoot(element, React.createElement(IslandComponent));
154
+ // Mount (createRoot 사용 - SSR 플레이스홀더 교체)
155
+ // hydrateRoot 대신 createRoot 사용: Island는 SSR과 다른 컨텐츠를 렌더링할 수 있음
156
+ const root = createRoot(element);
157
+ root.render(React.createElement(IslandComponent));
155
158
  hydratedRoots.set(id, root);
156
159
 
157
160
  // 완료 표시