@fluixi/compiler 1.0.0-alpha.83 → 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.cjs +62 -1
- package/dist/analyze/expr-shape.d.cts +14 -0
- package/dist/analyze/expr-shape.d.ts +2 -2
- package/dist/analyze/expr-shape.js +1 -1
- package/dist/analyze/expr-shape.mjs +41 -1
- package/dist/analyze/intrinsics.cjs +80 -1
- package/dist/analyze/intrinsics.d.cts +66 -0
- 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 +59 -1
- package/dist/analyze/paren.cjs +134 -0
- package/dist/analyze/paren.d.cts +23 -0
- package/dist/analyze/paren.d.ts +24 -0
- package/dist/analyze/paren.d.ts.map +1 -0
- package/dist/analyze/paren.js +168 -0
- package/dist/analyze/paren.mjs +113 -0
- package/dist/analyze/props-destructure.cjs +226 -1
- package/dist/analyze/props-destructure.d.cts +83 -0
- 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/props-destructure.mjs +205 -1
- package/dist/analyze/reactive-bindings.cjs +190 -1
- package/dist/analyze/reactive-bindings.d.cts +42 -0
- package/dist/analyze/reactive-bindings.d.ts +1 -1
- package/dist/analyze/reactive-bindings.js +2 -2
- package/dist/analyze/reactive-bindings.mjs +167 -1
- package/dist/analyze/reactive-expr.cjs +38 -1
- package/dist/analyze/reactive-expr.d.cts +38 -0
- 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/reactive-expr.mjs +17 -1
- package/dist/analyze/static-graph.cjs +811 -1
- package/dist/analyze/static-graph.d.cts +102 -0
- 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 +793 -1
- package/dist/babel-TGY76XJ7.mjs +636 -0
- package/dist/chunk-4PLHS2FP.mjs +158 -0
- package/dist/chunk-6DB5FXS4.mjs +1718 -0
- package/dist/chunk-F74GFKSL.mjs +16 -0
- package/dist/chunk-G6QC2WRJ.mjs +11 -0
- package/dist/chunk-RUDJDZAA.mjs +1078 -0
- package/dist/codegen/backend.cjs +18 -1
- package/dist/codegen/backend.d.cts +35 -0
- package/dist/codegen/backends/imperative.cjs +542 -1
- package/dist/codegen/backends/imperative.d.cts +11 -0
- package/dist/codegen/backends/imperative.d.ts +1 -1
- package/dist/codegen/backends/imperative.d.ts.map +1 -1
- package/dist/codegen/backends/imperative.js +24 -20
- package/dist/codegen/backends/imperative.mjs +519 -1
- package/dist/codegen/contract.cjs +52 -1
- package/dist/codegen/contract.d.cts +24 -0
- package/dist/codegen/contract.d.ts +2 -2
- package/dist/codegen/contract.js +2 -2
- package/dist/codegen/contract.mjs +31 -1
- package/dist/codegen/partial-template.cjs +176 -1
- package/dist/codegen/partial-template.d.cts +61 -0
- package/dist/codegen/partial-template.d.ts +4 -4
- package/dist/codegen/partial-template.js +0 -0
- package/dist/codegen/partial-template.mjs +153 -1
- package/dist/codegen/serialize-static.cjs +125 -1
- package/dist/codegen/serialize-static.d.cts +38 -0
- package/dist/codegen/serialize-static.d.ts +3 -3
- package/dist/codegen/serialize-static.js +6 -6
- package/dist/codegen/serialize-static.mjs +104 -1
- package/dist/frontend/babel/build-ir-lit.cjs +1509 -1
- package/dist/frontend/babel/build-ir-lit.d.cts +26 -0
- package/dist/frontend/babel/build-ir-lit.d.ts +2 -2
- package/dist/frontend/babel/build-ir-lit.mjs +1478 -1
- package/dist/frontend/babel/build-ir.cjs +1524 -1
- package/dist/frontend/babel/build-ir.d.cts +35 -0
- 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 +1495 -1
- package/dist/frontend/babel/index.cjs +2186 -1
- package/dist/frontend/babel/index.d.cts +33 -0
- package/dist/frontend/babel/index.d.ts +1 -1
- package/dist/frontend/babel/index.js +1 -1
- package/dist/frontend/babel/index.mjs +2156 -1
- package/dist/frontend/babel/lower-template.cjs +1507 -1
- package/dist/frontend/babel/lower-template.d.cts +23 -0
- 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 +1478 -1
- package/dist/frontend/babel/plugin.cjs +2132 -1
- package/dist/frontend/babel/plugin.d.cts +95 -0
- 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 +2103 -1
- package/dist/frontend/babel/server-functions.cjs +110 -1
- package/dist/frontend/babel/server-functions.d.cts +10 -0
- package/dist/frontend/babel/server-functions.mjs +89 -1
- package/dist/frontend/babel/types.cjs +18 -1
- package/dist/frontend/babel/types.d.cts +33 -0
- package/dist/frontend/types.cjs +18 -1
- package/dist/frontend/types.d.cts +25 -0
- package/dist/frontend/vocabulary.cjs +98 -0
- package/dist/frontend/vocabulary.d.cts +79 -0
- package/dist/frontend/vocabulary.d.ts +80 -0
- package/dist/frontend/vocabulary.d.ts.map +1 -0
- package/dist/frontend/vocabulary.js +124 -0
- package/dist/frontend/vocabulary.mjs +77 -0
- package/dist/index.cjs +1595 -14
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +1575 -14
- package/dist/integrations.cjs +4312 -26
- package/dist/integrations.d.cts +215 -0
- 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 +536 -18
- package/dist/ir/nodes.cjs +18 -1
- package/dist/ir/nodes.d.cts +168 -0
- package/dist/ir/nodes.d.ts +6 -6
- package/dist/lower/compile-template.cjs +1356 -1
- package/dist/lower/compile-template.d.cts +69 -0
- package/dist/lower/compile-template.d.ts +3 -3
- package/dist/lower/compile-template.js +1 -1
- package/dist/lower/compile-template.mjs +1336 -1
- package/dist/lower/jsx.cjs +529 -1
- package/dist/lower/jsx.d.cts +25 -0
- package/dist/lower/jsx.d.ts +1 -1
- package/dist/lower/jsx.d.ts.map +1 -1
- package/dist/lower/jsx.js +6 -5
- package/dist/lower/jsx.mjs +506 -1
- package/dist/lower/template.cjs +1061 -1
- package/dist/lower/template.d.cts +53 -0
- package/dist/lower/template.d.ts +3 -3
- package/dist/lower/template.d.ts.map +1 -1
- package/dist/lower/template.js +12 -11
- package/dist/lower/template.mjs +1042 -1
- package/dist/lower/text.cjs +42 -1
- package/dist/lower/text.d.cts +10 -0
- 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/lower/text.mjs +21 -1
- package/dist/optimize/analyze-static.cjs +112 -1
- package/dist/optimize/analyze-static.d.cts +39 -0
- package/dist/optimize/analyze-static.d.ts +2 -2
- package/dist/optimize/analyze-static.js +2 -2
- package/dist/optimize/analyze-static.mjs +91 -1
- package/dist/optimize/collapse-strategies.cjs +90 -1
- package/dist/optimize/collapse-strategies.d.cts +30 -0
- package/dist/optimize/collapse-strategies.d.ts +3 -3
- package/dist/optimize/collapse-strategies.mjs +67 -1
- package/dist/options.cjs +33 -1
- package/dist/options.d.cts +39 -0
- package/dist/options.d.ts +2 -2
- package/dist/options.mjs +12 -1
- package/dist/resolve/builtins.cjs +73 -1
- package/dist/resolve/builtins.d.cts +68 -0
- 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 +53 -1
- package/dist/resolve/component-globals.cjs +234 -14
- package/dist/resolve/component-globals.d.cts +80 -0
- package/dist/resolve/component-globals.d.ts +5 -5
- package/dist/resolve/component-globals.js +10 -10
- package/dist/resolve/component-globals.mjs +211 -14
- package/dist/resolve/component-resolver.cjs +80 -1
- package/dist/resolve/component-resolver.d.cts +68 -0
- 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/component-resolver.mjs +59 -1
- package/dist/resolve/load-directive.cjs +93 -1
- package/dist/resolve/load-directive.d.cts +53 -0
- package/dist/resolve/load-directive.d.ts +5 -5
- package/dist/resolve/load-directive.js +6 -6
- package/dist/resolve/load-directive.mjs +72 -1
- package/dist/resolve/resolve-ir.cjs +108 -1
- package/dist/resolve/resolve-ir.d.cts +53 -0
- 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/resolve-ir.mjs +85 -1
- package/dist/resolve/write-globals.cjs +319 -14
- package/dist/resolve/write-globals.d.cts +30 -0
- package/dist/resolve/write-globals.js +2 -2
- package/dist/resolve/write-globals.mjs +298 -14
- package/dist/server-fns-ZYWQTSZU.mjs +78 -0
- package/dist/server-functions-PCERFA7A.mjs +82 -0
- package/dist/transform/bindings.cjs +71 -1
- package/dist/transform/bindings.d.cts +16 -0
- package/dist/transform/bindings.d.ts +1 -1
- package/dist/transform/bindings.js +1 -1
- package/dist/transform/bindings.mjs +50 -1
- package/dist/transform/index.cjs +2732 -8
- package/dist/transform/index.d.cts +15 -0
- package/dist/transform/index.mjs +3773 -17
- package/dist/transform/intrinsics.cjs +216 -3
- package/dist/transform/intrinsics.d.cts +21 -0
- package/dist/transform/intrinsics.js +1 -1
- package/dist/transform/intrinsics.mjs +193 -3
- package/dist/transform/props.cjs +441 -3
- package/dist/transform/props.d.cts +45 -0
- 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/props.mjs +1482 -12
- package/dist/transform/server-fn-id.cjs +35 -1
- package/dist/transform/server-fn-id.d.cts +9 -0
- package/dist/transform/server-fn-id.d.ts +1 -1
- package/dist/transform/server-fn-id.js +2 -2
- package/dist/transform/server-fn-id.mjs +14 -1
- package/dist/transform/server-fns.cjs +114 -2
- package/dist/transform/server-fns.d.cts +12 -0
- package/dist/transform/server-fns.js +3 -3
- package/dist/transform/server-fns.mjs +1155 -11
- package/dist/transform/source-locations.cjs +330 -1
- package/dist/transform/source-locations.d.cts +43 -0
- package/dist/transform/source-locations.d.ts +1 -1
- package/dist/transform/source-locations.js +5 -5
- package/dist/transform/source-locations.mjs +307 -1
- package/dist/transform/templates.cjs +2701 -7
- package/dist/transform/templates.d.cts +69 -0
- 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 +3743 -16
- package/dist/transform-RWDTQUF5.mjs +893 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/dist/babel-VXKH6MRQ.mjs +0 -1
- package/dist/chunk-3SAEGOMQ.mjs +0 -1
- package/dist/chunk-5KMMN5QP.mjs +0 -1
- package/dist/chunk-IBRM4W7I.mjs +0 -10
- package/dist/chunk-OHHZCYIQ.mjs +0 -1
- package/dist/chunk-YKZ54NVE.mjs +0 -1
- package/dist/server-fns-6QM243HC.mjs +0 -2
- package/dist/server-functions-E3LKCZ4R.mjs +0 -1
- package/dist/transform-C4ZXRVGP.mjs +0 -8
package/dist/lower/text.cjs
CHANGED
|
@@ -1 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lower/text.ts
|
|
21
|
+
var text_exports = {};
|
|
22
|
+
__export(text_exports, {
|
|
23
|
+
cleanTemplateText: () => cleanTemplateText
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(text_exports);
|
|
26
|
+
function cleanTemplateText(value) {
|
|
27
|
+
const lines = value.split(/\r\n|\n|\r/);
|
|
28
|
+
let lastNonEmpty = 0;
|
|
29
|
+
for (let i = 0; i < lines.length; i++) {
|
|
30
|
+
if (/[^ \t]/.test(lines[i])) lastNonEmpty = i;
|
|
31
|
+
}
|
|
32
|
+
let out = "";
|
|
33
|
+
for (let i = 0; i < lines.length; i++) {
|
|
34
|
+
let line = lines[i].replace(/\t/g, " ");
|
|
35
|
+
if (i !== 0) line = line.replace(/^ +/, "");
|
|
36
|
+
if (i !== lines.length - 1) line = line.replace(/ +$/, "");
|
|
37
|
+
if (!line) continue;
|
|
38
|
+
if (i !== lastNonEmpty) line += " ";
|
|
39
|
+
out += line;
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whitespace handling for template text runs.
|
|
3
|
+
*
|
|
4
|
+
* JSX and `` html`...` `` collapse a text run the same way, the rule came from
|
|
5
|
+
* JSX and the template syntax adopted it so an author moving between the two
|
|
6
|
+
* gets the same output. It is pure string work with no parser in it, so it lives
|
|
7
|
+
* here rather than in a front-end, where both can reach it and neither owns it.
|
|
8
|
+
*/
|
|
9
|
+
/** Canonical JSX text cleaning: kept identical to plugin.ts cleanTemplateText. */
|
|
10
|
+
export declare function cleanTemplateText(value: string): string;
|
package/dist/lower/text.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whitespace handling for template text runs.
|
|
3
3
|
*
|
|
4
|
-
* JSX and `` html`...` `` collapse a text run the same way
|
|
4
|
+
* JSX and `` html`...` `` collapse a text run the same way, the rule came from
|
|
5
5
|
* JSX and the template syntax adopted it so an author moving between the two
|
|
6
6
|
* gets the same output. It is pure string work with no parser in it, so it lives
|
|
7
7
|
* here rather than in a front-end, where both can reach it and neither owns it.
|
|
8
8
|
*/
|
|
9
|
-
/** Canonical JSX text cleaning
|
|
9
|
+
/** Canonical JSX text cleaning: kept identical to plugin.ts cleanTemplateText. */
|
|
10
10
|
export declare function cleanTemplateText(value: string): string;
|
|
11
11
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/lower/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/lower/text.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/lower/text.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBvD"}
|
package/dist/lower/text.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whitespace handling for template text runs.
|
|
3
3
|
*
|
|
4
|
-
* JSX and `` html`...` `` collapse a text run the same way
|
|
4
|
+
* JSX and `` html`...` `` collapse a text run the same way, the rule came from
|
|
5
5
|
* JSX and the template syntax adopted it so an author moving between the two
|
|
6
6
|
* gets the same output. It is pure string work with no parser in it, so it lives
|
|
7
7
|
* here rather than in a front-end, where both can reach it and neither owns it.
|
|
8
8
|
*/
|
|
9
|
-
/** Canonical JSX text cleaning
|
|
9
|
+
/** Canonical JSX text cleaning: kept identical to plugin.ts cleanTemplateText. */
|
|
10
10
|
export function cleanTemplateText(value) {
|
|
11
11
|
const lines = value.split(/\r\n|\n|\r/);
|
|
12
12
|
let lastNonEmpty = 0;
|
package/dist/lower/text.mjs
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lower/text.ts
|
|
2
|
+
function cleanTemplateText(value) {
|
|
3
|
+
const lines = value.split(/\r\n|\n|\r/);
|
|
4
|
+
let lastNonEmpty = 0;
|
|
5
|
+
for (let i = 0; i < lines.length; i++) {
|
|
6
|
+
if (/[^ \t]/.test(lines[i])) lastNonEmpty = i;
|
|
7
|
+
}
|
|
8
|
+
let out = "";
|
|
9
|
+
for (let i = 0; i < lines.length; i++) {
|
|
10
|
+
let line = lines[i].replace(/\t/g, " ");
|
|
11
|
+
if (i !== 0) line = line.replace(/^ +/, "");
|
|
12
|
+
if (i !== lines.length - 1) line = line.replace(/ +$/, "");
|
|
13
|
+
if (!line) continue;
|
|
14
|
+
if (i !== lastNonEmpty) line += " ";
|
|
15
|
+
out += line;
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
cleanTemplateText
|
|
21
|
+
};
|
|
@@ -1 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/optimize/analyze-static.ts
|
|
21
|
+
var analyze_static_exports = {};
|
|
22
|
+
__export(analyze_static_exports, {
|
|
23
|
+
analyzeStatic: () => analyzeStatic,
|
|
24
|
+
staticRoots: () => staticRoots
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(analyze_static_exports);
|
|
27
|
+
function propReason(prop) {
|
|
28
|
+
switch (prop.kind) {
|
|
29
|
+
case "event":
|
|
30
|
+
return "event";
|
|
31
|
+
case "ref":
|
|
32
|
+
return "ref";
|
|
33
|
+
case "spread":
|
|
34
|
+
return "spread";
|
|
35
|
+
case "class":
|
|
36
|
+
case "style":
|
|
37
|
+
return "class-or-style-directive";
|
|
38
|
+
case "attr":
|
|
39
|
+
case "prop":
|
|
40
|
+
if (prop.reactive) return "reactive-prop";
|
|
41
|
+
if (prop.expr !== void 0) return "expression-prop";
|
|
42
|
+
return void 0;
|
|
43
|
+
/* c8 ignore next 2 */
|
|
44
|
+
default:
|
|
45
|
+
return "expression-prop";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function analyzeStatic(root) {
|
|
49
|
+
const staticElements = [];
|
|
50
|
+
const reasons = /* @__PURE__ */ new Map();
|
|
51
|
+
const visit = (node) => {
|
|
52
|
+
switch (node.kind) {
|
|
53
|
+
case "text":
|
|
54
|
+
return true;
|
|
55
|
+
case "expr":
|
|
56
|
+
return false;
|
|
57
|
+
case "component":
|
|
58
|
+
case "control":
|
|
59
|
+
for (const child of node.children) visit(child);
|
|
60
|
+
return false;
|
|
61
|
+
case "fragment":
|
|
62
|
+
for (const child of node.children) visit(child);
|
|
63
|
+
return false;
|
|
64
|
+
case "element": {
|
|
65
|
+
let childrenStatic = true;
|
|
66
|
+
for (const child of node.children) {
|
|
67
|
+
if (!visit(child)) childrenStatic = false;
|
|
68
|
+
}
|
|
69
|
+
let reason;
|
|
70
|
+
for (const prop of node.props) {
|
|
71
|
+
reason = propReason(prop);
|
|
72
|
+
if (reason) break;
|
|
73
|
+
}
|
|
74
|
+
if (!reason && !childrenStatic) {
|
|
75
|
+
reason = childReason(node);
|
|
76
|
+
}
|
|
77
|
+
node.static = !reason;
|
|
78
|
+
if (reason) reasons.set(node, reason);
|
|
79
|
+
else staticElements.push(node);
|
|
80
|
+
return node.static;
|
|
81
|
+
}
|
|
82
|
+
/* c8 ignore next 2 */
|
|
83
|
+
default:
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
for (const node of Array.isArray(root) ? root : [root]) visit(node);
|
|
88
|
+
return { staticElements, reasons };
|
|
89
|
+
}
|
|
90
|
+
function childReason(node) {
|
|
91
|
+
for (const child of node.children) {
|
|
92
|
+
if (child.kind === "expr") return "expression-child";
|
|
93
|
+
if (child.kind === "component") return "component-child";
|
|
94
|
+
if (child.kind === "control") return "control-child";
|
|
95
|
+
if (child.kind === "element" && !child.static) return "expression-child";
|
|
96
|
+
if (child.kind === "fragment") return "expression-child";
|
|
97
|
+
}
|
|
98
|
+
return "expression-child";
|
|
99
|
+
}
|
|
100
|
+
function staticRoots(root) {
|
|
101
|
+
const roots = [];
|
|
102
|
+
const visit = (node) => {
|
|
103
|
+
if (node.kind === "element" && node.static) {
|
|
104
|
+
roots.push(node);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const children = node.children;
|
|
108
|
+
if (children) for (const child of children) visit(child);
|
|
109
|
+
};
|
|
110
|
+
for (const node of Array.isArray(root) ? root : [root]) visit(node);
|
|
111
|
+
return roots;
|
|
112
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static analysis: mark the element subtrees that never change after creation.
|
|
3
|
+
*
|
|
4
|
+
* A static subtree can be built once as an HTML string and cloned per instance, instead
|
|
5
|
+
* of constructed an element at a time. That is the difference between one `cloneNode`
|
|
6
|
+
* and N `createElement` + N `spread` calls: measured at 2.1x faster for a three-element
|
|
7
|
+
* row and 2.4x for a nine-element card, with the gap widening as components grow.
|
|
8
|
+
*
|
|
9
|
+
* `IRElement.static` has existed since the IR was written, documented as
|
|
10
|
+
* "subtree has no dynamic parts → hoistable (template-clone)", but was hardcoded `false`
|
|
11
|
+
* with no producer. This is the producer.
|
|
12
|
+
*
|
|
13
|
+
* The analysis is deliberately conservative: marking something static that is not is a
|
|
14
|
+
* correctness bug (a shared DOM node across renders), while missing one is only a lost
|
|
15
|
+
* optimisation. Anything not positively known to be inert makes its whole ancestry
|
|
16
|
+
* dynamic.
|
|
17
|
+
*/
|
|
18
|
+
import type { IRNode, IRElement } from '../ir/nodes.cjs';
|
|
19
|
+
/** Why a subtree could not be treated as static. Useful for diagnostics and tests. */
|
|
20
|
+
export type DynamicReason = 'reactive-prop' | 'expression-prop' | 'event' | 'ref' | 'spread' | 'class-or-style-directive' | 'expression-child' | 'component-child' | 'control-child';
|
|
21
|
+
export interface StaticReport {
|
|
22
|
+
/** Elements marked static, in visit order. */
|
|
23
|
+
staticElements: IRElement[];
|
|
24
|
+
/** Why each non-static element was rejected, keyed by the element node. */
|
|
25
|
+
reasons: Map<IRElement, DynamicReason>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mark every static element in the tree, returning what was decided.
|
|
29
|
+
*
|
|
30
|
+
* Mutates `IRElement.static` in place, since that field is the contract codegen reads.
|
|
31
|
+
*/
|
|
32
|
+
export declare function analyzeStatic(root: IRNode | IRNode[]): StaticReport;
|
|
33
|
+
/**
|
|
34
|
+
* The outermost static elements: the roots worth turning into templates.
|
|
35
|
+
*
|
|
36
|
+
* Cloning a static child of a static parent is wasted: the parent's template already
|
|
37
|
+
* contains it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function staticRoots(root: IRNode | IRNode[]): IRElement[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A static subtree can be built once as an HTML string and cloned per instance, instead
|
|
5
5
|
* of constructed an element at a time. That is the difference between one `cloneNode`
|
|
6
|
-
* and N `createElement` + N `spread` calls
|
|
6
|
+
* and N `createElement` + N `spread` calls: measured at 2.1x faster for a three-element
|
|
7
7
|
* row and 2.4x for a nine-element card, with the gap widening as components grow.
|
|
8
8
|
*
|
|
9
9
|
* `IRElement.static` has existed since the IR was written, documented as
|
|
@@ -31,7 +31,7 @@ export interface StaticReport {
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function analyzeStatic(root: IRNode | IRNode[]): StaticReport;
|
|
33
33
|
/**
|
|
34
|
-
* The outermost static elements
|
|
34
|
+
* The outermost static elements: the roots worth turning into templates.
|
|
35
35
|
*
|
|
36
36
|
* Cloning a static child of a static parent is wasted: the parent's template already
|
|
37
37
|
* contains it.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A prop is inert only when it is a plain attribute or property with a literal value.
|
|
3
3
|
*
|
|
4
4
|
* `expr` means arbitrary JS, which may read a signal or allocate, so it is dynamic even
|
|
5
|
-
* when `reactive` is false
|
|
5
|
+
* when `reactive` is false: a non-reactive expression still has to run per instance.
|
|
6
6
|
*/
|
|
7
7
|
function propReason(prop) {
|
|
8
8
|
switch (prop.kind) {
|
|
@@ -108,7 +108,7 @@ function childReason(node) {
|
|
|
108
108
|
return 'expression-child';
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
-
* The outermost static elements
|
|
111
|
+
* The outermost static elements: the roots worth turning into templates.
|
|
112
112
|
*
|
|
113
113
|
* Cloning a static child of a static parent is wasted: the parent's template already
|
|
114
114
|
* contains it.
|
|
@@ -1 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
// src/optimize/analyze-static.ts
|
|
2
|
+
function propReason(prop) {
|
|
3
|
+
switch (prop.kind) {
|
|
4
|
+
case "event":
|
|
5
|
+
return "event";
|
|
6
|
+
case "ref":
|
|
7
|
+
return "ref";
|
|
8
|
+
case "spread":
|
|
9
|
+
return "spread";
|
|
10
|
+
case "class":
|
|
11
|
+
case "style":
|
|
12
|
+
return "class-or-style-directive";
|
|
13
|
+
case "attr":
|
|
14
|
+
case "prop":
|
|
15
|
+
if (prop.reactive) return "reactive-prop";
|
|
16
|
+
if (prop.expr !== void 0) return "expression-prop";
|
|
17
|
+
return void 0;
|
|
18
|
+
/* c8 ignore next 2 */
|
|
19
|
+
default:
|
|
20
|
+
return "expression-prop";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function analyzeStatic(root) {
|
|
24
|
+
const staticElements = [];
|
|
25
|
+
const reasons = /* @__PURE__ */ new Map();
|
|
26
|
+
const visit = (node) => {
|
|
27
|
+
switch (node.kind) {
|
|
28
|
+
case "text":
|
|
29
|
+
return true;
|
|
30
|
+
case "expr":
|
|
31
|
+
return false;
|
|
32
|
+
case "component":
|
|
33
|
+
case "control":
|
|
34
|
+
for (const child of node.children) visit(child);
|
|
35
|
+
return false;
|
|
36
|
+
case "fragment":
|
|
37
|
+
for (const child of node.children) visit(child);
|
|
38
|
+
return false;
|
|
39
|
+
case "element": {
|
|
40
|
+
let childrenStatic = true;
|
|
41
|
+
for (const child of node.children) {
|
|
42
|
+
if (!visit(child)) childrenStatic = false;
|
|
43
|
+
}
|
|
44
|
+
let reason;
|
|
45
|
+
for (const prop of node.props) {
|
|
46
|
+
reason = propReason(prop);
|
|
47
|
+
if (reason) break;
|
|
48
|
+
}
|
|
49
|
+
if (!reason && !childrenStatic) {
|
|
50
|
+
reason = childReason(node);
|
|
51
|
+
}
|
|
52
|
+
node.static = !reason;
|
|
53
|
+
if (reason) reasons.set(node, reason);
|
|
54
|
+
else staticElements.push(node);
|
|
55
|
+
return node.static;
|
|
56
|
+
}
|
|
57
|
+
/* c8 ignore next 2 */
|
|
58
|
+
default:
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
for (const node of Array.isArray(root) ? root : [root]) visit(node);
|
|
63
|
+
return { staticElements, reasons };
|
|
64
|
+
}
|
|
65
|
+
function childReason(node) {
|
|
66
|
+
for (const child of node.children) {
|
|
67
|
+
if (child.kind === "expr") return "expression-child";
|
|
68
|
+
if (child.kind === "component") return "component-child";
|
|
69
|
+
if (child.kind === "control") return "control-child";
|
|
70
|
+
if (child.kind === "element" && !child.static) return "expression-child";
|
|
71
|
+
if (child.kind === "fragment") return "expression-child";
|
|
72
|
+
}
|
|
73
|
+
return "expression-child";
|
|
74
|
+
}
|
|
75
|
+
function staticRoots(root) {
|
|
76
|
+
const roots = [];
|
|
77
|
+
const visit = (node) => {
|
|
78
|
+
if (node.kind === "element" && node.static) {
|
|
79
|
+
roots.push(node);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const children = node.children;
|
|
83
|
+
if (children) for (const child of children) visit(child);
|
|
84
|
+
};
|
|
85
|
+
for (const node of Array.isArray(root) ? root : [root]) visit(node);
|
|
86
|
+
return roots;
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
analyzeStatic,
|
|
90
|
+
staticRoots
|
|
91
|
+
};
|
|
@@ -1 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/optimize/collapse-strategies.ts
|
|
21
|
+
var collapse_strategies_exports = {};
|
|
22
|
+
__export(collapse_strategies_exports, {
|
|
23
|
+
collapseStrategies: () => collapseStrategies
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(collapse_strategies_exports);
|
|
26
|
+
|
|
27
|
+
// src/resolve/load-directive.ts
|
|
28
|
+
function isDeferred(strategy) {
|
|
29
|
+
return strategy.kind !== "eager" && strategy.kind !== "never";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/resolve/builtins.ts
|
|
33
|
+
var DOM_CONTROL_FLOW = [
|
|
34
|
+
"Show",
|
|
35
|
+
"For",
|
|
36
|
+
"Index",
|
|
37
|
+
"Switch",
|
|
38
|
+
"Match",
|
|
39
|
+
"Portal",
|
|
40
|
+
"Dynamic",
|
|
41
|
+
"ErrorBoundary"
|
|
42
|
+
];
|
|
43
|
+
var CORE_CONTROL_FLOW = ["Suspense", "SuspenseList", "Await"];
|
|
44
|
+
var ROUTER_COMPONENTS = ["Router", "Outlet", "Redirect", "Link"];
|
|
45
|
+
var BUILTIN_COMPONENTS = [
|
|
46
|
+
...DOM_CONTROL_FLOW,
|
|
47
|
+
...CORE_CONTROL_FLOW,
|
|
48
|
+
...ROUTER_COMPONENTS
|
|
49
|
+
];
|
|
50
|
+
var RESERVED_COMPONENTS = /* @__PURE__ */ new Set([
|
|
51
|
+
...DOM_CONTROL_FLOW,
|
|
52
|
+
...CORE_CONTROL_FLOW
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
// src/resolve/resolve-ir.ts
|
|
56
|
+
function walk(root, visit) {
|
|
57
|
+
const nodes = Array.isArray(root) ? root : [root];
|
|
58
|
+
for (const node of nodes) {
|
|
59
|
+
visit(node);
|
|
60
|
+
const children = node.children;
|
|
61
|
+
if (children) walk(children, visit);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/optimize/collapse-strategies.ts
|
|
66
|
+
function collapseStrategies(root) {
|
|
67
|
+
const components = [];
|
|
68
|
+
walk(root, (node) => {
|
|
69
|
+
if (node.kind === "component" && node.source) components.push(node);
|
|
70
|
+
});
|
|
71
|
+
const eager = /* @__PURE__ */ new Set();
|
|
72
|
+
const never = /* @__PURE__ */ new Set();
|
|
73
|
+
for (const node of components) {
|
|
74
|
+
const { module: module2, loading } = node.source;
|
|
75
|
+
if (loading.kind === "eager") eager.add(module2);
|
|
76
|
+
if (loading.kind === "never") never.add(module2);
|
|
77
|
+
}
|
|
78
|
+
const collapsed = /* @__PURE__ */ new Map();
|
|
79
|
+
for (const node of components) {
|
|
80
|
+
const source = node.source;
|
|
81
|
+
if (!isDeferred(source.loading)) continue;
|
|
82
|
+
if (!eager.has(source.module)) continue;
|
|
83
|
+
source.loading = { kind: "eager" };
|
|
84
|
+
collapsed.set(source.module, (collapsed.get(source.module) ?? 0) + 1);
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
collapsed,
|
|
88
|
+
conflicted: [...never].filter((m) => eager.has(m))
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy collapsing: demote a deferred reference whose module is already present.
|
|
3
|
+
*
|
|
4
|
+
* This is not a nice-to-have. Without it the naive feature is a regression: if a module
|
|
5
|
+
* is referenced eagerly anywhere in the compilation unit, it is in the parent chunk
|
|
6
|
+
* already, so a `load:visible` boundary elsewhere adds a wrapper, a promise and a
|
|
7
|
+
* re-render in order to fetch nothing. The bytes are paid twice, once in the chunk,
|
|
8
|
+
* once in the deferral machinery: and the component renders later than it needs to.
|
|
9
|
+
*
|
|
10
|
+
* Collapsing runs per module, not per component name, because a chunk is a module:
|
|
11
|
+
* `<Button>` eager and `<ButtonGroup load:visible>` from the same package means the
|
|
12
|
+
* package is already loaded, so deferring the second buys nothing.
|
|
13
|
+
*
|
|
14
|
+
* `never` is not collapsed. It means "no client code at all", which is a statement about
|
|
15
|
+
* what should exist rather than about when to fetch it; an eager sibling does not make a
|
|
16
|
+
* server-only component suddenly belong in the client bundle. That combination is
|
|
17
|
+
* contradictory and reported instead.
|
|
18
|
+
*/
|
|
19
|
+
import type { IRNode } from '../ir/nodes.cjs';
|
|
20
|
+
export interface CollapseReport {
|
|
21
|
+
/** Modules demoted to eager, with the reference count that was demoted. */
|
|
22
|
+
collapsed: Map<string, number>;
|
|
23
|
+
/**
|
|
24
|
+
* Modules referenced both as `load:never` and in a way that needs client code.
|
|
25
|
+
* Contradictory rather than optimisable, so it is reported and left alone.
|
|
26
|
+
*/
|
|
27
|
+
conflicted: string[];
|
|
28
|
+
}
|
|
29
|
+
/** Demote deferred references to modules that are already in the chunk. */
|
|
30
|
+
export declare function collapseStrategies(root: IRNode | IRNode[]): CollapseReport;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Strategy collapsing
|
|
2
|
+
* Strategy collapsing: demote a deferred reference whose module is already present.
|
|
3
3
|
*
|
|
4
4
|
* This is not a nice-to-have. Without it the naive feature is a regression: if a module
|
|
5
5
|
* is referenced eagerly anywhere in the compilation unit, it is in the parent chunk
|
|
6
6
|
* already, so a `load:visible` boundary elsewhere adds a wrapper, a promise and a
|
|
7
|
-
* re-render in order to fetch nothing. The bytes are paid twice
|
|
8
|
-
* once in the deferral machinery
|
|
7
|
+
* re-render in order to fetch nothing. The bytes are paid twice, once in the chunk,
|
|
8
|
+
* once in the deferral machinery: and the component renders later than it needs to.
|
|
9
9
|
*
|
|
10
10
|
* Collapsing runs per module, not per component name, because a chunk is a module:
|
|
11
11
|
* `<Button>` eager and `<ButtonGroup load:visible>` from the same package means the
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
// src/resolve/load-directive.ts
|
|
2
|
+
function isDeferred(strategy) {
|
|
3
|
+
return strategy.kind !== "eager" && strategy.kind !== "never";
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// src/resolve/builtins.ts
|
|
7
|
+
var DOM_CONTROL_FLOW = [
|
|
8
|
+
"Show",
|
|
9
|
+
"For",
|
|
10
|
+
"Index",
|
|
11
|
+
"Switch",
|
|
12
|
+
"Match",
|
|
13
|
+
"Portal",
|
|
14
|
+
"Dynamic",
|
|
15
|
+
"ErrorBoundary"
|
|
16
|
+
];
|
|
17
|
+
var CORE_CONTROL_FLOW = ["Suspense", "SuspenseList", "Await"];
|
|
18
|
+
var ROUTER_COMPONENTS = ["Router", "Outlet", "Redirect", "Link"];
|
|
19
|
+
var BUILTIN_COMPONENTS = [
|
|
20
|
+
...DOM_CONTROL_FLOW,
|
|
21
|
+
...CORE_CONTROL_FLOW,
|
|
22
|
+
...ROUTER_COMPONENTS
|
|
23
|
+
];
|
|
24
|
+
var RESERVED_COMPONENTS = /* @__PURE__ */ new Set([
|
|
25
|
+
...DOM_CONTROL_FLOW,
|
|
26
|
+
...CORE_CONTROL_FLOW
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
// src/resolve/resolve-ir.ts
|
|
30
|
+
function walk(root, visit) {
|
|
31
|
+
const nodes = Array.isArray(root) ? root : [root];
|
|
32
|
+
for (const node of nodes) {
|
|
33
|
+
visit(node);
|
|
34
|
+
const children = node.children;
|
|
35
|
+
if (children) walk(children, visit);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/optimize/collapse-strategies.ts
|
|
40
|
+
function collapseStrategies(root) {
|
|
41
|
+
const components = [];
|
|
42
|
+
walk(root, (node) => {
|
|
43
|
+
if (node.kind === "component" && node.source) components.push(node);
|
|
44
|
+
});
|
|
45
|
+
const eager = /* @__PURE__ */ new Set();
|
|
46
|
+
const never = /* @__PURE__ */ new Set();
|
|
47
|
+
for (const node of components) {
|
|
48
|
+
const { module, loading } = node.source;
|
|
49
|
+
if (loading.kind === "eager") eager.add(module);
|
|
50
|
+
if (loading.kind === "never") never.add(module);
|
|
51
|
+
}
|
|
52
|
+
const collapsed = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const node of components) {
|
|
54
|
+
const source = node.source;
|
|
55
|
+
if (!isDeferred(source.loading)) continue;
|
|
56
|
+
if (!eager.has(source.module)) continue;
|
|
57
|
+
source.loading = { kind: "eager" };
|
|
58
|
+
collapsed.set(source.module, (collapsed.get(source.module) ?? 0) + 1);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
collapsed,
|
|
62
|
+
conflicted: [...never].filter((m) => eager.has(m))
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
collapseStrategies
|
|
67
|
+
};
|
package/dist/options.cjs
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/options.ts
|
|
21
|
+
var options_exports = {};
|
|
22
|
+
__export(options_exports, {
|
|
23
|
+
defaultOptions: () => defaultOptions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(options_exports);
|
|
26
|
+
var defaultOptions = {
|
|
27
|
+
backend: "imperative",
|
|
28
|
+
moduleName: "@fluixi/dom",
|
|
29
|
+
delegateEvents: true,
|
|
30
|
+
hydratable: false,
|
|
31
|
+
sourceMaps: true,
|
|
32
|
+
dev: false
|
|
33
|
+
};
|