@mandujs/core 0.7.1 → 0.7.2

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.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -55,8 +55,12 @@ function generateRuntimeSource(): string {
55
55
  * Mandu Hydration Runtime (Generated)
56
56
  */
57
57
 
58
- const islandRegistry = new Map();
59
- const hydratedRoots = new Map();
58
+ // 글로벌 레지스트리 사용 (Island 번들과 공유)
59
+ window.__MANDU_ISLANDS__ = window.__MANDU_ISLANDS__ || new Map();
60
+ window.__MANDU_ROOTS__ = window.__MANDU_ROOTS__ || new Map();
61
+
62
+ const islandRegistry = window.__MANDU_ISLANDS__;
63
+ const hydratedRoots = window.__MANDU_ROOTS__;
60
64
 
61
65
  // 서버 데이터
62
66
  const serverData = window.__MANDU_DATA__ || {};
@@ -65,7 +69,7 @@ const serverData = window.__MANDU_DATA__ || {};
65
69
  * Island 등록
66
70
  */
67
71
  export function registerIsland(id, loader) {
68
- islandRegistry.set(id, loader);
72
+ window.__MANDU_ISLANDS__.set(id, loader);
69
73
  }
70
74
 
71
75
  /**
@@ -605,6 +609,7 @@ async function buildRouterRuntime(
605
609
 
606
610
  /**
607
611
  * Island 엔트리 래퍼 생성
612
+ * 주의: 글로벌 레지스트리 직접 사용 (번들러 인라인 문제 방지)
608
613
  */
609
614
  function generateIslandEntry(routeId: string, clientModulePath: string): string {
610
615
  // Windows 경로의 백슬래시를 슬래시로 변환 (JS escape 문제 방지)
@@ -615,9 +620,10 @@ function generateIslandEntry(routeId: string, clientModulePath: string): string
615
620
  */
616
621
 
617
622
  import island from "${normalizedPath}";
618
- import { registerIsland } from "./_runtime.js";
619
623
 
620
- registerIsland("${routeId}", () => island);
624
+ // 글로벌 레지스트리에 직접 등록 (런타임과 공유)
625
+ window.__MANDU_ISLANDS__ = window.__MANDU_ISLANDS__ || new Map();
626
+ window.__MANDU_ISLANDS__.set("${routeId}", () => island);
621
627
 
622
628
  export default island;
623
629
  `;