@vue-jsx-vapor/compiler 2.6.2 → 2.6.4

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/dist/index.cjs CHANGED
@@ -1412,12 +1412,13 @@ function genTemplates(templates, rootIndex, { helper }) {
1412
1412
  }
1413
1413
  function genSelf(dynamic, context) {
1414
1414
  const [frag, push] = buildCodeFragment();
1415
- const { id, template, operation } = dynamic;
1415
+ const { id, template, operation, hasDynamicChild } = dynamic;
1416
1416
  if (id !== void 0 && template !== void 0) {
1417
1417
  push(NEWLINE, `const n${id} = t${template}()`);
1418
1418
  push(...genDirectivesForElement(id, context));
1419
1419
  }
1420
1420
  if (operation) push(...genOperationWithInsertionState(operation, context));
1421
+ if (hasDynamicChild) push(...genChildren(dynamic, context, push, `n${id}`));
1421
1422
  return frag;
1422
1423
  }
1423
1424
  function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
@@ -1426,7 +1427,6 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
1426
1427
  const { children } = dynamic;
1427
1428
  let offset = 0;
1428
1429
  let prev;
1429
- const childrenToGen = [];
1430
1430
  for (const [index, child] of children.entries()) {
1431
1431
  if (child.flags & DynamicFlag.NON_TEMPLATE) offset--;
1432
1432
  const id = child.flags & DynamicFlag.REFERENCED ? child.flags & DynamicFlag.INSERT ? child.anchor : child.id : void 0;
@@ -1446,12 +1446,11 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
1446
1446
  else if (elementIndex > 1) init = genCall(helper("nthChild"), from, String(elementIndex));
1447
1447
  pushBlock(...init);
1448
1448
  }
1449
- if (id === child.anchor) push(...genSelf(child, context));
1449
+ if (id === child.anchor && !child.hasDynamicChild) push(...genSelf(child, context));
1450
1450
  if (id !== void 0) push(...genDirectivesForElement(id, context));
1451
1451
  prev = [variable, elementIndex];
1452
- childrenToGen.push([child, variable]);
1452
+ push(...genChildren(child, context, pushBlock, variable));
1453
1453
  }
1454
- if (childrenToGen.length) for (const [child, from$1] of childrenToGen) push(...genChildren(child, context, pushBlock, from$1));
1455
1454
  return frag;
1456
1455
  }
1457
1456
 
@@ -1483,7 +1482,7 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
1483
1482
  genResolveAssets("directive", "resolveDirective");
1484
1483
  }
1485
1484
  for (const child of dynamic.children) push(...genSelf(child, context));
1486
- for (const child of dynamic.children) push(...genChildren(child, context, push, `n${child.id}`));
1485
+ for (const child of dynamic.children) if (!child.hasDynamicChild) push(...genChildren(child, context, push, `n${child.id}`));
1487
1486
  push(...genOperations(operation, context));
1488
1487
  push(...genEffects(effect, context, genEffectsExtraFrag));
1489
1488
  push(NEWLINE, `return `);
package/dist/index.js CHANGED
@@ -1389,12 +1389,13 @@ function genTemplates(templates, rootIndex, { helper }) {
1389
1389
  }
1390
1390
  function genSelf(dynamic, context) {
1391
1391
  const [frag, push] = buildCodeFragment();
1392
- const { id, template, operation } = dynamic;
1392
+ const { id, template, operation, hasDynamicChild } = dynamic;
1393
1393
  if (id !== void 0 && template !== void 0) {
1394
1394
  push(NEWLINE, `const n${id} = t${template}()`);
1395
1395
  push(...genDirectivesForElement(id, context));
1396
1396
  }
1397
1397
  if (operation) push(...genOperationWithInsertionState(operation, context));
1398
+ if (hasDynamicChild) push(...genChildren(dynamic, context, push, `n${id}`));
1398
1399
  return frag;
1399
1400
  }
1400
1401
  function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
@@ -1403,7 +1404,6 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
1403
1404
  const { children } = dynamic;
1404
1405
  let offset = 0;
1405
1406
  let prev;
1406
- const childrenToGen = [];
1407
1407
  for (const [index, child] of children.entries()) {
1408
1408
  if (child.flags & DynamicFlag.NON_TEMPLATE) offset--;
1409
1409
  const id = child.flags & DynamicFlag.REFERENCED ? child.flags & DynamicFlag.INSERT ? child.anchor : child.id : void 0;
@@ -1423,12 +1423,11 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
1423
1423
  else if (elementIndex > 1) init = genCall(helper("nthChild"), from, String(elementIndex));
1424
1424
  pushBlock(...init);
1425
1425
  }
1426
- if (id === child.anchor) push(...genSelf(child, context));
1426
+ if (id === child.anchor && !child.hasDynamicChild) push(...genSelf(child, context));
1427
1427
  if (id !== void 0) push(...genDirectivesForElement(id, context));
1428
1428
  prev = [variable, elementIndex];
1429
- childrenToGen.push([child, variable]);
1429
+ push(...genChildren(child, context, pushBlock, variable));
1430
1430
  }
1431
- if (childrenToGen.length) for (const [child, from$1] of childrenToGen) push(...genChildren(child, context, pushBlock, from$1));
1432
1431
  return frag;
1433
1432
  }
1434
1433
 
@@ -1460,7 +1459,7 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
1460
1459
  genResolveAssets("directive", "resolveDirective");
1461
1460
  }
1462
1461
  for (const child of dynamic.children) push(...genSelf(child, context));
1463
- for (const child of dynamic.children) push(...genChildren(child, context, push, `n${child.id}`));
1462
+ for (const child of dynamic.children) if (!child.hasDynamicChild) push(...genChildren(child, context, push, `n${child.id}`));
1464
1463
  push(...genOperations(operation, context));
1465
1464
  push(...genEffects(effect, context, genEffectsExtraFrag));
1466
1465
  push(NEWLINE, `return `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/compiler",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "Vue JSX Vapor Compiler",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -34,11 +34,11 @@
34
34
  "./*": "./*"
35
35
  },
36
36
  "dependencies": {
37
- "@babel/parser": "^7.28.0",
38
- "@babel/types": "^7.28.0",
37
+ "@babel/parser": "^7.28.4",
38
+ "@babel/types": "^7.28.4",
39
39
  "@vue/compiler-dom": "3.6.0-alpha.2",
40
40
  "@vue/shared": "3.6.0-alpha.2",
41
- "ast-kit": "^2.1.1",
41
+ "ast-kit": "^2.1.2",
42
42
  "source-map-js": "^1.2.1"
43
43
  },
44
44
  "scripts": {