@mandujs/core 0.8.0 → 0.8.1

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.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -62,6 +62,10 @@ function generateRuntimeSource(): string {
62
62
  * Fresh-style dynamic import architecture
63
63
  */
64
64
 
65
+ // React 정적 import (Island와 같은 인스턴스 공유)
66
+ import React from 'react';
67
+ import { createRoot } from 'react-dom/client';
68
+
65
69
  // Hydrated roots 추적 (unmount용)
66
70
  const hydratedRoots = new Map();
67
71
 
@@ -134,17 +138,13 @@ async function loadAndHydrate(element, src) {
134
138
  const { definition } = island;
135
139
  const data = getServerData(id);
136
140
 
137
- // React 동적 로드
138
- const { createRoot } = await import('react-dom/client');
139
- const React = await import('react');
140
-
141
- // Island 컴포넌트
141
+ // Island 컴포넌트 (정적 import된 React 사용)
142
142
  function IslandComponent() {
143
143
  const setupResult = definition.setup(data);
144
144
  return definition.render(setupResult);
145
145
  }
146
146
 
147
- // Mount
147
+ // Mount (상단에서 import한 createRoot 사용)
148
148
  const root = createRoot(element);
149
149
  root.render(React.createElement(IslandComponent));
150
150
  hydratedRoots.set(id, root);