ezfw-core 1.0.71 → 1.0.73

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.
@@ -89,6 +89,10 @@ export class StaticHtmlRenderer {
89
89
  * Render a static component to HTML
90
90
  */
91
91
  async renderStaticComponent(name, definition, props, ctx) {
92
+ // Track CSS module for this component
93
+ if (definition.css && typeof definition.css === 'string') {
94
+ ctx.styles.add(definition.css);
95
+ }
92
96
  let config;
93
97
  // Get component config from template or items
94
98
  if (definition.template) {
@@ -364,11 +368,11 @@ export class StaticHtmlRenderer {
364
368
  if (islands.length === 0)
365
369
  return '';
366
370
  const islandsJson = JSON.stringify(islands);
367
- return `
368
- <script type="module">
369
- import { hydrateIslands } from '/ez/islands/runtime.js';
370
- window.__EZ_ISLANDS__ = ${islandsJson};
371
- hydrateIslands(window.__EZ_ISLANDS__);
371
+ return `
372
+ <script type="module">
373
+ import { hydrateIslands } from '/ez/islands/runtime.js';
374
+ window.__EZ_ISLANDS__ = ${islandsJson};
375
+ hydrateIslands(window.__EZ_ISLANDS__);
372
376
  </script>`;
373
377
  }
374
378
  /**
@@ -66,7 +66,7 @@ const DEFAULT_TEMPLATE = `<!DOCTYPE html>
66
66
  {{head}}
67
67
  </head>
68
68
  <body>
69
- {{body}}
69
+ <div id="app">{{body}}</div>
70
70
  {{scripts}}
71
71
  </body>
72
72
  </html>`;
@@ -668,7 +668,7 @@ async function renderPageDev(page, server, opts, renderer, islands, root) {
668
668
  };
669
669
  // Render body
670
670
  const body = await renderer.renderPage(page.name, definition, ctx);
671
- // Generate hydration script
671
+ // Generate hydration script (pass CSS modules collected during render)
672
672
  const scripts = generateHydrationScript(ctx.islands, true, [...ctx.styles]);
673
673
  // Generate head meta tags
674
674
  const title = page.title || page.name;
@@ -757,7 +757,7 @@ async function renderPageBuild(page, opts, renderer, analyzer, root, islands) {
757
757
  };
758
758
  // Render body
759
759
  const body = await renderer.renderPage(page.name, definition, ctx);
760
- // Generate hydration script
760
+ // Generate hydration script (pass CSS modules collected during render)
761
761
  const scripts = generateHydrationScript(ctx.islands, false, [...ctx.styles]);
762
762
  // Generate head meta tags
763
763
  const title = page.title || page.name;
@@ -150,7 +150,7 @@ const DEFAULT_TEMPLATE = `<!DOCTYPE html>
150
150
  {{head}}
151
151
  </head>
152
152
  <body>
153
- {{body}}
153
+ <div id="app">{{body}}</div>
154
154
  {{scripts}}
155
155
  </body>
156
156
  </html>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezfw-core",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Ez Framework - A declarative component framework for building modern web applications",
5
5
  "type": "module",
6
6
  "main": "./core/ez.ts",