@mandujs/core 0.9.7 → 0.9.8

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.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -47,9 +47,17 @@ function getGlobalRouterState(): RouterState {
47
47
  return { currentRoute: null, loaderData: undefined, navigation: { state: "idle" } };
48
48
  }
49
49
  if (!window.__MANDU_ROUTER_STATE__) {
50
+ // SSR에서 주입된 __MANDU_ROUTE__에서 초기화
51
+ const route = (window as any).__MANDU_ROUTE__;
52
+ const data = (window as any).__MANDU_DATA__;
53
+
50
54
  window.__MANDU_ROUTER_STATE__ = {
51
- currentRoute: null,
52
- loaderData: undefined,
55
+ currentRoute: route ? {
56
+ id: route.id,
57
+ pattern: route.pattern,
58
+ params: route.params || {},
59
+ } : null,
60
+ loaderData: route && data?.[route.id]?.serverData,
53
61
  navigation: { state: "idle" },
54
62
  };
55
63
  }