@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
|
@@ -1 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
// src/resolve/component-resolver.ts
|
|
2
|
+
var isMapRule = (rule) => "components" in rule;
|
|
3
|
+
function substitute(template, match) {
|
|
4
|
+
return template.replace(/\$(\d+)/g, (whole, index) => {
|
|
5
|
+
const group = match[Number(index)];
|
|
6
|
+
return group ?? whole;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function normalise(name, entry) {
|
|
10
|
+
return typeof entry === "string" ? { module: entry, export: name } : entry;
|
|
11
|
+
}
|
|
12
|
+
function createComponentResolver(rules = []) {
|
|
13
|
+
const exact = /* @__PURE__ */ new Map();
|
|
14
|
+
const conflicts = [];
|
|
15
|
+
const patterns = [];
|
|
16
|
+
for (const rule of rules) {
|
|
17
|
+
if (!isMapRule(rule)) {
|
|
18
|
+
patterns.push(rule);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
for (const [name, entry] of Object.entries(rule.components)) {
|
|
22
|
+
const resolved = normalise(name, entry);
|
|
23
|
+
const existing = exact.get(name);
|
|
24
|
+
if (existing && existing.module !== resolved.module) {
|
|
25
|
+
const conflict = conflicts.find((c) => c.name === name);
|
|
26
|
+
if (conflict) conflict.modules.push(resolved.module);
|
|
27
|
+
else conflicts.push({ name, modules: [existing.module, resolved.module] });
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
exact.set(name, resolved);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const cache = /* @__PURE__ */ new Map();
|
|
34
|
+
const resolve = (name) => {
|
|
35
|
+
if (cache.has(name)) return cache.get(name);
|
|
36
|
+
let result = exact.get(name);
|
|
37
|
+
if (!result) {
|
|
38
|
+
for (const rule of patterns) {
|
|
39
|
+
const match = name.match(new RegExp(rule.match.source, rule.match.flags.replace("g", "")));
|
|
40
|
+
if (!match) continue;
|
|
41
|
+
result = {
|
|
42
|
+
module: substitute(rule.module, match),
|
|
43
|
+
export: rule.export ? substitute(rule.export, match) : name
|
|
44
|
+
};
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
cache.set(name, result);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
resolve,
|
|
53
|
+
names: () => [...exact.keys()],
|
|
54
|
+
conflicts: () => conflicts
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
createComponentResolver
|
|
59
|
+
};
|
|
@@ -1 +1,93 @@
|
|
|
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/resolve/load-directive.ts
|
|
21
|
+
var load_directive_exports = {};
|
|
22
|
+
__export(load_directive_exports, {
|
|
23
|
+
DEFAULT_INTERACTION_EVENTS: () => DEFAULT_INTERACTION_EVENTS,
|
|
24
|
+
EAGER: () => EAGER,
|
|
25
|
+
LoadDirectiveError: () => LoadDirectiveError,
|
|
26
|
+
isDeferred: () => isDeferred,
|
|
27
|
+
isLoadDirective: () => isLoadDirective,
|
|
28
|
+
parseLoadDirective: () => parseLoadDirective,
|
|
29
|
+
strategyKey: () => strategyKey
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(load_directive_exports);
|
|
32
|
+
var EAGER = { kind: "eager" };
|
|
33
|
+
var DEFAULT_INTERACTION_EVENTS = ["pointerdown", "focusin", "keydown"];
|
|
34
|
+
var STRATEGIES = /* @__PURE__ */ new Set(["eager", "idle", "visible", "interaction", "media", "never"]);
|
|
35
|
+
var LoadDirectiveError = class extends Error {
|
|
36
|
+
};
|
|
37
|
+
function isLoadDirective(name) {
|
|
38
|
+
return name.startsWith("load:");
|
|
39
|
+
}
|
|
40
|
+
function parseLoadDirective(name, value) {
|
|
41
|
+
const strategy = name.slice("load:".length);
|
|
42
|
+
if (!STRATEGIES.has(strategy)) {
|
|
43
|
+
throw new LoadDirectiveError(
|
|
44
|
+
`Unknown load strategy 'load:${strategy}'. Expected one of ${[...STRATEGIES].join(", ")}.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
switch (strategy) {
|
|
48
|
+
case "eager":
|
|
49
|
+
return EAGER;
|
|
50
|
+
case "idle":
|
|
51
|
+
return { kind: "idle" };
|
|
52
|
+
case "never":
|
|
53
|
+
return { kind: "never" };
|
|
54
|
+
case "visible":
|
|
55
|
+
return value ? { kind: "visible", rootMargin: value } : { kind: "visible" };
|
|
56
|
+
case "interaction":
|
|
57
|
+
return {
|
|
58
|
+
kind: "interaction",
|
|
59
|
+
events: value ? splitEvents(value) : [...DEFAULT_INTERACTION_EVENTS]
|
|
60
|
+
};
|
|
61
|
+
case "media":
|
|
62
|
+
if (!value) {
|
|
63
|
+
throw new LoadDirectiveError(
|
|
64
|
+
`'load:media' needs a query, e.g. load:media="(min-width: 1024px)".`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return { kind: "media", query: value };
|
|
68
|
+
default:
|
|
69
|
+
throw new LoadDirectiveError(`Unhandled load strategy '${strategy}'.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function splitEvents(value) {
|
|
73
|
+
const events = value.split(/[\s,]+/).map((e) => e.trim()).filter(Boolean);
|
|
74
|
+
if (events.length === 0) {
|
|
75
|
+
throw new LoadDirectiveError(`'load:interaction' was given no event names.`);
|
|
76
|
+
}
|
|
77
|
+
return events;
|
|
78
|
+
}
|
|
79
|
+
function isDeferred(strategy) {
|
|
80
|
+
return strategy.kind !== "eager" && strategy.kind !== "never";
|
|
81
|
+
}
|
|
82
|
+
function strategyKey(strategy) {
|
|
83
|
+
switch (strategy.kind) {
|
|
84
|
+
case "visible":
|
|
85
|
+
return `visible:${strategy.rootMargin ?? ""}`;
|
|
86
|
+
case "interaction":
|
|
87
|
+
return `interaction:${[...strategy.events].sort().join(",")}`;
|
|
88
|
+
case "media":
|
|
89
|
+
return `media:${strategy.query}`;
|
|
90
|
+
default:
|
|
91
|
+
return strategy.kind;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
|
+
*
|
|
4
|
+
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
|
+
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
|
+
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
|
+
*
|
|
10
|
+
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
|
+
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
|
+
*
|
|
13
|
+
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
|
+
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
|
+
*/
|
|
17
|
+
/** When a component's module is fetched. */
|
|
18
|
+
export type IRLoadStrategy = {
|
|
19
|
+
kind: 'eager';
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'idle';
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'visible';
|
|
24
|
+
rootMargin?: string;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'interaction';
|
|
27
|
+
events: string[];
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'media';
|
|
30
|
+
query: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'never';
|
|
33
|
+
};
|
|
34
|
+
/** Everything is eager unless a directive says otherwise. */
|
|
35
|
+
export declare const EAGER: IRLoadStrategy;
|
|
36
|
+
/** Events that trigger an `interaction` load when none are named. */
|
|
37
|
+
export declare const DEFAULT_INTERACTION_EVENTS: readonly ["pointerdown", "focusin", "keydown"];
|
|
38
|
+
export declare class LoadDirectiveError extends Error {
|
|
39
|
+
}
|
|
40
|
+
/** True for an attribute name in the `load:` namespace. */
|
|
41
|
+
export declare function isLoadDirective(name: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
|
+
*
|
|
45
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
|
+
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
47
|
+
* because it decides how the module is emitted, and a runtime value cannot.
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseLoadDirective(name: string, value: string | null): IRLoadStrategy;
|
|
50
|
+
/** True when the strategy means "not in the parent chunk". */
|
|
51
|
+
export declare function isDeferred(strategy: IRLoadStrategy): boolean;
|
|
52
|
+
/** A stable key for grouping references that share a strategy. */
|
|
53
|
+
export declare function strategyKey(strategy: IRLoadStrategy): string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `load:` directive
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
3
|
*
|
|
4
4
|
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
5
|
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
6
|
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
-
* wait for the viewport is a property of the usage. Fusing them
|
|
8
|
-
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
9
|
*
|
|
10
10
|
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
11
|
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
12
|
*
|
|
13
13
|
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
-
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
15
|
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
16
|
*/
|
|
17
17
|
/** When a component's module is fetched. */
|
|
@@ -42,7 +42,7 @@ export declare function isLoadDirective(name: string): boolean;
|
|
|
42
42
|
/**
|
|
43
43
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
44
44
|
*
|
|
45
|
-
* `value` is the attribute's literal text
|
|
45
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
46
46
|
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
47
47
|
* because it decides how the module is emitted, and a runtime value cannot.
|
|
48
48
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `load:` directive
|
|
2
|
+
* The `load:` directive: when a component's code is fetched.
|
|
3
3
|
*
|
|
4
4
|
* Resolution decides *where* a component comes from; this decides *when*. They are
|
|
5
5
|
* separate because they vary independently: the location of `<RevenueChart>` is the
|
|
6
6
|
* same everywhere and belongs in config, while whether this particular usage should
|
|
7
|
-
* wait for the viewport is a property of the usage. Fusing them
|
|
8
|
-
|
|
7
|
+
* wait for the viewport is a property of the usage. Fusing them, `<Chart lazy="./Chart">`
|
|
8
|
+
*: was rejected for exactly that reason.
|
|
9
9
|
*
|
|
10
10
|
* `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
|
|
11
11
|
* collide with a real prop and the parser already has a directive taxonomy to hang it on.
|
|
12
12
|
*
|
|
13
13
|
* One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
|
|
14
|
-
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node
|
|
14
|
+
* so JSX needs no parser change, and the html`` path produces a `LoadDirective` node ,
|
|
15
15
|
* but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
|
|
16
16
|
*/
|
|
17
17
|
/** Everything is eager unless a directive says otherwise. */
|
|
@@ -28,7 +28,7 @@ export function isLoadDirective(name) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Parse `load:<strategy>` plus its optional value into a strategy.
|
|
30
30
|
*
|
|
31
|
-
* `value` is the attribute's literal text
|
|
31
|
+
* `value` is the attribute's literal text: `load:visible="200px"`, or null for a bare
|
|
32
32
|
* directive. A `${…}` hole is rejected: the strategy has to be known at compile time
|
|
33
33
|
* because it decides how the module is emitted, and a runtime value cannot.
|
|
34
34
|
*/
|
|
@@ -46,7 +46,7 @@ export function parseLoadDirective(name, value) {
|
|
|
46
46
|
return { kind: 'never' };
|
|
47
47
|
case 'visible':
|
|
48
48
|
// `load:visible="200px"` starts the fetch before the element reaches the
|
|
49
|
-
// viewport, which is usually what you want
|
|
49
|
+
// viewport, which is usually what you want, arriving exactly on intersection
|
|
50
50
|
// means the user waits for the network.
|
|
51
51
|
return value ? { kind: 'visible', rootMargin: value } : { kind: 'visible' };
|
|
52
52
|
case 'interaction':
|
|
@@ -1 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
// src/resolve/load-directive.ts
|
|
2
|
+
var EAGER = { kind: "eager" };
|
|
3
|
+
var DEFAULT_INTERACTION_EVENTS = ["pointerdown", "focusin", "keydown"];
|
|
4
|
+
var STRATEGIES = /* @__PURE__ */ new Set(["eager", "idle", "visible", "interaction", "media", "never"]);
|
|
5
|
+
var LoadDirectiveError = class extends Error {
|
|
6
|
+
};
|
|
7
|
+
function isLoadDirective(name) {
|
|
8
|
+
return name.startsWith("load:");
|
|
9
|
+
}
|
|
10
|
+
function parseLoadDirective(name, value) {
|
|
11
|
+
const strategy = name.slice("load:".length);
|
|
12
|
+
if (!STRATEGIES.has(strategy)) {
|
|
13
|
+
throw new LoadDirectiveError(
|
|
14
|
+
`Unknown load strategy 'load:${strategy}'. Expected one of ${[...STRATEGIES].join(", ")}.`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
switch (strategy) {
|
|
18
|
+
case "eager":
|
|
19
|
+
return EAGER;
|
|
20
|
+
case "idle":
|
|
21
|
+
return { kind: "idle" };
|
|
22
|
+
case "never":
|
|
23
|
+
return { kind: "never" };
|
|
24
|
+
case "visible":
|
|
25
|
+
return value ? { kind: "visible", rootMargin: value } : { kind: "visible" };
|
|
26
|
+
case "interaction":
|
|
27
|
+
return {
|
|
28
|
+
kind: "interaction",
|
|
29
|
+
events: value ? splitEvents(value) : [...DEFAULT_INTERACTION_EVENTS]
|
|
30
|
+
};
|
|
31
|
+
case "media":
|
|
32
|
+
if (!value) {
|
|
33
|
+
throw new LoadDirectiveError(
|
|
34
|
+
`'load:media' needs a query, e.g. load:media="(min-width: 1024px)".`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return { kind: "media", query: value };
|
|
38
|
+
default:
|
|
39
|
+
throw new LoadDirectiveError(`Unhandled load strategy '${strategy}'.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function splitEvents(value) {
|
|
43
|
+
const events = value.split(/[\s,]+/).map((e) => e.trim()).filter(Boolean);
|
|
44
|
+
if (events.length === 0) {
|
|
45
|
+
throw new LoadDirectiveError(`'load:interaction' was given no event names.`);
|
|
46
|
+
}
|
|
47
|
+
return events;
|
|
48
|
+
}
|
|
49
|
+
function isDeferred(strategy) {
|
|
50
|
+
return strategy.kind !== "eager" && strategy.kind !== "never";
|
|
51
|
+
}
|
|
52
|
+
function strategyKey(strategy) {
|
|
53
|
+
switch (strategy.kind) {
|
|
54
|
+
case "visible":
|
|
55
|
+
return `visible:${strategy.rootMargin ?? ""}`;
|
|
56
|
+
case "interaction":
|
|
57
|
+
return `interaction:${[...strategy.events].sort().join(",")}`;
|
|
58
|
+
case "media":
|
|
59
|
+
return `media:${strategy.query}`;
|
|
60
|
+
default:
|
|
61
|
+
return strategy.kind;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
DEFAULT_INTERACTION_EVENTS,
|
|
66
|
+
EAGER,
|
|
67
|
+
LoadDirectiveError,
|
|
68
|
+
isDeferred,
|
|
69
|
+
isLoadDirective,
|
|
70
|
+
parseLoadDirective,
|
|
71
|
+
strategyKey
|
|
72
|
+
};
|
|
@@ -1 +1,108 @@
|
|
|
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/resolve/resolve-ir.ts
|
|
21
|
+
var resolve_ir_exports = {};
|
|
22
|
+
__export(resolve_ir_exports, {
|
|
23
|
+
resolveComponentSources: () => resolveComponentSources,
|
|
24
|
+
walk: () => walk
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(resolve_ir_exports);
|
|
27
|
+
|
|
28
|
+
// src/resolve/builtins.ts
|
|
29
|
+
var DOM_CONTROL_FLOW = [
|
|
30
|
+
"Show",
|
|
31
|
+
"For",
|
|
32
|
+
"Index",
|
|
33
|
+
"Switch",
|
|
34
|
+
"Match",
|
|
35
|
+
"Portal",
|
|
36
|
+
"Dynamic",
|
|
37
|
+
"ErrorBoundary"
|
|
38
|
+
];
|
|
39
|
+
var CORE_CONTROL_FLOW = ["Suspense", "SuspenseList", "Await"];
|
|
40
|
+
var ROUTER_COMPONENTS = ["Router", "Outlet", "Redirect", "Link"];
|
|
41
|
+
var BUILTIN_COMPONENTS = [
|
|
42
|
+
...DOM_CONTROL_FLOW,
|
|
43
|
+
...CORE_CONTROL_FLOW,
|
|
44
|
+
...ROUTER_COMPONENTS
|
|
45
|
+
];
|
|
46
|
+
var RESERVED_COMPONENTS = /* @__PURE__ */ new Set([
|
|
47
|
+
...DOM_CONTROL_FLOW,
|
|
48
|
+
...CORE_CONTROL_FLOW
|
|
49
|
+
]);
|
|
50
|
+
function builtinComponentMap(modules = {}) {
|
|
51
|
+
const {
|
|
52
|
+
controlFlowModule = "@fluixi/dom",
|
|
53
|
+
coreModule = "@fluixi/core",
|
|
54
|
+
routerModule = "@fluixi/core/router"
|
|
55
|
+
} = modules;
|
|
56
|
+
const map = {};
|
|
57
|
+
for (const name of DOM_CONTROL_FLOW) map[name] = controlFlowModule;
|
|
58
|
+
for (const name of CORE_CONTROL_FLOW) map[name] = coreModule;
|
|
59
|
+
for (const name of ROUTER_COMPONENTS) map[name] = routerModule;
|
|
60
|
+
return map;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/resolve/load-directive.ts
|
|
64
|
+
var EAGER = { kind: "eager" };
|
|
65
|
+
|
|
66
|
+
// src/resolve/resolve-ir.ts
|
|
67
|
+
function resolveComponentSources(root, options = {}) {
|
|
68
|
+
const { resolver, isBound, modules, strategyFor } = options;
|
|
69
|
+
const builtins = builtinComponentMap(modules);
|
|
70
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
71
|
+
const unresolved = /* @__PURE__ */ new Set();
|
|
72
|
+
const annotate = (node) => {
|
|
73
|
+
const { name } = node;
|
|
74
|
+
if (!name || name.includes(".")) return;
|
|
75
|
+
if (isBound?.(name)) return;
|
|
76
|
+
const source = sourceFor(name);
|
|
77
|
+
if (!source) {
|
|
78
|
+
unresolved.add(name);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const loading = source.origin === "builtin" && RESERVED_COMPONENTS.has(name) ? EAGER : strategyFor?.(node) ?? EAGER;
|
|
82
|
+
node.source = { ...source, loading };
|
|
83
|
+
resolved.set(name, node.source);
|
|
84
|
+
};
|
|
85
|
+
const sourceFor = (name) => {
|
|
86
|
+
if (RESERVED_COMPONENTS.has(name)) {
|
|
87
|
+
return { module: builtins[name], export: name, origin: "builtin" };
|
|
88
|
+
}
|
|
89
|
+
const rule = resolver?.resolve(name);
|
|
90
|
+
if (rule) return { module: rule.module, export: rule.export, origin: "rule" };
|
|
91
|
+
if (ROUTER_COMPONENTS.includes(name)) {
|
|
92
|
+
return { module: builtins[name], export: name, origin: "builtin" };
|
|
93
|
+
}
|
|
94
|
+
return void 0;
|
|
95
|
+
};
|
|
96
|
+
walk(root, (node) => {
|
|
97
|
+
if (node.kind === "component") annotate(node);
|
|
98
|
+
});
|
|
99
|
+
return { resolved, unresolved: [...unresolved] };
|
|
100
|
+
}
|
|
101
|
+
function walk(root, visit) {
|
|
102
|
+
const nodes = Array.isArray(root) ? root : [root];
|
|
103
|
+
for (const node of nodes) {
|
|
104
|
+
visit(node);
|
|
105
|
+
const children = node.children;
|
|
106
|
+
if (children) walk(children, visit);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolve pass: annotate component references in the IR with where they come from.
|
|
3
|
+
*
|
|
4
|
+
* Runs between the frontends and the optimizer, so every later pass reads provenance off
|
|
5
|
+
* the node instead of re-deriving it. Nothing here emits code, the pass only records a
|
|
6
|
+
* decision, which is what lets the same answer drive import injection, chunk grouping,
|
|
7
|
+
* hint planning and diagnostics without any of them agreeing by coincidence.
|
|
8
|
+
*
|
|
9
|
+
* Two suppliers, in precedence order:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Control flow** (`Show`, `For`, `Switch`, …), the name selects a lowering, so a
|
|
12
|
+
* rule cannot re-point it. Recorded as `builtin` so a later pass can tell the
|
|
13
|
+
* difference between "configured here" and "fixed by the compiler".
|
|
14
|
+
* 2. **Configured rules**, then the **router built-ins**. Router components are only an
|
|
15
|
+
* import, so a project's own `Link` wins; see `builtins.ts`.
|
|
16
|
+
*
|
|
17
|
+
* A name bound in the file is not resolved at all: the author's import always wins, and
|
|
18
|
+
* the caller supplies those bindings via `isBound`.
|
|
19
|
+
*/
|
|
20
|
+
import type { IRNode, IRComponent, IRComponentSource } from '../ir/nodes.cjs';
|
|
21
|
+
import type { ComponentResolver } from './component-resolver.cjs';
|
|
22
|
+
import { builtinComponentMap } from './builtins.cjs';
|
|
23
|
+
import { type IRLoadStrategy } from './load-directive.cjs';
|
|
24
|
+
export interface ResolveOptions {
|
|
25
|
+
/** Rules configured for the project. Omit when the project configures none. */
|
|
26
|
+
resolver?: ComponentResolver;
|
|
27
|
+
/** True when the name already has a binding in the file, an import the author wrote. */
|
|
28
|
+
isBound?: (name: string) => boolean;
|
|
29
|
+
/** Module overrides, so `routerModule` and friends are honoured. */
|
|
30
|
+
modules?: Parameters<typeof builtinComponentMap>[0];
|
|
31
|
+
/**
|
|
32
|
+
* The `load:` strategy for a reference, when the frontend found one on the tag.
|
|
33
|
+
* Keyed by node so two usages of the same component can load differently, the
|
|
34
|
+
* whole reason timing lives at the usage site and location does not.
|
|
35
|
+
*/
|
|
36
|
+
strategyFor?: (node: IRComponent) => IRLoadStrategy | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface ResolveReport {
|
|
39
|
+
/** Every reference the pass annotated, by name. */
|
|
40
|
+
resolved: Map<string, IRComponentSource>;
|
|
41
|
+
/**
|
|
42
|
+
* Capitalised tags nothing supplies and nothing binds.
|
|
43
|
+
*
|
|
44
|
+
* These compile to a reference to an identifier that does not exist, the build
|
|
45
|
+
* succeeds and the page throws at runtime: so they are the pass's most useful
|
|
46
|
+
* output for diagnostics.
|
|
47
|
+
*/
|
|
48
|
+
unresolved: string[];
|
|
49
|
+
}
|
|
50
|
+
/** Annotate every component reference in `root`, returning what was decided. */
|
|
51
|
+
export declare function resolveComponentSources(root: IRNode | IRNode[], options?: ResolveOptions): ResolveReport;
|
|
52
|
+
/** Depth-first walk over every node that can contain children. */
|
|
53
|
+
export declare function walk(root: IRNode | IRNode[], visit: (node: IRNode) => void): void;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* The resolve pass: annotate component references in the IR with where they come from.
|
|
3
3
|
*
|
|
4
4
|
* Runs between the frontends and the optimizer, so every later pass reads provenance off
|
|
5
|
-
* the node instead of re-deriving it. Nothing here emits code
|
|
5
|
+
* the node instead of re-deriving it. Nothing here emits code, the pass only records a
|
|
6
6
|
* decision, which is what lets the same answer drive import injection, chunk grouping,
|
|
7
7
|
* hint planning and diagnostics without any of them agreeing by coincidence.
|
|
8
8
|
*
|
|
9
9
|
* Two suppliers, in precedence order:
|
|
10
10
|
*
|
|
11
|
-
* 1. **Control flow** (`Show`, `For`, `Switch`, …)
|
|
11
|
+
* 1. **Control flow** (`Show`, `For`, `Switch`, …), the name selects a lowering, so a
|
|
12
12
|
* rule cannot re-point it. Recorded as `builtin` so a later pass can tell the
|
|
13
13
|
* difference between "configured here" and "fixed by the compiler".
|
|
14
14
|
* 2. **Configured rules**, then the **router built-ins**. Router components are only an
|
|
@@ -24,13 +24,13 @@ import { type IRLoadStrategy } from './load-directive.js';
|
|
|
24
24
|
export interface ResolveOptions {
|
|
25
25
|
/** Rules configured for the project. Omit when the project configures none. */
|
|
26
26
|
resolver?: ComponentResolver;
|
|
27
|
-
/** True when the name already has a binding in the file
|
|
27
|
+
/** True when the name already has a binding in the file, an import the author wrote. */
|
|
28
28
|
isBound?: (name: string) => boolean;
|
|
29
29
|
/** Module overrides, so `routerModule` and friends are honoured. */
|
|
30
30
|
modules?: Parameters<typeof builtinComponentMap>[0];
|
|
31
31
|
/**
|
|
32
32
|
* The `load:` strategy for a reference, when the frontend found one on the tag.
|
|
33
|
-
* Keyed by node so two usages of the same component can load differently
|
|
33
|
+
* Keyed by node so two usages of the same component can load differently, the
|
|
34
34
|
* whole reason timing lives at the usage site and location does not.
|
|
35
35
|
*/
|
|
36
36
|
strategyFor?: (node: IRComponent) => IRLoadStrategy | undefined;
|
|
@@ -41,8 +41,8 @@ export interface ResolveReport {
|
|
|
41
41
|
/**
|
|
42
42
|
* Capitalised tags nothing supplies and nothing binds.
|
|
43
43
|
*
|
|
44
|
-
* These compile to a reference to an identifier that does not exist
|
|
45
|
-
* succeeds and the page throws at runtime
|
|
44
|
+
* These compile to a reference to an identifier that does not exist, the build
|
|
45
|
+
* succeeds and the page throws at runtime: so they are the pass's most useful
|
|
46
46
|
* output for diagnostics.
|
|
47
47
|
*/
|
|
48
48
|
unresolved: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-ir.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve-ir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA0C,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"resolve-ir.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve-ir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA0C,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,wFAAwF;IACxF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,oEAAoE;IACpE,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,cAAc,GAAG,SAAS,CAAC;CACjE;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,OAAO,GAAE,cAAmB,GAC3B,aAAa,CA8Cf;AAED,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAOjF"}
|
|
@@ -9,7 +9,7 @@ export function resolveComponentSources(root, options = {}) {
|
|
|
9
9
|
const annotate = (node) => {
|
|
10
10
|
const { name } = node;
|
|
11
11
|
// A dotted path (`Ctx.Provider`) or a dynamic tag needs its root binding, which is
|
|
12
|
-
// an ordinary expression the author wrote
|
|
12
|
+
// an ordinary expression the author wrote: nothing to supply.
|
|
13
13
|
if (!name || name.includes('.'))
|
|
14
14
|
return;
|
|
15
15
|
if (isBound?.(name))
|