@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,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ambient declarations for the components `resolve` supplies without an import.
|
|
3
3
|
*
|
|
4
|
-
* The compiler injects the import, so nothing in the source imports these
|
|
4
|
+
* The compiler injects the import, so nothing in the source imports these, which leaves
|
|
5
5
|
* TypeScript reporting `TS2304: Cannot find name`. The code compiles and runs; the editor
|
|
6
6
|
* is unusable and `tsc` fails. These declarations describe what the compiler already
|
|
7
7
|
* does. They do not enable it.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* This lives next to the resolver, and takes rules rather than a flat map, because the
|
|
10
10
|
* resolver is the only thing that knows the whole picture: a UI library's components, the
|
|
11
11
|
* project's own, and the framework builtins all arrive through the same config. A
|
|
12
|
-
* component library cannot generate this on its own
|
|
13
|
-
* project resolves
|
|
12
|
+
* component library cannot generate this on its own, it does not know what else the
|
|
13
|
+
* project resolves: which is why the generator belongs here and the library-specific CLI
|
|
14
14
|
* that predates it does not.
|
|
15
15
|
*
|
|
16
16
|
* Pure, like the resolver: rules in, source out, no filesystem. Writing the file is the
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { type ComponentResolverRule } from './component-resolver.js';
|
|
20
20
|
export interface ComponentGlobalsOptions {
|
|
21
21
|
/**
|
|
22
|
-
* Packages the project can actually resolve
|
|
22
|
+
* Packages the project can actually resolve: normally its declared dependencies.
|
|
23
23
|
*
|
|
24
24
|
* Declaring a component from a package the project does not depend on produces an
|
|
25
25
|
* unresolvable `import(...)`, and under the usual `skipLibCheck: true` that failure is
|
|
@@ -27,7 +27,7 @@ export interface ComponentGlobalsOptions {
|
|
|
27
27
|
* worse than the error it replaced. Omit to declare everything, which is only correct
|
|
28
28
|
* when every package is present.
|
|
29
29
|
*
|
|
30
|
-
* Relative and alias specifiers are never filtered
|
|
30
|
+
* Relative and alias specifiers are never filtered, there is no package to check.
|
|
31
31
|
*/
|
|
32
32
|
available?: Iterable<string>;
|
|
33
33
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ambient declarations for the components `resolve` supplies without an import.
|
|
3
3
|
*
|
|
4
|
-
* The compiler injects the import, so nothing in the source imports these
|
|
4
|
+
* The compiler injects the import, so nothing in the source imports these, which leaves
|
|
5
5
|
* TypeScript reporting `TS2304: Cannot find name`. The code compiles and runs; the editor
|
|
6
6
|
* is unusable and `tsc` fails. These declarations describe what the compiler already
|
|
7
7
|
* does. They do not enable it.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* This lives next to the resolver, and takes rules rather than a flat map, because the
|
|
10
10
|
* resolver is the only thing that knows the whole picture: a UI library's components, the
|
|
11
11
|
* project's own, and the framework builtins all arrive through the same config. A
|
|
12
|
-
* component library cannot generate this on its own
|
|
13
|
-
* project resolves
|
|
12
|
+
* component library cannot generate this on its own, it does not know what else the
|
|
13
|
+
* project resolves: which is why the generator belongs here and the library-specific CLI
|
|
14
14
|
* that predates it does not.
|
|
15
15
|
*
|
|
16
16
|
* Pure, like the resolver: rules in, source out, no filesystem. Writing the file is the
|
|
@@ -23,7 +23,7 @@ import { INTRINSICS } from '../analyze/intrinsics.js';
|
|
|
23
23
|
* Names `lib.dom` already declares as globals.
|
|
24
24
|
*
|
|
25
25
|
* An ambient `const Text` cannot beat `lib.dom`'s `var Text`, so for these the editor
|
|
26
|
-
* would disagree with the compiler
|
|
26
|
+
* would disagree with the compiler: resolution still works at runtime, but the type
|
|
27
27
|
* shown would be the DOM node's. They are left out and reported instead, since importing
|
|
28
28
|
* them explicitly makes both agree.
|
|
29
29
|
*/
|
|
@@ -68,7 +68,7 @@ export function componentGlobals(rules, options = {}) {
|
|
|
68
68
|
const { available: availableList, builtins = true, intrinsics = true, generator = '@fluixi/compiler', specifier = (module) => module, } = options;
|
|
69
69
|
const all = [...rules];
|
|
70
70
|
if (builtins) {
|
|
71
|
-
// Appended, so an explicit rule for the same name still wins
|
|
71
|
+
// Appended, so an explicit rule for the same name still wins, the resolver is
|
|
72
72
|
// first-match, and a project retargeting `Router` should keep its own answer.
|
|
73
73
|
all.push({ components: builtinComponentMap() });
|
|
74
74
|
}
|
|
@@ -107,8 +107,8 @@ export function componentGlobals(rules, options = {}) {
|
|
|
107
107
|
// (`Button(props: ButtonProps): ComponentChild`) and go-to-definition lands on the
|
|
108
108
|
// source. Both forms keep the JSDoc; the alias also keeps the shape.
|
|
109
109
|
//
|
|
110
|
-
// A default export cannot use it
|
|
111
|
-
// `default` is a reserved word in that position
|
|
110
|
+
// A default export cannot use it: `import X = ns.default` is a syntax error, since
|
|
111
|
+
// `default` is a reserved word in that position, so those fall back to the `const`
|
|
112
112
|
// form, which types and documents correctly but renders as an anonymous arrow.
|
|
113
113
|
const lines = declared.map((name) => {
|
|
114
114
|
const target = resolved.get(name);
|
|
@@ -118,7 +118,7 @@ export function componentGlobals(rules, options = {}) {
|
|
|
118
118
|
: ` export import ${name} = ${ns}.${target.export};`;
|
|
119
119
|
});
|
|
120
120
|
const note = shadowedByDom.length > 0
|
|
121
|
-
? `//\n// Import these explicitly
|
|
121
|
+
? `//\n// Import these explicitly: lib.dom already declares the name, so an ambient\n` +
|
|
122
122
|
`// declaration cannot win:\n` +
|
|
123
123
|
shadowedByDom
|
|
124
124
|
.map((n) => {
|
|
@@ -129,7 +129,7 @@ export function componentGlobals(rules, options = {}) {
|
|
|
129
129
|
: '';
|
|
130
130
|
// `typeof ns.signal` rather than an alias: the intrinsic is a global that stands for
|
|
131
131
|
// the runtime call, so it takes the runtime's signature without claiming to be that
|
|
132
|
-
// symbol
|
|
132
|
+
// symbol: go-to-definition on `$signal` should land on what it compiles to.
|
|
133
133
|
const intrinsicLines = intrinsics
|
|
134
134
|
? Object.entries(INTRINSICS).map(([name, intrinsic]) => ` const ${name}: typeof ${namespaceAlias(intrinsic.module)}.${intrinsic.export};`)
|
|
135
135
|
: [];
|
|
@@ -139,7 +139,7 @@ export function componentGlobals(rules, options = {}) {
|
|
|
139
139
|
`// a pattern matches unboundedly many names, so there is no list to emit. Those\n` +
|
|
140
140
|
`// tags still resolve at build time; declare them by hand if the editor needs them.\n`
|
|
141
141
|
: '';
|
|
142
|
-
const source = `// GENERATED by ${generator}
|
|
142
|
+
const source = `// GENERATED by ${generator}, do not edit.\n` +
|
|
143
143
|
`//\n` +
|
|
144
144
|
`// The components \`resolve\` supplies without an import. This describes what the\n` +
|
|
145
145
|
`// compiler already does; it does not enable it.\n` +
|
|
@@ -99,7 +99,7 @@ var INTRINSICS = {
|
|
|
99
99
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
100
100
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
101
101
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
102
|
-
// name. Still worth having
|
|
102
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
103
103
|
// designed, the change is this line rather than a compiler pass.
|
|
104
104
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
105
105
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -185,7 +185,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
185
185
|
return target.export === "default" ? ` const ${name}: typeof ${ns}.default;` : ` export import ${name} = ${ns}.${target.export};`;
|
|
186
186
|
});
|
|
187
187
|
const note = shadowedByDom.length > 0 ? `//
|
|
188
|
-
// Import these explicitly
|
|
188
|
+
// Import these explicitly: lib.dom already declares the name, so an ambient
|
|
189
189
|
// declaration cannot win:
|
|
190
190
|
` + shadowedByDom.map((n) => {
|
|
191
191
|
const module = resolver.resolve(n)?.module;
|
|
@@ -201,7 +201,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
201
201
|
// a pattern matches unboundedly many names, so there is no list to emit. Those
|
|
202
202
|
// tags still resolve at build time; declare them by hand if the editor needs them.
|
|
203
203
|
` : "";
|
|
204
|
-
const source = `// GENERATED by ${generator}
|
|
204
|
+
const source = `// GENERATED by ${generator}, do not edit.
|
|
205
205
|
//
|
|
206
206
|
// The components \`resolve\` supplies without an import. This describes what the
|
|
207
207
|
// compiler already does; it does not enable it.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* An unbound capitalised tag in a template is a name the compiler can resolve to a
|
|
5
5
|
* module, instead of an import the author has to write. The framework already does
|
|
6
6
|
* this for `Suspense`/`Portal`/`Router`, but through a hardcoded name set inside the
|
|
7
|
-
* Babel plugin
|
|
7
|
+
* Babel plugin: which cannot be extended by a UI library or an app, and cannot be
|
|
8
8
|
* configured per project.
|
|
9
9
|
*
|
|
10
10
|
* This is the configurable version of the same idea. It is deliberately a pure
|
|
@@ -44,7 +44,7 @@ export interface ComponentPatternRule {
|
|
|
44
44
|
export?: string;
|
|
45
45
|
}
|
|
46
46
|
export type ComponentResolverRule = ComponentMapRule | ComponentPatternRule;
|
|
47
|
-
/** Two rules claiming the same name
|
|
47
|
+
/** Two rules claiming the same name: reported rather than silently first-wins. */
|
|
48
48
|
export interface ResolverConflict {
|
|
49
49
|
name: string;
|
|
50
50
|
modules: string[];
|
|
@@ -60,7 +60,7 @@ export interface ComponentResolver {
|
|
|
60
60
|
/**
|
|
61
61
|
* Build a resolver from rules, in order.
|
|
62
62
|
*
|
|
63
|
-
* Map rules are flattened up front so lookup is a plain object read
|
|
63
|
+
* Map rules are flattened up front so lookup is a plain object read, resolution runs
|
|
64
64
|
* once per component reference per compile, so it sits on the hot path of every build.
|
|
65
65
|
* Pattern rules are tried afterwards, in declaration order, and only when no map rule
|
|
66
66
|
* matched: an explicit entry should always beat a pattern.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* An unbound capitalised tag in a template is a name the compiler can resolve to a
|
|
5
5
|
* module, instead of an import the author has to write. The framework already does
|
|
6
6
|
* this for `Suspense`/`Portal`/`Router`, but through a hardcoded name set inside the
|
|
7
|
-
* Babel plugin
|
|
7
|
+
* Babel plugin: which cannot be extended by a UI library or an app, and cannot be
|
|
8
8
|
* configured per project.
|
|
9
9
|
*
|
|
10
10
|
* This is the configurable version of the same idea. It is deliberately a pure
|
|
@@ -44,7 +44,7 @@ export interface ComponentPatternRule {
|
|
|
44
44
|
export?: string;
|
|
45
45
|
}
|
|
46
46
|
export type ComponentResolverRule = ComponentMapRule | ComponentPatternRule;
|
|
47
|
-
/** Two rules claiming the same name
|
|
47
|
+
/** Two rules claiming the same name: reported rather than silently first-wins. */
|
|
48
48
|
export interface ResolverConflict {
|
|
49
49
|
name: string;
|
|
50
50
|
modules: string[];
|
|
@@ -60,7 +60,7 @@ export interface ComponentResolver {
|
|
|
60
60
|
/**
|
|
61
61
|
* Build a resolver from rules, in order.
|
|
62
62
|
*
|
|
63
|
-
* Map rules are flattened up front so lookup is a plain object read
|
|
63
|
+
* Map rules are flattened up front so lookup is a plain object read, resolution runs
|
|
64
64
|
* once per component reference per compile, so it sits on the hot path of every build.
|
|
65
65
|
* Pattern rules are tried afterwards, in declaration order, and only when no map rule
|
|
66
66
|
* matched: an explicit entry should always beat a pattern.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-resolver.d.ts","sourceRoot":"","sources":["../../src/resolve/component-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE5E,
|
|
1
|
+
{"version":3,"file":"component-resolver.d.ts","sourceRoot":"","sources":["../../src/resolve/component-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE5E,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,CAAC;IACzD,iEAAiE;IACjE,KAAK,EAAE,MAAM,MAAM,EAAE,CAAC;IACtB,kEAAkE;IAClE,SAAS,EAAE,MAAM,gBAAgB,EAAE,CAAC;CACrC;AAiBD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,GAAE,SAAS,qBAAqB,EAAO,GAC3C,iBAAiB,CAwDnB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* An unbound capitalised tag in a template is a name the compiler can resolve to a
|
|
5
5
|
* module, instead of an import the author has to write. The framework already does
|
|
6
6
|
* this for `Suspense`/`Portal`/`Router`, but through a hardcoded name set inside the
|
|
7
|
-
* Babel plugin
|
|
7
|
+
* Babel plugin: which cannot be extended by a UI library or an app, and cannot be
|
|
8
8
|
* configured per project.
|
|
9
9
|
*
|
|
10
10
|
* This is the configurable version of the same idea. It is deliberately a pure
|
|
@@ -33,7 +33,7 @@ function normalise(name, entry) {
|
|
|
33
33
|
/**
|
|
34
34
|
* Build a resolver from rules, in order.
|
|
35
35
|
*
|
|
36
|
-
* Map rules are flattened up front so lookup is a plain object read
|
|
36
|
+
* Map rules are flattened up front so lookup is a plain object read, resolution runs
|
|
37
37
|
* once per component reference per compile, so it sits on the hot path of every build.
|
|
38
38
|
* Pattern rules are tried afterwards, in declaration order, and only when no map rule
|
|
39
39
|
* matched: an explicit entry should always beat a pattern.
|
|
@@ -54,7 +54,7 @@ export function createComponentResolver(rules = []) {
|
|
|
54
54
|
// Ambiguity is the failure mode that actually happens once a map holds
|
|
55
55
|
// ~80 common words (Card, Table, Text, Link). Silently taking the first
|
|
56
56
|
// rule would compile a working import of the wrong component, which is
|
|
57
|
-
// far worse to debug than a build error
|
|
57
|
+
// far worse to debug than a build error: so it is recorded and reported.
|
|
58
58
|
const conflict = conflicts.find((c) => c.name === name);
|
|
59
59
|
if (conflict)
|
|
60
60
|
conflict.modules.push(resolved.module);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `load:` directive
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
3
|
*
|
|
4
4
|
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
5
|
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
6
|
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
-
* wait for the viewport is a property of the usage. Fusing them
|
|
8
|
-
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
9
|
*
|
|
10
10
|
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
11
|
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
12
|
*
|
|
13
13
|
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
-
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
15
|
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
16
|
*/
|
|
17
17
|
/** When a component's module is fetched. */
|
|
@@ -42,7 +42,7 @@ export declare function isLoadDirective(name: string): boolean;
|
|
|
42
42
|
/**
|
|
43
43
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
44
|
*
|
|
45
|
-
* `value` is the attribute's literal text
|
|
45
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
46
|
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
47
47
|
* because it decides how the module is emitted, and a runtime value cannot.
|
|
48
48
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `load:` directive
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
3
|
*
|
|
4
4
|
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
5
|
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
6
|
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
-
* wait for the viewport is a property of the usage. Fusing them
|
|
8
|
-
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
9
|
*
|
|
10
10
|
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
11
|
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
12
|
*
|
|
13
13
|
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
-
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
15
|
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
16
|
*/
|
|
17
17
|
/** When a component's module is fetched. */
|
|
@@ -42,7 +42,7 @@ export declare function isLoadDirective(name: string): boolean;
|
|
|
42
42
|
/**
|
|
43
43
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
44
|
*
|
|
45
|
-
* `value` is the attribute's literal text
|
|
45
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
46
|
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
47
47
|
* because it decides how the module is emitted, and a runtime value cannot.
|
|
48
48
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `load:` directive
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
3
|
*
|
|
4
4
|
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
5
|
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
6
|
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
-
* wait for the viewport is a property of the usage. Fusing them
|
|
8
|
-
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
9
|
*
|
|
10
10
|
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
11
|
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
12
|
*
|
|
13
13
|
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
-
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
15
|
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
16
|
*/
|
|
17
17
|
/** Everything is eager unless a directive says otherwise. */
|
|
@@ -28,7 +28,7 @@ export function isLoadDirective(name) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
30
30
|
*
|
|
31
|
-
* `value` is the attribute's literal text
|
|
31
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
32
32
|
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
33
33
|
* because it decides how the module is emitted, and a runtime value cannot.
|
|
34
34
|
*/
|
|
@@ -46,7 +46,7 @@ export function parseLoadDirective(name, value) {
|
|
|
46
46
|
return { kind: 'never' };
|
|
47
47
|
case 'visible':
|
|
48
48
|
// `load:visible="200px"` starts the fetch before the element reaches the
|
|
49
|
-
// viewport, which is usually what you want
|
|
49
|
+
// viewport, which is usually what you want, arriving exactly on intersection
|
|
50
50
|
// means the user waits for the network.
|
|
51
51
|
return value ? { kind: 'visible', rootMargin: value } : { kind: 'visible' };
|
|
52
52
|
case 'interaction':
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* The resolve pass: annotate component references in the IR with where they come from.
|
|
3
3
|
*
|
|
4
4
|
* Runs between the frontends and the optimizer, so every later pass reads provenance off
|
|
5
|
-
* the node instead of re-deriving it. Nothing here emits code
|
|
5
|
+
* the node instead of re-deriving it. Nothing here emits code, the pass only records a
|
|
6
6
|
* decision, which is what lets the same answer drive import injection, chunk grouping,
|
|
7
7
|
* hint planning and diagnostics without any of them agreeing by coincidence.
|
|
8
8
|
*
|
|
9
9
|
* Two suppliers, in precedence order:
|
|
10
10
|
*
|
|
11
|
-
* 1. **Control flow** (`Show`, `For`, `Switch`, …)
|
|
11
|
+
* 1. **Control flow** (`Show`, `For`, `Switch`, …), the name selects a lowering, so a
|
|
12
12
|
* rule cannot re-point it. Recorded as `builtin` so a later pass can tell the
|
|
13
13
|
* difference between "configured here" and "fixed by the compiler".
|
|
14
14
|
* 2. **Configured rules**, then the **router built-ins**. Router components are only an
|
|
@@ -24,13 +24,13 @@ import { type IRLoadStrategy } from './load-directive.cjs';
|
|
|
24
24
|
export interface ResolveOptions {
|
|
25
25
|
/** Rules configured for the project. Omit when the project configures none. */
|
|
26
26
|
resolver?: ComponentResolver;
|
|
27
|
-
/** True when the name already has a binding in the file
|
|
27
|
+
/** True when the name already has a binding in the file, an import the author wrote. */
|
|
28
28
|
isBound?: (name: string) => boolean;
|
|
29
29
|
/** Module overrides, so `routerModule` and friends are honoured. */
|
|
30
30
|
modules?: Parameters<typeof builtinComponentMap>[0];
|
|
31
31
|
/**
|
|
32
32
|
* The `load:` strategy for a reference, when the frontend found one on the tag.
|
|
33
|
-
* Keyed by node so two usages of the same component can load differently
|
|
33
|
+
* Keyed by node so two usages of the same component can load differently, the
|
|
34
34
|
* whole reason timing lives at the usage site and location does not.
|
|
35
35
|
*/
|
|
36
36
|
strategyFor?: (node: IRComponent) => IRLoadStrategy | undefined;
|
|
@@ -41,8 +41,8 @@ export interface ResolveReport {
|
|
|
41
41
|
/**
|
|
42
42
|
* Capitalised tags nothing supplies and nothing binds.
|
|
43
43
|
*
|
|
44
|
-
* These compile to a reference to an identifier that does not exist
|
|
45
|
-
* succeeds and the page throws at runtime
|
|
44
|
+
* These compile to a reference to an identifier that does not exist, the build
|
|
45
|
+
* succeeds and the page throws at runtime: so they are the pass's most useful
|
|
46
46
|
* output for diagnostics.
|
|
47
47
|
*/
|
|
48
48
|
unresolved: string[];
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* The resolve pass: annotate component references in the IR with where they come from.
|
|
3
3
|
*
|
|
4
4
|
* Runs between the frontends and the optimizer, so every later pass reads provenance off
|
|
5
|
-
* the node instead of re-deriving it. Nothing here emits code
|
|
5
|
+
* the node instead of re-deriving it. Nothing here emits code, the pass only records a
|
|
6
6
|
* decision, which is what lets the same answer drive import injection, chunk grouping,
|
|
7
7
|
* hint planning and diagnostics without any of them agreeing by coincidence.
|
|
8
8
|
*
|
|
9
9
|
* Two suppliers, in precedence order:
|
|
10
10
|
*
|
|
11
|
-
* 1. **Control flow** (`Show`, `For`, `Switch`, …)
|
|
11
|
+
* 1. **Control flow** (`Show`, `For`, `Switch`, …), the name selects a lowering, so a
|
|
12
12
|
* rule cannot re-point it. Recorded as `builtin` so a later pass can tell the
|
|
13
13
|
* difference between "configured here" and "fixed by the compiler".
|
|
14
14
|
* 2. **Configured rules**, then the **router built-ins**. Router components are only an
|
|
@@ -24,13 +24,13 @@ import { type IRLoadStrategy } from './load-directive.js';
|
|
|
24
24
|
export interface ResolveOptions {
|
|
25
25
|
/** Rules configured for the project. Omit when the project configures none. */
|
|
26
26
|
resolver?: ComponentResolver;
|
|
27
|
-
/** True when the name already has a binding in the file
|
|
27
|
+
/** True when the name already has a binding in the file, an import the author wrote. */
|
|
28
28
|
isBound?: (name: string) => boolean;
|
|
29
29
|
/** Module overrides, so `routerModule` and friends are honoured. */
|
|
30
30
|
modules?: Parameters<typeof builtinComponentMap>[0];
|
|
31
31
|
/**
|
|
32
32
|
* The `load:` strategy for a reference, when the frontend found one on the tag.
|
|
33
|
-
* Keyed by node so two usages of the same component can load differently
|
|
33
|
+
* Keyed by node so two usages of the same component can load differently, the
|
|
34
34
|
* whole reason timing lives at the usage site and location does not.
|
|
35
35
|
*/
|
|
36
36
|
strategyFor?: (node: IRComponent) => IRLoadStrategy | undefined;
|
|
@@ -41,8 +41,8 @@ export interface ResolveReport {
|
|
|
41
41
|
/**
|
|
42
42
|
* Capitalised tags nothing supplies and nothing binds.
|
|
43
43
|
*
|
|
44
|
-
* These compile to a reference to an identifier that does not exist
|
|
45
|
-
* succeeds and the page throws at runtime
|
|
44
|
+
* These compile to a reference to an identifier that does not exist, the build
|
|
45
|
+
* succeeds and the page throws at runtime: so they are the pass's most useful
|
|
46
46
|
* output for diagnostics.
|
|
47
47
|
*/
|
|
48
48
|
unresolved: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-ir.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve-ir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA0C,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"resolve-ir.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve-ir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA0C,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,wFAAwF;IACxF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,oEAAoE;IACpE,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,cAAc,GAAG,SAAS,CAAC;CACjE;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,OAAO,GAAE,cAAmB,GAC3B,aAAa,CA8Cf;AAED,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAOjF"}
|
|
@@ -9,7 +9,7 @@ export function resolveComponentSources(root, options = {}) {
|
|
|
9
9
|
const annotate = (node) => {
|
|
10
10
|
const { name } = node;
|
|
11
11
|
// A dotted path (`Ctx.Provider`) or a dynamic tag needs its root binding, which is
|
|
12
|
-
// an ordinary expression the author wrote
|
|
12
|
+
// an ordinary expression the author wrote: nothing to supply.
|
|
13
13
|
if (!name || name.includes('.'))
|
|
14
14
|
return;
|
|
15
15
|
if (isBound?.(name))
|
|
@@ -128,7 +128,7 @@ var INTRINSICS = {
|
|
|
128
128
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
129
129
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
130
130
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
131
|
-
// name. Still worth having
|
|
131
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
132
132
|
// designed, the change is this line rather than a compiler pass.
|
|
133
133
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
134
134
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -214,7 +214,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
214
214
|
return target.export === "default" ? ` const ${name}: typeof ${ns}.default;` : ` export import ${name} = ${ns}.${target.export};`;
|
|
215
215
|
});
|
|
216
216
|
const note = shadowedByDom.length > 0 ? `//
|
|
217
|
-
// Import these explicitly
|
|
217
|
+
// Import these explicitly: lib.dom already declares the name, so an ambient
|
|
218
218
|
// declaration cannot win:
|
|
219
219
|
` + shadowedByDom.map((n) => {
|
|
220
220
|
const module2 = resolver.resolve(n)?.module;
|
|
@@ -230,7 +230,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
230
230
|
// a pattern matches unboundedly many names, so there is no list to emit. Those
|
|
231
231
|
// tags still resolve at build time; declare them by hand if the editor needs them.
|
|
232
232
|
` : "";
|
|
233
|
-
const source = `// GENERATED by ${generator}
|
|
233
|
+
const source = `// GENERATED by ${generator}, do not edit.
|
|
234
234
|
//
|
|
235
235
|
// The components \`resolve\` supplies without an import. This describes what the
|
|
236
236
|
// compiler already does; it does not enable it.
|
|
@@ -21,7 +21,7 @@ export const DEFAULT_GLOBALS_PATH = 'fluixi.d.ts';
|
|
|
21
21
|
/**
|
|
22
22
|
* Whether `target` looks covered by the project's `include`, as best we can tell.
|
|
23
23
|
*
|
|
24
|
-
* `undefined` when there is nothing to judge from
|
|
24
|
+
* `undefined` when there is nothing to judge from, no tsconfig, unreadable, or an
|
|
25
25
|
* `extends` we would have to resolve to answer honestly. Best-effort by design: this
|
|
26
26
|
* drives a warning, never a failure, so a wrong guess must not be able to break a build.
|
|
27
27
|
*/
|
|
@@ -84,7 +84,7 @@ function projectDependencies(root) {
|
|
|
84
84
|
];
|
|
85
85
|
}
|
|
86
86
|
catch {
|
|
87
|
-
// No manifest to read
|
|
87
|
+
// No manifest to read: declare everything and let TypeScript report what is missing.
|
|
88
88
|
return undefined;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -103,7 +103,7 @@ var INTRINSICS = {
|
|
|
103
103
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
104
104
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
105
105
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
106
|
-
// name. Still worth having
|
|
106
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
107
107
|
// designed, the change is this line rather than a compiler pass.
|
|
108
108
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
109
109
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -189,7 +189,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
189
189
|
return target.export === "default" ? ` const ${name}: typeof ${ns}.default;` : ` export import ${name} = ${ns}.${target.export};`;
|
|
190
190
|
});
|
|
191
191
|
const note = shadowedByDom.length > 0 ? `//
|
|
192
|
-
// Import these explicitly
|
|
192
|
+
// Import these explicitly: lib.dom already declares the name, so an ambient
|
|
193
193
|
// declaration cannot win:
|
|
194
194
|
` + shadowedByDom.map((n) => {
|
|
195
195
|
const module = resolver.resolve(n)?.module;
|
|
@@ -205,7 +205,7 @@ function componentGlobals(rules, options = {}) {
|
|
|
205
205
|
// a pattern matches unboundedly many names, so there is no list to emit. Those
|
|
206
206
|
// tags still resolve at build time; declare them by hand if the editor needs them.
|
|
207
207
|
` : "";
|
|
208
|
-
const source = `// GENERATED by ${generator}
|
|
208
|
+
const source = `// GENERATED by ${generator}, do not edit.
|
|
209
209
|
//
|
|
210
210
|
// The components \`resolve\` supplies without an import. This describes what the
|
|
211
211
|
// compiler already does; it does not enable it.
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
MagicString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RUDJDZAA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
serverFnId
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-F74GFKSL.mjs";
|
|
8
|
+
import "./chunk-G6QC2WRJ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/transform/server-fns.ts
|
|
11
11
|
import { parse } from "@babel/parser";
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
serverFnId
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-F74GFKSL.mjs";
|
|
5
|
+
import "./chunk-G6QC2WRJ.mjs";
|
|
6
6
|
|
|
7
7
|
// src/frontend/babel/server-functions.ts
|
|
8
8
|
import { transformSync } from "@babel/core";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* function shadows our import there but cannot collide with it, which is the same
|
|
7
7
|
* answer `path.scope.hasBinding` gives on the Program path.
|
|
8
8
|
*
|
|
9
|
-
* Missing a binding emits a duplicate declaration
|
|
9
|
+
* Missing a binding emits a duplicate declaration, a syntax error. Reporting one
|
|
10
10
|
* that isn't there drops an import the code needs. Both are loud, neither is
|
|
11
11
|
* subtle, and the corpus in bindings.spec.ts covers the patterns that bind.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* function shadows our import there but cannot collide with it, which is the same
|
|
7
7
|
* answer `path.scope.hasBinding` gives on the Program path.
|
|
8
8
|
*
|
|
9
|
-
* Missing a binding emits a duplicate declaration
|
|
9
|
+
* Missing a binding emits a duplicate declaration, a syntax error. Reporting one
|
|
10
10
|
* that isn't there drops an import the code needs. Both are loud, neither is
|
|
11
11
|
* subtle, and the corpus in bindings.spec.ts covers the patterns that bind.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* function shadows our import there but cannot collide with it, which is the same
|
|
7
7
|
* answer `path.scope.hasBinding` gives on the Program path.
|
|
8
8
|
*
|
|
9
|
-
* Missing a binding emits a duplicate declaration
|
|
9
|
+
* Missing a binding emits a duplicate declaration, a syntax error. Reporting one
|
|
10
10
|
* that isn't there drops an import the code needs. Both are loud, neither is
|
|
11
11
|
* subtle, and the corpus in bindings.spec.ts covers the patterns that bind.
|
|
12
12
|
*/
|
package/dist/transform/index.cjs
CHANGED
|
@@ -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 __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -490,7 +490,7 @@ var INTRINSICS = {
|
|
|
490
490
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
491
491
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
492
492
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
493
|
-
// name. Still worth having
|
|
493
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
494
494
|
// designed, the change is this line rather than a compiler pass.
|
|
495
495
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
496
496
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -1582,7 +1582,7 @@ var Lowerer = class {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
];
|
|
1584
1584
|
}
|
|
1585
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
1585
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
1586
1586
|
plainAttr(a) {
|
|
1587
1587
|
const v = a.value;
|
|
1588
1588
|
let name = a.name;
|
package/dist/transform/index.mjs
CHANGED
|
@@ -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/transform/templates.ts
|
|
4
4
|
import { parse as parse2 } from "@babel/parser";
|
|
@@ -1522,7 +1522,7 @@ var INTRINSICS = {
|
|
|
1522
1522
|
$store: { export: "store", module: "@fluixi/reactive/store", returns: "store-handle" },
|
|
1523
1523
|
$resource: { export: "resource", module: REACTIVE_MODULE, returns: "resource-handle" },
|
|
1524
1524
|
// No short runtime form for these yet, so the intrinsic stands for the `create*`
|
|
1525
|
-
// name. Still worth having
|
|
1525
|
+
// name. Still worth having: no import to write, and when a shorter form is
|
|
1526
1526
|
// designed, the change is this line rather than a compiler pass.
|
|
1527
1527
|
$selector: { export: "createSelector", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
1528
1528
|
$deferred: { export: "createDeferred", module: REACTIVE_MODULE, returns: "memo-accessor" },
|
|
@@ -2616,7 +2616,7 @@ var Lowerer = class {
|
|
|
2616
2616
|
}
|
|
2617
2617
|
];
|
|
2618
2618
|
}
|
|
2619
|
-
/** A plain attribute (incl. lit `?bool`, mixed values)
|
|
2619
|
+
/** A plain attribute (incl. lit `?bool`, mixed values), old `mkProp` behavior. */
|
|
2620
2620
|
plainAttr(a) {
|
|
2621
2621
|
const v = a.value;
|
|
2622
2622
|
let name = a.name;
|