@fluixi/compiler 1.0.0-alpha.94 → 1.0.0-alpha.96

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.
Files changed (60) hide show
  1. package/LICENSE +1 -1
  2. package/dist/analyze/static-graph.cjs +1 -1
  3. package/dist/analyze/static-graph.mjs +1 -1
  4. package/dist/{babel-RJFQVFJW.mjs → babel-YG5PQAMX.mjs} +4 -4
  5. package/dist/{chunk-ZR2QHTEX.mjs → chunk-JHBI26FW.mjs} +6 -4
  6. package/dist/{chunk-DP2QDWWH.mjs → chunk-JJ4ZAZKY.mjs} +1 -1
  7. package/dist/{chunk-HCCBEJEZ.mjs → chunk-L6WBOEIO.mjs} +1 -1
  8. package/dist/{chunk-HIZU7WI2.mjs → chunk-UVH2BMMY.mjs} +1 -1
  9. package/dist/chunk-VX2OBUMB.mjs +92 -0
  10. package/dist/{chunk-E2RWTIYE.mjs → chunk-X735CULF.mjs} +4 -89
  11. package/dist/chunk-ZPEHDBCH.mjs +584 -0
  12. package/dist/codegen/backends/imperative.cjs +4 -2
  13. package/dist/codegen/backends/imperative.d.ts.map +1 -1
  14. package/dist/codegen/backends/imperative.js +9 -2
  15. package/dist/codegen/backends/imperative.mjs +4 -2
  16. package/dist/frontend/babel/build-ir-lit.cjs +4 -2
  17. package/dist/frontend/babel/build-ir-lit.mjs +4 -2
  18. package/dist/frontend/babel/build-ir.cjs +4 -2
  19. package/dist/frontend/babel/build-ir.mjs +4 -2
  20. package/dist/frontend/babel/index.cjs +5 -3
  21. package/dist/frontend/babel/index.mjs +5 -3
  22. package/dist/frontend/babel/lower-template.cjs +4 -2
  23. package/dist/frontend/babel/lower-template.mjs +4 -2
  24. package/dist/frontend/babel/plugin.cjs +4 -2
  25. package/dist/frontend/babel/plugin.mjs +4 -2
  26. package/dist/index.cjs +5 -3
  27. package/dist/index.mjs +5 -3
  28. package/dist/integrations.cjs +3330 -3269
  29. package/dist/integrations.d.ts.map +1 -1
  30. package/dist/integrations.js +19 -8
  31. package/dist/integrations.mjs +85 -40
  32. package/dist/lower/compile-template.cjs +5 -3
  33. package/dist/lower/compile-template.mjs +5 -3
  34. package/dist/lower/jsx.cjs +4 -2
  35. package/dist/lower/jsx.mjs +4 -2
  36. package/dist/lower/template.cjs +4 -2
  37. package/dist/lower/template.mjs +4 -2
  38. package/dist/resolve/builtins.cjs +1 -1
  39. package/dist/resolve/builtins.mjs +1 -1
  40. package/dist/{server-fns-JLSTKWPS.mjs → server-fns-PZEOON2D.mjs} +5 -4
  41. package/dist/{server-functions-BGY3RD4R.mjs → server-functions-JNSQMA63.mjs} +3 -3
  42. package/dist/transform/index.cjs +35 -16
  43. package/dist/transform/index.mjs +35 -16
  44. package/dist/transform/styles.cjs +31 -13
  45. package/dist/transform/styles.d.cts +27 -1
  46. package/dist/transform/styles.d.ts +27 -1
  47. package/dist/transform/styles.d.ts.map +1 -1
  48. package/dist/transform/styles.js +45 -16
  49. package/dist/transform/styles.mjs +31 -13
  50. package/dist/transform/templates.cjs +34 -15
  51. package/dist/transform/templates.mjs +34 -15
  52. package/dist/{transform-GBP6Y4UI.mjs → transform-UODP37VJ.mjs} +12 -563
  53. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  54. package/dist/vite-styles.cjs +66 -23
  55. package/dist/vite-styles.d.cts +16 -7
  56. package/dist/vite-styles.d.ts +16 -7
  57. package/dist/vite-styles.d.ts.map +1 -1
  58. package/dist/vite-styles.js +68 -25
  59. package/dist/vite-styles.mjs +78 -23
  60. package/package.json +4 -4
@@ -570,14 +570,16 @@ function emitNode(node, used, templates) {
570
570
  for (const child of node.children) {
571
571
  used.add("insert");
572
572
  const childCode = emitNode(child, used, templates);
573
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
574
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
573
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
574
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
575
575
  }
576
576
  parts.push(`return ${el};`);
577
577
  return `(() => { ${parts.join(" ")} })()`;
578
578
  }
579
579
  }
580
580
  }
581
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
582
+ var isLiteralCode = (code) => LITERAL.test(code);
581
583
  function inlineTemplates(code, templates) {
582
584
  if (!templates || templates.length === 0) return code;
583
585
  const byId = new Map(templates.map((t3) => [t3.id, JSON.stringify(t3.html)]));
@@ -553,14 +553,16 @@ function emitNode(node, used, templates) {
553
553
  for (const child of node.children) {
554
554
  used.add("insert");
555
555
  const childCode = emitNode(child, used, templates);
556
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
557
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
556
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
557
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
558
558
  }
559
559
  parts.push(`return ${el};`);
560
560
  return `(() => { ${parts.join(" ")} })()`;
561
561
  }
562
562
  }
563
563
  }
564
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
565
+ var isLiteralCode = (code) => LITERAL.test(code);
564
566
  function inlineTemplates(code, templates) {
565
567
  if (!templates || templates.length === 0) return code;
566
568
  const byId = new Map(templates.map((t3) => [t3.id, JSON.stringify(t3.html)]));
@@ -516,14 +516,16 @@ function emitNode(node, used, templates) {
516
516
  for (const child of node.children) {
517
517
  used.add("insert");
518
518
  const childCode = emitNode(child, used, templates);
519
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
520
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
519
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
520
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
521
521
  }
522
522
  parts.push(`return ${el};`);
523
523
  return `(() => { ${parts.join(" ")} })()`;
524
524
  }
525
525
  }
526
526
  }
527
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
528
+ var isLiteralCode = (code) => LITERAL.test(code);
527
529
  function inlineTemplates(code, templates) {
528
530
  if (!templates || templates.length === 0) return code;
529
531
  const byId = new Map(templates.map((t3) => [t3.id, JSON.stringify(t3.html)]));
@@ -1,4 +1,4 @@
1
- /*! @fluixi/compiler v1.0.0-alpha.94 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
1
+ /*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -778,14 +778,16 @@ function emitNode(node, used, templates) {
778
778
  for (const child of node.children) {
779
779
  used.add("insert");
780
780
  const childCode = emitNode(child, used, templates);
781
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
782
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
781
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
782
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
783
783
  }
784
784
  parts.push(`return ${el};`);
785
785
  return `(() => { ${parts.join(" ")} })()`;
786
786
  }
787
787
  }
788
788
  }
789
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
790
+ var isLiteralCode = (code) => LITERAL.test(code);
789
791
  function inlineTemplates(code, templates) {
790
792
  if (!templates || templates.length === 0) return code;
791
793
  const byId = new Map(templates.map((t4) => [t4.id, JSON.stringify(t4.html)]));
@@ -1,4 +1,4 @@
1
- /*! @fluixi/compiler v1.0.0-alpha.94 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
1
+ /*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
2
 
3
3
  // src/frontend/babel/plugin.ts
4
4
  import { declare } from "@babel/helper-plugin-utils";
@@ -739,14 +739,16 @@ function emitNode(node, used, templates) {
739
739
  for (const child of node.children) {
740
740
  used.add("insert");
741
741
  const childCode = emitNode(child, used, templates);
742
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
743
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
742
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
743
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
744
744
  }
745
745
  parts.push(`return ${el};`);
746
746
  return `(() => { ${parts.join(" ")} })()`;
747
747
  }
748
748
  }
749
749
  }
750
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
751
+ var isLiteralCode = (code) => LITERAL.test(code);
750
752
  function inlineTemplates(code, templates) {
751
753
  if (!templates || templates.length === 0) return code;
752
754
  const byId = new Map(templates.map((t4) => [t4.id, JSON.stringify(t4.html)]));
@@ -602,14 +602,16 @@ function emitNode(node, used, templates) {
602
602
  for (const child of node.children) {
603
603
  used.add("insert");
604
604
  const childCode = emitNode(child, used, templates);
605
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
606
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
605
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
606
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
607
607
  }
608
608
  parts.push(`return ${el};`);
609
609
  return `(() => { ${parts.join(" ")} })()`;
610
610
  }
611
611
  }
612
612
  }
613
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
614
+ var isLiteralCode = (code) => LITERAL.test(code);
613
615
  function inlineTemplates(code, templates) {
614
616
  if (!templates || templates.length === 0) return code;
615
617
  const byId = new Map(templates.map((t3) => [t3.id, JSON.stringify(t3.html)]));
@@ -570,14 +570,16 @@ function emitNode(node, used, templates) {
570
570
  for (const child of node.children) {
571
571
  used.add("insert");
572
572
  const childCode = emitNode(child, used, templates);
573
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
574
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
573
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
574
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
575
575
  }
576
576
  parts.push(`return ${el};`);
577
577
  return `(() => { ${parts.join(" ")} })()`;
578
578
  }
579
579
  }
580
580
  }
581
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
582
+ var isLiteralCode = (code) => LITERAL.test(code);
581
583
  function inlineTemplates(code, templates) {
582
584
  if (!templates || templates.length === 0) return code;
583
585
  const byId = new Map(templates.map((t3) => [t3.id, JSON.stringify(t3.html)]));
@@ -771,14 +771,16 @@ function emitNode(node, used, templates) {
771
771
  for (const child of node.children) {
772
772
  used.add("insert");
773
773
  const childCode = emitNode(child, used, templates);
774
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
775
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
774
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
775
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
776
776
  }
777
777
  parts.push(`return ${el};`);
778
778
  return `(() => { ${parts.join(" ")} })()`;
779
779
  }
780
780
  }
781
781
  }
782
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
783
+ var isLiteralCode = (code) => LITERAL.test(code);
782
784
  function inlineTemplates(code, templates) {
783
785
  if (!templates || templates.length === 0) return code;
784
786
  const byId = new Map(templates.map((t4) => [t4.id, JSON.stringify(t4.html)]));
@@ -737,14 +737,16 @@ function emitNode(node, used, templates) {
737
737
  for (const child of node.children) {
738
738
  used.add("insert");
739
739
  const childCode = emitNode(child, used, templates);
740
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
741
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
740
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
741
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
742
742
  }
743
743
  parts.push(`return ${el};`);
744
744
  return `(() => { ${parts.join(" ")} })()`;
745
745
  }
746
746
  }
747
747
  }
748
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
749
+ var isLiteralCode = (code) => LITERAL.test(code);
748
750
  function inlineTemplates(code, templates) {
749
751
  if (!templates || templates.length === 0) return code;
750
752
  const byId = new Map(templates.map((t4) => [t4.id, JSON.stringify(t4.html)]));
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @fluixi/compiler v1.0.0-alpha.94 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
1
+ /*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -635,14 +635,16 @@ function emitNode(node, used, templates) {
635
635
  for (const child of node.children) {
636
636
  used.add("insert");
637
637
  const childCode = emitNode(child, used, templates);
638
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
639
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
638
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
639
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
640
640
  }
641
641
  parts.push(`return ${el};`);
642
642
  return `(() => { ${parts.join(" ")} })()`;
643
643
  }
644
644
  }
645
645
  }
646
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
647
+ var isLiteralCode = (code) => LITERAL.test(code);
646
648
  function inlineTemplates(code, templates) {
647
649
  if (!templates || templates.length === 0) return code;
648
650
  const byId = new Map(templates.map((t) => [t.id, JSON.stringify(t.html)]));
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @fluixi/compiler v1.0.0-alpha.94 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
1
+ /*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
2
 
3
3
  // src/analyze/reactive-expr.ts
4
4
  var STABLE_MEMBER = "children";
@@ -588,14 +588,16 @@ function emitNode(node, used, templates) {
588
588
  for (const child of node.children) {
589
589
  used.add("insert");
590
590
  const childCode = emitNode(child, used, templates);
591
- const isFn = child.kind === "expr" && child.reactive || child.kind === "component" || child.kind === "control";
592
- parts.push(isFn ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
591
+ const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
592
+ parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
593
593
  }
594
594
  parts.push(`return ${el};`);
595
595
  return `(() => { ${parts.join(" ")} })()`;
596
596
  }
597
597
  }
598
598
  }
599
+ var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
600
+ var isLiteralCode = (code) => LITERAL.test(code);
599
601
  function inlineTemplates(code, templates) {
600
602
  if (!templates || templates.length === 0) return code;
601
603
  const byId = new Map(templates.map((t) => [t.id, JSON.stringify(t.html)]));