dalila 1.7.3 → 1.7.5

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.
@@ -464,8 +464,18 @@ function pageProps(pageHtml, pageTs) {
464
464
  if (hasNamedExport(pageTs, 'validation')) {
465
465
  props.push(`validation: ${moduleExport(pageTs, 'validation', { allowValue: true })}`);
466
466
  }
467
- if (hasNamedExport(pageTs, 'view')) {
468
- props.push(`onMount: ${moduleExport(pageTs, 'view')}`);
467
+ if (hasNamedExport(pageTs, 'onMount')) {
468
+ if (pageTs.lazy) {
469
+ const lazyLoader = `${pageTs.importName}_lazy`;
470
+ props.push(`onMount: (root: HTMLElement) => ${lazyLoader}().then(mod => {
471
+ if (typeof (mod as any).onMount === 'function') {
472
+ (mod as any).onMount(root);
473
+ }
474
+ })`);
475
+ }
476
+ else {
477
+ props.push(`onMount: ${moduleExport(pageTs, 'onMount')}`);
478
+ }
469
479
  }
470
480
  }
471
481
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dalila",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "DOM-first reactive framework based on signals",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",