@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 +1 -1
- package/src/bundler/build.ts +11 -5
- package/src/filling/context.ts +438 -464
- package/src/filling/filling.ts +220 -552
- package/src/filling/tmpclaude-2f8d-cwd +1 -0
- package/src/filling/tmpclaude-fb5a-cwd +1 -0
package/package.json
CHANGED
package/src/bundler/build.ts
CHANGED
|
@@ -55,8 +55,12 @@ function generateRuntimeSource(): string {
|
|
|
55
55
|
* Mandu Hydration Runtime (Generated)
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
`;
|