@fluixi/compiler 1.0.0-alpha.100 → 1.0.0-alpha.102
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/README.md +13 -13
- package/dist/analyze/props-destructure.d.cts +1 -1
- package/dist/analyze/props-destructure.d.ts +1 -1
- package/dist/analyze/props-destructure.js +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 +3 -3
- package/dist/analyze/static-graph.cjs +1 -1
- package/dist/analyze/static-graph.js +2 -2
- package/dist/analyze/static-graph.mjs +1 -1
- package/dist/{babel-I6BUWUCU.mjs → babel-WBQWG5BI.mjs} +23 -23
- package/dist/{chunk-C3XPDB4Y.mjs → chunk-AOKTQGX3.mjs} +1 -1
- package/dist/{chunk-HXEXPWJ2.mjs → chunk-EEUWXI5C.mjs} +2 -2
- package/dist/{chunk-3AICWNF7.mjs → chunk-HUWJHS6T.mjs} +1 -1
- package/dist/{chunk-NU3W67UZ.mjs → chunk-KGXFUVHJ.mjs} +2 -2
- package/dist/{chunk-GX5XV6Z7.mjs → chunk-MASWFMPJ.mjs} +1 -1
- package/dist/{chunk-SKAVY75W.mjs → chunk-TFGOAGRI.mjs} +1 -1
- package/dist/{chunk-6CWJWGE2.mjs → chunk-WUV5ZIYZ.mjs} +10 -10
- package/dist/codegen/backends/imperative.js +2 -2
- package/dist/frontend/babel/{build-ir-lit.cjs → build-ir-html.cjs} +19 -19
- package/dist/frontend/babel/{build-ir-lit.d.cts → build-ir-html.d.cts} +5 -5
- package/dist/frontend/babel/{build-ir-lit.d.ts → build-ir-html.d.ts} +6 -6
- package/dist/frontend/babel/build-ir-html.d.ts.map +1 -0
- package/dist/frontend/babel/{build-ir-lit.js → build-ir-html.js} +4 -4
- package/dist/frontend/babel/{build-ir-lit.mjs → build-ir-html.mjs} +15 -15
- package/dist/frontend/babel/build-ir.cjs +14 -14
- package/dist/frontend/babel/build-ir.d.cts +1 -1
- package/dist/frontend/babel/build-ir.d.ts +1 -1
- package/dist/frontend/babel/build-ir.js +5 -5
- package/dist/frontend/babel/build-ir.mjs +14 -14
- package/dist/frontend/babel/index.cjs +28 -28
- package/dist/frontend/babel/index.d.cts +0 -11
- package/dist/frontend/babel/index.d.ts +0 -11
- package/dist/frontend/babel/index.d.ts.map +1 -1
- package/dist/frontend/babel/index.js +2 -14
- package/dist/frontend/babel/index.mjs +28 -28
- package/dist/frontend/babel/lower-template.cjs +15 -15
- package/dist/frontend/babel/lower-template.d.cts +3 -3
- package/dist/frontend/babel/lower-template.d.ts +3 -3
- package/dist/frontend/babel/lower-template.d.ts.map +1 -1
- package/dist/frontend/babel/lower-template.js +4 -4
- package/dist/frontend/babel/lower-template.mjs +15 -15
- package/dist/frontend/babel/plugin.cjs +25 -25
- package/dist/frontend/babel/plugin.d.cts +6 -22
- package/dist/frontend/babel/plugin.d.ts +6 -22
- package/dist/frontend/babel/plugin.d.ts.map +1 -1
- package/dist/frontend/babel/plugin.js +19 -42
- package/dist/frontend/babel/plugin.mjs +25 -25
- package/dist/frontend/babel/server-functions.js +2 -2
- package/dist/index.cjs +9 -9
- package/dist/index.mjs +9 -9
- package/dist/integrations.cjs +42 -42
- package/dist/integrations.d.cts +7 -22
- package/dist/integrations.d.ts +7 -22
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +3 -34
- package/dist/integrations.mjs +13 -13
- package/dist/ir/nodes.d.cts +1 -1
- package/dist/ir/nodes.d.ts +1 -1
- package/dist/lower/compile-template.cjs +9 -9
- package/dist/lower/compile-template.d.cts +2 -2
- package/dist/lower/compile-template.d.ts +2 -2
- package/dist/lower/compile-template.d.ts.map +1 -1
- package/dist/lower/compile-template.js +1 -1
- package/dist/lower/compile-template.mjs +9 -9
- package/dist/lower/jsx.js +2 -2
- package/dist/lower/template.cjs +8 -8
- package/dist/lower/template.d.cts +6 -6
- package/dist/lower/template.d.ts +6 -6
- package/dist/lower/template.d.ts.map +1 -1
- package/dist/lower/template.js +14 -14
- package/dist/lower/template.mjs +8 -8
- package/dist/resolve/builtins.cjs +1 -1
- package/dist/resolve/builtins.d.cts +2 -2
- package/dist/resolve/builtins.d.ts +2 -2
- package/dist/resolve/builtins.js +1 -1
- package/dist/resolve/builtins.mjs +1 -1
- package/dist/resolve/component-globals.d.cts +2 -2
- package/dist/resolve/component-globals.d.ts +2 -2
- package/dist/resolve/component-globals.js +1 -1
- package/dist/resolve/load-directive.d.cts +1 -1
- package/dist/resolve/load-directive.d.ts +1 -1
- package/dist/resolve/load-directive.js +1 -1
- package/dist/resolve/resolve-ir.d.cts +1 -1
- package/dist/resolve/resolve-ir.d.ts +1 -1
- package/dist/{server-fns-VZLHMQTC.mjs → server-fns-I6FKYS22.mjs} +5 -5
- package/dist/{server-functions-UAZKOLZW.mjs → server-functions-MATGYTBX.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 +17 -17
- package/dist/transform/index.mjs +17 -17
- package/dist/transform/intrinsics.d.cts +1 -1
- package/dist/transform/intrinsics.d.ts +1 -1
- package/dist/transform/intrinsics.js +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.d.ts.map +1 -1
- package/dist/transform/source-locations.js +6 -6
- package/dist/transform/styles.d.cts +2 -2
- package/dist/transform/styles.d.ts +2 -2
- package/dist/transform/styles.d.ts.map +1 -1
- package/dist/transform/styles.js +5 -5
- package/dist/transform/templates.cjs +16 -16
- 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 +10 -10
- package/dist/transform/templates.mjs +16 -16
- package/dist/{transform-3W45L3EA.mjs → transform-AP5PSRT7.mjs} +15 -15
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/vite-styles.js +2 -2
- package/package.json +4 -4
- package/dist/frontend/babel/build-ir-lit.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.102 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* *which module a name comes from*, and *whether the name has special lowering*. Only
|
|
6
6
|
* the first is interesting outside the compiler, and every tool needs it, the TS
|
|
7
7
|
* plugin, to resolve `<Show>` for hover and go-to-definition; the language server, to
|
|
8
|
-
* complete and validate tags inside `` html
|
|
8
|
+
* complete and validate tags inside `` html`...` ``; a codemod, to materialise imports.
|
|
9
9
|
* Having no published source, `@fluixi/ts-plugin` duplicated the list and pinned it
|
|
10
10
|
* with a test that fails when the two drift.
|
|
11
11
|
*
|
|
@@ -40,7 +40,7 @@ export declare const CORE_CONTROL_FLOW: readonly ["Suspense", "SuspenseList", "A
|
|
|
40
40
|
/**
|
|
41
41
|
* Router components.
|
|
42
42
|
*
|
|
43
|
-
* `Routes` is not a component (routing is `<Router routes={
|
|
43
|
+
* `Routes` is not a component (routing is `<Router routes={...}>`) and `lazy` is a call
|
|
44
44
|
* rather than a tag, so neither can be supplied this way.
|
|
45
45
|
*/
|
|
46
46
|
export declare const ROUTER_COMPONENTS: readonly ["Router", "Outlet", "Redirect", "Link"];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* *which module a name comes from*, and *whether the name has special lowering*. Only
|
|
6
6
|
* the first is interesting outside the compiler, and every tool needs it, the TS
|
|
7
7
|
* plugin, to resolve `<Show>` for hover and go-to-definition; the language server, to
|
|
8
|
-
* complete and validate tags inside `` html
|
|
8
|
+
* complete and validate tags inside `` html`...` ``; a codemod, to materialise imports.
|
|
9
9
|
* Having no published source, `@fluixi/ts-plugin` duplicated the list and pinned it
|
|
10
10
|
* with a test that fails when the two drift.
|
|
11
11
|
*
|
|
@@ -40,7 +40,7 @@ export declare const CORE_CONTROL_FLOW: readonly ["Suspense", "SuspenseList", "A
|
|
|
40
40
|
/**
|
|
41
41
|
* Router components.
|
|
42
42
|
*
|
|
43
|
-
* `Routes` is not a component (routing is `<Router routes={
|
|
43
|
+
* `Routes` is not a component (routing is `<Router routes={...}>`) and `lazy` is a call
|
|
44
44
|
* rather than a tag, so neither can be supplied this way.
|
|
45
45
|
*/
|
|
46
46
|
export declare const ROUTER_COMPONENTS: readonly ["Router", "Outlet", "Redirect", "Link"];
|
package/dist/resolve/builtins.js
CHANGED
|
@@ -14,7 +14,7 @@ export const CORE_CONTROL_FLOW = ['Suspense', 'SuspenseList', 'Await'];
|
|
|
14
14
|
/**
|
|
15
15
|
* Router components.
|
|
16
16
|
*
|
|
17
|
-
* `Routes` is not a component (routing is `<Router routes={
|
|
17
|
+
* `Routes` is not a component (routing is `<Router routes={...}>`) and `lazy` is a call
|
|
18
18
|
* rather than a tag, so neither can be supplied this way.
|
|
19
19
|
*/
|
|
20
20
|
export const ROUTER_COMPONENTS = ['Router', 'Outlet', 'Redirect', 'Link'];
|
|
@@ -31,7 +31,7 @@ export interface ComponentGlobalsOptions {
|
|
|
31
31
|
*/
|
|
32
32
|
available?: Iterable<string>;
|
|
33
33
|
/**
|
|
34
|
-
* Declare the framework builtins (`Show`, `For`, `Portal`, `Router`,
|
|
34
|
+
* Declare the framework builtins (`Show`, `For`, `Portal`, `Router`, ...) too.
|
|
35
35
|
*
|
|
36
36
|
* On by default because the compiler resolves them whether or not a rule mentions
|
|
37
37
|
* them, so declaring them is what matches reality. A real import shadows the ambient
|
|
@@ -39,7 +39,7 @@ export interface ComponentGlobalsOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
builtins?: boolean;
|
|
41
41
|
/**
|
|
42
|
-
* Declare the `$` reactive intrinsics (`$signal`, `$memo`,
|
|
42
|
+
* Declare the `$` reactive intrinsics (`$signal`, `$memo`, ...).
|
|
43
43
|
*
|
|
44
44
|
* On by default, matching the compiler: it rewrites those calls whether or not
|
|
45
45
|
* anything declares them, and without the declaration the editor reports
|
|
@@ -31,7 +31,7 @@ export interface ComponentGlobalsOptions {
|
|
|
31
31
|
*/
|
|
32
32
|
available?: Iterable<string>;
|
|
33
33
|
/**
|
|
34
|
-
* Declare the framework builtins (`Show`, `For`, `Portal`, `Router`,
|
|
34
|
+
* Declare the framework builtins (`Show`, `For`, `Portal`, `Router`, ...) too.
|
|
35
35
|
*
|
|
36
36
|
* On by default because the compiler resolves them whether or not a rule mentions
|
|
37
37
|
* them, so declaring them is what matches reality. A real import shadows the ambient
|
|
@@ -39,7 +39,7 @@ export interface ComponentGlobalsOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
builtins?: boolean;
|
|
41
41
|
/**
|
|
42
|
-
* Declare the `$` reactive intrinsics (`$signal`, `$memo`,
|
|
42
|
+
* Declare the `$` reactive intrinsics (`$signal`, `$memo`, ...).
|
|
43
43
|
*
|
|
44
44
|
* On by default, matching the compiler: it rewrites those calls whether or not
|
|
45
45
|
* anything declares them, and without the declaration the editor reports
|
|
@@ -110,7 +110,7 @@ export function componentGlobals(rules, options = {}) {
|
|
|
110
110
|
...new Set([...declared.map((name) => resolved.get(name).module), ...intrinsicModules]),
|
|
111
111
|
].sort();
|
|
112
112
|
const imports = modules.map((m) => `import * as ${namespaceAlias(m)} from '${specifier(m)}';`);
|
|
113
|
-
// `export import X = ns.X` rather than `const X: typeof import('
|
|
113
|
+
// `export import X = ns.X` rather than `const X: typeof import('...').X`: an alias
|
|
114
114
|
// resolves to the original symbol, so hover shows the real declaration
|
|
115
115
|
// (`Button(props: ButtonProps): ComponentChild`) and go-to-definition lands on the
|
|
116
116
|
// source. Both forms keep the JSDoc; the alias also keeps the shape.
|
|
@@ -43,7 +43,7 @@ export declare function isLoadDirective(name: string): boolean;
|
|
|
43
43
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
44
|
*
|
|
45
45
|
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
|
-
* directive. A `${
|
|
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
|
*/
|
|
49
49
|
export declare function parseLoadDirective(name: string, value: string | null): IRLoadStrategy;
|
|
@@ -43,7 +43,7 @@ export declare function isLoadDirective(name: string): boolean;
|
|
|
43
43
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
44
|
*
|
|
45
45
|
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
|
-
* directive. A `${
|
|
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
|
*/
|
|
49
49
|
export declare function parseLoadDirective(name: string, value: string | null): IRLoadStrategy;
|
|
@@ -29,7 +29,7 @@ export function isLoadDirective(name) {
|
|
|
29
29
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
30
30
|
*
|
|
31
31
|
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
32
|
-
* directive. A `${
|
|
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
|
*/
|
|
35
35
|
export function parseLoadDirective(name, value) {
|
|
@@ -8,7 +8,7 @@
|
|
|
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
|
|
@@ -8,7 +8,7 @@
|
|
|
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
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.102 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
import {
|
|
3
3
|
MagicString
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-EEUWXI5C.mjs";
|
|
5
|
+
import "./chunk-HUWJHS6T.mjs";
|
|
6
6
|
import {
|
|
7
7
|
serverFnId
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-AOKTQGX3.mjs";
|
|
9
|
+
import "./chunk-TFGOAGRI.mjs";
|
|
10
10
|
|
|
11
11
|
// src/transform/server-fns.ts
|
|
12
12
|
import { parse } from "@babel/parser";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.102 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
import {
|
|
3
3
|
serverFnId
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-AOKTQGX3.mjs";
|
|
5
|
+
import "./chunk-TFGOAGRI.mjs";
|
|
6
6
|
|
|
7
7
|
// src/frontend/babel/server-functions.ts
|
|
8
8
|
import { transformSync } from "@babel/core";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Names bound at module scope.
|
|
3
3
|
*
|
|
4
4
|
* Injected imports are skipped when the name already exists, so a file with its
|
|
5
|
-
* own `Show` keeps it. Only module scope matters: a `const insert =
|
|
5
|
+
* own `Show` keeps it. Only module scope matters: a `const insert = ...` inside a
|
|
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
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Names bound at module scope.
|
|
3
3
|
*
|
|
4
4
|
* Injected imports are skipped when the name already exists, so a file with its
|
|
5
|
-
* own `Show` keeps it. Only module scope matters: a `const insert =
|
|
5
|
+
* own `Show` keeps it. Only module scope matters: a `const insert = ...` inside a
|
|
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
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Names bound at module scope.
|
|
3
3
|
*
|
|
4
4
|
* Injected imports are skipped when the name already exists, so a file with its
|
|
5
|
-
* own `Show` keeps it. Only module scope matters: a `const insert =
|
|
5
|
+
* own `Show` keeps it. Only module scope matters: a `const insert = ...` inside a
|
|
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
|
*
|
package/dist/transform/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.102 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -2155,7 +2155,7 @@ var Lowerer = class {
|
|
|
2155
2155
|
for (const s of imports) this.used.add(s);
|
|
2156
2156
|
return inlineTemplates(code, templates);
|
|
2157
2157
|
}
|
|
2158
|
-
//
|
|
2158
|
+
// content
|
|
2159
2159
|
lowerRoot(children) {
|
|
2160
2160
|
const nodes = this.lowerChildren(children);
|
|
2161
2161
|
if (nodes.length === 1) return nodes[0];
|
|
@@ -2284,8 +2284,8 @@ var Lowerer = class {
|
|
|
2284
2284
|
}
|
|
2285
2285
|
return { slots, rest };
|
|
2286
2286
|
}
|
|
2287
|
-
//
|
|
2288
|
-
/** `<el if=${cond}
|
|
2287
|
+
// control-flow sugar
|
|
2288
|
+
/** `<el if=${cond}>...</el>` (+ optional `<el else>`) → `<Show when fallback>`. */
|
|
2289
2289
|
lowerIf(el, condHole, elseEl) {
|
|
2290
2290
|
const cond = this.hole(condHole);
|
|
2291
2291
|
const props = [
|
|
@@ -2300,8 +2300,8 @@ var Lowerer = class {
|
|
|
2300
2300
|
return { kind: "component", name: "Show", props, children: [child], ...at ? { at } : {}, ...cond.at ? { bindAt: cond.at } : {} };
|
|
2301
2301
|
}
|
|
2302
2302
|
/**
|
|
2303
|
-
* `<el each=${items} key?>${item =>
|
|
2304
|
-
* content is repeated per item. Content that is not a `${item =>
|
|
2303
|
+
* `<el each=${items} key?>${item => ...}</el>` → `<el><For each>{item => ...}</For></el>`: the
|
|
2304
|
+
* content is repeated per item. Content that is not a `${item => ...}` arrow is repeated as
|
|
2305
2305
|
* it is. Null when the element has no `each`.
|
|
2306
2306
|
*/
|
|
2307
2307
|
lowerEach(el) {
|
|
@@ -2338,7 +2338,7 @@ var Lowerer = class {
|
|
|
2338
2338
|
const clone = { ...el, attributes: el.attributes.filter((a) => !drop(a)) };
|
|
2339
2339
|
return clone.kind === "Element" ? this.lowerElement(clone) : this.lowerComponent(clone);
|
|
2340
2340
|
}
|
|
2341
|
-
//
|
|
2341
|
+
// attributes
|
|
2342
2342
|
/**
|
|
2343
2343
|
* `element`: a DOM element, where each class:/style: value that moves is its own accessor.
|
|
2344
2344
|
* A component gets the object as before, rebuilt whole when any value moves.
|
|
@@ -2479,7 +2479,7 @@ var Lowerer = class {
|
|
|
2479
2479
|
if (mods.includes("passive")) opts.push("passive: true");
|
|
2480
2480
|
return opts.length ? `{ ${opts.join(", ")} }` : null;
|
|
2481
2481
|
}
|
|
2482
|
-
/** `bind:value=${sig}` → `value={read()}` + `onInput={e => write(e
|
|
2482
|
+
/** `bind:value=${sig}` → `value={read()}` + `onInput={e => write(e...value)}`. */
|
|
2483
2483
|
bindProps(prop, h) {
|
|
2484
2484
|
const sigCode = h.code;
|
|
2485
2485
|
const checked = prop === "checked";
|
|
@@ -2505,7 +2505,7 @@ var Lowerer = class {
|
|
|
2505
2505
|
}
|
|
2506
2506
|
];
|
|
2507
2507
|
}
|
|
2508
|
-
/** A plain attribute (incl.
|
|
2508
|
+
/** A plain attribute (incl. html `?bool`, mixed values), old `mkProp` behavior. */
|
|
2509
2509
|
plainAttr(a) {
|
|
2510
2510
|
const v = a.value;
|
|
2511
2511
|
let name = a.name;
|
|
@@ -3483,7 +3483,7 @@ function outermost(list) {
|
|
|
3483
3483
|
(e) => !list.some(
|
|
3484
3484
|
(o) => o !== e && o.start <= e.start && o.end >= e.end && o.end - o.start > e.end - e.start && // An insertion at either edge of the container sits beside it, not inside it, so
|
|
3485
3485
|
// it is not something the container's code already folded in. A statement can
|
|
3486
|
-
// start where its callee starts (`$effect(
|
|
3486
|
+
// start where its callee starts (`$effect(...)`) and a declarator can end where its
|
|
3487
3487
|
// JSX ends (`const Row = () => <b/>`).
|
|
3488
3488
|
!(e.start === e.end && (e.start === o.start || e.start === o.end))
|
|
3489
3489
|
)
|
|
@@ -3500,7 +3500,7 @@ function bindHole(code, expr, edits, keepPosition = false) {
|
|
|
3500
3500
|
const hole = {
|
|
3501
3501
|
code: slice(code, expr.start, expr.end, edits),
|
|
3502
3502
|
reactive: isReactiveShape(shapeOf(expr)),
|
|
3503
|
-
// Where the `${
|
|
3503
|
+
// Where the `${...}` is, so a binding made from it can say so. The source map cannot:
|
|
3504
3504
|
// the whole template is one overwrite. Only when source locations were asked for.
|
|
3505
3505
|
...at ? { at: { line: at.line, column: at.column } } : {}
|
|
3506
3506
|
};
|
|
@@ -3616,11 +3616,11 @@ function relativeToRoot(id, root) {
|
|
|
3616
3616
|
return id.startsWith(base) ? id.slice(base.length) : id;
|
|
3617
3617
|
}
|
|
3618
3618
|
function transformTemplates(code, id, options = {}) {
|
|
3619
|
-
const
|
|
3619
|
+
const htmlTag = options.htmlTag ?? "html";
|
|
3620
3620
|
const format = options.format ?? "both";
|
|
3621
|
-
const
|
|
3622
|
-
const wantsJsx = format !== "
|
|
3623
|
-
const mayHaveTemplate =
|
|
3621
|
+
const wantsHtml = format !== "jsx";
|
|
3622
|
+
const wantsJsx = format !== "html";
|
|
3623
|
+
const mayHaveTemplate = wantsHtml && (code.includes(`${htmlTag}\``) || code.includes("svg`"));
|
|
3624
3624
|
const wantsIntrinsics = options.intrinsics !== false && mayHaveIntrinsic(code);
|
|
3625
3625
|
const wantsSources = options.sourceLocations === true && mayHaveSourceMarks(code);
|
|
3626
3626
|
const sourceName = relativeToRoot(id, options.sourceRoot);
|
|
@@ -3632,12 +3632,12 @@ function transformTemplates(code, id, options = {}) {
|
|
|
3632
3632
|
errorRecovery: true
|
|
3633
3633
|
});
|
|
3634
3634
|
const intrinsicTags = options.intrinsics === false ? /* @__PURE__ */ new Map() : tagIntrinsics(moduleBindings(ast.program));
|
|
3635
|
-
const templateTags = /* @__PURE__ */ new Map([[
|
|
3635
|
+
const templateTags = /* @__PURE__ */ new Map([[htmlTag, "html"], ["svg", "svg"]]);
|
|
3636
3636
|
for (const [name, tag] of intrinsicTags) if (tag !== "css") templateTags.set(name, tag);
|
|
3637
3637
|
const cssTags = [...intrinsicTags].filter(([, tag]) => tag === "css").map(([name]) => name);
|
|
3638
3638
|
const found = [];
|
|
3639
3639
|
walk7(ast.program, (n, parent, key) => {
|
|
3640
|
-
if (
|
|
3640
|
+
if (wantsHtml && isTemplateTag(n, templateTags)) found.push(n);
|
|
3641
3641
|
else if (wantsJsx && isJsxRoot(n, parent, key)) found.push(n);
|
|
3642
3642
|
});
|
|
3643
3643
|
const props = options.propsDestructure === false ? { edits: [], diagnostics: [], used: /* @__PURE__ */ new Set() } : collectPropsEdits(ast.program, code, { runtimeModule: options.runtimeModule });
|
package/dist/transform/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.102 | (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";
|
|
@@ -3193,7 +3193,7 @@ var Lowerer = class {
|
|
|
3193
3193
|
for (const s of imports) this.used.add(s);
|
|
3194
3194
|
return inlineTemplates(code, templates);
|
|
3195
3195
|
}
|
|
3196
|
-
//
|
|
3196
|
+
// content
|
|
3197
3197
|
lowerRoot(children) {
|
|
3198
3198
|
const nodes = this.lowerChildren(children);
|
|
3199
3199
|
if (nodes.length === 1) return nodes[0];
|
|
@@ -3322,8 +3322,8 @@ var Lowerer = class {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return { slots, rest };
|
|
3324
3324
|
}
|
|
3325
|
-
//
|
|
3326
|
-
/** `<el if=${cond}
|
|
3325
|
+
// control-flow sugar
|
|
3326
|
+
/** `<el if=${cond}>...</el>` (+ optional `<el else>`) → `<Show when fallback>`. */
|
|
3327
3327
|
lowerIf(el, condHole, elseEl) {
|
|
3328
3328
|
const cond = this.hole(condHole);
|
|
3329
3329
|
const props = [
|
|
@@ -3338,8 +3338,8 @@ var Lowerer = class {
|
|
|
3338
3338
|
return { kind: "component", name: "Show", props, children: [child], ...at ? { at } : {}, ...cond.at ? { bindAt: cond.at } : {} };
|
|
3339
3339
|
}
|
|
3340
3340
|
/**
|
|
3341
|
-
* `<el each=${items} key?>${item =>
|
|
3342
|
-
* content is repeated per item. Content that is not a `${item =>
|
|
3341
|
+
* `<el each=${items} key?>${item => ...}</el>` → `<el><For each>{item => ...}</For></el>`: the
|
|
3342
|
+
* content is repeated per item. Content that is not a `${item => ...}` arrow is repeated as
|
|
3343
3343
|
* it is. Null when the element has no `each`.
|
|
3344
3344
|
*/
|
|
3345
3345
|
lowerEach(el) {
|
|
@@ -3376,7 +3376,7 @@ var Lowerer = class {
|
|
|
3376
3376
|
const clone = { ...el, attributes: el.attributes.filter((a) => !drop(a)) };
|
|
3377
3377
|
return clone.kind === "Element" ? this.lowerElement(clone) : this.lowerComponent(clone);
|
|
3378
3378
|
}
|
|
3379
|
-
//
|
|
3379
|
+
// attributes
|
|
3380
3380
|
/**
|
|
3381
3381
|
* `element`: a DOM element, where each class:/style: value that moves is its own accessor.
|
|
3382
3382
|
* A component gets the object as before, rebuilt whole when any value moves.
|
|
@@ -3517,7 +3517,7 @@ var Lowerer = class {
|
|
|
3517
3517
|
if (mods.includes("passive")) opts.push("passive: true");
|
|
3518
3518
|
return opts.length ? `{ ${opts.join(", ")} }` : null;
|
|
3519
3519
|
}
|
|
3520
|
-
/** `bind:value=${sig}` → `value={read()}` + `onInput={e => write(e
|
|
3520
|
+
/** `bind:value=${sig}` → `value={read()}` + `onInput={e => write(e...value)}`. */
|
|
3521
3521
|
bindProps(prop, h) {
|
|
3522
3522
|
const sigCode = h.code;
|
|
3523
3523
|
const checked = prop === "checked";
|
|
@@ -3543,7 +3543,7 @@ var Lowerer = class {
|
|
|
3543
3543
|
}
|
|
3544
3544
|
];
|
|
3545
3545
|
}
|
|
3546
|
-
/** A plain attribute (incl.
|
|
3546
|
+
/** A plain attribute (incl. html `?bool`, mixed values), old `mkProp` behavior. */
|
|
3547
3547
|
plainAttr(a) {
|
|
3548
3548
|
const v = a.value;
|
|
3549
3549
|
let name = a.name;
|
|
@@ -4520,7 +4520,7 @@ function outermost(list) {
|
|
|
4520
4520
|
(e) => !list.some(
|
|
4521
4521
|
(o) => o !== e && o.start <= e.start && o.end >= e.end && o.end - o.start > e.end - e.start && // An insertion at either edge of the container sits beside it, not inside it, so
|
|
4522
4522
|
// it is not something the container's code already folded in. A statement can
|
|
4523
|
-
// start where its callee starts (`$effect(
|
|
4523
|
+
// start where its callee starts (`$effect(...)`) and a declarator can end where its
|
|
4524
4524
|
// JSX ends (`const Row = () => <b/>`).
|
|
4525
4525
|
!(e.start === e.end && (e.start === o.start || e.start === o.end))
|
|
4526
4526
|
)
|
|
@@ -4537,7 +4537,7 @@ function bindHole(code, expr, edits, keepPosition = false) {
|
|
|
4537
4537
|
const hole = {
|
|
4538
4538
|
code: slice(code, expr.start, expr.end, edits),
|
|
4539
4539
|
reactive: isReactiveShape(shapeOf(expr)),
|
|
4540
|
-
// Where the `${
|
|
4540
|
+
// Where the `${...}` is, so a binding made from it can say so. The source map cannot:
|
|
4541
4541
|
// the whole template is one overwrite. Only when source locations were asked for.
|
|
4542
4542
|
...at ? { at: { line: at.line, column: at.column } } : {}
|
|
4543
4543
|
};
|
|
@@ -4653,11 +4653,11 @@ function relativeToRoot(id, root) {
|
|
|
4653
4653
|
return id.startsWith(base) ? id.slice(base.length) : id;
|
|
4654
4654
|
}
|
|
4655
4655
|
function transformTemplates(code, id, options = {}) {
|
|
4656
|
-
const
|
|
4656
|
+
const htmlTag = options.htmlTag ?? "html";
|
|
4657
4657
|
const format = options.format ?? "both";
|
|
4658
|
-
const
|
|
4659
|
-
const wantsJsx = format !== "
|
|
4660
|
-
const mayHaveTemplate =
|
|
4658
|
+
const wantsHtml = format !== "jsx";
|
|
4659
|
+
const wantsJsx = format !== "html";
|
|
4660
|
+
const mayHaveTemplate = wantsHtml && (code.includes(`${htmlTag}\``) || code.includes("svg`"));
|
|
4661
4661
|
const wantsIntrinsics = options.intrinsics !== false && mayHaveIntrinsic(code);
|
|
4662
4662
|
const wantsSources = options.sourceLocations === true && mayHaveSourceMarks(code);
|
|
4663
4663
|
const sourceName = relativeToRoot(id, options.sourceRoot);
|
|
@@ -4669,12 +4669,12 @@ function transformTemplates(code, id, options = {}) {
|
|
|
4669
4669
|
errorRecovery: true
|
|
4670
4670
|
});
|
|
4671
4671
|
const intrinsicTags = options.intrinsics === false ? /* @__PURE__ */ new Map() : tagIntrinsics(moduleBindings(ast.program));
|
|
4672
|
-
const templateTags = /* @__PURE__ */ new Map([[
|
|
4672
|
+
const templateTags = /* @__PURE__ */ new Map([[htmlTag, "html"], ["svg", "svg"]]);
|
|
4673
4673
|
for (const [name, tag] of intrinsicTags) if (tag !== "css") templateTags.set(name, tag);
|
|
4674
4674
|
const cssTags = [...intrinsicTags].filter(([, tag]) => tag === "css").map(([name]) => name);
|
|
4675
4675
|
const found = [];
|
|
4676
4676
|
walk7(ast.program, (n2, parent, key) => {
|
|
4677
|
-
if (
|
|
4677
|
+
if (wantsHtml && isTemplateTag(n2, templateTags)) found.push(n2);
|
|
4678
4678
|
else if (wantsJsx && isJsxRoot(n2, parent, key)) found.push(n2);
|
|
4679
4679
|
});
|
|
4680
4680
|
const props = options.propsDestructure === false ? { edits: [], diagnostics: [], used: /* @__PURE__ */ new Set() } : collectPropsEdits(ast.program, code, { runtimeModule: options.runtimeModule });
|
|
@@ -24,7 +24,7 @@ export declare function collectIntrinsicEdits(program: unknown): IntrinsicsResul
|
|
|
24
24
|
*
|
|
25
25
|
* `$env('X')` becomes `env('X')`, and the import of `env` used to be skipped when the module
|
|
26
26
|
* already bound `env`, on the assumption that it was the same import. A config module with its
|
|
27
|
-
* own `const env = {
|
|
27
|
+
* own `const env = {...}` is common, and there the call reached the app's object instead. Such a
|
|
28
28
|
* name is now imported under a private alias. A module that imports that very export from that
|
|
29
29
|
* very module keeps the old behaviour: the binding is the runtime already.
|
|
30
30
|
*/
|
|
@@ -24,7 +24,7 @@ export declare function collectIntrinsicEdits(program: unknown): IntrinsicsResul
|
|
|
24
24
|
*
|
|
25
25
|
* `$env('X')` becomes `env('X')`, and the import of `env` used to be skipped when the module
|
|
26
26
|
* already bound `env`, on the assumption that it was the same import. A config module with its
|
|
27
|
-
* own `const env = {
|
|
27
|
+
* own `const env = {...}` is common, and there the call reached the app's object instead. Such a
|
|
28
28
|
* name is now imported under a private alias. A module that imports that very export from that
|
|
29
29
|
* very module keeps the old behaviour: the binding is the runtime already.
|
|
30
30
|
*/
|
|
@@ -71,7 +71,7 @@ export function collectIntrinsicEdits(program) {
|
|
|
71
71
|
*
|
|
72
72
|
* `$env('X')` becomes `env('X')`, and the import of `env` used to be skipped when the module
|
|
73
73
|
* already bound `env`, on the assumption that it was the same import. A config module with its
|
|
74
|
-
* own `const env = {
|
|
74
|
+
* own `const env = {...}` is common, and there the call reached the app's object instead. Such a
|
|
75
75
|
* name is now imported under a private alias. A module that imports that very export from that
|
|
76
76
|
* very module keeps the old behaviour: the binding is the runtime already.
|
|
77
77
|
*/
|
|
@@ -41,7 +41,7 @@ export declare const markHole: (accessor: string, line: number, column: number,
|
|
|
41
41
|
* back: devtools keeps the map, and a build without it passes the object through.
|
|
42
42
|
*/
|
|
43
43
|
export declare const PROPS_MARKER = "__fx_props";
|
|
44
|
-
/** `_({ get a() {
|
|
44
|
+
/** `_({ get a() {...} }, {"a":[9,25]})`, or the object untouched when nothing is watching. */
|
|
45
45
|
export declare const markProps: (object: string, at: Record<string, [number, number]>) => string;
|
|
46
46
|
/** Whether a module has anything to mark: a primitive call or a subclass. Cheap enough to run before parsing. */
|
|
47
47
|
export declare function mayHaveSourceMarks(code: string): boolean;
|
|
@@ -41,7 +41,7 @@ export declare const markHole: (accessor: string, line: number, column: number,
|
|
|
41
41
|
* back: devtools keeps the map, and a build without it passes the object through.
|
|
42
42
|
*/
|
|
43
43
|
export declare const PROPS_MARKER = "__fx_props";
|
|
44
|
-
/** `_({ get a() {
|
|
44
|
+
/** `_({ get a() {...} }, {"a":[9,25]})`, or the object untouched when nothing is watching. */
|
|
45
45
|
export declare const markProps: (object: string, at: Record<string, [number, number]>) => string;
|
|
46
46
|
/** Whether a module has anything to mark: a primitive call or a subclass. Cheap enough to run before parsing. */
|
|
47
47
|
export declare function mayHaveSourceMarks(code: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-locations.d.ts","sourceRoot":"","sources":["../../src/transform/source-locations.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gEAAgE;AAChE,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GACnB,UAAU,MAAM,EAChB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,OAAO,MAAM,KACZ,MAGE,CAAC;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"source-locations.d.ts","sourceRoot":"","sources":["../../src/transform/source-locations.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gEAAgE;AAChE,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GACnB,UAAU,MAAM,EAChB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,OAAO,MAAM,KACZ,MAGE,CAAC;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,8FAA8F;AAC9F,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAG,MACF,CAAC;AAQhF,iHAAiH;AACjH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOxD;AAmFD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CA6J5F"}
|
|
@@ -51,7 +51,7 @@ export const markHole = (accessor, line, column, name) => `(globalThis.${HOLE_MA
|
|
|
51
51
|
* back: devtools keeps the map, and a build without it passes the object through.
|
|
52
52
|
*/
|
|
53
53
|
export const PROPS_MARKER = '__fx_props';
|
|
54
|
-
/** `_({ get a() {
|
|
54
|
+
/** `_({ get a() {...} }, {"a":[9,25]})`, or the object untouched when nothing is watching. */
|
|
55
55
|
export const markProps = (object, at) => `(globalThis.${PROPS_MARKER} ?? ((p) => p))(${object},${JSON.stringify(at)})`;
|
|
56
56
|
/** The runtime names that make a node. */
|
|
57
57
|
const RUNTIME_PRIMITIVES = new Set([
|
|
@@ -108,8 +108,8 @@ function walk(node, visit, stack = []) {
|
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* const count = signal(0) → count
|
|
111
|
-
* const [count, setCount] =
|
|
112
|
-
* effect(() =>
|
|
111
|
+
* const [count, setCount] = ... → count, the accessor rather than the setter
|
|
112
|
+
* effect(() => ...) → nothing
|
|
113
113
|
*/
|
|
114
114
|
function nameFor(stack) {
|
|
115
115
|
const declarator = stack[stack.length - 1];
|
|
@@ -169,7 +169,7 @@ export function collectSourceEdits(program, filename) {
|
|
|
169
169
|
//
|
|
170
170
|
// Only through what wraps a declaration. Anything else above it is a block or an
|
|
171
171
|
// argument list, and a statement appended there lands outside the grammar ,
|
|
172
|
-
// `function Page(){}` inside `it('
|
|
172
|
+
// `function Page(){}` inside `it('...', () => { ... })` ended up between the `}` and the
|
|
173
173
|
// `)`, which is a syntax error in a file that compiled a moment earlier.
|
|
174
174
|
let end = node.end;
|
|
175
175
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
@@ -265,7 +265,7 @@ export function collectSourceEdits(program, filename) {
|
|
|
265
265
|
}
|
|
266
266
|
if (!statement)
|
|
267
267
|
return;
|
|
268
|
-
// `export const [cart] = createStore(
|
|
268
|
+
// `export const [cart] = createStore(...)` finds the declaration, which starts after the
|
|
269
269
|
// keyword: a mark there splits `export` from what it exports.
|
|
270
270
|
let start = statement.start;
|
|
271
271
|
let end = statement.end;
|
|
@@ -289,7 +289,7 @@ export function collectSourceEdits(program, filename) {
|
|
|
289
289
|
.filter((a) => a !== undefined)
|
|
290
290
|
.join(',');
|
|
291
291
|
const mark = `globalThis.${SOURCE_MARKER}?.(${args});`;
|
|
292
|
-
// `if (c) effect(
|
|
292
|
+
// `if (c) effect(...)` has one statement where the grammar allows one statement, so
|
|
293
293
|
// putting the mark in front of it moves the branch body out of the branch. Braces are
|
|
294
294
|
// added around both rather than skipping the mark.
|
|
295
295
|
if (isLoneBranch(statement, parent)) {
|
|
@@ -102,7 +102,7 @@ export interface CompiledStyle {
|
|
|
102
102
|
/** A custom element class with a shadow root, and what its styles are made of. */
|
|
103
103
|
interface ShadowClass {
|
|
104
104
|
node: Node;
|
|
105
|
-
/** Its `static styles =
|
|
105
|
+
/** Its `static styles = ...`, when it has one. */
|
|
106
106
|
styles?: Node;
|
|
107
107
|
/** Indexes in `plan.styles` of the blocks its render holds. */
|
|
108
108
|
indexes: number[];
|
|
@@ -198,7 +198,7 @@ export declare function applyTemplateStyles(ir: IRLike, t: TemplateStyles): void
|
|
|
198
198
|
/**
|
|
199
199
|
* Where a component's style blocks and css`` values are served: next to the component, a path
|
|
200
200
|
* ending in `.css`. Every CSS tool in the bundler then sees CSS, and none sees TSX: Vite 8
|
|
201
|
-
* matches its transforms on the path without the query, so `card.tsx
|
|
201
|
+
* matches its transforms on the path without the query, so `card.tsx?...` would read as a .tsx.
|
|
202
202
|
* `?inline` (Vite's own) asks for the CSS as a string, for a shadow root.
|
|
203
203
|
*/
|
|
204
204
|
export declare const styleIds: {
|
|
@@ -102,7 +102,7 @@ export interface CompiledStyle {
|
|
|
102
102
|
/** A custom element class with a shadow root, and what its styles are made of. */
|
|
103
103
|
interface ShadowClass {
|
|
104
104
|
node: Node;
|
|
105
|
-
/** Its `static styles =
|
|
105
|
+
/** Its `static styles = ...`, when it has one. */
|
|
106
106
|
styles?: Node;
|
|
107
107
|
/** Indexes in `plan.styles` of the blocks its render holds. */
|
|
108
108
|
indexes: number[];
|
|
@@ -198,7 +198,7 @@ export declare function applyTemplateStyles(ir: IRLike, t: TemplateStyles): void
|
|
|
198
198
|
/**
|
|
199
199
|
* Where a component's style blocks and css`` values are served: next to the component, a path
|
|
200
200
|
* ending in `.css`. Every CSS tool in the bundler then sees CSS, and none sees TSX: Vite 8
|
|
201
|
-
* matches its transforms on the path without the query, so `card.tsx
|
|
201
|
+
* matches its transforms on the path without the query, so `card.tsx?...` would read as a .tsx.
|
|
202
202
|
* `?inline` (Vite's own) asks for the CSS as a string, for a shadow root.
|
|
203
203
|
*/
|
|
204
204
|
export declare const styleIds: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/transform/styles.ts"],"names":[],"mappings":"AAcA,uEAAuE;AACvE,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAA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