@barefootjs/jsx 0.9.1 → 0.9.3
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/adapters/attr-value-emitter.d.ts +1 -1
- package/dist/adapters/attr-value-emitter.d.ts.map +1 -1
- package/dist/adapters/interface.d.ts +1 -1
- package/dist/adapters/interface.d.ts.map +1 -1
- package/dist/adapters/ir-node-emitter.d.ts +1 -1
- package/dist/adapters/ir-node-emitter.d.ts.map +1 -1
- package/dist/adapters/jsx-adapter.d.ts +2 -2
- package/dist/adapters/jsx-adapter.d.ts.map +1 -1
- package/dist/adapters/parsed-expr-emitter.d.ts +1 -1
- package/dist/adapters/parsed-expr-emitter.d.ts.map +1 -1
- package/dist/adapters/template-imports.d.ts +1 -1
- package/dist/adapters/template-imports.d.ts.map +1 -1
- package/dist/adapters/test-adapter.d.ts +3 -3
- package/dist/adapters/test-adapter.d.ts.map +1 -1
- package/dist/analyzer-context.d.ts +2 -2
- package/dist/analyzer-context.d.ts.map +1 -1
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/augment-inherited-props.d.ts +1 -1
- package/dist/augment-inherited-props.d.ts.map +1 -1
- package/dist/compiler.d.ts +3 -3
- package/dist/compiler.d.ts.map +1 -1
- package/dist/css-layer-prefixer.d.ts +1 -1
- package/dist/css-layer-prefixer.d.ts.map +1 -1
- package/dist/debug.d.ts +3 -3
- package/dist/debug.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/expression-parser.d.ts +12 -0
- package/dist/expression-parser.d.ts.map +1 -1
- package/dist/free-refs.d.ts +1 -1
- package/dist/free-refs.d.ts.map +1 -1
- package/dist/index.d.ts +42 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/ir-to-client-js/build-references.d.ts +2 -2
- package/dist/ir-to-client-js/build-references.d.ts.map +1 -1
- package/dist/ir-to-client-js/child-components.d.ts +2 -2
- package/dist/ir-to-client-js/child-components.d.ts.map +1 -1
- package/dist/ir-to-client-js/collect-elements.d.ts +4 -4
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/compute-inlinability.d.ts +4 -4
- package/dist/ir-to-client-js/compute-inlinability.d.ts.map +1 -1
- package/dist/ir-to-client-js/compute-prop-usage.d.ts +2 -2
- package/dist/ir-to-client-js/compute-prop-usage.d.ts.map +1 -1
- package/dist/ir-to-client-js/compute-scope.d.ts +2 -2
- package/dist/ir-to-client-js/compute-scope.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-component-loop.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-component-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-composite-loop.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-composite-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-inner-loop.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/build-inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-loop-child-arm.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/build-loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-reactive-effects.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/build-reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/event-delegation.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/plan/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/inner-loop.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/insert.d.ts +3 -3
- package/dist/ir-to-client-js/control-flow/plan/insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/loop-child-arm.d.ts +4 -4
- package/dist/ir-to-client-js/control-flow/plan/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts +4 -4
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/types.d.ts +7 -7
- package/dist/ir-to-client-js/control-flow/plan/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/shared.d.ts +5 -5
- package/dist/ir-to-client-js/control-flow/shared.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/branch-loop.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/component-loop.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/component-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/composite-loop.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/composite-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/insert.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/declaration-sort.d.ts +1 -1
- package/dist/ir-to-client-js/declaration-sort.d.ts.map +1 -1
- package/dist/ir-to-client-js/element-refs.d.ts +1 -1
- package/dist/ir-to-client-js/element-refs.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-module-level.d.ts +1 -1
- package/dist/ir-to-client-js/emit-module-level.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +2 -2
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-registration.d.ts +2 -2
- package/dist/ir-to-client-js/emit-registration.d.ts.map +1 -1
- package/dist/ir-to-client-js/generate-init.d.ts +2 -2
- package/dist/ir-to-client-js/generate-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +4 -4
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +1 -1
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/index.d.ts +3 -3
- package/dist/ir-to-client-js/index.d.ts.map +1 -1
- package/dist/ir-to-client-js/init-declarations.d.ts +2 -2
- package/dist/ir-to-client-js/init-declarations.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/conditional-slot-ids.d.ts +1 -1
- package/dist/ir-to-client-js/phases/conditional-slot-ids.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/effects-and-on-mounts.d.ts +1 -1
- package/dist/ir-to-client-js/phases/effects-and-on-mounts.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/event-handlers.d.ts +1 -1
- package/dist/ir-to-client-js/phases/event-handlers.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/init-statements.d.ts +1 -1
- package/dist/ir-to-client-js/phases/init-statements.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/props-event-handlers.d.ts +1 -1
- package/dist/ir-to-client-js/phases/props-event-handlers.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/props-extraction.d.ts +2 -2
- package/dist/ir-to-client-js/phases/props-extraction.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/provider-and-child-inits.d.ts +1 -1
- package/dist/ir-to-client-js/phases/provider-and-child-inits.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/ref-callbacks.d.ts +1 -1
- package/dist/ir-to-client-js/phases/ref-callbacks.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/rest-attr-applications.d.ts +1 -1
- package/dist/ir-to-client-js/phases/rest-attr-applications.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/static-array-child-inits.d.ts +1 -1
- package/dist/ir-to-client-js/phases/static-array-child-inits.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases.d.ts +3 -3
- package/dist/ir-to-client-js/phases.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/build-declaration-emit.d.ts +5 -5
- package/dist/ir-to-client-js/plan/build-declaration-emit.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/build-static-array-child-init.d.ts +2 -2
- package/dist/ir-to-client-js/plan/build-static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/static-array-child-init.d.ts +1 -1
- package/dist/ir-to-client-js/plan/static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/prop-handling.d.ts +2 -2
- package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts +2 -2
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/source-map.d.ts +2 -2
- package/dist/ir-to-client-js/source-map.d.ts.map +1 -1
- package/dist/ir-to-client-js/stringify/declaration-emit.d.ts +1 -1
- package/dist/ir-to-client-js/stringify/declaration-emit.d.ts.map +1 -1
- package/dist/ir-to-client-js/stringify/static-array-child-init.d.ts +1 -1
- package/dist/ir-to-client-js/stringify/static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +7 -7
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +2 -2
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/ir-to-client-js/walk-prop-accesses.d.ts +1 -1
- package/dist/ir-to-client-js/walk-prop-accesses.d.ts.map +1 -1
- package/dist/ir-to-client-js/walker.d.ts +1 -1
- package/dist/ir-to-client-js/walker.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts +2 -2
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/module-exports.d.ts +1 -1
- package/dist/module-exports.d.ts.map +1 -1
- package/dist/preprocess-inline-jsx-callbacks.d.ts +1 -1
- package/dist/preprocess-inline-jsx-callbacks.d.ts.map +1 -1
- package/dist/relocate.d.ts +3 -3
- package/dist/relocate.d.ts.map +1 -1
- package/dist/ssr-defaults.d.ts +1 -1
- package/dist/ssr-defaults.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/expression-parser.test.ts +30 -1
- package/src/adapters/attr-value-emitter.ts +1 -1
- package/src/adapters/interface.ts +1 -1
- package/src/adapters/ir-node-emitter.ts +1 -1
- package/src/adapters/jsx-adapter.ts +3 -3
- package/src/adapters/parsed-expr-emitter.ts +1 -1
- package/src/adapters/template-imports.ts +1 -1
- package/src/adapters/test-adapter.ts +5 -5
- package/src/analyzer-context.ts +2 -2
- package/src/analyzer.ts +8 -8
- package/src/augment-inherited-props.ts +2 -2
- package/src/compiler.ts +12 -12
- package/src/css-layer-prefixer.ts +1 -1
- package/src/debug.ts +7 -7
- package/src/errors.ts +2 -2
- package/src/expression-parser.ts +27 -0
- package/src/free-refs.ts +4 -4
- package/src/index.ts +42 -42
- package/src/ir-to-client-js/build-references.ts +6 -6
- package/src/ir-to-client-js/child-components.ts +2 -2
- package/src/ir-to-client-js/collect-elements.ts +14 -14
- package/src/ir-to-client-js/compute-inlinability.ts +10 -10
- package/src/ir-to-client-js/compute-prop-usage.ts +3 -3
- package/src/ir-to-client-js/compute-scope.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/branch-loop.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/build-branch-loop.ts +7 -7
- package/src/ir-to-client-js/control-flow/plan/build-component-loop.ts +6 -6
- package/src/ir-to-client-js/control-flow/plan/build-composite-loop.ts +7 -7
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/build-inner-loop.ts +8 -8
- package/src/ir-to-client-js/control-flow/plan/build-insert.ts +4 -4
- package/src/ir-to-client-js/control-flow/plan/build-loop-child-arm.ts +7 -7
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +7 -7
- package/src/ir-to-client-js/control-flow/plan/build-reactive-effects.ts +8 -8
- package/src/ir-to-client-js/control-flow/plan/event-delegation.ts +1 -1
- package/src/ir-to-client-js/control-flow/plan/inner-loop.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/insert.ts +3 -3
- package/src/ir-to-client-js/control-flow/plan/loop-child-arm.ts +4 -4
- package/src/ir-to-client-js/control-flow/plan/loop.ts +4 -4
- package/src/ir-to-client-js/control-flow/plan/reactive-effects.ts +2 -2
- package/src/ir-to-client-js/control-flow/plan/types.ts +7 -7
- package/src/ir-to-client-js/control-flow/shared.ts +8 -8
- package/src/ir-to-client-js/control-flow/stringify/branch-loop.ts +6 -6
- package/src/ir-to-client-js/control-flow/stringify/component-loop.ts +3 -3
- package/src/ir-to-client-js/control-flow/stringify/composite-loop.ts +6 -6
- package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +2 -2
- package/src/ir-to-client-js/control-flow/stringify/event-listener.ts +1 -1
- package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +6 -6
- package/src/ir-to-client-js/control-flow/stringify/insert.ts +6 -6
- package/src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts +6 -6
- package/src/ir-to-client-js/control-flow/stringify/loop.ts +7 -7
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +5 -5
- package/src/ir-to-client-js/control-flow/stringify/template-parse.ts +1 -1
- package/src/ir-to-client-js/control-flow.ts +7 -7
- package/src/ir-to-client-js/csr-substitute.ts +3 -3
- package/src/ir-to-client-js/declaration-sort.ts +2 -2
- package/src/ir-to-client-js/element-refs.ts +3 -3
- package/src/ir-to-client-js/emit-module-level.ts +2 -2
- package/src/ir-to-client-js/emit-reactive.ts +5 -5
- package/src/ir-to-client-js/emit-registration.ts +6 -6
- package/src/ir-to-client-js/generate-init.ts +14 -14
- package/src/ir-to-client-js/html-template.ts +11 -11
- package/src/ir-to-client-js/imports.ts +1 -1
- package/src/ir-to-client-js/index.ts +15 -15
- package/src/ir-to-client-js/init-declarations.ts +8 -8
- package/src/ir-to-client-js/phases/conditional-slot-ids.ts +1 -1
- package/src/ir-to-client-js/phases/effects-and-on-mounts.ts +1 -1
- package/src/ir-to-client-js/phases/event-handlers.ts +2 -2
- package/src/ir-to-client-js/phases/init-statements.ts +1 -1
- package/src/ir-to-client-js/phases/props-event-handlers.ts +2 -2
- package/src/ir-to-client-js/phases/props-extraction.ts +4 -4
- package/src/ir-to-client-js/phases/provider-and-child-inits.ts +3 -3
- package/src/ir-to-client-js/phases/ref-callbacks.ts +2 -2
- package/src/ir-to-client-js/phases/rest-attr-applications.ts +2 -2
- package/src/ir-to-client-js/phases/static-array-child-inits.ts +3 -3
- package/src/ir-to-client-js/phases.ts +18 -18
- package/src/ir-to-client-js/plan/build-declaration-emit.ts +6 -6
- package/src/ir-to-client-js/plan/build-static-array-child-init.ts +7 -7
- package/src/ir-to-client-js/plan/static-array-child-init.ts +1 -1
- package/src/ir-to-client-js/prop-handling.ts +2 -2
- package/src/ir-to-client-js/reactivity.ts +5 -5
- package/src/ir-to-client-js/rewrite-props-object.ts +1 -1
- package/src/ir-to-client-js/source-map.ts +4 -4
- package/src/ir-to-client-js/stringify/declaration-emit.ts +1 -1
- package/src/ir-to-client-js/stringify/static-array-child-init.ts +2 -2
- package/src/ir-to-client-js/types.ts +6 -6
- package/src/ir-to-client-js/utils.ts +4 -4
- package/src/ir-to-client-js/walk-prop-accesses.ts +2 -2
- package/src/ir-to-client-js/walker.ts +1 -1
- package/src/jsx-runtime/index.d.ts +1 -1
- package/src/jsx-to-ir.ts +9 -9
- package/src/module-exports.ts +1 -1
- package/src/preprocess-inline-jsx-callbacks.ts +2 -2
- package/src/prop-rewrite.ts +2 -2
- package/src/reactivity-checker.ts +1 -1
- package/src/relocate.ts +5 -5
- package/src/shared-program.ts +1 -1
- package/src/ssr-defaults.ts +1 -1
- package/src/types.ts +1 -1
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
* `loop-child-arm.ts` — no legacy passthrough remains.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { varSlotId } from '../../utils'
|
|
12
|
-
import { emitAttrUpdate } from '../../emit-reactive'
|
|
11
|
+
import { varSlotId } from '../../utils.ts'
|
|
12
|
+
import { emitAttrUpdate } from '../../emit-reactive.ts'
|
|
13
13
|
import {
|
|
14
14
|
stringifyBranchChildComponentInits,
|
|
15
15
|
stringifyBranchEventBindings,
|
|
16
16
|
stringifyBranchInnerLoops,
|
|
17
17
|
stringifyLoopChildConditionals,
|
|
18
|
-
} from './loop-child-arm'
|
|
19
|
-
import type { LoopChildArmPlan, LoopChildArmText } from '../plan/loop-child-arm'
|
|
18
|
+
} from './loop-child-arm.ts'
|
|
19
|
+
import type { LoopChildArmPlan, LoopChildArmText } from '../plan/loop-child-arm.ts'
|
|
20
20
|
import type {
|
|
21
21
|
NestedConditionalPlan,
|
|
22
22
|
ReactiveEffectsPlan,
|
|
23
23
|
ReactiveTextEffect,
|
|
24
|
-
} from '../plan/reactive-effects'
|
|
24
|
+
} from '../plan/reactive-effects.ts'
|
|
25
25
|
|
|
26
26
|
export interface StringifyReactiveEffectsOptions {
|
|
27
27
|
/** Indent prefix for every emitted line. */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* extra level to get the real root.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import { findInterpolationEnd, findTopLevelTemplateLiterals } from '../../../scanner/js-scanner'
|
|
23
|
+
import { findInterpolationEnd, findTopLevelTemplateLiterals } from '../../../scanner/js-scanner.ts'
|
|
24
24
|
|
|
25
25
|
const SVG_ROOT_TAGS = new Set([
|
|
26
26
|
'svg',
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* control-flow.ts -> control-flow/{plan,stringify}/* -> legacy-helpers.ts
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import type { ClientJsContext, TopLevelLoop } from './types'
|
|
24
|
-
import { buildInsertPlan } from './control-flow/plan/build-insert'
|
|
25
|
-
import { stringifyInsert } from './control-flow/stringify/insert'
|
|
26
|
-
import { buildLoopPlan } from './control-flow/plan/build-loop'
|
|
27
|
-
import { stringifyLoop } from './control-flow/stringify/loop'
|
|
23
|
+
import type { ClientJsContext, TopLevelLoop } from './types.ts'
|
|
24
|
+
import { buildInsertPlan } from './control-flow/plan/build-insert.ts'
|
|
25
|
+
import { stringifyInsert } from './control-flow/stringify/insert.ts'
|
|
26
|
+
import { buildLoopPlan } from './control-flow/plan/build-loop.ts'
|
|
27
|
+
import { stringifyLoop } from './control-flow/stringify/loop.ts'
|
|
28
28
|
import {
|
|
29
29
|
buildDynamicLoopDelegationPlan,
|
|
30
30
|
buildStaticArrayDelegationPlan,
|
|
31
|
-
} from './control-flow/plan/build-event-delegation'
|
|
32
|
-
import { stringifyEventDelegation } from './control-flow/stringify/event-delegation'
|
|
31
|
+
} from './control-flow/plan/build-event-delegation.ts'
|
|
32
|
+
import { stringifyEventDelegation } from './control-flow/stringify/event-delegation.ts'
|
|
33
33
|
|
|
34
34
|
/** Emit insert() calls for server-rendered reactive conditionals with branch configs. */
|
|
35
35
|
export function emitConditionalUpdates(lines: string[], ctx: ClientJsContext): void {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import ts from 'typescript'
|
|
28
|
-
import { PROPS_PARAM, inferDefaultValue } from './utils'
|
|
29
|
-
import { extractFreeIdentifiersFromNode } from '../analyzer'
|
|
30
|
-
import type { MemoInfo, SignalInfo } from '../types'
|
|
28
|
+
import { PROPS_PARAM, inferDefaultValue } from './utils.ts'
|
|
29
|
+
import { extractFreeIdentifiersFromNode } from '../analyzer.ts'
|
|
30
|
+
import type { MemoInfo, SignalInfo } from '../types.ts'
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* CSR-substituted const value: the const's initializer with every
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* `form = createForm({onSubmit: async () => {}})` (#508).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ConstantInfo, FunctionInfo, MemoInfo, ReferencesGraph, SignalInfo } from '../types'
|
|
11
|
-
import { graphDeclarationReferences } from './build-references'
|
|
10
|
+
import type { ConstantInfo, FunctionInfo, MemoInfo, ReferencesGraph, SignalInfo } from '../types.ts'
|
|
11
|
+
import { graphDeclarationReferences } from './build-references.ts'
|
|
12
12
|
|
|
13
13
|
// =============================================================================
|
|
14
14
|
// Declaration types
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* DOM element reference and `$c` is the right selector.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import type { ClientJsContext } from './types'
|
|
20
|
-
import { collectConditionalSlotIds } from './phases/conditional-slot-ids'
|
|
21
|
-
import { varSlotId } from './utils'
|
|
19
|
+
import type { ClientJsContext } from './types.ts'
|
|
20
|
+
import { collectConditionalSlotIds } from './phases/conditional-slot-ids.ts'
|
|
21
|
+
import { varSlotId } from './utils.ts'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Generate `const _slotId = find(...)` declarations for all elements
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
* them onto the placeholder replacements at the end of emission.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { ComponentIR, ConstantInfo, FunctionInfo, SignalInfo, MemoInfo } from '../types'
|
|
22
|
+
import type { ComponentIR, ConstantInfo, FunctionInfo, SignalInfo, MemoInfo } from '../types.ts'
|
|
23
23
|
import {
|
|
24
24
|
RUNTIME_MODULE,
|
|
25
25
|
collectExternalImports,
|
|
26
26
|
collectUserDomImports,
|
|
27
27
|
detectUsedImports,
|
|
28
|
-
} from './imports'
|
|
28
|
+
} from './imports.ts'
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Build the module-level code block that replaces `MODULE_CONSTANTS_PLACEHOLDER`.
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* client-only expressions, and reactive component prop bindings.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { AttrMeta } from '../types'
|
|
8
|
-
import { isBooleanAttr } from '../html-constants'
|
|
9
|
-
import type { ClientJsContext } from './types'
|
|
10
|
-
import { toHtmlAttrName, varSlotId, PROPS_PARAM } from './utils'
|
|
11
|
-
import { createTemplateAwareStringProtector } from './html-template'
|
|
7
|
+
import type { AttrMeta } from '../types.ts'
|
|
8
|
+
import { isBooleanAttr } from '../html-constants.ts'
|
|
9
|
+
import type { ClientJsContext } from './types.ts'
|
|
10
|
+
import { toHtmlAttrName, varSlotId, PROPS_PARAM } from './utils.ts'
|
|
11
|
+
import { createTemplateAwareStringProtector } from './html-template.ts'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Generate JS statements to update a DOM attribute reactively.
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* and the final hydrate() call emission.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { ComponentIR, IRFragment, IRNode, ReferencesGraph } from '../types'
|
|
8
|
-
import type { ClientJsContext } from './types'
|
|
9
|
-
import { PROPS_PARAM } from './utils'
|
|
10
|
-
import { computeInlinability, toLegacyInlinability } from './compute-inlinability'
|
|
11
|
-
import { canGenerateStaticTemplate, irToComponentTemplate, generateCsrTemplate, createStringProtector } from './html-template'
|
|
12
|
-
import { nameForRegistryRef } from './component-scope'
|
|
7
|
+
import type { ComponentIR, IRFragment, IRNode, ReferencesGraph } from '../types.ts'
|
|
8
|
+
import type { ClientJsContext } from './types.ts'
|
|
9
|
+
import { PROPS_PARAM } from './utils.ts'
|
|
10
|
+
import { computeInlinability, toLegacyInlinability } from './compute-inlinability.ts'
|
|
11
|
+
import { canGenerateStaticTemplate, irToComponentTemplate, generateCsrTemplate, createStringProtector } from './html-template.ts'
|
|
12
|
+
import { nameForRegistryRef } from './component-scope.ts'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Resolve chained references within a constants map.
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
* classification logic).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ComponentIR } from '../types'
|
|
12
|
-
import type { ClientJsContext } from './types'
|
|
13
|
-
import { PROPS_PARAM } from './utils'
|
|
14
|
-
import { buildReferencesGraph } from './build-references'
|
|
15
|
-
import { computePropUsage } from './compute-prop-usage'
|
|
16
|
-
import { IMPORT_PLACEHOLDER, MODULE_CONSTANTS_PLACEHOLDER } from './imports'
|
|
17
|
-
import { emitRegistrationAndHydration, csrInlinableConstantsFromCtx } from './emit-registration'
|
|
18
|
-
import { computeDeferredChildSlots } from './html-template'
|
|
19
|
-
import { emitChildComponentImports } from './child-components'
|
|
20
|
-
import { classifyLocalDeclarations } from './init-declarations'
|
|
21
|
-
import { emitModuleLevelDeclarations, resolveFinalImports } from './emit-module-level'
|
|
22
|
-
import { buildPhaseCtx, PHASES, runPhases } from './phases'
|
|
23
|
-
import { rewritePropsObjectRef } from './rewrite-props-object'
|
|
24
|
-
import { buildInlinableConstants } from './emit-registration'
|
|
11
|
+
import type { ComponentIR } from '../types.ts'
|
|
12
|
+
import type { ClientJsContext } from './types.ts'
|
|
13
|
+
import { PROPS_PARAM } from './utils.ts'
|
|
14
|
+
import { buildReferencesGraph } from './build-references.ts'
|
|
15
|
+
import { computePropUsage } from './compute-prop-usage.ts'
|
|
16
|
+
import { IMPORT_PLACEHOLDER, MODULE_CONSTANTS_PLACEHOLDER } from './imports.ts'
|
|
17
|
+
import { emitRegistrationAndHydration, csrInlinableConstantsFromCtx } from './emit-registration.ts'
|
|
18
|
+
import { computeDeferredChildSlots } from './html-template.ts'
|
|
19
|
+
import { emitChildComponentImports } from './child-components.ts'
|
|
20
|
+
import { classifyLocalDeclarations } from './init-declarations.ts'
|
|
21
|
+
import { emitModuleLevelDeclarations, resolveFinalImports } from './emit-module-level.ts'
|
|
22
|
+
import { buildPhaseCtx, PHASES, runPhases } from './phases.ts'
|
|
23
|
+
import { rewritePropsObjectRef } from './rewrite-props-object.ts'
|
|
24
|
+
import { buildInlinableConstants } from './emit-registration.ts'
|
|
25
25
|
import { BF_SCOPE } from '@barefootjs/shared'
|
|
26
26
|
|
|
27
27
|
export function generateInitFunction(
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* IR → HTML template string generation and validation.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { AttrValue, IRAttribute, IRNode, IRProp } from '../types'
|
|
6
|
-
import { isBooleanAttr } from '../html-constants'
|
|
7
|
-
import { toHtmlAttrName, attrValueToString, quotePropName, PROPS_PARAM, DATA_BF_PH, keyAttrName, loopStartMarker, loopEndMarker, loopItemMarker, freeIdsFromRefs, setIntersects, wrapExprWithLoopParams } from './utils'
|
|
8
|
-
import type { LoopParamSpec } from './utils'
|
|
9
|
-
import { nameForRegistryRef } from './component-scope'
|
|
10
|
-
import { assertNever } from './walker'
|
|
11
|
-
import { buildSignalMemoEnv, csrSubstitute, applyPropsRewrite, type CsrEnv } from './csr-substitute'
|
|
12
|
-
import type { ClientJsContext } from './types'
|
|
5
|
+
import type { AttrValue, IRAttribute, IRNode, IRProp } from '../types.ts'
|
|
6
|
+
import { isBooleanAttr } from '../html-constants.ts'
|
|
7
|
+
import { toHtmlAttrName, attrValueToString, quotePropName, PROPS_PARAM, DATA_BF_PH, keyAttrName, loopStartMarker, loopEndMarker, loopItemMarker, freeIdsFromRefs, setIntersects, wrapExprWithLoopParams } from './utils.ts'
|
|
8
|
+
import type { LoopParamSpec } from './utils.ts'
|
|
9
|
+
import { nameForRegistryRef } from './component-scope.ts'
|
|
10
|
+
import { assertNever } from './walker.ts'
|
|
11
|
+
import { buildSignalMemoEnv, csrSubstitute, applyPropsRewrite, type CsrEnv } from './csr-substitute.ts'
|
|
12
|
+
import type { ClientJsContext } from './types.ts'
|
|
13
13
|
import { BF_PARENT_SCOPE_PLACEHOLDER, BF_SCOPE } from '@barefootjs/shared'
|
|
14
|
-
import { buildLoopChainExpr } from '../loop-chain'
|
|
14
|
+
import { buildLoopChainExpr } from '../loop-chain.ts'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Protect string literals from regex-based replacements.
|
|
@@ -114,7 +114,7 @@ const VOID_ELEMENTS = new Set([
|
|
|
114
114
|
* The `base` override lets the CSR-template path pre-substitute
|
|
115
115
|
* props (`_p.items.toSorted(...)`) before the chain rides on top.
|
|
116
116
|
*/
|
|
117
|
-
function applyLoopChain(loop: import('../types').IRLoop, base: string = loop.array): string {
|
|
117
|
+
function applyLoopChain(loop: import('../types.ts').IRLoop, base: string = loop.array): string {
|
|
118
118
|
return buildLoopChainExpr({
|
|
119
119
|
base,
|
|
120
120
|
sortComparator: loop.sortComparator,
|
|
@@ -129,7 +129,7 @@ function applyLoopChain(loop: import('../types').IRLoop, base: string = loop.arr
|
|
|
129
129
|
* Returns the (possibly wrapped) array and the callback param string.
|
|
130
130
|
*/
|
|
131
131
|
function applyIterationShape(
|
|
132
|
-
node: import('../types').IRLoop,
|
|
132
|
+
node: import('../types.ts').IRLoop,
|
|
133
133
|
arrayExpr: string,
|
|
134
134
|
indexParam: string,
|
|
135
135
|
): { array: string; callbackParam: string } {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { ComponentIR, IRNode } from '../types'
|
|
5
|
+
import type { ComponentIR, IRNode } from '../types.ts'
|
|
6
6
|
|
|
7
7
|
// All exports from @barefootjs/client/runtime that may be used in generated code
|
|
8
8
|
export const RUNTIME_IMPORT_CANDIDATES = [
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* Generates client-side JavaScript from Pure IR for hydration.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { ComponentIR } from '../types'
|
|
8
|
-
import type { ClientJsContext } from './types'
|
|
7
|
+
import type { ComponentIR } from '../types.ts'
|
|
8
|
+
import type { ClientJsContext } from './types.ts'
|
|
9
9
|
import type {
|
|
10
10
|
TemplatePrimitiveRegistry,
|
|
11
11
|
TemplateCallAcceptor,
|
|
12
|
-
} from '../adapters/interface'
|
|
13
|
-
import { collectElements, computeLoopSiblingOffsets } from './collect-elements'
|
|
14
|
-
import { generateInitFunction } from './generate-init'
|
|
15
|
-
import { buildReferencesGraph, graphUsedIdentifiers } from './build-references'
|
|
16
|
-
import { addConstantPropRefsToSet } from './init-declarations'
|
|
17
|
-
import { canGenerateStaticTemplate, irToComponentTemplate, generateCsrTemplate } from './html-template'
|
|
18
|
-
import { PROPS_PARAM } from './utils'
|
|
19
|
-
import { buildInlinableConstants, csrInlinableConstantsFromCtx } from './emit-registration'
|
|
20
|
-
import { buildEnvFromCtx } from './compute-inlinability'
|
|
21
|
-
import { nameForRegistryRef } from './component-scope'
|
|
22
|
-
import { IMPORT_PLACEHOLDER, RUNTIME_MODULE, detectUsedImports, collectExternalImports } from './imports'
|
|
23
|
-
import { isInlinableInTemplate } from '../relocate'
|
|
24
|
-
import { buildSourceMapFromIR, type SourceMapV3 } from './source-map'
|
|
12
|
+
} from '../adapters/interface.ts'
|
|
13
|
+
import { collectElements, computeLoopSiblingOffsets } from './collect-elements.ts'
|
|
14
|
+
import { generateInitFunction } from './generate-init.ts'
|
|
15
|
+
import { buildReferencesGraph, graphUsedIdentifiers } from './build-references.ts'
|
|
16
|
+
import { addConstantPropRefsToSet } from './init-declarations.ts'
|
|
17
|
+
import { canGenerateStaticTemplate, irToComponentTemplate, generateCsrTemplate } from './html-template.ts'
|
|
18
|
+
import { PROPS_PARAM } from './utils.ts'
|
|
19
|
+
import { buildInlinableConstants, csrInlinableConstantsFromCtx } from './emit-registration.ts'
|
|
20
|
+
import { buildEnvFromCtx } from './compute-inlinability.ts'
|
|
21
|
+
import { nameForRegistryRef } from './component-scope.ts'
|
|
22
|
+
import { IMPORT_PLACEHOLDER, RUNTIME_MODULE, detectUsedImports, collectExternalImports } from './imports.ts'
|
|
23
|
+
import { isInlinableInTemplate } from '../relocate.ts'
|
|
24
|
+
import { buildSourceMapFromIR, type SourceMapV3 } from './source-map.ts'
|
|
25
25
|
|
|
26
26
|
export interface ClientJsResult {
|
|
27
27
|
code: string
|
|
@@ -26,14 +26,14 @@ import type {
|
|
|
26
26
|
MemoInfo,
|
|
27
27
|
ReferencesGraph,
|
|
28
28
|
SignalInfo,
|
|
29
|
-
} from '../types'
|
|
30
|
-
import { computeDeclarationScopes } from './compute-scope'
|
|
31
|
-
import { graphUsedIdentifiers } from './build-references'
|
|
32
|
-
import { getControlledPropName } from './prop-handling'
|
|
33
|
-
import { type Declaration, providedNames, sortDeclarations } from './declaration-sort'
|
|
34
|
-
import { buildDeclarationEmitLookups, buildDeclarationEmitPlan } from './plan/build-declaration-emit'
|
|
35
|
-
import { stringifyDeclarationEmit } from './stringify/declaration-emit'
|
|
36
|
-
import type { ClientJsContext } from './types'
|
|
29
|
+
} from '../types.ts'
|
|
30
|
+
import { computeDeclarationScopes } from './compute-scope.ts'
|
|
31
|
+
import { graphUsedIdentifiers } from './build-references.ts'
|
|
32
|
+
import { getControlledPropName } from './prop-handling.ts'
|
|
33
|
+
import { type Declaration, providedNames, sortDeclarations } from './declaration-sort.ts'
|
|
34
|
+
import { buildDeclarationEmitLookups, buildDeclarationEmitPlan } from './plan/build-declaration-emit.ts'
|
|
35
|
+
import { stringifyDeclarationEmit } from './stringify/declaration-emit.ts'
|
|
36
|
+
import type { ClientJsContext } from './types.ts'
|
|
37
37
|
|
|
38
38
|
export interface ControlledSignal {
|
|
39
39
|
signal: SignalInfo
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Cached once per generate-init invocation (see `buildPhaseCtx`).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ClientJsContext } from '../types'
|
|
11
|
+
import type { ClientJsContext } from '../types.ts'
|
|
12
12
|
|
|
13
13
|
export function collectConditionalSlotIds(ctx: ClientJsContext): Set<string> {
|
|
14
14
|
const slots = new Set<string>()
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* value) still resolves at runtime.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { ClientJsContext } from '../types'
|
|
10
|
+
import type { ClientJsContext } from '../types.ts'
|
|
11
11
|
|
|
12
12
|
export function emitEffectsAndOnMounts(lines: string[], ctx: ClientJsContext): void {
|
|
13
13
|
for (const effect of ctx.effects) {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* root element carries the listener (no `bf=` slot).
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { ClientJsContext } from '../types'
|
|
13
|
-
import { toDomEventName, varSlotId, wrapHandlerInBlock } from '../utils'
|
|
12
|
+
import type { ClientJsContext } from '../types.ts'
|
|
13
|
+
import { toDomEventName, varSlotId, wrapHandlerInBlock } from '../utils.ts'
|
|
14
14
|
|
|
15
15
|
export function emitEventHandlers(
|
|
16
16
|
lines: string[],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* the orchestrator. Folding it in keeps the phase self-contained.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type { ClientJsContext } from '../types'
|
|
14
|
+
import type { ClientJsContext } from '../types.ts'
|
|
15
15
|
|
|
16
16
|
export function emitInitStatements(lines: string[], ctx: ClientJsContext): void {
|
|
17
17
|
if (ctx.initStatements.length === 0) return
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* `handlerName(...)` without writing the prop accessor inline.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ClientJsContext } from '../types'
|
|
12
|
-
import { PROPS_PARAM } from '../utils'
|
|
11
|
+
import type { ClientJsContext } from '../types.ts'
|
|
12
|
+
import { PROPS_PARAM } from '../utils.ts'
|
|
13
13
|
|
|
14
14
|
export function emitPropsEventHandlers(
|
|
15
15
|
lines: string[],
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
* `_p.X` directly via the late-stage rename.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import type { PropUsage } from '../../types'
|
|
21
|
-
import { propHasPropertyAccess } from '../compute-prop-usage'
|
|
22
|
-
import type { ClientJsContext } from '../types'
|
|
23
|
-
import { inferDefaultValue, PROPS_PARAM } from '../utils'
|
|
20
|
+
import type { PropUsage } from '../../types.ts'
|
|
21
|
+
import { propHasPropertyAccess } from '../compute-prop-usage.ts'
|
|
22
|
+
import type { ClientJsContext } from '../types.ts'
|
|
23
|
+
import { inferDefaultValue, PROPS_PARAM } from '../utils.ts'
|
|
24
24
|
|
|
25
25
|
export function emitPropsExtraction(
|
|
26
26
|
lines: string[],
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* `useContext()`.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type { ClientJsContext } from '../types'
|
|
15
|
-
import { varSlotId } from '../utils'
|
|
16
|
-
import { nameForRegistryRef } from '../component-scope'
|
|
14
|
+
import type { ClientJsContext } from '../types.ts'
|
|
15
|
+
import { varSlotId } from '../utils.ts'
|
|
16
|
+
import { nameForRegistryRef } from '../component-scope.ts'
|
|
17
17
|
|
|
18
18
|
export function emitProviderAndChildInits(lines: string[], ctx: ClientJsContext): void {
|
|
19
19
|
if (ctx.providerSetups.length > 0) {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* runs the ref callback every time the branch swaps in.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ClientJsContext } from '../types'
|
|
9
|
-
import { emitRefCall, varSlotId } from '../utils'
|
|
8
|
+
import type { ClientJsContext } from '../types.ts'
|
|
9
|
+
import { emitRefCall, varSlotId } from '../utils.ts'
|
|
10
10
|
|
|
11
11
|
export function emitRefCallbacks(
|
|
12
12
|
lines: string[],
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* DOM attributes, skipping the keys statically set on the element.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { ClientJsContext } from '../types'
|
|
10
|
-
import { varSlotId } from '../utils'
|
|
9
|
+
import type { ClientJsContext } from '../types.ts'
|
|
10
|
+
import { varSlotId } from '../utils.ts'
|
|
11
11
|
|
|
12
12
|
export function emitRestAttrApplications(lines: string[], ctx: ClientJsContext): void {
|
|
13
13
|
if (ctx.restAttrElements.length === 0) return
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* available when array children call `useContext()`.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { buildStaticArrayChildInitsPlan } from '../plan/build-static-array-child-init'
|
|
15
|
-
import { stringifyStaticArrayChildInits } from '../stringify/static-array-child-init'
|
|
16
|
-
import type { ClientJsContext } from '../types'
|
|
14
|
+
import { buildStaticArrayChildInitsPlan } from '../plan/build-static-array-child-init.ts'
|
|
15
|
+
import { stringifyStaticArrayChildInits } from '../stringify/static-array-child-init.ts'
|
|
16
|
+
import type { ClientJsContext } from '../types.ts'
|
|
17
17
|
|
|
18
18
|
export function emitStaticArrayChildInits(lines: string[], ctx: ClientJsContext): void {
|
|
19
19
|
const plans = buildStaticArrayChildInitsPlan(ctx)
|
|
@@ -13,30 +13,30 @@
|
|
|
13
13
|
* a long manual sequence.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import type { ComponentIR, PropUsage, ReferencesGraph } from '../types'
|
|
17
|
-
import type { ClientJsContext } from './types'
|
|
18
|
-
import type { LocalClassification } from './init-declarations'
|
|
19
|
-
import { collectConditionalSlotIds } from './phases/conditional-slot-ids'
|
|
20
|
-
import { emitEffectsAndOnMounts } from './phases/effects-and-on-mounts'
|
|
21
|
-
import { emitEventHandlers } from './phases/event-handlers'
|
|
22
|
-
import { emitInitStatements } from './phases/init-statements'
|
|
23
|
-
import { emitProviderAndChildInits } from './phases/provider-and-child-inits'
|
|
24
|
-
import { emitPropsEventHandlers } from './phases/props-event-handlers'
|
|
25
|
-
import { emitPropsExtraction } from './phases/props-extraction'
|
|
26
|
-
import { emitRefCallbacks } from './phases/ref-callbacks'
|
|
27
|
-
import { emitRestAttrApplications } from './phases/rest-attr-applications'
|
|
28
|
-
import { emitStaticArrayChildInits } from './phases/static-array-child-inits'
|
|
29
|
-
import { emitClientOnlyConditionals, emitConditionalUpdates, emitLoopUpdates } from './control-flow'
|
|
16
|
+
import type { ComponentIR, PropUsage, ReferencesGraph } from '../types.ts'
|
|
17
|
+
import type { ClientJsContext } from './types.ts'
|
|
18
|
+
import type { LocalClassification } from './init-declarations.ts'
|
|
19
|
+
import { collectConditionalSlotIds } from './phases/conditional-slot-ids.ts'
|
|
20
|
+
import { emitEffectsAndOnMounts } from './phases/effects-and-on-mounts.ts'
|
|
21
|
+
import { emitEventHandlers } from './phases/event-handlers.ts'
|
|
22
|
+
import { emitInitStatements } from './phases/init-statements.ts'
|
|
23
|
+
import { emitProviderAndChildInits } from './phases/provider-and-child-inits.ts'
|
|
24
|
+
import { emitPropsEventHandlers } from './phases/props-event-handlers.ts'
|
|
25
|
+
import { emitPropsExtraction } from './phases/props-extraction.ts'
|
|
26
|
+
import { emitRefCallbacks } from './phases/ref-callbacks.ts'
|
|
27
|
+
import { emitRestAttrApplications } from './phases/rest-attr-applications.ts'
|
|
28
|
+
import { emitStaticArrayChildInits } from './phases/static-array-child-inits.ts'
|
|
29
|
+
import { emitClientOnlyConditionals, emitConditionalUpdates, emitLoopUpdates } from './control-flow.ts'
|
|
30
30
|
import {
|
|
31
31
|
emitClientOnlyExpressions,
|
|
32
32
|
emitDynamicTextUpdates,
|
|
33
33
|
emitReactiveAttributeUpdates,
|
|
34
34
|
emitReactiveChildProps,
|
|
35
35
|
emitReactivePropBindings,
|
|
36
|
-
} from './emit-reactive'
|
|
37
|
-
import { emitSortedDeclarations } from './init-declarations'
|
|
38
|
-
import { generateElementRefs } from './element-refs'
|
|
39
|
-
import { graphUsedFunctions } from './build-references'
|
|
36
|
+
} from './emit-reactive.ts'
|
|
37
|
+
import { emitSortedDeclarations } from './init-declarations.ts'
|
|
38
|
+
import { generateElementRefs } from './element-refs.ts'
|
|
39
|
+
import { graphUsedFunctions } from './build-references.ts'
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Inputs available to every phase. Built once by `generateInitFunction`
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
* the branches is easy to review.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ControlledSignal } from '../init-declarations'
|
|
12
|
-
import type { Declaration } from '../declaration-sort'
|
|
13
|
-
import type { ClientJsContext } from '../types'
|
|
14
|
-
import type { ParamInfo, SignalInfo } from '../../types'
|
|
15
|
-
import { inferDefaultValue, PROPS_PARAM } from '../utils'
|
|
11
|
+
import type { ControlledSignal } from '../init-declarations.ts'
|
|
12
|
+
import type { Declaration } from '../declaration-sort.ts'
|
|
13
|
+
import type { ClientJsContext } from '../types.ts'
|
|
14
|
+
import type { ParamInfo, SignalInfo } from '../../types.ts'
|
|
15
|
+
import { inferDefaultValue, PROPS_PARAM } from '../utils.ts'
|
|
16
16
|
import type {
|
|
17
17
|
ControlledSignalEffectPlan,
|
|
18
18
|
DeclarationEmitPlan,
|
|
19
19
|
SignalEmitPlan,
|
|
20
|
-
} from './declaration-emit'
|
|
20
|
+
} from './declaration-emit.ts'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Pre-computed lookup tables used while building declaration plans.
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
* stringifier never inspects raw IR.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import type { IRLoopChildComponent } from '../../types'
|
|
21
|
-
import type { NestedLoop, TopLevelLoop } from '../types'
|
|
22
|
-
import type { ClientJsContext } from '../types'
|
|
23
|
-
import { quotePropName, varSlotId, attrValueToString, buildLoopChildIndexExpr } from '../utils'
|
|
24
|
-
import { irChildrenToJsExpr } from '../html-template'
|
|
25
|
-
import { buildCompSelector } from '../control-flow/shared'
|
|
20
|
+
import type { IRLoopChildComponent } from '../../types.ts'
|
|
21
|
+
import type { NestedLoop, TopLevelLoop } from '../types.ts'
|
|
22
|
+
import type { ClientJsContext } from '../types.ts'
|
|
23
|
+
import { quotePropName, varSlotId, attrValueToString, buildLoopChildIndexExpr } from '../utils.ts'
|
|
24
|
+
import { irChildrenToJsExpr } from '../html-template.ts'
|
|
25
|
+
import { buildCompSelector } from '../control-flow/shared.ts'
|
|
26
26
|
|
|
27
27
|
/** The inline prop shape carried on `IRLoopChildComponent.props`. */
|
|
28
28
|
type LoopChildCompProp = IRLoopChildComponent['props'][number]
|
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
SingleCompInitPlan,
|
|
36
36
|
StaticArrayChildInitPlan,
|
|
37
37
|
StaticArrayChildInitsPlan,
|
|
38
|
-
} from './static-array-child-init'
|
|
38
|
+
} from './static-array-child-init.ts'
|
|
39
39
|
|
|
40
40
|
export function buildStaticArrayChildInitsPlan(
|
|
41
41
|
ctx: ClientJsContext,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* shapes were determined by inline branching on the IR.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import type { PreludeStatements } from '../control-flow/plan/inner-loop'
|
|
26
|
+
import type { PreludeStatements } from '../control-flow/plan/inner-loop.ts'
|
|
27
27
|
|
|
28
28
|
/** Pre-built `{ name: value, ... }` props object expression. */
|
|
29
29
|
export type PropsExpr = string
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Props expansion, dependency analysis, and controlled component detection.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { ParamInfo, SignalInfo } from '../types'
|
|
6
|
-
import type { ClientJsContext } from './types'
|
|
5
|
+
import type { ParamInfo, SignalInfo } from '../types.ts'
|
|
6
|
+
import type { ClientJsContext } from './types.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Expand dynamic prop value by resolving local constants.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reactivity detection: reactive expression checking, event/ref collection.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { type IRNode, type IRElement, type IRProp, type LoopParamBinding, type OriginInfo, pickAttrMetaFromIR, isReactiveOrigin } from '../types'
|
|
5
|
+
import { type IRNode, type IRElement, type IRProp, type LoopParamBinding, type OriginInfo, pickAttrMetaFromIR, isReactiveOrigin } from '../types.ts'
|
|
6
6
|
import type {
|
|
7
7
|
ClientJsContext,
|
|
8
8
|
ConditionalBranchEvent,
|
|
@@ -13,10 +13,10 @@ import type {
|
|
|
13
13
|
LoopChildRef,
|
|
14
14
|
LoopChildReactiveText,
|
|
15
15
|
NestedLoop,
|
|
16
|
-
} from './types'
|
|
17
|
-
import { attrValueToString, freeIdsFromRefs, tokenContainsIdent } from './utils'
|
|
18
|
-
import { expandConstantForReactivity } from './prop-handling'
|
|
19
|
-
import { walkIR, stopAt } from './walker'
|
|
16
|
+
} from './types.ts'
|
|
17
|
+
import { attrValueToString, freeIdsFromRefs, tokenContainsIdent } from './utils.ts'
|
|
18
|
+
import { expandConstantForReactivity } from './prop-handling.ts'
|
|
19
|
+
import { walkIR, stopAt } from './walker.ts'
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Phase 2 reactivity detection: determines if a code expression needs `createEffect`
|