@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,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Babel front-end for the Fluixi compiler.
|
|
3
|
+
* @module @fluixi/babel-plugin-jsx
|
|
4
|
+
*
|
|
5
|
+
* This is a host adapter, not the compiler. It parses with babel and, for each
|
|
6
|
+
* JSX element/fragment and each `` html`...` `` template, hands the node to the
|
|
7
|
+
* shared pipeline — build IR, run the imperative backend — then splices the
|
|
8
|
+
* emitted code back into the program. Everything that decides *what* the output
|
|
9
|
+
* means (directives, control flow, component resolution, load strategies,
|
|
10
|
+
* reactivity, templates) lives in ../../{ir,resolve,optimize,codegen}, which
|
|
11
|
+
* import no babel at all.
|
|
12
|
+
*
|
|
13
|
+
* What stays here is genuinely host work: dispatching the visitors, collecting
|
|
14
|
+
* the runtime symbols the backend reported so the imports can be injected, and
|
|
15
|
+
* hoisting static templates to module scope.
|
|
16
|
+
*/
|
|
17
|
+
import { type ComponentResolverRule } from '../../resolve/component-resolver.cjs';
|
|
18
|
+
import { type PluginObj } from '@babel/core';
|
|
19
|
+
export interface PluginOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Import source for the JSX types and for whatever JSX this plugin does not
|
|
22
|
+
* consume — esbuild's automatic runtime and TypeScript's `jsxImportSource`
|
|
23
|
+
* both point at it. The compiler itself never emits `jsx()` calls.
|
|
24
|
+
* @default '@fluixi/jsx'
|
|
25
|
+
*/
|
|
26
|
+
importSource?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Enable development mode with additional checks
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
development?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Enable event delegation
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
delegateEvents?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Generate source maps
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
sourceMaps?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Module name for signal directive
|
|
44
|
+
* @default '@fluixi/dom'
|
|
45
|
+
*/
|
|
46
|
+
signalModule?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Module name for control flow
|
|
49
|
+
* @default '@fluixi/dom'
|
|
50
|
+
*/
|
|
51
|
+
controlFlowModule?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Module the router components (Router/Outlet/…) are auto-imported from.
|
|
54
|
+
* @default '@fluixi/core/router'
|
|
55
|
+
*/
|
|
56
|
+
routerModule?: string;
|
|
57
|
+
/** Clone static subtrees from a template. Client-only — see CompilerOptions. */
|
|
58
|
+
templateClone?: boolean;
|
|
59
|
+
/** Also clone structure-static subtrees with holes. See CompilerOptions. */
|
|
60
|
+
partialTemplates?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Rules that resolve an unbound capitalised tag to a module, so a component can be
|
|
63
|
+
* used without an import — the configurable form of the built-in
|
|
64
|
+
* Suspense/Portal/Router auto-import.
|
|
65
|
+
*
|
|
66
|
+
* A lexical binding always wins, so an explicit import or a local variable is never
|
|
67
|
+
* overridden. With no rules, behaviour is exactly as before.
|
|
68
|
+
*/
|
|
69
|
+
resolve?: readonly ComponentResolverRule[];
|
|
70
|
+
/**
|
|
71
|
+
* Where reactive primitives (createMemo) are imported from — the signal core,
|
|
72
|
+
* not the dom runtime.
|
|
73
|
+
* @default '@fluixi/reactive/signal'
|
|
74
|
+
*/
|
|
75
|
+
reactiveModule?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Which authoring syntaxes to compile:
|
|
78
|
+
* - 'jsx': only JSX elements/fragments.
|
|
79
|
+
* - 'lit': only `` html`...` `` / `` svg`...` `` tagged templates.
|
|
80
|
+
* - 'both' (default): JSX and `html``` templates in the same file.
|
|
81
|
+
*
|
|
82
|
+
* Both syntaxes lower to the same IR and the same imperative backend, so the
|
|
83
|
+
* choice is about which source forms the plugin touches, not about output.
|
|
84
|
+
* @default 'both'
|
|
85
|
+
*/
|
|
86
|
+
format?: 'jsx' | 'lit' | 'both';
|
|
87
|
+
/**
|
|
88
|
+
* Tag name that marks a lit template for compilation (when `format` includes
|
|
89
|
+
* lit). Other tagged templates are left untouched.
|
|
90
|
+
* @default 'html'
|
|
91
|
+
*/
|
|
92
|
+
litTag?: string;
|
|
93
|
+
}
|
|
94
|
+
declare const _default: (api: object, options: PluginOptions | null | undefined, dirname: string) => PluginObj<import("@babel/core").PluginPass>;
|
|
95
|
+
export default _default;
|