@fluixi/compiler 1.0.0-alpha.83 → 1.0.0-alpha.84
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.mjs +41 -1
- package/dist/analyze/intrinsics.cjs +80 -1
- package/dist/analyze/intrinsics.d.cts +66 -0
- 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.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.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.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.mjs +793 -1
- package/dist/babel-NRW4EFTG.mjs +636 -0
- package/dist/chunk-3YKZ4GNH.mjs +11 -0
- package/dist/chunk-EZR7NZOY.mjs +1718 -0
- package/dist/chunk-FSSWUXUR.mjs +16 -0
- package/dist/chunk-MJV3UXIL.mjs +158 -0
- package/dist/chunk-R2VHAZAX.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.map +1 -1
- package/dist/codegen/backends/imperative.js +12 -8
- 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.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.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.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.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.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.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.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.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 +1594 -13
- package/dist/index.d.cts +27 -0
- package/dist/index.mjs +1574 -13
- package/dist/integrations.cjs +4307 -25
- package/dist/integrations.d.cts +215 -0
- package/dist/integrations.mjs +531 -17
- package/dist/ir/nodes.cjs +18 -1
- package/dist/ir/nodes.d.cts +168 -0
- package/dist/lower/compile-template.cjs +1356 -1
- package/dist/lower/compile-template.d.cts +69 -0
- 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.map +1 -1
- package/dist/lower/jsx.js +2 -1
- 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.map +1 -1
- package/dist/lower/template.js +5 -4
- 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.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.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.mjs +67 -1
- package/dist/options.cjs +33 -1
- package/dist/options.d.cts +39 -0
- 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.mjs +53 -1
- package/dist/resolve/component-globals.cjs +233 -13
- package/dist/resolve/component-globals.d.cts +80 -0
- package/dist/resolve/component-globals.mjs +210 -13
- package/dist/resolve/component-resolver.cjs +80 -1
- package/dist/resolve/component-resolver.d.cts +68 -0
- 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.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.mjs +85 -1
- package/dist/resolve/write-globals.cjs +318 -13
- package/dist/resolve/write-globals.d.cts +30 -0
- package/dist/resolve/write-globals.mjs +297 -13
- package/dist/server-fns-4ZXN6DYU.mjs +78 -0
- package/dist/server-functions-V6D6DRIA.mjs +82 -0
- package/dist/transform/bindings.cjs +71 -1
- package/dist/transform/bindings.d.cts +16 -0
- 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.mjs +193 -3
- package/dist/transform/props.cjs +441 -3
- package/dist/transform/props.d.cts +45 -0
- 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.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.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.mjs +307 -1
- package/dist/transform/templates.cjs +2701 -7
- package/dist/transform/templates.d.cts +69 -0
- package/dist/transform/templates.mjs +3743 -16
- package/dist/transform-BT4MMASR.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;
|