@fluixi/compiler 1.0.0-alpha.84 → 1.0.0-alpha.86
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/analyze/expr-shape.d.cts +2 -2
- package/dist/analyze/expr-shape.d.ts +2 -2
- package/dist/analyze/expr-shape.js +1 -1
- package/dist/analyze/intrinsics.cjs +1 -1
- package/dist/analyze/intrinsics.d.cts +7 -7
- package/dist/analyze/intrinsics.d.ts +7 -7
- package/dist/analyze/intrinsics.d.ts.map +1 -1
- package/dist/analyze/intrinsics.js +3 -3
- package/dist/analyze/intrinsics.mjs +1 -1
- package/dist/analyze/props-destructure.d.cts +3 -3
- package/dist/analyze/props-destructure.d.ts +3 -3
- package/dist/analyze/props-destructure.d.ts.map +1 -1
- package/dist/analyze/props-destructure.js +4 -4
- package/dist/analyze/reactive-bindings.cjs +1 -1
- package/dist/analyze/reactive-bindings.d.cts +1 -1
- package/dist/analyze/reactive-bindings.d.ts +1 -1
- package/dist/analyze/reactive-bindings.js +2 -2
- package/dist/analyze/reactive-bindings.mjs +1 -1
- package/dist/analyze/reactive-expr.d.cts +4 -4
- package/dist/analyze/reactive-expr.d.ts +4 -4
- package/dist/analyze/reactive-expr.d.ts.map +1 -1
- package/dist/analyze/reactive-expr.js +2 -2
- package/dist/analyze/static-graph.cjs +2 -2
- package/dist/analyze/static-graph.d.cts +1 -1
- package/dist/analyze/static-graph.d.ts +1 -1
- package/dist/analyze/static-graph.d.ts.map +1 -1
- package/dist/analyze/static-graph.js +11 -11
- package/dist/analyze/static-graph.mjs +2 -2
- package/dist/{babel-NRW4EFTG.mjs → babel-EFKUQT45.mjs} +6 -6
- package/dist/{chunk-R2VHAZAX.mjs → chunk-D3ZN6JUI.mjs} +1 -1
- package/dist/{chunk-FSSWUXUR.mjs → chunk-DREDGBKD.mjs} +1 -1
- package/dist/{chunk-MJV3UXIL.mjs → chunk-H6UK4N32.mjs} +2 -2
- package/dist/{chunk-EZR7NZOY.mjs → chunk-LOFOPSDV.mjs} +3 -3
- package/dist/{chunk-3YKZ4GNH.mjs → chunk-SYNSZIB2.mjs} +1 -1
- package/dist/codegen/backends/imperative.cjs +1 -1
- package/dist/codegen/backends/imperative.d.cts +1 -1
- package/dist/codegen/backends/imperative.d.ts +1 -1
- package/dist/codegen/backends/imperative.js +12 -12
- package/dist/codegen/backends/imperative.mjs +1 -1
- package/dist/codegen/contract.d.cts +2 -2
- package/dist/codegen/contract.d.ts +2 -2
- package/dist/codegen/contract.js +2 -2
- package/dist/codegen/partial-template.d.cts +4 -4
- package/dist/codegen/partial-template.d.ts +4 -4
- package/dist/codegen/partial-template.js +0 -0
- package/dist/codegen/serialize-static.d.cts +3 -3
- package/dist/codegen/serialize-static.d.ts +3 -3
- package/dist/codegen/serialize-static.js +6 -6
- package/dist/frontend/babel/build-ir-lit.cjs +3 -3
- package/dist/frontend/babel/build-ir-lit.d.cts +2 -2
- package/dist/frontend/babel/build-ir-lit.d.ts +2 -2
- package/dist/frontend/babel/build-ir-lit.mjs +3 -3
- package/dist/frontend/babel/build-ir.cjs +3 -3
- package/dist/frontend/babel/build-ir.d.cts +2 -2
- package/dist/frontend/babel/build-ir.d.ts +2 -2
- package/dist/frontend/babel/build-ir.js +2 -2
- package/dist/frontend/babel/build-ir.mjs +3 -3
- package/dist/frontend/babel/index.cjs +5 -5
- package/dist/frontend/babel/index.d.cts +1 -1
- package/dist/frontend/babel/index.d.ts +1 -1
- package/dist/frontend/babel/index.js +1 -1
- package/dist/frontend/babel/index.mjs +5 -5
- package/dist/frontend/babel/lower-template.cjs +3 -3
- package/dist/frontend/babel/lower-template.d.cts +1 -1
- package/dist/frontend/babel/lower-template.d.ts +1 -1
- package/dist/frontend/babel/lower-template.js +2 -2
- package/dist/frontend/babel/lower-template.mjs +3 -3
- package/dist/frontend/babel/plugin.cjs +4 -4
- package/dist/frontend/babel/plugin.d.cts +5 -5
- package/dist/frontend/babel/plugin.d.ts +5 -5
- package/dist/frontend/babel/plugin.d.ts.map +1 -1
- package/dist/frontend/babel/plugin.js +14 -14
- package/dist/frontend/babel/plugin.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +5 -5
- package/dist/integrations.cjs +12 -8
- package/dist/integrations.d.cts +9 -9
- package/dist/integrations.d.ts +9 -9
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +29 -8
- package/dist/integrations.mjs +15 -11
- package/dist/ir/nodes.d.cts +6 -6
- package/dist/ir/nodes.d.ts +6 -6
- package/dist/lower/compile-template.cjs +3 -3
- package/dist/lower/compile-template.d.cts +3 -3
- package/dist/lower/compile-template.d.ts +3 -3
- package/dist/lower/compile-template.js +1 -1
- package/dist/lower/compile-template.mjs +3 -3
- package/dist/lower/jsx.d.cts +1 -1
- package/dist/lower/jsx.d.ts +1 -1
- package/dist/lower/jsx.js +4 -4
- package/dist/lower/template.cjs +2 -2
- package/dist/lower/template.d.cts +3 -3
- package/dist/lower/template.d.ts +3 -3
- package/dist/lower/template.d.ts.map +1 -1
- package/dist/lower/template.js +7 -7
- package/dist/lower/template.mjs +2 -2
- package/dist/lower/text.d.cts +2 -2
- package/dist/lower/text.d.ts +2 -2
- package/dist/lower/text.d.ts.map +1 -1
- package/dist/lower/text.js +2 -2
- package/dist/optimize/analyze-static.d.cts +2 -2
- package/dist/optimize/analyze-static.d.ts +2 -2
- package/dist/optimize/analyze-static.js +2 -2
- package/dist/optimize/collapse-strategies.d.cts +3 -3
- package/dist/optimize/collapse-strategies.d.ts +3 -3
- package/dist/options.d.cts +2 -2
- package/dist/options.d.ts +2 -2
- package/dist/resolve/builtins.cjs +1 -1
- package/dist/resolve/builtins.d.cts +8 -8
- package/dist/resolve/builtins.d.ts +8 -8
- package/dist/resolve/builtins.d.ts.map +1 -1
- package/dist/resolve/builtins.js +4 -4
- package/dist/resolve/builtins.mjs +1 -1
- package/dist/resolve/component-globals.cjs +3 -3
- package/dist/resolve/component-globals.d.cts +5 -5
- package/dist/resolve/component-globals.d.ts +5 -5
- package/dist/resolve/component-globals.js +10 -10
- package/dist/resolve/component-globals.mjs +3 -3
- package/dist/resolve/component-resolver.d.cts +3 -3
- package/dist/resolve/component-resolver.d.ts +3 -3
- package/dist/resolve/component-resolver.d.ts.map +1 -1
- package/dist/resolve/component-resolver.js +3 -3
- package/dist/resolve/load-directive.d.cts +5 -5
- package/dist/resolve/load-directive.d.ts +5 -5
- package/dist/resolve/load-directive.js +6 -6
- package/dist/resolve/resolve-ir.d.cts +6 -6
- package/dist/resolve/resolve-ir.d.ts +6 -6
- package/dist/resolve/resolve-ir.d.ts.map +1 -1
- package/dist/resolve/resolve-ir.js +1 -1
- package/dist/resolve/write-globals.cjs +3 -3
- package/dist/resolve/write-globals.js +2 -2
- package/dist/resolve/write-globals.mjs +3 -3
- package/dist/{server-fns-4ZXN6DYU.mjs → server-fns-7I2C3D5P.mjs} +4 -4
- package/dist/{server-functions-V6D6DRIA.mjs → server-functions-GMKMN3D7.mjs} +3 -3
- package/dist/transform/bindings.d.cts +1 -1
- package/dist/transform/bindings.d.ts +1 -1
- package/dist/transform/bindings.js +1 -1
- package/dist/transform/index.cjs +3 -3
- package/dist/transform/index.mjs +3 -3
- package/dist/transform/intrinsics.cjs +1 -1
- package/dist/transform/intrinsics.js +1 -1
- package/dist/transform/intrinsics.mjs +1 -1
- package/dist/transform/props.d.cts +1 -1
- package/dist/transform/props.d.ts +1 -1
- package/dist/transform/props.d.ts.map +1 -1
- package/dist/transform/props.js +4 -4
- package/dist/transform/server-fn-id.d.cts +1 -1
- package/dist/transform/server-fn-id.d.ts +1 -1
- package/dist/transform/server-fn-id.js +2 -2
- package/dist/transform/server-fns.js +3 -3
- package/dist/transform/source-locations.cjs +1 -1
- package/dist/transform/source-locations.d.cts +1 -1
- package/dist/transform/source-locations.d.ts +1 -1
- package/dist/transform/source-locations.js +5 -5
- package/dist/transform/source-locations.mjs +1 -1
- package/dist/transform/templates.cjs +2 -2
- package/dist/transform/templates.d.cts +2 -2
- package/dist/transform/templates.d.ts +2 -2
- package/dist/transform/templates.d.ts.map +1 -1
- package/dist/transform/templates.js +7 -7
- package/dist/transform/templates.mjs +2 -2
- package/dist/{transform-BT4MMASR.mjs → transform-CRVH2C2I.mjs} +5 -5
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.86 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -477,7 +477,7 @@ var INTRINSICS = {
|
|
|
477
477
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
478
478
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
479
479
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
480
|
-
// name. Still worth having
|
|
480
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
481
481
|
// designed, the change is this line rather than a compiler pass.
|
|
482
482
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
483
483
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1214,7 +1214,7 @@ var Lowerer = class {
|
|
|
1214
1214
|
}
|
|
1215
1215
|
];
|
|
1216
1216
|
}
|
|
1217
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1217
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1218
1218
|
plainAttr(a) {
|
|
1219
1219
|
const v = a.value;
|
|
1220
1220
|
let name = a.name;
|
|
@@ -1677,7 +1677,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1677
1677
|
const ir = buildJsxIR(node, {
|
|
1678
1678
|
code: (n) => (
|
|
1679
1679
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1680
|
-
// through the nested-JSX compile
|
|
1680
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1681
1681
|
n.type === "JSXMemberExpression" ? gen2(n) : genExpr(n, used, onNested)
|
|
1682
1682
|
),
|
|
1683
1683
|
used
|
|
@@ -1928,7 +1928,7 @@ var plugin_default = (0, import_helper_plugin_utils.declare)((api, options = {})
|
|
|
1928
1928
|
import_core3.types.identifier(name),
|
|
1929
1929
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
1930
1930
|
// knows whether this is a server render, a hydration or a fresh
|
|
1931
|
-
// client render
|
|
1931
|
+
// client render: a module-scope `createTemplate` would touch
|
|
1932
1932
|
// `document` at import time and break SSR outright.
|
|
1933
1933
|
import_core3.types.stringLiteral(html)
|
|
1934
1934
|
)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is one of the compiler's front-end adapters: it parses with @babel and
|
|
6
6
|
* runs the JSX transform. The transform/codegen it currently performs is the
|
|
7
|
-
* existing behaviour (emits the jsx() automatic runtime)
|
|
7
|
+
* existing behaviour (emits the jsx() automatic runtime), switching codegen to
|
|
8
8
|
* the IR-driven backends (see ../../codegen) is a later step. SWC/other
|
|
9
9
|
* front-ends will plug in alongside this without touching the rest of the pipeline.
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is one of the compiler's front-end adapters: it parses with @babel and
|
|
6
6
|
* runs the JSX transform. The transform/codegen it currently performs is the
|
|
7
|
-
* existing behaviour (emits the jsx() automatic runtime)
|
|
7
|
+
* existing behaviour (emits the jsx() automatic runtime), switching codegen to
|
|
8
8
|
* the IR-driven backends (see ../../codegen) is a later step. SWC/other
|
|
9
9
|
* front-ends will plug in alongside this without touching the rest of the pipeline.
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is one of the compiler's front-end adapters: it parses with @babel and
|
|
6
6
|
* runs the JSX transform. The transform/codegen it currently performs is the
|
|
7
|
-
* existing behaviour (emits the jsx() automatic runtime)
|
|
7
|
+
* existing behaviour (emits the jsx() automatic runtime), switching codegen to
|
|
8
8
|
* the IR-driven backends (see ../../codegen) is a later step. SWC/other
|
|
9
9
|
* front-ends will plug in alongside this without touching the rest of the pipeline.
|
|
10
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.86 | (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";
|
|
@@ -438,7 +438,7 @@ var INTRINSICS = {
|
|
|
438
438
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
439
439
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
440
440
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
441
|
-
// name. Still worth having
|
|
441
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
442
442
|
// designed, the change is this line rather than a compiler pass.
|
|
443
443
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
444
444
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1177,7 +1177,7 @@ var Lowerer = class {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
];
|
|
1179
1179
|
}
|
|
1180
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1180
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1181
1181
|
plainAttr(a) {
|
|
1182
1182
|
const v = a.value;
|
|
1183
1183
|
let name = a.name;
|
|
@@ -1640,7 +1640,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1640
1640
|
const ir = buildJsxIR(node, {
|
|
1641
1641
|
code: (n) => (
|
|
1642
1642
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1643
|
-
// through the nested-JSX compile
|
|
1643
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1644
1644
|
n.type === "JSXMemberExpression" ? gen2(n) : genExpr(n, used, onNested)
|
|
1645
1645
|
),
|
|
1646
1646
|
used
|
|
@@ -1891,7 +1891,7 @@ var plugin_default = declare((api, options = {}) => {
|
|
|
1891
1891
|
t3.identifier(name),
|
|
1892
1892
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
1893
1893
|
// knows whether this is a server render, a hydration or a fresh
|
|
1894
|
-
// client render
|
|
1894
|
+
// client render: a module-scope `createTemplate` would touch
|
|
1895
1895
|
// `document` at import time and break SSR outright.
|
|
1896
1896
|
t3.stringLiteral(html)
|
|
1897
1897
|
)
|
|
@@ -301,7 +301,7 @@ var INTRINSICS = {
|
|
|
301
301
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
302
302
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
303
303
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
304
|
-
// name. Still worth having
|
|
304
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
305
305
|
// designed, the change is this line rather than a compiler pass.
|
|
306
306
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
307
307
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1031,7 +1031,7 @@ var Lowerer = class {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
];
|
|
1033
1033
|
}
|
|
1034
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1034
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1035
1035
|
plainAttr(a) {
|
|
1036
1036
|
const v = a.value;
|
|
1037
1037
|
let name = a.name;
|
|
@@ -1459,7 +1459,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1459
1459
|
const ir = buildJsxIR(node, {
|
|
1460
1460
|
code: (n) => (
|
|
1461
1461
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1462
|
-
// through the nested-JSX compile
|
|
1462
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1463
1463
|
n.type === "JSXMemberExpression" ? gen(n) : genExpr(n, used, onNested)
|
|
1464
1464
|
),
|
|
1465
1465
|
used
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The lowering itself is in ../../lower/template.ts and takes no Babel. What is
|
|
5
5
|
* left here is the part that genuinely needs to read JavaScript: turning each
|
|
6
|
-
* `${…}` into a `TemplateHole
|
|
6
|
+
* `${…}` into a `TemplateHole`: its source text, whether it is reactive, and
|
|
7
7
|
* the two structural facts the lowering branches on (a single-expression arrow,
|
|
8
8
|
* an object literal).
|
|
9
9
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The lowering itself is in ../../lower/template.ts and takes no Babel. What is
|
|
5
5
|
* left here is the part that genuinely needs to read JavaScript: turning each
|
|
6
|
-
* `${…}` into a `TemplateHole
|
|
6
|
+
* `${…}` into a `TemplateHole`: its source text, whether it is reactive, and
|
|
7
7
|
* the two structural facts the lowering branches on (a single-expression arrow,
|
|
8
8
|
* an object literal).
|
|
9
9
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The lowering itself is in ../../lower/template.ts and takes no Babel. What is
|
|
5
5
|
* left here is the part that genuinely needs to read JavaScript: turning each
|
|
6
|
-
* `${…}` into a `TemplateHole
|
|
6
|
+
* `${…}` into a `TemplateHole`: its source text, whether it is reactive, and
|
|
7
7
|
* the two structural facts the lowering branches on (a single-expression arrow,
|
|
8
8
|
* an object literal).
|
|
9
9
|
*
|
|
@@ -24,7 +24,7 @@ function bindHole(expr, used, onNested) {
|
|
|
24
24
|
code: genExpr(expr, used, onNested),
|
|
25
25
|
reactive: isReactiveExpr(expr),
|
|
26
26
|
};
|
|
27
|
-
// `${item => <li>${item}</li>}
|
|
27
|
+
// `${item => <li>${item}</li>}`: `each` lowers this into For's render
|
|
28
28
|
// function, which needs the parameters and the body apart from each other. A
|
|
29
29
|
// block body is not a render expression, so it stays an ordinary hole.
|
|
30
30
|
if (t.isArrowFunctionExpression(expr) && !t.isBlockStatement(expr.body)) {
|
|
@@ -269,7 +269,7 @@ var INTRINSICS = {
|
|
|
269
269
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
270
270
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
271
271
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
272
|
-
// name. Still worth having
|
|
272
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
273
273
|
// designed, the change is this line rather than a compiler pass.
|
|
274
274
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
275
275
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -999,7 +999,7 @@ var Lowerer = class {
|
|
|
999
999
|
}
|
|
1000
1000
|
];
|
|
1001
1001
|
}
|
|
1002
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1002
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1003
1003
|
plainAttr(a) {
|
|
1004
1004
|
const v = a.value;
|
|
1005
1005
|
let name = a.name;
|
|
@@ -1427,7 +1427,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1427
1427
|
const ir = buildJsxIR(node, {
|
|
1428
1428
|
code: (n) => (
|
|
1429
1429
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1430
|
-
// through the nested-JSX compile
|
|
1430
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1431
1431
|
n.type === "JSXMemberExpression" ? gen(n) : genExpr(n, used, onNested)
|
|
1432
1432
|
),
|
|
1433
1433
|
used
|
|
@@ -470,7 +470,7 @@ var INTRINSICS = {
|
|
|
470
470
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
471
471
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
472
472
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
473
|
-
// name. Still worth having
|
|
473
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
474
474
|
// designed, the change is this line rather than a compiler pass.
|
|
475
475
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
476
476
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1207,7 +1207,7 @@ var Lowerer = class {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
];
|
|
1209
1209
|
}
|
|
1210
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1210
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1211
1211
|
plainAttr(a) {
|
|
1212
1212
|
const v = a.value;
|
|
1213
1213
|
let name = a.name;
|
|
@@ -1670,7 +1670,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1670
1670
|
const ir = buildJsxIR(node, {
|
|
1671
1671
|
code: (n) => (
|
|
1672
1672
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1673
|
-
// through the nested-JSX compile
|
|
1673
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1674
1674
|
n.type === "JSXMemberExpression" ? gen2(n) : genExpr(n, used, onNested)
|
|
1675
1675
|
),
|
|
1676
1676
|
used
|
|
@@ -1921,7 +1921,7 @@ var plugin_default = (0, import_helper_plugin_utils.declare)((api, options = {})
|
|
|
1921
1921
|
import_core3.types.identifier(name),
|
|
1922
1922
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
1923
1923
|
// knows whether this is a server render, a hydration or a fresh
|
|
1924
|
-
// client render
|
|
1924
|
+
// client render: a module-scope `createTemplate` would touch
|
|
1925
1925
|
// `document` at import time and break SSR outright.
|
|
1926
1926
|
import_core3.types.stringLiteral(html)
|
|
1927
1927
|
)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is a host adapter, not the compiler. It parses with babel and, for each
|
|
6
6
|
* JSX element/fragment and each `` html`...` `` template, hands the node to the
|
|
7
|
-
* shared pipeline
|
|
7
|
+
* shared pipeline: build IR, run the imperative backend, then splices the
|
|
8
8
|
* emitted code back into the program. Everything that decides *what* the output
|
|
9
9
|
* means (directives, control flow, component resolution, load strategies,
|
|
10
10
|
* reactivity, templates) lives in ../../{ir,resolve,optimize,codegen}, which
|
|
@@ -19,7 +19,7 @@ import { type PluginObj } from '@babel/core';
|
|
|
19
19
|
export interface PluginOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Import source for the JSX types and for whatever JSX this plugin does not
|
|
22
|
-
* consume
|
|
22
|
+
* consume: esbuild's automatic runtime and TypeScript's `jsxImportSource`
|
|
23
23
|
* both point at it. The compiler itself never emits `jsx()` calls.
|
|
24
24
|
* @default '@fluixi/jsx'
|
|
25
25
|
*/
|
|
@@ -54,13 +54,13 @@ export interface PluginOptions {
|
|
|
54
54
|
* @default '@fluixi/core/router'
|
|
55
55
|
*/
|
|
56
56
|
routerModule?: string;
|
|
57
|
-
/** Clone static subtrees from a template. Client-only
|
|
57
|
+
/** Clone static subtrees from a template. Client-only, see CompilerOptions. */
|
|
58
58
|
templateClone?: boolean;
|
|
59
59
|
/** Also clone structure-static subtrees with holes. See CompilerOptions. */
|
|
60
60
|
partialTemplates?: boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Rules that resolve an unbound capitalised tag to a module, so a component can be
|
|
63
|
-
* used without an import
|
|
63
|
+
* used without an import: the configurable form of the built-in
|
|
64
64
|
* Suspense/Portal/Router auto-import.
|
|
65
65
|
*
|
|
66
66
|
* A lexical binding always wins, so an explicit import or a local variable is never
|
|
@@ -68,7 +68,7 @@ export interface PluginOptions {
|
|
|
68
68
|
*/
|
|
69
69
|
resolve?: readonly ComponentResolverRule[];
|
|
70
70
|
/**
|
|
71
|
-
* Where reactive primitives (createMemo) are imported from
|
|
71
|
+
* Where reactive primitives (createMemo) are imported from, the signal core,
|
|
72
72
|
* not the dom runtime.
|
|
73
73
|
* @default '@fluixi/reactive/signal'
|
|
74
74
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is a host adapter, not the compiler. It parses with babel and, for each
|
|
6
6
|
* JSX element/fragment and each `` html`...` `` template, hands the node to the
|
|
7
|
-
* shared pipeline
|
|
7
|
+
* shared pipeline: build IR, run the imperative backend, then splices the
|
|
8
8
|
* emitted code back into the program. Everything that decides *what* the output
|
|
9
9
|
* means (directives, control flow, component resolution, load strategies,
|
|
10
10
|
* reactivity, templates) lives in ../../{ir,resolve,optimize,codegen}, which
|
|
@@ -19,7 +19,7 @@ import { type PluginObj } from '@babel/core';
|
|
|
19
19
|
export interface PluginOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Import source for the JSX types and for whatever JSX this plugin does not
|
|
22
|
-
* consume
|
|
22
|
+
* consume: esbuild's automatic runtime and TypeScript's `jsxImportSource`
|
|
23
23
|
* both point at it. The compiler itself never emits `jsx()` calls.
|
|
24
24
|
* @default '@fluixi/jsx'
|
|
25
25
|
*/
|
|
@@ -54,13 +54,13 @@ export interface PluginOptions {
|
|
|
54
54
|
* @default '@fluixi/core/router'
|
|
55
55
|
*/
|
|
56
56
|
routerModule?: string;
|
|
57
|
-
/** Clone static subtrees from a template. Client-only
|
|
57
|
+
/** Clone static subtrees from a template. Client-only, see CompilerOptions. */
|
|
58
58
|
templateClone?: boolean;
|
|
59
59
|
/** Also clone structure-static subtrees with holes. See CompilerOptions. */
|
|
60
60
|
partialTemplates?: boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Rules that resolve an unbound capitalised tag to a module, so a component can be
|
|
63
|
-
* used without an import
|
|
63
|
+
* used without an import: the configurable form of the built-in
|
|
64
64
|
* Suspense/Portal/Router auto-import.
|
|
65
65
|
*
|
|
66
66
|
* A lexical binding always wins, so an explicit import or a local variable is never
|
|
@@ -68,7 +68,7 @@ export interface PluginOptions {
|
|
|
68
68
|
*/
|
|
69
69
|
resolve?: readonly ComponentResolverRule[];
|
|
70
70
|
/**
|
|
71
|
-
* Where reactive primitives (createMemo) are imported from
|
|
71
|
+
* Where reactive primitives (createMemo) are imported from, the signal core,
|
|
72
72
|
* not the dom runtime.
|
|
73
73
|
* @default '@fluixi/reactive/signal'
|
|
74
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/frontend/babel/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAUnE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/frontend/babel/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAUnE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAE3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAEhC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AAkDD,wBAgVG"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is a host adapter, not the compiler. It parses with babel and, for each
|
|
6
6
|
* JSX element/fragment and each `` html`...` `` template, hands the node to the
|
|
7
|
-
* shared pipeline
|
|
7
|
+
* shared pipeline: build IR, run the imperative backend, then splices the
|
|
8
8
|
* emitted code back into the program. Everything that decides *what* the output
|
|
9
9
|
* means (directives, control flow, component resolution, load strategies,
|
|
10
10
|
* reactivity, templates) lives in ../../{ir,resolve,optimize,codegen}, which
|
|
@@ -27,7 +27,7 @@ import { imperativeBackend } from '../../codegen/backends/imperative.js';
|
|
|
27
27
|
// ============================================================================
|
|
28
28
|
// Constants
|
|
29
29
|
// ============================================================================
|
|
30
|
-
// Control-flow components that live in fluixi, NOT @fluixi/dom
|
|
30
|
+
// Control-flow components that live in fluixi, NOT @fluixi/dom, they must
|
|
31
31
|
// be auto-imported from core (dom doesn't export them).
|
|
32
32
|
const CORE_ONLY_CONTROL_FLOW = new Set(CORE_CONTROL_FLOW);
|
|
33
33
|
// Router components auto-imported (from routerModule) the same way control flow is:
|
|
@@ -168,7 +168,7 @@ export default declare((api, options = {}) => {
|
|
|
168
168
|
// enabling resolution can never change what an existing file means.
|
|
169
169
|
//
|
|
170
170
|
// Grouped by module so several components from one package share a single
|
|
171
|
-
// declaration, and emitted with the local name equal to the tag
|
|
171
|
+
// declaration, and emitted with the local name equal to the tag, the
|
|
172
172
|
// generated code refers to the tag, not to the export.
|
|
173
173
|
// Deferred components become value bindings, not imports: a literal
|
|
174
174
|
// `import()` is what lets the bundler split, hash and tree-shake the chunk
|
|
@@ -232,7 +232,7 @@ export default declare((api, options = {}) => {
|
|
|
232
232
|
t.variableDeclarator(t.identifier(name),
|
|
233
233
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
234
234
|
// knows whether this is a server render, a hydration or a fresh
|
|
235
|
-
// client render
|
|
235
|
+
// client render: a module-scope `createTemplate` would touch
|
|
236
236
|
// `document` at import time and break SSR outright.
|
|
237
237
|
t.stringLiteral(html)),
|
|
238
238
|
]));
|
|
@@ -242,7 +242,7 @@ export default declare((api, options = {}) => {
|
|
|
242
242
|
}
|
|
243
243
|
// Add all imports at the top, deduped. When a file mixes inline JSX
|
|
244
244
|
// and html`` (format 'both'), the two injection paths can each emit an
|
|
245
|
-
// import for the same module/name
|
|
245
|
+
// import for the same module/name: merge per-module and drop repeated
|
|
246
246
|
// specifiers so we never redeclare a binding.
|
|
247
247
|
if (imports.length > 0) {
|
|
248
248
|
path.node.body.unshift(...dedupeImports(imports));
|
|
@@ -262,7 +262,7 @@ export default declare((api, options = {}) => {
|
|
|
262
262
|
},
|
|
263
263
|
TaggedTemplateExpression(path, state) {
|
|
264
264
|
// `html`...`` and `svg`...`` lower through the same IR and the same
|
|
265
|
-
// backend as JSX
|
|
265
|
+
// backend as JSX: one pipeline, two authoring syntaxes.
|
|
266
266
|
if (compileLit &&
|
|
267
267
|
t.isIdentifier(path.node.tag) &&
|
|
268
268
|
(path.node.tag.name === litTag || path.node.tag.name === 'svg')) {
|
|
@@ -278,14 +278,14 @@ export default declare((api, options = {}) => {
|
|
|
278
278
|
/**
|
|
279
279
|
* Two usages of one component in the same file share a binding, so their strategies
|
|
280
280
|
* have to agree. The earlier-loading one wins: the module is in whichever chunk loads
|
|
281
|
-
* first regardless, so deferring the other buys nothing
|
|
281
|
+
* first regardless, so deferring the other buys nothing, the same reasoning as the
|
|
282
282
|
* collapse pass, applied within a file.
|
|
283
283
|
*/
|
|
284
284
|
/**
|
|
285
285
|
* What to do with JSX or a template found inside an expression: resolve its
|
|
286
286
|
* component references and record what the module needs, exactly as the
|
|
287
287
|
* top-level node gets. The IR itself is emitted and dropped by the walk, so
|
|
288
|
-
* anything not taken off it here is lost
|
|
288
|
+
* anything not taken off it here is lost: which is how `{(b) => <Input/>}`
|
|
289
289
|
* came out referring to a component nothing imported.
|
|
290
290
|
*/
|
|
291
291
|
function nestedHook(state) {
|
|
@@ -338,7 +338,7 @@ function adoptTemplates(code, templates, state) {
|
|
|
338
338
|
}
|
|
339
339
|
// One pass, not one replacement per id. The backend's local ids and the hoisted names
|
|
340
340
|
// share the `_tmpl$N` namespace, so replacing them in sequence can rewrite a name that
|
|
341
|
-
// an earlier replacement just produced
|
|
341
|
+
// an earlier replacement just produced: which silently points a template at another
|
|
342
342
|
// template's HTML.
|
|
343
343
|
return code.replace(/_tmpl\$\d+/g, (id) => rename.get(id) ?? id);
|
|
344
344
|
}
|
|
@@ -348,7 +348,7 @@ function emitViaIR(node, state) {
|
|
|
348
348
|
const used = new Set();
|
|
349
349
|
const ir = buildIR(node, used, nestedHook(state));
|
|
350
350
|
// The same passes the lit path runs. Without them `codegen: 'ir'` silently skipped
|
|
351
|
-
// resolution entirely
|
|
351
|
+
// resolution entirely: a resolved tag compiled to a reference with no import.
|
|
352
352
|
resolveComponentSources(ir, {
|
|
353
353
|
resolver: state.componentResolver,
|
|
354
354
|
modules: {
|
|
@@ -402,7 +402,7 @@ function dedupeImports(imports) {
|
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
404
|
* Lit-pipeline path: build IR from a `` html`...` `` template, emit through the
|
|
405
|
-
* imperative backend, reparse. Mirrors emitViaIR
|
|
405
|
+
* imperative backend, reparse. Mirrors emitViaIR, the whole point is that lit
|
|
406
406
|
* and JSX share one IR + one backend. Collects runtime imports and the delegated
|
|
407
407
|
* events used so Program.exit wires them.
|
|
408
408
|
*/
|
|
@@ -411,7 +411,7 @@ function emitLitViaIR(node, state) {
|
|
|
411
411
|
const svg = t.isIdentifier(node.tag) && node.tag.name === 'svg';
|
|
412
412
|
const ir = buildIRFromLit(node, used, { svg, onNested: nestedHook(state) });
|
|
413
413
|
// Resolve pass: annotate each component reference with where it comes from, before
|
|
414
|
-
// codegen. Bindings are not checked here
|
|
414
|
+
// codegen. Bindings are not checked here: Program.exit knows the whole file's scope
|
|
415
415
|
// and drops any injected import whose name turns out to be bound.
|
|
416
416
|
resolveComponentSources(ir, {
|
|
417
417
|
resolver: state.componentResolver,
|
|
@@ -434,7 +434,7 @@ function emitLitViaIR(node, state) {
|
|
|
434
434
|
collectRuntimeNeeds(ir, state);
|
|
435
435
|
state.hasLitIR = true;
|
|
436
436
|
// The IR is emitted as a string and reparsed, so the resulting nodes carry no
|
|
437
|
-
// position
|
|
437
|
+
// position: which is why compiled html`` had no source map at all. Give every
|
|
438
438
|
// generated node the template's own location so a breakpoint or stack frame
|
|
439
439
|
// lands on the template instead of nowhere.
|
|
440
440
|
const expression = template.expression(adoptTemplates(code, templates, state), {
|
|
@@ -487,7 +487,7 @@ function collectRuntimeNeeds(node, state) {
|
|
|
487
487
|
if (node.kind === 'component' && node.source) {
|
|
488
488
|
// Provenance was decided by the resolve pass and recorded on the node; this only
|
|
489
489
|
// translates it into the two things Program.exit wires. Reading it here rather
|
|
490
|
-
// than re-resolving is the point
|
|
490
|
+
// than re-resolving is the point: one decision, so import injection and every
|
|
491
491
|
// later pass cannot disagree.
|
|
492
492
|
if (node.source.origin === 'builtin') {
|
|
493
493
|
state.controlFlowComponents.add(node.name);
|
|
@@ -436,7 +436,7 @@ var INTRINSICS = {
|
|
|
436
436
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
437
437
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
438
438
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
439
|
-
// name. Still worth having
|
|
439
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
440
440
|
// designed, the change is this line rather than a compiler pass.
|
|
441
441
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
442
442
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1175,7 +1175,7 @@ var Lowerer = class {
|
|
|
1175
1175
|
}
|
|
1176
1176
|
];
|
|
1177
1177
|
}
|
|
1178
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1178
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1179
1179
|
plainAttr(a) {
|
|
1180
1180
|
const v = a.value;
|
|
1181
1181
|
let name = a.name;
|
|
@@ -1638,7 +1638,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
1638
1638
|
const ir = buildJsxIR(node, {
|
|
1639
1639
|
code: (n) => (
|
|
1640
1640
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
1641
|
-
// through the nested-JSX compile
|
|
1641
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
1642
1642
|
n.type === "JSXMemberExpression" ? gen2(n) : genExpr(n, used, onNested)
|
|
1643
1643
|
),
|
|
1644
1644
|
used
|
|
@@ -1889,7 +1889,7 @@ var plugin_default = declare((api, options = {}) => {
|
|
|
1889
1889
|
t3.identifier(name),
|
|
1890
1890
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
1891
1891
|
// knows whether this is a server render, a hydration or a fresh
|
|
1892
|
-
// client render
|
|
1892
|
+
// client render: a module-scope `createTemplate` would touch
|
|
1893
1893
|
// `document` at import time and break SSR outright.
|
|
1894
1894
|
t3.stringLiteral(html)
|
|
1895
1895
|
)
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.86 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -328,7 +328,7 @@ var INTRINSICS = {
|
|
|
328
328
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
329
329
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
330
330
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
331
|
-
// name. Still worth having
|
|
331
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
332
332
|
// designed, the change is this line rather than a compiler pass.
|
|
333
333
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
334
334
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1058,7 +1058,7 @@ var Lowerer = class {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
];
|
|
1060
1060
|
}
|
|
1061
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1061
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1062
1062
|
plainAttr(a) {
|
|
1063
1063
|
const v = a.value;
|
|
1064
1064
|
let name = a.name;
|
|
@@ -1473,7 +1473,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
1473
1473
|
return target.export === "default" ? ` const ${name}: typeof ${ns}.default;` : ` export import ${name} = ${ns}.${target.export};`;
|
|
1474
1474
|
});
|
|
1475
1475
|
const note = shadowedByDom.length > 0 ? `//
|
|
1476
|
-
// Import these explicitly
|
|
1476
|
+
// Import these explicitly: lib.dom already declares the name, so an ambient
|
|
1477
1477
|
// declaration cannot win:
|
|
1478
1478
|
` + shadowedByDom.map((n) => {
|
|
1479
1479
|
const module2 = resolver.resolve(n)?.module;
|
|
@@ -1489,7 +1489,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
1489
1489
|
// a pattern matches unboundedly many names, so there is no list to emit. Those
|
|
1490
1490
|
// tags still resolve at build time; declare them by hand if the editor needs them.
|
|
1491
1491
|
` : "";
|
|
1492
|
-
const source = `// GENERATED by ${generator}
|
|
1492
|
+
const source = `// GENERATED by ${generator}, do not edit.
|
|
1493
1493
|
//
|
|
1494
1494
|
// The components \`resolve\` supplies without an import. This describes what the
|
|
1495
1495
|
// compiler already does; it does not enable it.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fluixi/compiler
|
|
2
|
+
* @fluixi/compiler: host-agnostic JSX compiler for Fluixi.
|
|
3
3
|
*
|
|
4
4
|
* Pipeline: front-end adapters (babel now, swc later) → IR → analyze →
|
|
5
5
|
* transform → codegen backends (imperative now, template-clone later) emitting
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fluixi/compiler
|
|
2
|
+
* @fluixi/compiler: host-agnostic JSX compiler for Fluixi.
|
|
3
3
|
*
|
|
4
4
|
* Pipeline: front-end adapters (babel now, swc later) → IR → analyze →
|
|
5
5
|
* transform → codegen backends (imperative now, template-clone later) emitting
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fluixi/compiler
|
|
2
|
+
* @fluixi/compiler: host-agnostic JSX compiler for Fluixi.
|
|
3
3
|
*
|
|
4
4
|
* Pipeline: front-end adapters (babel now, swc later) → IR → analyze →
|
|
5
5
|
* transform → codegen backends (imperative now, template-clone later) emitting
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* The babel front-end is exposed at the '@fluixi/compiler/babel' subpath.
|
|
9
9
|
*/
|
|
10
10
|
export * from './ir/nodes.js';
|
|
11
|
-
// The reactivity rule, expressed over shapes rather than a parser's AST
|
|
11
|
+
// The reactivity rule, expressed over shapes rather than a parser's AST, so a
|
|
12
12
|
// front-end supplies the mapping and inherits the semantics.
|
|
13
13
|
export * from './analyze/reactive-expr.js';
|
|
14
|
-
// analyzeReactiveGraph is not here: it parses, and this entry reaches no babel
|
|
14
|
+
// analyzeReactiveGraph is not here: it parses, and this entry reaches no babel, the
|
|
15
15
|
// ts-plugin imports it and a stray parser is a module that fails to resolve for it. It is
|
|
16
16
|
// `@fluixi/compiler/analyze`.
|
|
17
17
|
// Template lowering + the Babel-free compile entry. `compileTemplate` goes from
|
|
@@ -19,7 +19,7 @@ export * from './analyze/reactive-expr.js';
|
|
|
19
19
|
export { lowerTemplate } from './lower/template.js';
|
|
20
20
|
export { cleanTemplateText } from './lower/text.js';
|
|
21
21
|
export * from './lower/compile-template.js';
|
|
22
|
-
// Component resolution
|
|
22
|
+
// Component resolution: shared by the compiler, the TS plugin (to synthesise the
|
|
23
23
|
// import the author did not write) and codemods, so all three agree on one answer.
|
|
24
24
|
export * from './resolve/component-resolver.js';
|
|
25
25
|
export * from './resolve/component-globals.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.86 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/analyze/reactive-expr.ts
|
|
4
4
|
var STABLE_MEMBER = "children";
|
|
@@ -282,7 +282,7 @@ var INTRINSICS = {
|
|
|
282
282
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
283
283
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
284
284
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
285
|
-
// name. Still worth having
|
|
285
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
286
286
|
// designed, the change is this line rather than a compiler pass.
|
|
287
287
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
288
288
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1012,7 +1012,7 @@ var Lowerer = class {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
];
|
|
1014
1014
|
}
|
|
1015
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1015
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1016
1016
|
plainAttr(a) {
|
|
1017
1017
|
const v = a.value;
|
|
1018
1018
|
let name = a.name;
|
|
@@ -1427,7 +1427,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
1427
1427
|
return target.export === "default" ? ` const ${name}: typeof ${ns}.default;` : ` export import ${name} = ${ns}.${target.export};`;
|
|
1428
1428
|
});
|
|
1429
1429
|
const note = shadowedByDom.length > 0 ? `//
|
|
1430
|
-
// Import these explicitly
|
|
1430
|
+
// Import these explicitly: lib.dom already declares the name, so an ambient
|
|
1431
1431
|
// declaration cannot win:
|
|
1432
1432
|
` + shadowedByDom.map((n) => {
|
|
1433
1433
|
const module = resolver.resolve(n)?.module;
|
|
@@ -1443,7 +1443,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
1443
1443
|
// a pattern matches unboundedly many names, so there is no list to emit. Those
|
|
1444
1444
|
// tags still resolve at build time; declare them by hand if the editor needs them.
|
|
1445
1445
|
` : "";
|
|
1446
|
-
const source = `// GENERATED by ${generator}
|
|
1446
|
+
const source = `// GENERATED by ${generator}, do not edit.
|
|
1447
1447
|
//
|
|
1448
1448
|
// The components \`resolve\` supplies without an import. This describes what the
|
|
1449
1449
|
// compiler already does; it does not enable it.
|