@barefootjs/jsx 0.39.6 → 0.39.8
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-plan.d.ts +8 -1
- package/dist/adapters/attr-plan.d.ts.map +1 -1
- package/dist/adapters/callback-method.d.ts +44 -0
- package/dist/adapters/callback-method.d.ts.map +1 -1
- package/dist/adapters/component-props.d.ts +80 -13
- package/dist/adapters/component-props.d.ts.map +1 -1
- package/dist/adapters/computed-const.d.ts +52 -0
- package/dist/adapters/computed-const.d.ts.map +1 -0
- package/dist/adapters/dangerous-inner-html.d.ts +10 -0
- package/dist/adapters/dangerous-inner-html.d.ts.map +1 -1
- package/dist/adapters/dsl-template-adapter.d.ts +151 -0
- package/dist/adapters/dsl-template-adapter.d.ts.map +1 -0
- package/dist/adapters/element-shell.d.ts +44 -0
- package/dist/adapters/element-shell.d.ts.map +1 -0
- package/dist/adapters/interface.d.ts +2 -0
- package/dist/adapters/interface.d.ts.map +1 -1
- package/dist/adapters/jsx-adapter.d.ts +4 -0
- package/dist/adapters/jsx-adapter.d.ts.map +1 -1
- package/dist/adapters/literal-value.d.ts +2 -2
- package/dist/adapters/literal-value.d.ts.map +1 -1
- package/dist/adapters/parsed-expr-emitter.d.ts +27 -0
- package/dist/adapters/parsed-expr-emitter.d.ts.map +1 -1
- package/dist/adapters/style-object.d.ts +33 -0
- package/dist/adapters/style-object.d.ts.map +1 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/augment-inherited-props.d.ts +7 -0
- package/dist/augment-inherited-props.d.ts.map +1 -1
- package/dist/children-nullish.d.ts +22 -0
- package/dist/children-nullish.d.ts.map +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/expression-parser.d.ts +9 -19
- package/dist/expression-parser.d.ts.map +1 -1
- package/dist/fold-render-reassignments.d.ts +43 -0
- package/dist/fold-render-reassignments.d.ts.map +1 -0
- package/dist/free-refs.d.ts +15 -0
- package/dist/free-refs.d.ts.map +1 -1
- package/dist/index.d.ts +21 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24620 -23233
- package/dist/ir-to-client-js/compute-inlinability.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/event-collision.d.ts +2 -1
- package/dist/ir-to-client-js/control-flow/plan/event-collision.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/insert.d.ts +2 -2
- package/dist/ir-to-client-js/control-flow/plan/insert.d.ts.map +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/event-listener.d.ts +10 -9
- package/dist/ir-to-client-js/control-flow/stringify/event-listener.d.ts.map +1 -1
- package/dist/ir-to-client-js/csr-substitute.d.ts +0 -13
- package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-registration.d.ts +10 -8
- package/dist/ir-to-client-js/emit-registration.d.ts.map +1 -1
- package/dist/ir-to-client-js/generate-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +9 -19
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/identifiers.d.ts +6 -8
- package/dist/ir-to-client-js/identifiers.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +23 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/index.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/props-extraction.d.ts +3 -2
- package/dist/ir-to-client-js/phases/props-extraction.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/declaration-emit.d.ts +5 -0
- package/dist/ir-to-client-js/plan/declaration-emit.d.ts.map +1 -1
- package/dist/ir-to-client-js/prop-handling.d.ts +11 -12
- package/dist/ir-to-client-js/prop-handling.d.ts.map +1 -1
- package/dist/ir-to-client-js/prune-unused-prop-extractions.d.ts +1 -1
- package/dist/ir-to-client-js/prune-unused-prop-extractions.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-destructured-props.d.ts +1 -1
- package/dist/ir-to-client-js/rewrite-destructured-props.d.ts.map +1 -1
- package/dist/ir-to-client-js/safe-html.d.ts +20 -2
- package/dist/ir-to-client-js/safe-html.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +3 -3
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +15 -11
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/nullable-signal-attr.d.ts +43 -12
- package/dist/nullable-signal-attr.d.ts.map +1 -1
- package/dist/prop-rewrite.d.ts +18 -0
- package/dist/prop-rewrite.d.ts.map +1 -1
- package/dist/props-binding.d.ts +43 -6
- package/dist/props-binding.d.ts.map +1 -1
- package/dist/relocate.d.ts +16 -0
- package/dist/relocate.d.ts.map +1 -1
- package/dist/scanner/js-scanner.d.ts.map +1 -1
- package/dist/scanner/js-scanner.js +30 -2
- package/dist/signal-prop-name-collision.d.ts +6 -5
- package/dist/signal-prop-name-collision.d.ts.map +1 -1
- package/dist/ssr-defaults.d.ts +28 -0
- package/dist/ssr-defaults.d.ts.map +1 -1
- package/dist/ssr-seed-plan.d.ts +37 -18
- package/dist/ssr-seed-plan.d.ts.map +1 -1
- package/dist/types.d.ts +162 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/value-references.d.ts +21 -0
- package/dist/value-references.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +18 -18
- package/src/__tests__/adapter-output.test.ts +5 -3
- package/src/__tests__/analyzer.test.ts +33 -0
- package/src/__tests__/arithmetic-lowering.test.ts +44 -0
- package/src/__tests__/block-memo-type.test.ts +51 -0
- package/src/__tests__/callback-method.test.ts +75 -0
- package/src/__tests__/children-read.test.ts +226 -0
- package/src/__tests__/client-only-date-lowering.test.ts +2 -2
- package/src/__tests__/client-template-escape-soundness.test.ts +31 -1
- package/src/__tests__/component-props.test.ts +68 -1
- package/src/__tests__/computed-const.test.ts +101 -0
- package/src/__tests__/constant-inlining-tree.test.ts +136 -0
- package/src/__tests__/destructure-default-reads-earlier-param.test.ts +138 -0
- package/src/__tests__/dsl-template-adapter.test.ts +173 -0
- package/src/__tests__/element-shell.test.ts +78 -0
- package/src/__tests__/event-handler-verbatim.test.ts +73 -0
- package/src/__tests__/expression-parser.test.ts +1 -44
- package/src/__tests__/fold-render-reassignments.test.ts +96 -0
- package/src/__tests__/inlinable-local-method-call.test.ts +81 -0
- package/src/__tests__/memo-body-expr.test.ts +120 -0
- package/src/__tests__/nullable-signal-attr.test.ts +67 -3
- package/src/__tests__/prop-handling.test.ts +35 -16
- package/src/__tests__/props-alias-const.test.ts +65 -0
- package/src/__tests__/reference-graph-identifiers.test.ts +161 -0
- package/src/__tests__/runtime-import-detection.test.ts +134 -0
- package/src/__tests__/signal-prop-name-collision.test.ts +30 -0
- package/src/__tests__/signal-prop-seed.test.ts +90 -0
- package/src/__tests__/ssr-defaults.test.ts +19 -1
- package/src/__tests__/ssr-seed-plan.test.ts +173 -1
- package/src/__tests__/static-template-reachability.test.ts +137 -0
- package/src/__tests__/style-object-plan.test.ts +54 -0
- package/src/__tests__/zero-param-helper-inline.test.ts +57 -0
- package/src/adapters/attr-plan.ts +29 -1
- package/src/adapters/callback-method.ts +85 -0
- package/src/adapters/component-props.ts +130 -12
- package/src/adapters/computed-const.ts +185 -0
- package/src/adapters/dangerous-inner-html.ts +33 -0
- package/src/adapters/dsl-template-adapter.ts +248 -0
- package/src/adapters/element-shell.ts +160 -0
- package/src/adapters/interface.ts +8 -0
- package/src/adapters/jsx-adapter.ts +12 -6
- package/src/adapters/literal-value.ts +2 -2
- package/src/adapters/parsed-expr-emitter.ts +34 -0
- package/src/adapters/style-object.ts +61 -0
- package/src/analyzer.ts +382 -94
- package/src/augment-inherited-props.ts +12 -0
- package/src/children-nullish.ts +33 -0
- package/src/debug.ts +2 -2
- package/src/errors.ts +12 -0
- package/src/expression-parser.ts +56 -53
- package/src/fold-render-reassignments.ts +314 -0
- package/src/free-refs.ts +77 -17
- package/src/index.ts +27 -10
- package/src/ir-to-client-js/compute-inlinability.ts +122 -19
- package/src/ir-to-client-js/control-flow/plan/event-collision.ts +2 -1
- package/src/ir-to-client-js/control-flow/plan/insert.ts +2 -2
- package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +3 -2
- package/src/ir-to-client-js/control-flow/stringify/event-listener.ts +13 -12
- package/src/ir-to-client-js/csr-substitute.ts +25 -37
- package/src/ir-to-client-js/emit-reactive.ts +2 -2
- package/src/ir-to-client-js/emit-registration.ts +31 -59
- package/src/ir-to-client-js/generate-init.ts +17 -1
- package/src/ir-to-client-js/html-template.ts +56 -120
- package/src/ir-to-client-js/identifiers.ts +75 -24
- package/src/ir-to-client-js/imports.ts +56 -19
- package/src/ir-to-client-js/index.ts +5 -3
- package/src/ir-to-client-js/init-declarations.ts +1 -1
- package/src/ir-to-client-js/phases/event-handlers.ts +2 -2
- package/src/ir-to-client-js/phases/props-extraction.ts +16 -15
- package/src/ir-to-client-js/plan/build-declaration-emit.ts +26 -52
- package/src/ir-to-client-js/plan/declaration-emit.ts +5 -0
- package/src/ir-to-client-js/prop-handling.ts +13 -54
- package/src/ir-to-client-js/prune-unused-prop-extractions.ts +7 -4
- package/src/ir-to-client-js/reactivity.ts +2 -2
- package/src/ir-to-client-js/rewrite-destructured-props.ts +27 -9
- package/src/ir-to-client-js/safe-html.ts +29 -35
- package/src/ir-to-client-js/stringify/declaration-emit.ts +1 -1
- package/src/ir-to-client-js/types.ts +3 -2
- package/src/ir-to-client-js/utils.ts +13 -26
- package/src/jsx-to-ir.ts +318 -130
- package/src/nullable-signal-attr.ts +156 -37
- package/src/prop-rewrite.ts +41 -0
- package/src/props-binding.ts +117 -7
- package/src/relocate.ts +40 -8
- package/src/scanner/__tests__/js-scanner.test.ts +37 -0
- package/src/scanner/js-scanner.ts +64 -4
- package/src/signal-prop-name-collision.ts +50 -24
- package/src/ssr-defaults.ts +47 -20
- package/src/ssr-seed-plan.ts +121 -29
- package/src/types.ts +165 -21
- package/src/value-references.ts +132 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-inlinability.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/compute-inlinability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAc,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"compute-inlinability.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/compute-inlinability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAc,MAAM,cAAc,CAAA;AAOtD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,WAAW,CAkCjE;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC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,CA4GtB;AA8YD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,YAAY,EACf,SAAS,EAAE,gBAAgB,EAAE,EAC7B,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,EAAE,GACvC,IAAI,CAiBN;AAuFD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,EAC9F,GAAG,EAAE,eAAe,GACnB;IACD,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B,CA+EA"}
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
* dispatcher instead) call it, rather than answering the question twice.
|
|
19
19
|
*/
|
|
20
20
|
import type { InteractiveElement } from '../../types.ts';
|
|
21
|
+
import type { JsSourceText } from '../../../types.ts';
|
|
21
22
|
export interface ContainerOwnHandler {
|
|
22
23
|
/** The container element's own slot id (used for profile-mode turn ids). */
|
|
23
24
|
slotId: string;
|
|
24
25
|
/** Original (pre-DOM-mapped) event name, e.g. 'contextmenu'. */
|
|
25
26
|
eventName: string;
|
|
26
|
-
handler:
|
|
27
|
+
handler: JsSourceText;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Find the container's own handler for `domEventName`, if any.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-collision.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/event-collision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"event-collision.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/event-collision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,YAAY,CAAA;CACtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC/B,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB,mBAAmB,GAAG,IAAI,CAO5B"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* runtime call. Nested conditionals nest as `InsertPlan` recursively in
|
|
6
6
|
* `ArmBody.conditionals`, so one stringifier handles arbitrary depth.
|
|
7
7
|
*/
|
|
8
|
-
import type { AttrMeta } from '../../../types.ts';
|
|
8
|
+
import type { AttrMeta, JsSourceText } from '../../../types.ts';
|
|
9
9
|
import type { ScopeRef } from './common.ts';
|
|
10
10
|
import type { BranchLoopPlan } from './branch-loop.ts';
|
|
11
11
|
/**
|
|
@@ -79,7 +79,7 @@ export interface ArmEventBind {
|
|
|
79
79
|
slotId: string;
|
|
80
80
|
eventName: string;
|
|
81
81
|
/** Handler source expression (already trimmed). The stringifier wraps it. */
|
|
82
|
-
handler:
|
|
82
|
+
handler: JsSourceText;
|
|
83
83
|
/** Profile-mode turn id (#1690, SR3); when set the listener is turn-wrapped. */
|
|
84
84
|
turnId?: string;
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/insert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/insert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,yEAAyE;IACzE,KAAK,EAAE,QAAQ,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAC5B;;;;OAIG;IACH,aAAa,EAAE,KAAK,GAAG,KAAK,CAAA;IAC5B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,0CAA0C;AAC1C,MAAM,WAAW,SAAS;IACxB,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,OAAO,CAAA;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,+DAA+D;IAC/D,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,4DAA4D;IAC5D,IAAI,EAAE,UAAU,EAAE,CAAA;IAClB,yEAAyE;IACzE,eAAe,EAAE,qBAAqB,EAAE,CAAA;IACxC;;;;;OAKG;IACH,aAAa,EAAE,eAAe,EAAE,CAAA;IAChC,0FAA0F;IAC1F,WAAW,EAAE,aAAa,EAAE,CAAA;IAC5B;;;OAGG;IACH,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB;;;OAGG;IACH,YAAY,EAAE,UAAU,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,OAAO,EAAE,YAAY,CAAA;IACrB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,kBAAkB,CAAA;AAgDzB,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAqGzF"}
|
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
* 2. inline event setup (`emit-control-flow.ts::emitEventSetup`)
|
|
7
7
|
* 3. loop-cond branch bindings (`stringify/loop-child-arm.ts::stringifyBranchEventBindings`)
|
|
8
8
|
*
|
|
9
|
-
* Each repeated
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Each repeated the DOM-event-name normalisation + `if (elem)
|
|
10
|
+
* elem.addEventListener(...)` line. Centralising the shape here keeps the
|
|
11
|
+
* event-name decision in one place — useful when
|
|
12
12
|
* we eventually drop the legacy "raw event name" mode (currently only used
|
|
13
13
|
* by `@client` conditionals).
|
|
14
14
|
*/
|
|
15
|
+
import type { JsSourceText } from '../../../types.ts';
|
|
15
16
|
export type EventNameMode = 'dom' | 'raw';
|
|
16
17
|
/**
|
|
17
18
|
* Emit `if (<elementVar>) <elementVar>.addEventListener('<eventName>',
|
|
18
|
-
* <
|
|
19
|
-
*
|
|
20
|
-
* `
|
|
21
|
-
*
|
|
19
|
+
* <handler>)` on a single line. The handler is already source-level and
|
|
20
|
+
* an expression (Phase 1 parenthesizes a comma sequence), so it is passed
|
|
21
|
+
* verbatim: `addEventListener` ignores a listener's return value, so an
|
|
22
|
+
* expression-bodied arrow needs no block wrap (#3538).
|
|
22
23
|
*/
|
|
23
|
-
export declare function emitListenerLine(lines: string[], indent: string, elementVar: string, eventName: string, handler:
|
|
24
|
+
export declare function emitListenerLine(lines: string[], indent: string, elementVar: string, eventName: string, handler: JsSourceText, mode?: EventNameMode, turnId?: string): void;
|
|
24
25
|
/**
|
|
25
26
|
* Emit a `{ qsa lookup; if (elem) addEventListener; }` block on
|
|
26
27
|
* (potentially) multiple lines. Used inside loop renderItem bodies
|
|
@@ -31,5 +32,5 @@ export declare function emitListenerLine(lines: string[], indent: string, elemen
|
|
|
31
32
|
* the walk crosses past `scopeVar` into its `<!--bf-loop-i-->`-bounded
|
|
32
33
|
* siblings (#1212).
|
|
33
34
|
*/
|
|
34
|
-
export declare function emitListenerBlock(lines: string[], indent: string, scopeVar: string, slotId: string, elementLocal: string, eventName: string, handler:
|
|
35
|
+
export declare function emitListenerBlock(lines: string[], indent: string, scopeVar: string, slotId: string, elementLocal: string, eventName: string, handler: JsSourceText, mode?: EventNameMode, bodyIsMultiRoot?: boolean): void;
|
|
35
36
|
//# sourceMappingURL=event-listener.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-listener.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"event-listener.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/event-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAA;AAEzC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,IAAI,GAAE,aAAqB,EAC3B,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAMN;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,IAAI,GAAE,aAAqB,EAC3B,eAAe,GAAE,OAAe,GAC/B,IAAI,CAKN"}
|
|
@@ -145,19 +145,6 @@ export declare function extractFreeIdentifiersFromStatementText(text: string): S
|
|
|
145
145
|
* so wrapping it here to parse mirrors exactly how it's already used.
|
|
146
146
|
*/
|
|
147
147
|
export declare function extractFreeIdentifiersFromTemplateText(template: string): Set<string>;
|
|
148
|
-
/**
|
|
149
|
-
* Reduce a memo's `() => expr` source to the expression that should be
|
|
150
|
-
* substituted in for `memoName()`. Matches the extraction done by the
|
|
151
|
-
* legacy `buildSignalAndMemoMaps` in `emit-registration.ts`:
|
|
152
|
-
*
|
|
153
|
-
* - `() => expr` → `expr`
|
|
154
|
-
* - `() => { return e; }` → `e`
|
|
155
|
-
* - `() => { ...complex... }` → `(() => { ...complex... })()`
|
|
156
|
-
*
|
|
157
|
-
* The IIFE form for non-trivial blocks keeps intermediate `const`/`let`
|
|
158
|
-
* bindings in scope; inlining the block bare would dangle them.
|
|
159
|
-
*/
|
|
160
|
-
export declare function extractMemoBodyExpr(computation: string): string;
|
|
161
148
|
/**
|
|
162
149
|
* Which local consts are bare alias-hop chains that ultimately name a
|
|
163
150
|
* substitutable signal/memo getter (`isGetter`) — e.g. `const
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csr-substitute.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/csr-substitute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAI7D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAA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C9B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,cAAc,GAAE,SAAS,YAAY,EAAO,GAC3C,MAAM,CAkDR"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Handles createEffect blocks for DOM attribute syncing, dynamic text nodes,
|
|
4
4
|
* client-only expressions, and reactive component prop bindings.
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
6
|
+
import { type AttrMeta } from '../types.ts';
|
|
7
7
|
import type { ClientJsContext } from './types.ts';
|
|
8
8
|
/**
|
|
9
9
|
* Generate JS statements to update a DOM attribute reactively.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"emit-reactive.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-reactive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,KAAK,QAAQ,EAAwC,MAAM,aAAa,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA8FjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ,EACd,UAAU,GAAE,UAAU,GAAG,IAAW,GACnC,MAAM,EAAE,CA6DV;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAA;AAEtD,+FAA+F;AAC/F,MAAM,WAAW,UAAU;IACzB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;CACd;AAOD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAM,GAAG,IAA0B,EAC1C,UAAU,GAAE,UAAU,GAAG,IAAW,GACnC,MAAM,EAAE,CAYV;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,CAyBzF;AAwMD,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAoFlF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAiBrF;AAED,kGAAkG;AAClG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAgCxF;AAED,+FAA+F;AAC/F,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAqFpF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAwDlF"}
|
|
@@ -7,15 +7,17 @@ import type { ComponentIR, IRNode, ReferencesGraph } from '../types.ts';
|
|
|
7
7
|
import type { ClientJsContext } from './types.ts';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve chained references within a constants map.
|
|
10
|
-
* If constant A references constant B, replace B's name in A's value with
|
|
11
|
-
*
|
|
10
|
+
* If constant A references constant B, replace B's name in A's value with
|
|
11
|
+
* B's resolved value. The substitution runs on the expression tree
|
|
12
|
+
* (`csrSubstitute`), so a constant's name inside a string or template
|
|
13
|
+
* literal, a member name, or a binding that shadows it is never replaced,
|
|
14
|
+
* and an object-literal shorthand expands to `name: (value)` (#3535).
|
|
12
15
|
*
|
|
13
|
-
* When `freeIdsMap` is supplied, it is updated in place
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* transitively-closed free-id map
|
|
17
|
-
*
|
|
18
|
-
* re-scanning the resolved string.
|
|
16
|
+
* When `freeIdsMap` is supplied, it is updated in place to the free
|
|
17
|
+
* identifiers of each resolved value, so downstream callers
|
|
18
|
+
* (`toLegacyInlinability` unsafe-ref check, #1267) can read a
|
|
19
|
+
* transitively-closed free-id map without re-scanning the resolved string.
|
|
20
|
+
* A constant whose recorded free ids name no other constant is skipped.
|
|
19
21
|
*/
|
|
20
22
|
export declare function resolveChainedRefs(constants: Map<string, string>, freeIdsMap?: Map<string, Set<string>>): void;
|
|
21
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-registration.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAc,MAAM,aAAa,CAAA;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"emit-registration.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/emit-registration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAc,MAAM,aAAa,CAAA;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAUjD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAmB9G;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM,GACb;IACD,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B,CAGA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMtF;AAkDD,4EAA4E;AAC5E;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,eAAe;AACtB;;;;;;GAMG;AACH,YAAY,CAAC,EAAE;IAAE,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GACxF,MAAM,CAmGR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-init.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/generate-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"generate-init.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/generate-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAkBjD,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,eAAe,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAC7B,MAAM,CA4HR"}
|
|
@@ -6,15 +6,6 @@ import type { LoopParamSpec } from './utils.ts';
|
|
|
6
6
|
import { type CsrEnv } from './csr-substitute.ts';
|
|
7
7
|
import type { ClientJsContext } from './types.ts';
|
|
8
8
|
import { BindingScope } from '../scope/binding-scope.ts';
|
|
9
|
-
/**
|
|
10
|
-
* Protect string literals from regex-based replacements.
|
|
11
|
-
* Returns protect/restore functions that extract string literals before
|
|
12
|
-
* regex replacements and restore them after.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createStringProtector(): {
|
|
15
|
-
protect: (s: string) => string;
|
|
16
|
-
restore: (s: string) => string;
|
|
17
|
-
};
|
|
18
9
|
/**
|
|
19
10
|
* Split a template literal body into static segments and `${...}` interpolations,
|
|
20
11
|
* correctly handling nested braces (e.g. object literals inside interpolations).
|
|
@@ -400,18 +391,23 @@ export declare function irToComponentTemplate(node: IRNode, inlinableConstants?:
|
|
|
400
391
|
* Returns false if the component has:
|
|
401
392
|
* - Loops (which use dynamic signal arrays)
|
|
402
393
|
* - Child components (which can't be fully represented in templates)
|
|
403
|
-
* -
|
|
404
|
-
*
|
|
394
|
+
* - A free reference that the module-scope template lambda cannot reach:
|
|
395
|
+
* a signal getter or memo (`todos().length`, `label + count()`), or a local
|
|
396
|
+
* variable not available at module scope (#343)
|
|
405
397
|
*
|
|
406
398
|
* Components that fail this check should not have registerTemplate() generated
|
|
407
399
|
* as the template would reference undefined variables at module scope.
|
|
408
400
|
*
|
|
401
|
+
* The decision reads only the IR's free identifiers (`origin.freeRefs` for
|
|
402
|
+
* expressions and conditions, `freeIdentifiers` for attributes), never the
|
|
403
|
+
* expression text, so it does not depend on operand order (#3509).
|
|
404
|
+
*
|
|
409
405
|
* @param node - IR node to check
|
|
410
|
-
* @param
|
|
406
|
+
* @param reactiveGetterNames - Signal getter and memo names (not callable in the template lambda)
|
|
411
407
|
* @param inlinableConstants - Constants that can be substituted with their values
|
|
412
408
|
* @param unsafeLocalNames - Local names that cannot be used in module-scope templates
|
|
413
409
|
*/
|
|
414
|
-
export declare function canGenerateStaticTemplate(node: IRNode,
|
|
410
|
+
export declare function canGenerateStaticTemplate(node: IRNode, reactiveGetterNames: ReadonlySet<string>, inlinableConstants?: Map<string, string>, unsafeLocalNames?: Set<string>): boolean;
|
|
415
411
|
/**
|
|
416
412
|
* Generate HTML template for CSR mode.
|
|
417
413
|
* Unlike irToComponentTemplate(), this handles stateful components:
|
|
@@ -448,10 +444,4 @@ export declare function generateCsrTemplate(node: IRNode, inlinableConstants: Ma
|
|
|
448
444
|
* placeholder + `createComponent` materialize paths.
|
|
449
445
|
*/
|
|
450
446
|
export declare function computeDeferredChildSlots(node: IRNode, ctx: ClientJsContext, inlinableConstants: Map<string, string> | undefined, unsafeLocalNames: ReadonlySet<string> | undefined, propsObjectName?: string | null): Set<string>;
|
|
451
|
-
/**
|
|
452
|
-
* Check if an expression is a simple prop-based expression.
|
|
453
|
-
* Simple prop expressions access props only: todo.done, todo.text, props.name
|
|
454
|
-
* Non-prop expressions call signals: todos(), todos().length, todos().filter(...)
|
|
455
|
-
*/
|
|
456
|
-
export declare function isSimplePropExpression(expr: string, propNames: Set<string>): boolean;
|
|
457
447
|
//# sourceMappingURL=html-template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAwC,MAAM,EAAU,mBAAmB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}` substitution body inside a template-style string
|
|
19
|
-
* Returns the inner expressions — the
|
|
20
|
-
* stripped. Empty array when no
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* cheap and matches the legacy reach. Object literals inside `${...}`
|
|
24
|
-
* are not supported (they would split prematurely on the inner `}`).
|
|
18
|
+
* Yield each `${...}` substitution body inside a template-style string
|
|
19
|
+
* (backtick-quoted or not). Returns the inner expressions — the
|
|
20
|
+
* surrounding HTML / static text is stripped. Empty array when no
|
|
21
|
+
* substitutions are present. Nested braces and template literals inside a
|
|
22
|
+
* body are kept whole.
|
|
25
23
|
*/
|
|
26
24
|
export declare function extractTemplateExpressions(template: string): string[];
|
|
27
25
|
/**
|
|
28
26
|
* Extract identifiers from template literal expressions.
|
|
29
|
-
*
|
|
27
|
+
* Only `${...}` substitutions are scanned; static text is not code.
|
|
30
28
|
*/
|
|
31
29
|
export declare function extractTemplateIdentifiers(template: string, set: Set<string>): void;
|
|
32
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA2GH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAIvE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAKrE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAInF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
|
-
import type { ComponentIR } from '../types.ts';
|
|
4
|
+
import type { CompilerError, ComponentIR, ImportInfo, SourceLocation } from '../types.ts';
|
|
5
5
|
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', 'batch', 'hydrate', 'insert', 'getLoopChildren', 'getLoopNodes', 'mapArray', 'mapArrayAnchored', 'mapArrayLazy', 'patchLeaf', 'createDisposableEffect', 'findCondContainer', 'createComponent', 'renderChild', 'registerComponent', 'registerTemplate', 'initChild', 'upsertChild', 'mountRowRoot', 'withParentScope', 'createPortal', 'provideContext', 'createContext', 'useContext', 'forwardProps', 'applyRestAttrs', 'splitProps', 'spreadAttrs', 'styleToCss', 'escapeAttr', 'escapeText', 'escapeTextOrNode', 'escapeCommentText', 'bfMarkup', 'escapeTextOrMarkup', 'markupOrEmpty', 'qsa', 'qsaItem', 'adoptRowPortal', 'claimRowPortals', 'relayRowPortalEvents', 'isRowPortalOf', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate', 'ownScopeId'];
|
|
6
6
|
/** @deprecated Use RUNTIME_IMPORT_CANDIDATES */
|
|
7
7
|
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "batch", "hydrate", "insert", "getLoopChildren", "getLoopNodes", "mapArray", "mapArrayAnchored", "mapArrayLazy", "patchLeaf", "createDisposableEffect", "findCondContainer", "createComponent", "renderChild", "registerComponent", "registerTemplate", "initChild", "upsertChild", "mountRowRoot", "withParentScope", "createPortal", "provideContext", "createContext", "useContext", "forwardProps", "applyRestAttrs", "splitProps", "spreadAttrs", "styleToCss", "escapeAttr", "escapeText", "escapeTextOrNode", "escapeCommentText", "bfMarkup", "escapeTextOrMarkup", "markupOrEmpty", "qsa", "qsaItem", "adoptRowPortal", "claimRowPortals", "relayRowPortalEvents", "isRowPortalOf", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate", "ownScopeId"];
|
|
@@ -9,9 +9,30 @@ export declare const RUNTIME_MODULE = "@barefootjs/client/runtime";
|
|
|
9
9
|
export declare const IMPORT_PLACEHOLDER = "/* __BAREFOOTJS_DOM_IMPORTS__ */";
|
|
10
10
|
export declare const MODULE_CONSTANTS_PLACEHOLDER = "/* __MODULE_LEVEL_CONSTANTS__ */";
|
|
11
11
|
/**
|
|
12
|
-
* Detect which @barefootjs/client/runtime functions
|
|
12
|
+
* Detect which @barefootjs/client/runtime functions the generated code uses:
|
|
13
|
+
* the runtime names it references without binding them itself (#3537). A
|
|
14
|
+
* module-level user helper emitted as `var insert = …`, or a parameter that
|
|
15
|
+
* happens to be called `qsa`, binds its name, so it neither pulls in the
|
|
16
|
+
* runtime import nor collides with it as a duplicate declaration.
|
|
17
|
+
*
|
|
18
|
+
* Falls back to the per-name call scan only when the code does not parse
|
|
19
|
+
* cleanly, where narrowing on a partial parse could drop a needed import.
|
|
13
20
|
*/
|
|
14
21
|
export declare function detectUsedImports(code: string): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* BF057 for each module-level binding of the user's that takes a runtime
|
|
24
|
+
* helper's name (#3537): a module-level declaration the client JS re-emits,
|
|
25
|
+
* or a value import from anything but the runtime itself, whose name the
|
|
26
|
+
* emitted `code` also calls. That call may be the compiler's own, which the
|
|
27
|
+
* user's binding would capture, so it is refused rather than guessed at.
|
|
28
|
+
* This is exactly the case that used to emit both the binding and a runtime
|
|
29
|
+
* import of the same name, a duplicate-declaration SyntaxError. A binding
|
|
30
|
+
* the code never calls (`const qsa = {…}` read as `qsa.step`) stays legal.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runtimeNameCollisions(declarations: readonly {
|
|
33
|
+
name: string;
|
|
34
|
+
loc: SourceLocation;
|
|
35
|
+
}[], imports: readonly ImportInfo[], code: string): CompilerError[];
|
|
15
36
|
/**
|
|
16
37
|
* Collect user-defined imports from @barefootjs/client (or the
|
|
17
38
|
* compiler-emitted /runtime subpath).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAU,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/imports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAU,cAAc,EAAE,MAAM,aAAa,CAAA;AAOjG,eAAO,MAAM,yBAAyB,YACpC,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAKpE,OAAO,EACP,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAK7I,mBAAmB,EACnB,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAKrG,cAAc,EAId,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAC/C,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAG3H,mBAAmB,EAInB,UAAU,EAAE,oBAAoB,EAGhC,eAAe,EACf,KAAK,EAAE,SAAS,EAEhB,gBAAgB,EAAE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AAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAwFxE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA6CvH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAejC,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGxE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,WAAW,CAAA;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,yBAAyB,CAAA;IAC9C,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;CAC3C;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACjC;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,WAAW,EACf,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAC9B,KAAK,CAAC,EAAE,SAAS,EACjB,mBAAmB,CAAC,EAAE,mBAAmB,EACzC,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,EAAE,EAAE,WAAW,EACf,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAC9B,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,CAAC,EAAE,SAAS,EACjB,mBAAmB,CAAC,EAAE,mBAAmB,EACzC,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,CAsChB;AAyCD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,WAAW,GACd;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAiCpF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `props-extraction` phase — emit the one surviving one-time prop
|
|
3
|
-
* extraction, `const children = _p.children [?? <default>]
|
|
3
|
+
* extraction, `const children = _p.children [?? <default>]` (or
|
|
4
|
+
* `const kids = _p.children` for a renamed `{ children: kids }`).
|
|
4
5
|
*
|
|
5
6
|
* `children` must stay a ONE-TIME read: a prop's slot-children value is a
|
|
6
7
|
* getter that INSTANTIATES child components when read (see
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
* Skipped entirely for an opaque props object (`propsObjectName != null`):
|
|
18
19
|
* downstream code there reads `_p.X` directly via the late-stage rename.
|
|
19
20
|
*/
|
|
20
|
-
import type
|
|
21
|
+
import { type PropUsage } from '../../types.ts';
|
|
21
22
|
import type { ClientJsContext } from '../types.ts';
|
|
22
23
|
export declare function emitPropsExtraction(lines: string[], ctx: ClientJsContext, neededProps: Set<string>, propUsage: Map<string, PropUsage>): void;
|
|
23
24
|
//# sourceMappingURL=props-extraction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-extraction.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/props-extraction.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"props-extraction.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/props-extraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,gBAAgB,CAAA;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAChC,IAAI,CAiBN"}
|
|
@@ -77,6 +77,11 @@ export interface ControlledSignalEffectPlan {
|
|
|
77
77
|
accessorExpr: string;
|
|
78
78
|
/** Profile-mode IR-aligned id, appended as the `createEffect` 2nd arg (#1690). */
|
|
79
79
|
bfId?: string;
|
|
80
|
+
/**
|
|
81
|
+
* When set, the value the effect sets once the prop is defined (the
|
|
82
|
+
* signal's initializer, for a `||` fallback); otherwise the prop itself.
|
|
83
|
+
*/
|
|
84
|
+
valueExpr?: string;
|
|
80
85
|
}
|
|
81
86
|
export interface MemoEmitPlan {
|
|
82
87
|
kind: 'memo';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration-emit.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/declaration-emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,qDAAqD;IACrD,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAA;IACd,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,gBAAgB,EAAE,0BAA0B,GAAG,IAAI,CAAA;IACnD;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,0BAA0B;IACzC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"declaration-emit.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/declaration-emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,qDAAqD;IACrD,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAA;IACd,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
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { SignalInfo } from '../types.ts';
|
|
5
5
|
import type { ClientJsContext } from './types.ts';
|
|
6
6
|
import type { BindingScope } from '../scope/binding-scope.ts';
|
|
7
7
|
/**
|
|
@@ -82,17 +82,16 @@ export declare function expandConstantForReactivity(expr: string, ctx: ClientJsC
|
|
|
82
82
|
freeIds: ReadonlySet<string> | undefined;
|
|
83
83
|
};
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
85
|
+
* The prop a signal is controlled by: its initializer reads that declared
|
|
86
|
+
* prop itself (not a member of it), bare or with a `??` / `||` fallback (`createSignal(props.checked)`,
|
|
87
|
+
* `createSignal(value ?? 0)`), so a createEffect re-syncs it when the
|
|
88
|
+
* parent's prop changes. Read from the analyzer's `SignalInfo.propSeed`, the
|
|
89
|
+
* same field `resolveSignalInitialValue` reads, never from the text (#3508).
|
|
87
90
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* These signals need a createEffect to sync with parent's prop changes.
|
|
93
|
-
*
|
|
94
|
-
* Note: Props starting with "default" (e.g., defaultChecked, defaultValue) are
|
|
95
|
-
* excluded as they are initial values, not controlled props.
|
|
91
|
+
* Props starting with "default" (`defaultChecked`) are initial values, not
|
|
92
|
+
* controlled props, and an async factory's value (`createQuery(fn, {
|
|
93
|
+
* initial: props.posts })`, #3165) takes `initial` once, then comes from its
|
|
94
|
+
* own requests.
|
|
96
95
|
*/
|
|
97
|
-
export declare function getControlledPropName(signal: SignalInfo
|
|
96
|
+
export declare function getControlledPropName(signal: SignalInfo): string | null;
|
|
98
97
|
//# sourceMappingURL=prop-handling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-handling.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prop-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"prop-handling.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prop-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAEnG;AAqCD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAahF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAexG;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACrC,KAAK,CAAC,EAAE,YAAY,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CAAE,CAgB5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAIvE"}
|
|
@@ -37,7 +37,7 @@ import ts from 'typescript';
|
|
|
37
37
|
* Does `init` read `<objectName>.<key>` or `<objectName>.<key> ?? <fallback>`?
|
|
38
38
|
* The one recognizer for "a prop read initializer", shared by
|
|
39
39
|
* `propExtractionName` below (which additionally requires the bound name to
|
|
40
|
-
* equal `key`, and always reads off `_p`), `rewriteBodyAliasReads`
|
|
40
|
+
* equal `key` unless `key` is `children`, and always reads off `_p`), `rewriteBodyAliasReads`
|
|
41
41
|
* (`rewrite-destructured-props.ts`, which does not require the name match —
|
|
42
42
|
* a renamed alias's bound name differs from `key` by definition, but also
|
|
43
43
|
* always reads off `_p`), and `resolveBodyPropAliases` (`props-binding.ts`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune-unused-prop-extractions.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prune-unused-prop-extractions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,UAAU,GAAE,MAAoB,GAC/B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAaxD;
|
|
1
|
+
{"version":3,"file":"prune-unused-prop-extractions.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/prune-unused-prop-extractions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,UAAU,GAAE,MAAoB,GAC/B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAaxD;AAoBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/reactivity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAkB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/reactivity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAkB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAA6D,MAAM,aAAa,CAAA;AACxM,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAA;AAenB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAIxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,WAAW,CAAC,EAAE,YAAY,GACzB,YAAY,GAAG,SAAS,CAQ1B;AAED;;;;;;;;;;;;GAYG;AACH;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAA;AAEtC,MAAM,MAAM,UAAU;AACpB,uEAAuE;AACrE,iBAAiB;AACnB,oFAAoF;GACl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ED;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,UAAQ,GAAG,WAAW,EAAE,CAiB5G;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,0BAA0B,UAAQ,EAClC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;AACzB,uFAAuF;AACvF,WAAW,CAAC,EAAE,YAAY,GACzB,qBAAqB,EAAE,CAkDzB;AAED;;;;;;;;;;GAUG;AACH;;;6EAG6E;AAC7E,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAGpF;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAC/C,0BAA0B,UAAQ,EAClC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;AACzB,uFAAuF;AACvF,WAAW,CAAC,EAAE,YAAY,GACzB,qBAAqB,EAAE,CAsEzB"}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* `props.value`), which that rename never touches — they stayed
|
|
24
24
|
* captured at the local's ONE declaration-time read forever.
|
|
25
25
|
*/
|
|
26
|
-
import type
|
|
26
|
+
import { type PropUsage } from '../types.ts';
|
|
27
27
|
import type { ClientJsContext } from './types.ts';
|
|
28
28
|
export declare function rewriteDestructuredPropReads(code: string, ctx: ClientJsContext, propUsage: ReadonlyMap<string, PropUsage>): string;
|
|
29
29
|
//# sourceMappingURL=rewrite-destructured-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewrite-destructured-props.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-destructured-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rewrite-destructured-props.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/rewrite-destructured-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,aAAa,CAAA;AAOjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,GACxC,MAAM,CAIR"}
|
|
@@ -77,6 +77,22 @@ export declare function branchSlotValue(expr: string, slotsVar: string): SafeHtm
|
|
|
77
77
|
* as visible `<span>` text.
|
|
78
78
|
*/
|
|
79
79
|
export declare function childrenMarkup(expr: string): SafeHtml;
|
|
80
|
+
/**
|
|
81
|
+
* `_p.children == null ? escapeText(expr) : markupOrEmpty(_p.children)` — a
|
|
82
|
+
* read of the children prop with a text fallback: `children ?? 'x'`,
|
|
83
|
+
* `(children ?? '<b>x</b>') ?? ''` (`absentWhen: 'nullish'`), or
|
|
84
|
+
* `children || 'x'` (`absentWhen: 'falsy'`, tested as `!_p.children`); #3554.
|
|
85
|
+
* Phase 1 decided from the binding that the chain's head is the component's
|
|
86
|
+
* own `children` prop (`IRExpression.childrenRead`), so the head is read where
|
|
87
|
+
* every client template finds that prop, `_p.children` (the same place the
|
|
88
|
+
* Phase 1 `templateExpr` rewrite and the alias inlining resolve a destructured
|
|
89
|
+
* or aliased `children` to). Present children are the HTML string
|
|
90
|
+
* `materializeComponent` joined, spliced as `childrenMarkup` does; otherwise
|
|
91
|
+
* `expr` (the whole lowered chain) evaluates to its fallback, which is text
|
|
92
|
+
* and escaped. `expr` is not split: when the head is absent,
|
|
93
|
+
* `(c ?? x) ?? y` and `c ?? (x ?? y)` both evaluate to `x ?? y`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function childrenMarkupOrEscapedFallback(expr: string, absentWhen: 'nullish' | 'falsy'): SafeHtml;
|
|
80
96
|
/**
|
|
81
97
|
* Stage 3 / D4 — an element-array child (`{out}`) built by an arbitrary
|
|
82
98
|
* `.map()` preamble is an array of compiled-leaf HTML strings; join it
|
|
@@ -152,7 +168,9 @@ export interface ChildSpliceContext {
|
|
|
152
168
|
* 3. `slotId` ∈ markupSlotIds → `escapedTextOrMarkup`
|
|
153
169
|
* 4. `slotId` → `escapedText`
|
|
154
170
|
* 5. `{children}` passthrough → `childrenMarkup` (bare splice only, #2775/#2786)
|
|
155
|
-
* 6.
|
|
171
|
+
* 6. `children ?? fallback`, → `childrenMarkupOrEscapedFallback` (#3554)
|
|
172
|
+
* `children || fallback`
|
|
173
|
+
* 7. otherwise → `escapedText`
|
|
156
174
|
*
|
|
157
175
|
* Arm 5 tests BOTH `node.expr` (the original source text, stable across
|
|
158
176
|
* builders) and the caller's resolved form (with parentheses handled structurally): a
|
|
@@ -160,5 +178,5 @@ export interface ChildSpliceContext {
|
|
|
160
178
|
* reads `kids` in the source and `(_p.children)` after substitution, and
|
|
161
179
|
* either alone misses one of the two shapes (#2786).
|
|
162
180
|
*/
|
|
163
|
-
export declare function spliceChildValue(node: Pick<IRExpression, 'expr' | 'slotId' | 'joinArrayChild'>, valueExpr: string, cx: ChildSpliceContext): SafeHtml;
|
|
181
|
+
export declare function spliceChildValue(node: Pick<IRExpression, 'expr' | 'slotId' | 'joinArrayChild' | 'childrenRead'>, valueExpr: string, cx: ChildSpliceContext): SafeHtml;
|
|
164
182
|
//# sourceMappingURL=safe-html.d.ts.map
|