@fluixi/compiler 1.0.0-alpha.84 → 1.0.0-alpha.85
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-TGY76XJ7.mjs} +6 -6
- package/dist/{chunk-MJV3UXIL.mjs → chunk-4PLHS2FP.mjs} +2 -2
- package/dist/{chunk-EZR7NZOY.mjs → chunk-6DB5FXS4.mjs} +3 -3
- package/dist/{chunk-FSSWUXUR.mjs → chunk-F74GFKSL.mjs} +1 -1
- package/dist/{chunk-3YKZ4GNH.mjs → chunk-G6QC2WRJ.mjs} +1 -1
- package/dist/{chunk-R2VHAZAX.mjs → chunk-RUDJDZAA.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-ZYWQTSZU.mjs} +4 -4
- package/dist/{server-functions-V6D6DRIA.mjs → server-functions-PCERFA7A.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-RWDTQUF5.mjs} +5 -5
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Map a parsed expression node to an `ExprShape`.
|
|
3
3
|
*
|
|
4
|
-
* Works off `node.type` strings, so it takes any ESTree-shaped AST
|
|
5
|
-
* acorn, or whatever replaces them
|
|
4
|
+
* Works off `node.type` strings, so it takes any ESTree-shaped AST, @babel/parser,
|
|
5
|
+
* acorn, or whatever replaces them: and accepts the few names Babel spells
|
|
6
6
|
* differently (`ObjectProperty`, `Optional*Expression`).
|
|
7
7
|
*/
|
|
8
8
|
import type { ExprShape } from './reactive-expr.cjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Map a parsed expression node to an `ExprShape`.
|
|
3
3
|
*
|
|
4
|
-
* Works off `node.type` strings, so it takes any ESTree-shaped AST
|
|
5
|
-
* acorn, or whatever replaces them
|
|
4
|
+
* Works off `node.type` strings, so it takes any ESTree-shaped AST, @babel/parser,
|
|
5
|
+
* acorn, or whatever replaces them: and accepts the few names Babel spells
|
|
6
6
|
* differently (`ObjectProperty`, `Optional*Expression`).
|
|
7
7
|
*/
|
|
8
8
|
import type { ExprShape } from './reactive-expr.js';
|
|
@@ -22,7 +22,7 @@ export function shapeOf(node) {
|
|
|
22
22
|
if (node.type === 'TemplateLiteral') {
|
|
23
23
|
return { kind: 'compound', parts: node.expressions.map(part) };
|
|
24
24
|
}
|
|
25
|
-
// A computed key or a spread contributes nothing
|
|
25
|
+
// A computed key or a spread contributes nothing, we cannot see what it
|
|
26
26
|
// introduces, so we must not claim it is inert.
|
|
27
27
|
if (node.type === 'ObjectExpression') {
|
|
28
28
|
const props = node.properties.filter((p) => (p.type === 'ObjectProperty' || p.type === 'Property') && p.computed !== true);
|
|
@@ -37,7 +37,7 @@ var INTRINSICS = {
|
|
|
37
37
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
38
38
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
39
39
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
40
|
-
// name. Still worth having
|
|
40
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
41
41
|
// designed, the change is this line rather than a compiler pass.
|
|
42
42
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
43
43
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
*/
|
|
22
22
|
/** What a binding holds, once we know where it came from. */
|
|
23
23
|
export type ReactiveKind = 'plain'
|
|
24
|
-
/** `signal(0)
|
|
24
|
+
/** `signal(0)`: one object, read with `.get()` and written with `.set()`. */
|
|
25
25
|
| 'signal-handle'
|
|
26
|
-
/** `memo(fn)
|
|
26
|
+
/** `memo(fn)`: read-only, so `.get()` only. */
|
|
27
27
|
| 'memo-handle'
|
|
28
|
-
/** `store(obj)
|
|
28
|
+
/** `store(obj)`: read properties directly, `.set()` writes. */
|
|
29
29
|
| 'store-handle'
|
|
30
|
-
/** `resource(fn)
|
|
30
|
+
/** `resource(fn)`: `.get()` reads, with `.loading`/`.latest`/`.refetch()` on it. */
|
|
31
31
|
| 'resource-handle'
|
|
32
32
|
/** The accessor half of the tuple form, `const [count] = createSignal(0)`. */
|
|
33
33
|
| 'signal-accessor' | 'signal-setter' | 'memo-accessor' | 'effect' | 'reactive-object';
|
|
@@ -38,7 +38,7 @@ export interface Intrinsic {
|
|
|
38
38
|
module: string;
|
|
39
39
|
/**
|
|
40
40
|
* What the call yields. A tuple means the call is destructured into that many
|
|
41
|
-
* bindings
|
|
41
|
+
* bindings: `createSignal` gives an accessor and a setter, in that order.
|
|
42
42
|
*/
|
|
43
43
|
returns: ReactiveKind | readonly ReactiveKind[];
|
|
44
44
|
}
|
|
@@ -47,8 +47,8 @@ export declare const REACTIVE_MODULE = "@fluixi/reactive/signal";
|
|
|
47
47
|
/**
|
|
48
48
|
* `$name` → the runtime it stands for.
|
|
49
49
|
*
|
|
50
|
-
* The `$` prefix is reserved. A local binding of the same name wins
|
|
51
|
-
* compiler would rewrite code that means something else
|
|
50
|
+
* The `$` prefix is reserved. A local binding of the same name wins, it has to, or the
|
|
51
|
+
* compiler would rewrite code that means something else, and that's reported rather
|
|
52
52
|
* than done quietly.
|
|
53
53
|
*/
|
|
54
54
|
export declare const INTRINSICS: Readonly<Record<string, Intrinsic>>;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
*/
|
|
22
22
|
/** What a binding holds, once we know where it came from. */
|
|
23
23
|
export type ReactiveKind = 'plain'
|
|
24
|
-
/** `signal(0)
|
|
24
|
+
/** `signal(0)`: one object, read with `.get()` and written with `.set()`. */
|
|
25
25
|
| 'signal-handle'
|
|
26
|
-
/** `memo(fn)
|
|
26
|
+
/** `memo(fn)`: read-only, so `.get()` only. */
|
|
27
27
|
| 'memo-handle'
|
|
28
|
-
/** `store(obj)
|
|
28
|
+
/** `store(obj)`: read properties directly, `.set()` writes. */
|
|
29
29
|
| 'store-handle'
|
|
30
|
-
/** `resource(fn)
|
|
30
|
+
/** `resource(fn)`: `.get()` reads, with `.loading`/`.latest`/`.refetch()` on it. */
|
|
31
31
|
| 'resource-handle'
|
|
32
32
|
/** The accessor half of the tuple form, `const [count] = createSignal(0)`. */
|
|
33
33
|
| 'signal-accessor' | 'signal-setter' | 'memo-accessor' | 'effect' | 'reactive-object';
|
|
@@ -38,7 +38,7 @@ export interface Intrinsic {
|
|
|
38
38
|
module: string;
|
|
39
39
|
/**
|
|
40
40
|
* What the call yields. A tuple means the call is destructured into that many
|
|
41
|
-
* bindings
|
|
41
|
+
* bindings: `createSignal` gives an accessor and a setter, in that order.
|
|
42
42
|
*/
|
|
43
43
|
returns: ReactiveKind | readonly ReactiveKind[];
|
|
44
44
|
}
|
|
@@ -47,8 +47,8 @@ export declare const REACTIVE_MODULE = "@fluixi/reactive/signal";
|
|
|
47
47
|
/**
|
|
48
48
|
* `$name` → the runtime it stands for.
|
|
49
49
|
*
|
|
50
|
-
* The `$` prefix is reserved. A local binding of the same name wins
|
|
51
|
-
* compiler would rewrite code that means something else
|
|
50
|
+
* The `$` prefix is reserved. A local binding of the same name wins, it has to, or the
|
|
51
|
+
* compiler would rewrite code that means something else, and that's reported rather
|
|
52
52
|
* than done quietly.
|
|
53
53
|
*/
|
|
54
54
|
export declare const INTRINSICS: Readonly<Record<string, Intrinsic>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intrinsics.d.ts","sourceRoot":"","sources":["../../src/analyze/intrinsics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GACpB,OAAO;AACT,
|
|
1
|
+
{"version":3,"file":"intrinsics.d.ts","sourceRoot":"","sources":["../../src/analyze/intrinsics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GACpB,OAAO;AACT,6EAA6E;GAC3E,eAAe;AACjB,+CAA+C;GAC7C,aAAa;AACf,+DAA+D;GAC7D,cAAc;AAChB,oFAAoF;GAClF,iBAAiB;AACnB,8EAA8E;GAC5E,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,QAAQ,GACR,iBAAiB,CAAC;AAEtB,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,YAAY,GAAG,SAAS,YAAY,EAAE,CAAC;CACjD;AAED,0FAA0F;AAC1F,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAmB1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAc7E,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAK9C,CAAC;AAQF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -24,8 +24,8 @@ export const REACTIVE_MODULE = '@fluixi/reactive/signal';
|
|
|
24
24
|
/**
|
|
25
25
|
* `$name` → the runtime it stands for.
|
|
26
26
|
*
|
|
27
|
-
* The `$` prefix is reserved. A local binding of the same name wins
|
|
28
|
-
* compiler would rewrite code that means something else
|
|
27
|
+
* The `$` prefix is reserved. A local binding of the same name wins, it has to, or the
|
|
28
|
+
* compiler would rewrite code that means something else, and that's reported rather
|
|
29
29
|
* than done quietly.
|
|
30
30
|
*/
|
|
31
31
|
export const INTRINSICS = {
|
|
@@ -35,7 +35,7 @@ export const INTRINSICS = {
|
|
|
35
35
|
$store: { export: 'store', module: '@fluixi/reactive/store', returns: 'store-handle' },
|
|
36
36
|
$resource: { export: 'resource', module: REACTIVE_MODULE, returns: 'resource-handle' },
|
|
37
37
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
38
|
-
// name. Still worth having
|
|
38
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
39
39
|
// designed, the change is this line rather than a compiler pass.
|
|
40
40
|
$selector: { export: 'createSelector', module: REACTIVE_MODULE, returns: 'memo-accessor' },
|
|
41
41
|
$deferred: { export: 'createDeferred', module: REACTIVE_MODULE, returns: 'memo-accessor' },
|
|
@@ -7,7 +7,7 @@ var INTRINSICS = {
|
|
|
7
7
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
8
8
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
9
9
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
10
|
-
// name. Still worth having
|
|
10
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
11
11
|
// designed, the change is this line rather than a compiler pass.
|
|
12
12
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
13
13
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* that I leave as written and report, so splitProps stays correct where it's still the
|
|
16
16
|
* right answer.
|
|
17
17
|
*
|
|
18
|
-
* No babel in here (see no-babel-in-core.spec.ts)
|
|
18
|
+
* No babel in here (see no-babel-in-core.spec.ts), nodes are read structurally, the way
|
|
19
19
|
* transform/bindings.ts does, so either front-end can drive it.
|
|
20
20
|
*/
|
|
21
21
|
interface Node {
|
|
@@ -29,7 +29,7 @@ export type DestructureBail =
|
|
|
29
29
|
* block to put the splitProps call in (`({ a, ...rest }) => …`).
|
|
30
30
|
*/
|
|
31
31
|
'rest'
|
|
32
|
-
/** `const { [key]: a } = props
|
|
32
|
+
/** `const { [key]: a } = props`: we don't know the property until it runs. */
|
|
33
33
|
| 'computed'
|
|
34
34
|
/** The binding gets assigned to, and props are read-only, so it can't become a member. */
|
|
35
35
|
| 'reassigned'
|
|
@@ -43,7 +43,7 @@ export type DestructureBail =
|
|
|
43
43
|
export interface PropsRead {
|
|
44
44
|
/** The local name the pattern introduced. */
|
|
45
45
|
name: string;
|
|
46
|
-
/** Property path to read through instead
|
|
46
|
+
/** Property path to read through instead: `['user', 'name']` for `{ user: { name } }`. */
|
|
47
47
|
path: string[];
|
|
48
48
|
/**
|
|
49
49
|
* Default from the pattern. JS only applies one for `undefined`, not for null, so
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* that I leave as written and report, so splitProps stays correct where it's still the
|
|
16
16
|
* right answer.
|
|
17
17
|
*
|
|
18
|
-
* No babel in here (see no-babel-in-core.spec.ts)
|
|
18
|
+
* No babel in here (see no-babel-in-core.spec.ts), nodes are read structurally, the way
|
|
19
19
|
* transform/bindings.ts does, so either front-end can drive it.
|
|
20
20
|
*/
|
|
21
21
|
interface Node {
|
|
@@ -29,7 +29,7 @@ export type DestructureBail =
|
|
|
29
29
|
* block to put the splitProps call in (`({ a, ...rest }) => …`).
|
|
30
30
|
*/
|
|
31
31
|
'rest'
|
|
32
|
-
/** `const { [key]: a } = props
|
|
32
|
+
/** `const { [key]: a } = props`: we don't know the property until it runs. */
|
|
33
33
|
| 'computed'
|
|
34
34
|
/** The binding gets assigned to, and props are read-only, so it can't become a member. */
|
|
35
35
|
| 'reassigned'
|
|
@@ -43,7 +43,7 @@ export type DestructureBail =
|
|
|
43
43
|
export interface PropsRead {
|
|
44
44
|
/** The local name the pattern introduced. */
|
|
45
45
|
name: string;
|
|
46
|
-
/** Property path to read through instead
|
|
46
|
+
/** Property path to read through instead: `['user', 'name']` for `{ user: { name } }`. */
|
|
47
47
|
path: string[];
|
|
48
48
|
/**
|
|
49
49
|
* Default from the pattern. JS only applies one for `undefined`, not for null, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-destructure.d.ts","sourceRoot":"","sources":["../../src/analyze/props-destructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,yFAAyF;AACzF,MAAM,MAAM,eAAe;AACzB;;;GAGG;AACD,MAAM;AACR
|
|
1
|
+
{"version":3,"file":"props-destructure.d.ts","sourceRoot":"","sources":["../../src/analyze/props-destructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,yFAAyF;AACzF,MAAM,MAAM,eAAe;AACzB;;;GAGG;AACD,MAAM;AACR,8EAA8E;GAC5E,UAAU;AACZ,0FAA0F;GACxF,YAAY;AACd,+EAA+E;GAC7E,UAAU;AACZ;;;GAGG;GACD,gBAAgB,CAAC;AAErB,MAAM,WAAW,SAAS;IACxB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,0FAA0F;IAC1F,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,yDAAyD;IACzD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;IACnD;;;;;;OAMG;IACH,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACzC;AAoLD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,CAgDlG;AAED,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAa3D"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* that I leave as written and report, so splitProps stays correct where it's still the
|
|
16
16
|
* right answer.
|
|
17
17
|
*
|
|
18
|
-
* No babel in here (see no-babel-in-core.spec.ts)
|
|
18
|
+
* No babel in here (see no-babel-in-core.spec.ts), nodes are read structurally, the way
|
|
19
19
|
* transform/bindings.ts does, so either front-end can drive it.
|
|
20
20
|
*/
|
|
21
21
|
/** Every name a pattern introduces, so we can check each one for shadowing and writes. */
|
|
@@ -48,8 +48,8 @@ function patternNames(node, out) {
|
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Defaults get re-run on every read now, so they have to be cheap and stable. Literals
|
|
51
|
-
* and identifiers are. A function isn't
|
|
52
|
-
* breaks anything comparing props
|
|
51
|
+
* and identifiers are. A function isn't: it hands out a new identity each read, which
|
|
52
|
+
* breaks anything comparing props: and neither is a call.
|
|
53
53
|
*/
|
|
54
54
|
function isSafeDefault(node) {
|
|
55
55
|
switch (node.type) {
|
|
@@ -94,7 +94,7 @@ function walk(root, visit) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
/** Anything written to in the body
|
|
97
|
+
/** Anything written to in the body: `name = x`, `name++`, `[name] = …`. */
|
|
98
98
|
function reassignedNames(body) {
|
|
99
99
|
const written = new Set();
|
|
100
100
|
walk(body, (node) => {
|
|
@@ -34,7 +34,7 @@ var INTRINSICS = {
|
|
|
34
34
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
35
35
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
36
36
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
37
|
-
// name. Still worth having
|
|
37
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
38
38
|
// designed, the change is this line rather than a compiler pass.
|
|
39
39
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
40
40
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -30,7 +30,7 @@ export interface ReactiveBindings {
|
|
|
30
30
|
* Deliberately scope-blind: it answers "does this file declare this name anywhere", which
|
|
31
31
|
* is the question a diagnostic needs. A component declared inside a function
|
|
32
32
|
* (`const Row = () => …`) is bound just as much as an import, and warning about it would
|
|
33
|
-
* be noise. Over-permissive on purpose
|
|
33
|
+
* be noise. Over-permissive on purpose: missing a warning beats inventing one.
|
|
34
34
|
*/
|
|
35
35
|
export declare function declaredNames(program: unknown): Set<string>;
|
|
36
36
|
/**
|
|
@@ -30,7 +30,7 @@ export interface ReactiveBindings {
|
|
|
30
30
|
* Deliberately scope-blind: it answers "does this file declare this name anywhere", which
|
|
31
31
|
* is the question a diagnostic needs. A component declared inside a function
|
|
32
32
|
* (`const Row = () => …`) is bound just as much as an import, and warning about it would
|
|
33
|
-
* be noise. Over-permissive on purpose
|
|
33
|
+
* be noise. Over-permissive on purpose: missing a warning beats inventing one.
|
|
34
34
|
*/
|
|
35
35
|
export declare function declaredNames(program: unknown): Set<string>;
|
|
36
36
|
/**
|
|
@@ -80,7 +80,7 @@ function calledPrimitive(node, bindings) {
|
|
|
80
80
|
/** Record what a declaration's pattern holds, given what the call returns. */
|
|
81
81
|
function classify(id, returns, kinds) {
|
|
82
82
|
if (Array.isArray(returns)) {
|
|
83
|
-
// `const [count, setCount] = $signal(0)
|
|
83
|
+
// `const [count, setCount] = $signal(0)`: position decides which is which.
|
|
84
84
|
if (id.type === 'ArrayPattern') {
|
|
85
85
|
id.elements.forEach((element, index) => {
|
|
86
86
|
const kind = returns[index];
|
|
@@ -99,7 +99,7 @@ function classify(id, returns, kinds) {
|
|
|
99
99
|
* Deliberately scope-blind: it answers "does this file declare this name anywhere", which
|
|
100
100
|
* is the question a diagnostic needs. A component declared inside a function
|
|
101
101
|
* (`const Row = () => …`) is bound just as much as an import, and warning about it would
|
|
102
|
-
* be noise. Over-permissive on purpose
|
|
102
|
+
* be noise. Over-permissive on purpose: missing a warning beats inventing one.
|
|
103
103
|
*/
|
|
104
104
|
export function declaredNames(program) {
|
|
105
105
|
const names = new Set();
|
|
@@ -7,7 +7,7 @@ var INTRINSICS = {
|
|
|
7
7
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
8
8
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
9
9
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
10
|
-
// name. Still worth having
|
|
10
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
11
11
|
// designed, the change is this line rather than a compiler pass.
|
|
12
12
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
13
13
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Which expressions get wired reactively: `count()` re-runs on change, `count`
|
|
3
3
|
* does not, `props.children` is a subtree reference rather than a value.
|
|
4
4
|
*
|
|
5
|
-
* `ExprShape` is four cases and must not grow into a JavaScript AST
|
|
5
|
+
* `ExprShape` is four cases and must not grow into a JavaScript AST, a front-end
|
|
6
6
|
* reports what the rule branches on, everything else collapses to `compound` or
|
|
7
7
|
* `opaque`. One rule, one place, whatever the parser.
|
|
8
8
|
*/
|
|
9
9
|
export type ExprShape =
|
|
10
|
-
/** A call
|
|
10
|
+
/** A call: `count()`, `t('key')`, `mergeRefs(a, b)`. Always reactive. */
|
|
11
11
|
{
|
|
12
12
|
kind: 'call';
|
|
13
13
|
}
|
|
@@ -20,7 +20,7 @@ export type ExprShape =
|
|
|
20
20
|
property: string | null;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Anything built out of sub-expressions
|
|
23
|
+
* Anything built out of sub-expressions: conditionals, logical and binary
|
|
24
24
|
* operators, template literals, object and array literals. Reactive when any
|
|
25
25
|
* part is, so `class={{ active: active() }}` reacts and `class={{ a: true }}`
|
|
26
26
|
* does not. The front-end decides which children count: a spread element or a
|
|
@@ -30,7 +30,7 @@ export type ExprShape =
|
|
|
30
30
|
kind: 'compound';
|
|
31
31
|
parts: ExprShape[];
|
|
32
32
|
}
|
|
33
|
-
/** Identifiers, literals, functions, JSX
|
|
33
|
+
/** Identifiers, literals, functions, JSX: passed through untouched. */
|
|
34
34
|
| {
|
|
35
35
|
kind: 'opaque';
|
|
36
36
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Which expressions get wired reactively: `count()` re-runs on change, `count`
|
|
3
3
|
* does not, `props.children` is a subtree reference rather than a value.
|
|
4
4
|
*
|
|
5
|
-
* `ExprShape` is four cases and must not grow into a JavaScript AST
|
|
5
|
+
* `ExprShape` is four cases and must not grow into a JavaScript AST, a front-end
|
|
6
6
|
* reports what the rule branches on, everything else collapses to `compound` or
|
|
7
7
|
* `opaque`. One rule, one place, whatever the parser.
|
|
8
8
|
*/
|
|
9
9
|
export type ExprShape =
|
|
10
|
-
/** A call
|
|
10
|
+
/** A call: `count()`, `t('key')`, `mergeRefs(a, b)`. Always reactive. */
|
|
11
11
|
{
|
|
12
12
|
kind: 'call';
|
|
13
13
|
}
|
|
@@ -20,7 +20,7 @@ export type ExprShape =
|
|
|
20
20
|
property: string | null;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Anything built out of sub-expressions
|
|
23
|
+
* Anything built out of sub-expressions: conditionals, logical and binary
|
|
24
24
|
* operators, template literals, object and array literals. Reactive when any
|
|
25
25
|
* part is, so `class={{ active: active() }}` reacts and `class={{ a: true }}`
|
|
26
26
|
* does not. The front-end decides which children count: a spread element or a
|
|
@@ -30,7 +30,7 @@ export type ExprShape =
|
|
|
30
30
|
kind: 'compound';
|
|
31
31
|
parts: ExprShape[];
|
|
32
32
|
}
|
|
33
|
-
/** Identifiers, literals, functions, JSX
|
|
33
|
+
/** Identifiers, literals, functions, JSX: passed through untouched. */
|
|
34
34
|
| {
|
|
35
35
|
kind: 'opaque';
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive-expr.d.ts","sourceRoot":"","sources":["../../src/analyze/reactive-expr.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,SAAS;AACnB,
|
|
1
|
+
{"version":3,"file":"reactive-expr.d.ts","sourceRoot":"","sources":["../../src/analyze/reactive-expr.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,SAAS;AACnB,yEAAyE;AACvE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAClB;;;GAGG;GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;AAC7C;;;;;;GAMG;GACD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE;AAC1C,uEAAuE;GACrE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAavB,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAWzD"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Which expressions get wired reactively: `count()` re-runs on change, `count`
|
|
3
3
|
* does not, `props.children` is a subtree reference rather than a value.
|
|
4
4
|
*
|
|
5
|
-
* `ExprShape` is four cases and must not grow into a JavaScript AST
|
|
5
|
+
* `ExprShape` is four cases and must not grow into a JavaScript AST, a front-end
|
|
6
6
|
* reports what the rule branches on, everything else collapses to `compound` or
|
|
7
7
|
* `opaque`. One rule, one place, whatever the parser.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* `props.children
|
|
10
|
+
* `props.children`: and any `.children` access: is a stable subtree reference,
|
|
11
11
|
* not a reactive value. Compiling it to a `() => props.children` thunk adds an
|
|
12
12
|
* insert layer that fully unwraps the children's Suspense/memo into a static node,
|
|
13
13
|
* severing the reactive binding: a nested lazy/Suspense that resolves later never
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -36,7 +36,7 @@ var INTRINSICS = {
|
|
|
36
36
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
37
37
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
38
38
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
39
|
-
// name. Still worth having
|
|
39
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
40
40
|
// designed, the change is this line rather than a compiler pass.
|
|
41
41
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
42
42
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -3,7 +3,7 @@ export type StaticNodeKind = 'state' | 'memo' | 'effect' | 'store' | 'resource'
|
|
|
3
3
|
| 'control'
|
|
4
4
|
/** The router's own tags: `Router`, `Outlet`, `Link`, `Redirect`. */
|
|
5
5
|
| 'router'
|
|
6
|
-
/** A server route handler
|
|
6
|
+
/** A server route handler: `GET`, `POST` in an api file. Not a component. */
|
|
7
7
|
| 'handler';
|
|
8
8
|
export interface StaticNode {
|
|
9
9
|
id: number;
|
|
@@ -3,7 +3,7 @@ export type StaticNodeKind = 'state' | 'memo' | 'effect' | 'store' | 'resource'
|
|
|
3
3
|
| 'control'
|
|
4
4
|
/** The router's own tags: `Router`, `Outlet`, `Link`, `Redirect`. */
|
|
5
5
|
| 'router'
|
|
6
|
-
/** A server route handler
|
|
6
|
+
/** A server route handler: `GET`, `POST` in an api file. Not a component. */
|
|
7
7
|
| 'handler';
|
|
8
8
|
export interface StaticNode {
|
|
9
9
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-graph.d.ts","sourceRoot":"","sources":["../../src/analyze/static-graph.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW;AACb,yFAAyF;GACvF,SAAS;AACX,qEAAqE;GACnE,QAAQ;AACV,
|
|
1
|
+
{"version":3,"file":"static-graph.d.ts","sourceRoot":"","sources":["../../src/analyze/static-graph.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW;AACb,yFAAyF;GACvF,SAAS;AACX,qEAAqE;GACnE,QAAQ;AACV,6EAA6E;GAC3E,SAAS,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC;IACrB,sCAAsC;IACtC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,EAAE,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC;IAC9B,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,kEAAkE;IAClE,MAAM,EAAE,IAAI,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+PD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,OAAO,GAAE,cAAmB,GAC3B,WAAW,CAimBb"}
|
|
@@ -185,7 +185,7 @@ function positionsIn(code) {
|
|
|
185
185
|
return { line: low + 1, column: offset - starts[low] };
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/** `span.box
|
|
188
|
+
/** `span.box`: a template element as written, static attributes only, like describeJsx. */
|
|
189
189
|
function describeTemplateElement(el) {
|
|
190
190
|
let id = '';
|
|
191
191
|
const classes = [];
|
|
@@ -200,7 +200,7 @@ function describeTemplateElement(el) {
|
|
|
200
200
|
}
|
|
201
201
|
return `${el.tag}${id}${classes.map((c) => `.${c}`).join('')}`;
|
|
202
202
|
}
|
|
203
|
-
/** Which holes an attribute value reads
|
|
203
|
+
/** Which holes an attribute value reads: one for `=${x}`, several for `"a-${x}-${y}"`. */
|
|
204
204
|
function valueHoles(value) {
|
|
205
205
|
if (!value)
|
|
206
206
|
return [];
|
|
@@ -211,7 +211,7 @@ function valueHoles(value) {
|
|
|
211
211
|
return [];
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* `span.num`, `div#root
|
|
214
|
+
* `span.num`, `div#root`: the element as written.
|
|
215
215
|
*
|
|
216
216
|
* Static attributes only: a class computed at runtime is not something the source can name,
|
|
217
217
|
* and guessing would put a lie on the card.
|
|
@@ -271,7 +271,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
271
271
|
const unresolved = [];
|
|
272
272
|
/**
|
|
273
273
|
* What each component's body names. Kept apart from `reads`, which becomes dependency
|
|
274
|
-
* edges
|
|
274
|
+
* edges: a component mentioning a route table does not depend on it reactively.
|
|
275
275
|
*/
|
|
276
276
|
const componentMentions = new Map();
|
|
277
277
|
let seq = 0;
|
|
@@ -465,8 +465,8 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
465
465
|
/**
|
|
466
466
|
* The elements each component writes, as a tree.
|
|
467
467
|
*
|
|
468
|
-
* Nothing has run, so this is the structure the source states outright. A hole
|
|
469
|
-
* `{items().map(...)}`, a `<Show>` body
|
|
468
|
+
* Nothing has run, so this is the structure the source states outright. A hole ,
|
|
469
|
+
* `{items().map(...)}`, a `<Show>` body: is decided at runtime and has no elements
|
|
470
470
|
* here; the tag stands in its place and fills in once the application is up.
|
|
471
471
|
*/
|
|
472
472
|
const describeTree = (el) => {
|
|
@@ -487,7 +487,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
487
487
|
// A capitalised tag renders its own dom, so it stands here as itself and the panel
|
|
488
488
|
// pulls that component's row in. `components` has the directives, `here` the names
|
|
489
489
|
// this file declares; anything else is a name another file exports, which is only
|
|
490
|
-
// resolvable once they have all been read. The children stay either way
|
|
490
|
+
// resolvable once they have all been read. The children stay either way, they are
|
|
491
491
|
// written here, and a row that resolves replaces them with the component's own.
|
|
492
492
|
if (tag[0] === tag[0]?.toUpperCase()) {
|
|
493
493
|
const node = { label: tag, children, ...(where ? { at: where } : {}) };
|
|
@@ -532,7 +532,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
532
532
|
* The tags and holes are inside a string, so none of the walks above can see them: a
|
|
533
533
|
* `<Show>` in a template is not a JSXElement and a `${count()}` is not an expression
|
|
534
534
|
* container. The template parser reads the string into the same shape the compiler
|
|
535
|
-
* lowers, and each hole maps back by index to the expression Babel already parsed
|
|
535
|
+
* lowers, and each hole maps back by index to the expression Babel already parsed ,
|
|
536
536
|
* which is where the position and the names read come from.
|
|
537
537
|
*/
|
|
538
538
|
walk(program, (node, stack) => {
|
|
@@ -672,7 +672,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
};
|
|
675
|
-
// Whatever body the template is written in
|
|
675
|
+
// Whatever body the template is written in, the same lookup the tag walk uses.
|
|
676
676
|
let owner;
|
|
677
677
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
678
678
|
const found = components.get(stack[i]);
|
|
@@ -795,7 +795,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
795
795
|
/**
|
|
796
796
|
* A file-route belongs to the outlet it renders into.
|
|
797
797
|
*
|
|
798
|
-
* Nothing names these components
|
|
798
|
+
* Nothing names these components: the table comes from the directory, so a page that
|
|
799
799
|
* declares no signals is connected to nothing at all and sits on its own. `<Outlet />` is
|
|
800
800
|
* the hole a matched route fills, so it is the honest owner; a router with no outlet
|
|
801
801
|
* written out renders into itself. Only one of either is a definite answer: with two
|
|
@@ -819,7 +819,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
819
819
|
* The api routes hang off one card of their own.
|
|
820
820
|
*
|
|
821
821
|
* A handler is served because of the directory it sits in, so like a page nothing names it
|
|
822
|
-
|
|
822
|
+
*: but unlike a page nothing renders it either, and hanging it off the router would say
|
|
823
823
|
* something false. A root of its own is what it is: one card, the handlers under it.
|
|
824
824
|
*/
|
|
825
825
|
const loose = pending.filter((p) => p.node.kind === 'handler' && p.node.createdIn === undefined);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/analyze/static-graph.ts
|
|
4
4
|
import { parse } from "@babel/parser";
|
|
@@ -15,7 +15,7 @@ var INTRINSICS = {
|
|
|
15
15
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
16
16
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
17
17
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
18
|
-
// name. Still worth having
|
|
18
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
19
19
|
// designed, the change is this line rather than a compiler pass.
|
|
20
20
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
21
21
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
import {
|
|
3
3
|
analyzeStatic,
|
|
4
4
|
buildJsxIR,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
lowerTemplate,
|
|
11
11
|
resolveComponentSources,
|
|
12
12
|
shapeOf
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6DB5FXS4.mjs";
|
|
14
14
|
import {
|
|
15
15
|
CORE_CONTROL_FLOW,
|
|
16
16
|
ROUTER_COMPONENTS,
|
|
17
17
|
createComponentResolver
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-4PLHS2FP.mjs";
|
|
19
|
+
import "./chunk-G6QC2WRJ.mjs";
|
|
20
20
|
|
|
21
21
|
// src/frontend/babel/plugin.ts
|
|
22
22
|
import { declare } from "@babel/helper-plugin-utils";
|
|
@@ -120,7 +120,7 @@ function buildIR(node, used = /* @__PURE__ */ new Set(), onNested) {
|
|
|
120
120
|
const ir = buildJsxIR(node, {
|
|
121
121
|
code: (n) => (
|
|
122
122
|
// A member-expression tag (`<ns.Foo/>`) is not an Expression, so it cannot go
|
|
123
|
-
// through the nested-JSX compile
|
|
123
|
+
// through the nested-JSX compile: it only ever needs printing.
|
|
124
124
|
n.type === "JSXMemberExpression" ? gen2(n) : genExpr(n, used, onNested)
|
|
125
125
|
),
|
|
126
126
|
used
|
|
@@ -371,7 +371,7 @@ var plugin_default = declare((api, options = {}) => {
|
|
|
371
371
|
t3.identifier(name),
|
|
372
372
|
// Just the HTML. Parsing is deferred to `templateNode`, which
|
|
373
373
|
// knows whether this is a server render, a hydration or a fresh
|
|
374
|
-
// client render
|
|
374
|
+
// client render: a module-scope `createTemplate` would touch
|
|
375
375
|
// `document` at import time and break SSR outright.
|
|
376
376
|
t3.stringLiteral(html)
|
|
377
377
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/resolve/component-resolver.ts
|
|
4
4
|
var isMapRule = (rule) => "components" in rule;
|
|
@@ -101,7 +101,7 @@ var INTRINSICS = {
|
|
|
101
101
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
102
102
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
103
103
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
104
|
-
// name. Still worth having
|
|
104
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
105
105
|
// designed, the change is this line rather than a compiler pass.
|
|
106
106
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
107
107
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|