@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export type StaticNodeKind = 'state' | 'memo' | 'effect' | 'store' | 'resource' | 'component'
|
|
2
|
+
/** Control flow the framework supplies: `Show`, `For`, `Switch`, `Suspense`, `Await`. */
|
|
3
|
+
| 'control'
|
|
4
|
+
/** The router's own tags: `Router`, `Outlet`, `Link`, `Redirect`. */
|
|
5
|
+
| 'router'
|
|
6
|
+
/** A server route handler: `GET`, `POST` in an api file. Not a component. */
|
|
7
|
+
| 'handler';
|
|
8
|
+
export interface StaticNode {
|
|
9
|
+
id: number;
|
|
10
|
+
label: string;
|
|
11
|
+
kind: StaticNodeKind;
|
|
12
|
+
/** Ids this one names in its body. */
|
|
13
|
+
deps: number[];
|
|
14
|
+
writes: number[];
|
|
15
|
+
/** Never run, so never pulsed. A renderer reads this as "nothing has happened yet". */
|
|
16
|
+
runs: number;
|
|
17
|
+
lastPulse: number;
|
|
18
|
+
source: {
|
|
19
|
+
file: string;
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
};
|
|
23
|
+
/** The component whose body declares it. */
|
|
24
|
+
createdIn?: number;
|
|
25
|
+
/** Where this value is written into the document. */
|
|
26
|
+
targets?: StaticDomTarget[];
|
|
27
|
+
/**
|
|
28
|
+
* The elements this component writes, as a tree, read from the source rather than from a
|
|
29
|
+
* page. Only what is written literally: anything inside a hole is decided at runtime.
|
|
30
|
+
*/
|
|
31
|
+
dom?: StaticDomNode[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* An element a component writes, in the shape a panel already draws.
|
|
35
|
+
*
|
|
36
|
+
* Deliberately the same fields as devtools' `DomNode`, minus the ones only a running page
|
|
37
|
+
* can fill. Mirrored rather than imported: the compiler does not depend on devtools.
|
|
38
|
+
*/
|
|
39
|
+
export interface StaticDomNode {
|
|
40
|
+
/** The element as written: `div#root`, `span.num`. */
|
|
41
|
+
label: string;
|
|
42
|
+
children: StaticDomNode[];
|
|
43
|
+
/** The component rendered here, when a tag stands in this position rather than an element. */
|
|
44
|
+
owner?: number;
|
|
45
|
+
/** Where the tag was written. */
|
|
46
|
+
at?: {
|
|
47
|
+
file: string;
|
|
48
|
+
line: number;
|
|
49
|
+
column: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Where a value reaches the document, read from the jsx rather than from a running page. */
|
|
53
|
+
export interface StaticDomTarget {
|
|
54
|
+
/** `content` for a hole between tags, `attribute` for one in a prop. */
|
|
55
|
+
kind: 'content' | 'attribute';
|
|
56
|
+
/** The attribute name, when it is one. */
|
|
57
|
+
name?: string;
|
|
58
|
+
/** The element as written: `span.num`, `div#root`. */
|
|
59
|
+
element: string;
|
|
60
|
+
/** Where the hole is, in the author's file. */
|
|
61
|
+
source: {
|
|
62
|
+
file: string;
|
|
63
|
+
line: number;
|
|
64
|
+
column: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface StaticGraph {
|
|
68
|
+
t: number;
|
|
69
|
+
nodes: StaticNode[];
|
|
70
|
+
/** Says what this graph is, for a panel that draws both kinds. */
|
|
71
|
+
static: true;
|
|
72
|
+
}
|
|
73
|
+
export interface StaticGraphFile {
|
|
74
|
+
path: string;
|
|
75
|
+
code: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AnalyzeOptions {
|
|
78
|
+
/**
|
|
79
|
+
* Where file-routes live, relative to the project root.
|
|
80
|
+
*
|
|
81
|
+
* Nothing in the source references these components: the router is handed a table built
|
|
82
|
+
* from the directory listing, so a page with no signals in it is named nowhere and reads
|
|
83
|
+
* as a component belonging to nothing. The directory is what says otherwise.
|
|
84
|
+
*
|
|
85
|
+
* `routesDir` in fluixi.config; a host that has read the config should pass what it found.
|
|
86
|
+
* @default 'src/routes'
|
|
87
|
+
*/
|
|
88
|
+
routesDir?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Where file-based API routes live. Same problem as the pages: the handlers are served by
|
|
91
|
+
* the directory they sit in, so nothing names them and each one draws on its own.
|
|
92
|
+
*
|
|
93
|
+
* `apiDir` in fluixi.config.
|
|
94
|
+
* @default 'src/api'
|
|
95
|
+
*/
|
|
96
|
+
apiDir?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Files are analysed independently, then joined: an imported name resolves to the node the
|
|
100
|
+
* exporting file declared under it, which connects a store to the memo reading it elsewhere.
|
|
101
|
+
*/
|
|
102
|
+
export declare function analyzeReactiveGraph(files: readonly StaticGraphFile[], options?: AnalyzeOptions): StaticGraph;
|
|
@@ -3,7 +3,7 @@ export type StaticNodeKind = 'state' | 'memo' | 'effect' | 'store' | 'resource'
|
|
|
3
3
|
| 'control'
|
|
4
4
|
/** The router's own tags: `Router`, `Outlet`, `Link`, `Redirect`. */
|
|
5
5
|
| 'router'
|
|
6
|
-
/** A server route handler
|
|
6
|
+
/** A server route handler: `GET`, `POST` in an api file. Not a component. */
|
|
7
7
|
| 'handler';
|
|
8
8
|
export interface StaticNode {
|
|
9
9
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-graph.d.ts","sourceRoot":"","sources":["../../src/analyze/static-graph.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW;AACb,yFAAyF;GACvF,SAAS;AACX,qEAAqE;GACnE,QAAQ;AACV,
|
|
1
|
+
{"version":3,"file":"static-graph.d.ts","sourceRoot":"","sources":["../../src/analyze/static-graph.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW;AACb,yFAAyF;GACvF,SAAS;AACX,qEAAqE;GACnE,QAAQ;AACV,6EAA6E;GAC3E,SAAS,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC;IACrB,sCAAsC;IACtC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,EAAE,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC;IAC9B,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,kEAAkE;IAClE,MAAM,EAAE,IAAI,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+PD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,OAAO,GAAE,cAAmB,GAC3B,WAAW,CAimBb"}
|
|
@@ -185,7 +185,7 @@ function positionsIn(code) {
|
|
|
185
185
|
return { line: low + 1, column: offset - starts[low] };
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/** `span.box
|
|
188
|
+
/** `span.box`: a template element as written, static attributes only, like describeJsx. */
|
|
189
189
|
function describeTemplateElement(el) {
|
|
190
190
|
let id = '';
|
|
191
191
|
const classes = [];
|
|
@@ -200,7 +200,7 @@ function describeTemplateElement(el) {
|
|
|
200
200
|
}
|
|
201
201
|
return `${el.tag}${id}${classes.map((c) => `.${c}`).join('')}`;
|
|
202
202
|
}
|
|
203
|
-
/** Which holes an attribute value reads
|
|
203
|
+
/** Which holes an attribute value reads: one for `=${x}`, several for `"a-${x}-${y}"`. */
|
|
204
204
|
function valueHoles(value) {
|
|
205
205
|
if (!value)
|
|
206
206
|
return [];
|
|
@@ -211,7 +211,7 @@ function valueHoles(value) {
|
|
|
211
211
|
return [];
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* `span.num`, `div#root
|
|
214
|
+
* `span.num`, `div#root`: the element as written.
|
|
215
215
|
*
|
|
216
216
|
* Static attributes only: a class computed at runtime is not something the source can name,
|
|
217
217
|
* and guessing would put a lie on the card.
|
|
@@ -271,7 +271,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
271
271
|
const unresolved = [];
|
|
272
272
|
/**
|
|
273
273
|
* What each component's body names. Kept apart from `reads`, which becomes dependency
|
|
274
|
-
* edges
|
|
274
|
+
* edges: a component mentioning a route table does not depend on it reactively.
|
|
275
275
|
*/
|
|
276
276
|
const componentMentions = new Map();
|
|
277
277
|
let seq = 0;
|
|
@@ -465,8 +465,8 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
465
465
|
/**
|
|
466
466
|
* The elements each component writes, as a tree.
|
|
467
467
|
*
|
|
468
|
-
* Nothing has run, so this is the structure the source states outright. A hole
|
|
469
|
-
* `{items().map(...)}`, a `<Show>` body
|
|
468
|
+
* Nothing has run, so this is the structure the source states outright. A hole ,
|
|
469
|
+
* `{items().map(...)}`, a `<Show>` body: is decided at runtime and has no elements
|
|
470
470
|
* here; the tag stands in its place and fills in once the application is up.
|
|
471
471
|
*/
|
|
472
472
|
const describeTree = (el) => {
|
|
@@ -487,7 +487,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
487
487
|
// A capitalised tag renders its own dom, so it stands here as itself and the panel
|
|
488
488
|
// pulls that component's row in. `components` has the directives, `here` the names
|
|
489
489
|
// this file declares; anything else is a name another file exports, which is only
|
|
490
|
-
// resolvable once they have all been read. The children stay either way
|
|
490
|
+
// resolvable once they have all been read. The children stay either way, they are
|
|
491
491
|
// written here, and a row that resolves replaces them with the component's own.
|
|
492
492
|
if (tag[0] === tag[0]?.toUpperCase()) {
|
|
493
493
|
const node = { label: tag, children, ...(where ? { at: where } : {}) };
|
|
@@ -532,7 +532,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
532
532
|
* The tags and holes are inside a string, so none of the walks above can see them: a
|
|
533
533
|
* `<Show>` in a template is not a JSXElement and a `${count()}` is not an expression
|
|
534
534
|
* container. The template parser reads the string into the same shape the compiler
|
|
535
|
-
* lowers, and each hole maps back by index to the expression Babel already parsed
|
|
535
|
+
* lowers, and each hole maps back by index to the expression Babel already parsed ,
|
|
536
536
|
* which is where the position and the names read come from.
|
|
537
537
|
*/
|
|
538
538
|
walk(program, (node, stack) => {
|
|
@@ -672,7 +672,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
};
|
|
675
|
-
// Whatever body the template is written in
|
|
675
|
+
// Whatever body the template is written in, the same lookup the tag walk uses.
|
|
676
676
|
let owner;
|
|
677
677
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
678
678
|
const found = components.get(stack[i]);
|
|
@@ -795,7 +795,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
795
795
|
/**
|
|
796
796
|
* A file-route belongs to the outlet it renders into.
|
|
797
797
|
*
|
|
798
|
-
* Nothing names these components
|
|
798
|
+
* Nothing names these components: the table comes from the directory, so a page that
|
|
799
799
|
* declares no signals is connected to nothing at all and sits on its own. `<Outlet />` is
|
|
800
800
|
* the hole a matched route fills, so it is the honest owner; a router with no outlet
|
|
801
801
|
* written out renders into itself. Only one of either is a definite answer: with two
|
|
@@ -819,7 +819,7 @@ export function analyzeReactiveGraph(files, options = {}) {
|
|
|
819
819
|
* The api routes hang off one card of their own.
|
|
820
820
|
*
|
|
821
821
|
* A handler is served because of the directory it sits in, so like a page nothing names it
|
|
822
|
-
|
|
822
|
+
*: but unlike a page nothing renders it either, and hanging it off the router would say
|
|
823
823
|
* something false. A root of its own is what it is: one card, the handlers under it.
|
|
824
824
|
*/
|
|
825
825
|
const loose = pending.filter((p) => p.node.kind === 'handler' && p.node.createdIn === undefined);
|