@fluixi/compiler 1.0.0-alpha.94 → 1.0.0-alpha.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/analyze/static-graph.cjs +1 -1
- package/dist/analyze/static-graph.mjs +1 -1
- package/dist/{babel-RJFQVFJW.mjs → babel-YG5PQAMX.mjs} +4 -4
- package/dist/{chunk-ZR2QHTEX.mjs → chunk-JHBI26FW.mjs} +6 -4
- package/dist/{chunk-DP2QDWWH.mjs → chunk-JJ4ZAZKY.mjs} +1 -1
- package/dist/{chunk-HCCBEJEZ.mjs → chunk-L6WBOEIO.mjs} +1 -1
- package/dist/{chunk-HIZU7WI2.mjs → chunk-UVH2BMMY.mjs} +1 -1
- package/dist/chunk-VX2OBUMB.mjs +92 -0
- package/dist/{chunk-E2RWTIYE.mjs → chunk-X735CULF.mjs} +4 -89
- package/dist/chunk-ZPEHDBCH.mjs +584 -0
- package/dist/codegen/backends/imperative.cjs +4 -2
- package/dist/codegen/backends/imperative.d.ts.map +1 -1
- package/dist/codegen/backends/imperative.js +9 -2
- package/dist/codegen/backends/imperative.mjs +4 -2
- package/dist/frontend/babel/build-ir-lit.cjs +4 -2
- package/dist/frontend/babel/build-ir-lit.mjs +4 -2
- package/dist/frontend/babel/build-ir.cjs +4 -2
- package/dist/frontend/babel/build-ir.mjs +4 -2
- package/dist/frontend/babel/index.cjs +5 -3
- package/dist/frontend/babel/index.mjs +5 -3
- package/dist/frontend/babel/lower-template.cjs +4 -2
- package/dist/frontend/babel/lower-template.mjs +4 -2
- package/dist/frontend/babel/plugin.cjs +4 -2
- package/dist/frontend/babel/plugin.mjs +4 -2
- package/dist/index.cjs +5 -3
- package/dist/index.mjs +5 -3
- package/dist/integrations.cjs +3330 -3269
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +19 -8
- package/dist/integrations.mjs +85 -40
- package/dist/lower/compile-template.cjs +5 -3
- package/dist/lower/compile-template.mjs +5 -3
- package/dist/lower/jsx.cjs +4 -2
- package/dist/lower/jsx.mjs +4 -2
- package/dist/lower/template.cjs +4 -2
- package/dist/lower/template.mjs +4 -2
- package/dist/resolve/builtins.cjs +1 -1
- package/dist/resolve/builtins.mjs +1 -1
- package/dist/{server-fns-JLSTKWPS.mjs → server-fns-PZEOON2D.mjs} +5 -4
- package/dist/{server-functions-BGY3RD4R.mjs → server-functions-JNSQMA63.mjs} +3 -3
- package/dist/transform/index.cjs +35 -16
- package/dist/transform/index.mjs +35 -16
- package/dist/transform/styles.cjs +31 -13
- package/dist/transform/styles.d.cts +27 -1
- package/dist/transform/styles.d.ts +27 -1
- package/dist/transform/styles.d.ts.map +1 -1
- package/dist/transform/styles.js +45 -16
- package/dist/transform/styles.mjs +31 -13
- package/dist/transform/templates.cjs +34 -15
- package/dist/transform/templates.mjs +34 -15
- package/dist/{transform-GBP6Y4UI.mjs → transform-UODP37VJ.mjs} +12 -563
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/vite-styles.cjs +66 -23
- package/dist/vite-styles.d.cts +16 -7
- package/dist/vite-styles.d.ts +16 -7
- package/dist/vite-styles.d.ts.map +1 -1
- package/dist/vite-styles.js +68 -25
- package/dist/vite-styles.mjs +78 -23
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (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-JHBI26FW.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-L6WBOEIO.mjs";
|
|
19
|
+
import "./chunk-UVH2BMMY.mjs";
|
|
20
20
|
|
|
21
21
|
// src/frontend/babel/plugin.ts
|
|
22
22
|
import { declare } from "@babel/helper-plugin-utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
import {
|
|
3
3
|
INTRINSICS,
|
|
4
4
|
RESERVED_COMPONENTS,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
builtinComponentMap,
|
|
8
8
|
isIntrinsicName,
|
|
9
9
|
isPrimitiveModule
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L6WBOEIO.mjs";
|
|
11
11
|
|
|
12
12
|
// src/analyze/expr-shape.ts
|
|
13
13
|
var CALL = /* @__PURE__ */ new Set(["CallExpression", "OptionalCallExpression"]);
|
|
@@ -962,14 +962,16 @@ function emitNode(node, used, templates) {
|
|
|
962
962
|
for (const child of node.children) {
|
|
963
963
|
used.add("insert");
|
|
964
964
|
const childCode = emitNode(child, used, templates);
|
|
965
|
-
const
|
|
966
|
-
parts.push(
|
|
965
|
+
const anchored = child.kind === "expr" && (child.reactive || !isLiteralCode(child.code)) || child.kind === "component" || child.kind === "control";
|
|
966
|
+
parts.push(anchored ? `insert(${el}, ${childCode}, null);` : `insert(${el}, ${childCode});`);
|
|
967
967
|
}
|
|
968
968
|
parts.push(`return ${el};`);
|
|
969
969
|
return `(() => { ${parts.join(" ")} })()`;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
+
var LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`[^`$]*`|-?\d[\d_.eE+-]*|true|false|null|undefined)\s*$/;
|
|
974
|
+
var isLiteralCode = (code) => LITERAL.test(code);
|
|
973
975
|
function inlineTemplates(code, templates) {
|
|
974
976
|
if (!templates || templates.length === 0) return code;
|
|
975
977
|
const byId = new Map(templates.map((t) => [t.id, JSON.stringify(t.html)]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
3
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
4
|
}) : x)(function(x) {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
4
|
+
var comma = ",".charCodeAt(0);
|
|
5
|
+
var semicolon = ";".charCodeAt(0);
|
|
6
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
7
|
+
var intToChar = new Uint8Array(64);
|
|
8
|
+
var charToInt = new Uint8Array(128);
|
|
9
|
+
for (let i = 0; i < chars.length; i++) {
|
|
10
|
+
const c = chars.charCodeAt(i);
|
|
11
|
+
intToChar[i] = c;
|
|
12
|
+
charToInt[c] = i;
|
|
13
|
+
}
|
|
14
|
+
function encodeInteger(builder, num) {
|
|
15
|
+
do {
|
|
16
|
+
let clamped = num & 31;
|
|
17
|
+
num >>>= 5;
|
|
18
|
+
if (num > 0) clamped |= 32;
|
|
19
|
+
builder.write(intToChar[clamped]);
|
|
20
|
+
} while (num > 0);
|
|
21
|
+
}
|
|
22
|
+
function encodeSign(num) {
|
|
23
|
+
return num < 0 ? -num << 1 | 1 : num << 1;
|
|
24
|
+
}
|
|
25
|
+
var bufLength = 1024 * 16;
|
|
26
|
+
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
27
|
+
decode(buf) {
|
|
28
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
29
|
+
return out.toString();
|
|
30
|
+
}
|
|
31
|
+
} : {
|
|
32
|
+
decode(buf) {
|
|
33
|
+
let out = "";
|
|
34
|
+
for (let i = 0; i < buf.length; i++) {
|
|
35
|
+
out += String.fromCharCode(buf[i]);
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var StringWriter = class {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.pos = 0;
|
|
43
|
+
this.out = "";
|
|
44
|
+
this.buffer = new Uint8Array(bufLength);
|
|
45
|
+
}
|
|
46
|
+
write(v) {
|
|
47
|
+
const { buffer } = this;
|
|
48
|
+
buffer[this.pos++] = v;
|
|
49
|
+
if (this.pos === bufLength) {
|
|
50
|
+
this.out += td.decode(buffer);
|
|
51
|
+
this.pos = 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
flush() {
|
|
55
|
+
const { buffer, out, pos } = this;
|
|
56
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function encode(decoded) {
|
|
60
|
+
const writer = new StringWriter();
|
|
61
|
+
let sourcesIndex = 0;
|
|
62
|
+
let sourceLine = 0;
|
|
63
|
+
let sourceColumn = 0;
|
|
64
|
+
let namesIndex = 0;
|
|
65
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
66
|
+
const line = decoded[i];
|
|
67
|
+
if (i > 0) writer.write(semicolon);
|
|
68
|
+
if (line.length === 0) continue;
|
|
69
|
+
let genColumn = 0;
|
|
70
|
+
for (let j = 0; j < line.length; j++) {
|
|
71
|
+
const segment = line[j];
|
|
72
|
+
if (j > 0) writer.write(comma);
|
|
73
|
+
encodeInteger(writer, encodeSign(segment[0] - genColumn));
|
|
74
|
+
genColumn = segment[0];
|
|
75
|
+
if (segment.length === 1) continue;
|
|
76
|
+
encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));
|
|
77
|
+
encodeInteger(writer, encodeSign(segment[2] - sourceLine));
|
|
78
|
+
encodeInteger(writer, encodeSign(segment[3] - sourceColumn));
|
|
79
|
+
sourcesIndex = segment[1];
|
|
80
|
+
sourceLine = segment[2];
|
|
81
|
+
sourceColumn = segment[3];
|
|
82
|
+
if (segment.length === 4) continue;
|
|
83
|
+
encodeInteger(writer, encodeSign(segment[4] - namesIndex));
|
|
84
|
+
namesIndex = segment[4];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return writer.flush();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
encode
|
|
92
|
+
};
|
|
@@ -1,91 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/compiler v1.0.0-alpha.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var semicolon = ";".charCodeAt(0);
|
|
6
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
7
|
-
var intToChar = new Uint8Array(64);
|
|
8
|
-
var charToInt = new Uint8Array(128);
|
|
9
|
-
for (let i = 0; i < chars.length; i++) {
|
|
10
|
-
const c = chars.charCodeAt(i);
|
|
11
|
-
intToChar[i] = c;
|
|
12
|
-
charToInt[c] = i;
|
|
13
|
-
}
|
|
14
|
-
function encodeInteger(builder, num) {
|
|
15
|
-
do {
|
|
16
|
-
let clamped = num & 31;
|
|
17
|
-
num >>>= 5;
|
|
18
|
-
if (num > 0) clamped |= 32;
|
|
19
|
-
builder.write(intToChar[clamped]);
|
|
20
|
-
} while (num > 0);
|
|
21
|
-
}
|
|
22
|
-
function encodeSign(num) {
|
|
23
|
-
return num < 0 ? -num << 1 | 1 : num << 1;
|
|
24
|
-
}
|
|
25
|
-
var bufLength = 1024 * 16;
|
|
26
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
27
|
-
decode(buf) {
|
|
28
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
29
|
-
return out.toString();
|
|
30
|
-
}
|
|
31
|
-
} : {
|
|
32
|
-
decode(buf) {
|
|
33
|
-
let out = "";
|
|
34
|
-
for (let i = 0; i < buf.length; i++) {
|
|
35
|
-
out += String.fromCharCode(buf[i]);
|
|
36
|
-
}
|
|
37
|
-
return out;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var StringWriter = class {
|
|
41
|
-
constructor() {
|
|
42
|
-
this.pos = 0;
|
|
43
|
-
this.out = "";
|
|
44
|
-
this.buffer = new Uint8Array(bufLength);
|
|
45
|
-
}
|
|
46
|
-
write(v) {
|
|
47
|
-
const { buffer } = this;
|
|
48
|
-
buffer[this.pos++] = v;
|
|
49
|
-
if (this.pos === bufLength) {
|
|
50
|
-
this.out += td.decode(buffer);
|
|
51
|
-
this.pos = 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
flush() {
|
|
55
|
-
const { buffer, out, pos } = this;
|
|
56
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
function encode(decoded) {
|
|
60
|
-
const writer = new StringWriter();
|
|
61
|
-
let sourcesIndex = 0;
|
|
62
|
-
let sourceLine = 0;
|
|
63
|
-
let sourceColumn = 0;
|
|
64
|
-
let namesIndex = 0;
|
|
65
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
66
|
-
const line = decoded[i];
|
|
67
|
-
if (i > 0) writer.write(semicolon);
|
|
68
|
-
if (line.length === 0) continue;
|
|
69
|
-
let genColumn = 0;
|
|
70
|
-
for (let j = 0; j < line.length; j++) {
|
|
71
|
-
const segment = line[j];
|
|
72
|
-
if (j > 0) writer.write(comma);
|
|
73
|
-
encodeInteger(writer, encodeSign(segment[0] - genColumn));
|
|
74
|
-
genColumn = segment[0];
|
|
75
|
-
if (segment.length === 1) continue;
|
|
76
|
-
encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));
|
|
77
|
-
encodeInteger(writer, encodeSign(segment[2] - sourceLine));
|
|
78
|
-
encodeInteger(writer, encodeSign(segment[3] - sourceColumn));
|
|
79
|
-
sourcesIndex = segment[1];
|
|
80
|
-
sourceLine = segment[2];
|
|
81
|
-
sourceColumn = segment[3];
|
|
82
|
-
if (segment.length === 4) continue;
|
|
83
|
-
encodeInteger(writer, encodeSign(segment[4] - namesIndex));
|
|
84
|
-
namesIndex = segment[4];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return writer.flush();
|
|
88
|
-
}
|
|
1
|
+
/*! @fluixi/compiler v1.0.0-alpha.96 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
import {
|
|
3
|
+
encode
|
|
4
|
+
} from "./chunk-VX2OBUMB.mjs";
|
|
89
5
|
|
|
90
6
|
// ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
|
|
91
7
|
var BitSet = class _BitSet {
|
|
@@ -1079,6 +995,5 @@ var MagicString = class _MagicString {
|
|
|
1079
995
|
};
|
|
1080
996
|
|
|
1081
997
|
export {
|
|
1082
|
-
encode,
|
|
1083
998
|
MagicString
|
|
1084
999
|
};
|