@barefootjs/jsx 0.35.4 → 0.35.6
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/analyzer-context.d.ts +5 -4
- package/dist/analyzer-context.d.ts.map +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.js +5306 -4949
- package/dist/ir-to-client-js/compute-inlinability.d.ts +8 -0
- package/dist/ir-to-client-js/compute-inlinability.d.ts.map +1 -1
- package/dist/ir-to-client-js/compute-prop-usage.d.ts +6 -0
- package/dist/ir-to-client-js/compute-prop-usage.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts +3 -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-loop.d.ts +12 -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/event-collision.d.ts +40 -0
- package/dist/ir-to-client-js/control-flow/plan/event-collision.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/event-delegation.d.ts +13 -0
- 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/loop-delegation-index.d.ts +45 -0
- package/dist/ir-to-client-js/control-flow/plan/loop-delegation-index.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/types.d.ts +2 -0
- package/dist/ir-to-client-js/control-flow/plan/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts +12 -0
- package/dist/ir-to-client-js/control-flow/stringify/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts +2 -1
- package/dist/ir-to-client-js/control-flow.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +7 -3
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/generate-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +2 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/index.d.ts +1 -0
- package/dist/ir-to-client-js/index.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/event-handlers.d.ts +9 -1
- package/dist/ir-to-client-js/phases/event-handlers.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases/props-event-handlers.d.ts +5 -0
- 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 +15 -13
- package/dist/ir-to-client-js/phases/props-extraction.d.ts.map +1 -1
- package/dist/ir-to-client-js/phases.d.ts +12 -1
- package/dist/ir-to-client-js/phases.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/build-declaration-emit.d.ts.map +1 -1
- 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 +50 -0
- package/dist/ir-to-client-js/prune-unused-prop-extractions.d.ts.map +1 -1
- package/dist/ir-to-client-js/rewrite-destructured-props.d.ts +29 -0
- package/dist/ir-to-client-js/rewrite-destructured-props.d.ts.map +1 -0
- package/dist/ir-to-client-js/utils.d.ts +21 -1
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/prop-rewrite.d.ts.map +1 -1
- package/dist/props-binding.d.ts +112 -1
- package/dist/props-binding.d.ts.map +1 -1
- package/dist/ssr-defaults.d.ts.map +1 -1
- package/dist/static-literal.d.ts +20 -8
- package/dist/static-literal.d.ts.map +1 -1
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +31 -35
- package/src/__tests__/aliased-destructured-prop-csr.test.ts +19 -7
- package/src/__tests__/body-destructured-prop-default-propsparams.test.ts +153 -0
- package/src/__tests__/body-destructured-props-live.test.ts +245 -0
- package/src/__tests__/client-js-generation.test.ts +11 -4
- package/src/__tests__/client-only-date-lowering.test.ts +5 -2
- package/src/__tests__/destructured-from-props-localconst-value.test.ts +17 -6
- package/src/__tests__/destructured-props-live.test.ts +167 -0
- package/src/__tests__/doc-examples.test.ts +2 -4
- package/src/__tests__/event-delegation-container-collision-2930.test.ts +197 -0
- package/src/__tests__/format-error.test.ts +5 -3
- package/src/__tests__/issue-2910-mutated-const-not-inlined.test.ts +118 -0
- package/src/__tests__/issue-2910-own-scope-id-emission.test.ts +64 -0
- package/src/__tests__/live-only-props.test.ts +160 -0
- package/src/__tests__/prop-references.test.ts +26 -17
- package/src/__tests__/props-destructuring.test.ts +6 -275
- package/src/__tests__/prune-unused-prop-extractions.test.ts +11 -5
- package/src/__tests__/signal-getter-not-called.test.ts +5 -0
- package/src/__tests__/ssr-defaults.test.ts +83 -0
- package/src/__tests__/staged-ir/02-shadow-guards.test.ts +12 -5
- package/src/__tests__/static-literal.test.ts +39 -4
- package/src/analyzer-context.ts +8 -7
- package/src/analyzer.ts +233 -106
- package/src/errors.ts +7 -8
- package/src/ir-to-client-js/compute-inlinability.ts +8 -1
- package/src/ir-to-client-js/compute-prop-usage.ts +19 -0
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +5 -0
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +27 -11
- package/src/ir-to-client-js/control-flow/plan/event-collision.ts +55 -0
- package/src/ir-to-client-js/control-flow/plan/event-delegation.ts +13 -0
- package/src/ir-to-client-js/control-flow/plan/loop-delegation-index.ts +79 -0
- package/src/ir-to-client-js/control-flow/plan/types.ts +2 -0
- package/src/ir-to-client-js/control-flow/stringify/event-delegation.ts +50 -10
- package/src/ir-to-client-js/control-flow.ts +68 -31
- package/src/ir-to-client-js/emit-reactive.ts +12 -8
- package/src/ir-to-client-js/emit-registration.ts +2 -2
- package/src/ir-to-client-js/generate-init.ts +22 -2
- package/src/ir-to-client-js/imports.ts +6 -0
- package/src/ir-to-client-js/index.ts +51 -3
- package/src/ir-to-client-js/phases/event-handlers.ts +10 -0
- package/src/ir-to-client-js/phases/props-event-handlers.ts +6 -0
- package/src/ir-to-client-js/phases/props-extraction.ts +29 -48
- package/src/ir-to-client-js/phases.ts +17 -3
- package/src/ir-to-client-js/plan/build-declaration-emit.ts +6 -5
- package/src/ir-to-client-js/prop-handling.ts +9 -0
- package/src/ir-to-client-js/prune-unused-prop-extractions.ts +31 -10
- package/src/ir-to-client-js/rewrite-destructured-props.ts +210 -0
- package/src/ir-to-client-js/utils.ts +29 -1
- package/src/jsx-to-ir.ts +110 -48
- package/src/prop-rewrite.ts +11 -0
- package/src/props-binding.ts +171 -6
- package/src/ssr-defaults.ts +10 -5
- package/src/static-literal.ts +21 -9
- package/src/types.ts +38 -0
|
@@ -85,6 +85,14 @@ export type ConstantInlinability = {
|
|
|
85
85
|
* a name classified unsafe above. Transitive demotion. */
|
|
86
86
|
| {
|
|
87
87
|
kind: 'depends-on-unsafe';
|
|
88
|
+
}
|
|
89
|
+
/** A same-scope statement mutates this binding's value after its
|
|
90
|
+
* declaration (`ConstantInfo.mutatedAfterDeclaration`, #2910) — e.g.
|
|
91
|
+
* `const config = {}; for (...) config[k] = ...`. `value` is a
|
|
92
|
+
* pre-mutation snapshot; inlining it anywhere would silently drop
|
|
93
|
+
* the mutation, so this is unsafe exactly like an init-local. */
|
|
94
|
+
| {
|
|
95
|
+
kind: 'mutated-after-declaration';
|
|
88
96
|
};
|
|
89
97
|
export type FunctionInlinability =
|
|
90
98
|
/** Module-scope function that does NOT touch component internals —
|
|
@@ -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,EAAE,MAAM,E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mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM,GACb,oBAAoB,CAwDtB;AAgSD;;;;;;;;;;;;;;;;;;;;;;;;;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;AAmFD;;;;;;;;;;;;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,CA2EA"}
|
|
@@ -22,4 +22,10 @@ initScopeConstants: readonly ConstantInfo[]): Map<string, PropUsage>;
|
|
|
22
22
|
/** Convenience predicate: does this prop need a `{}` default in the
|
|
23
23
|
* destructure to guard against `undefined.xxx` at runtime? */
|
|
24
24
|
export declare function propHasPropertyAccess(u: PropUsage | undefined): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Which of `propNames` guard a conditional branch. A prop in this set must
|
|
27
|
+
* NOT get a `{}` fallback even when it has property access — `{}` is truthy,
|
|
28
|
+
* so the branch would always render when the caller omits the prop.
|
|
29
|
+
*/
|
|
30
|
+
export declare function computePropsUsedAsConditions(ctx: Pick<ClientJsContext, 'conditionalElements' | 'clientOnlyConditionals'>, propNames: ReadonlySet<string>): Set<string>;
|
|
25
31
|
//# sourceMappingURL=compute-prop-usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-prop-usage.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/compute-prop-usage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,eAAe;AACpB;;;kCAGkC;AAClC,kBAAkB,EAAE,SAAS,YAAY,EAAE,GAC1C,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAoCxB;AAED;+DAC+D;AAC/D,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAGvE"}
|
|
1
|
+
{"version":3,"file":"compute-prop-usage.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/compute-prop-usage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,eAAe;AACpB;;;kCAGkC;AAClC,kBAAkB,EAAE,SAAS,YAAY,EAAE,GAC1C,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAoCxB;AAED;+DAC+D;AAC/D,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,qBAAqB,GAAG,wBAAwB,CAAC,EAC5E,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B,GAAG,CAAC,MAAM,CAAC,CASb"}
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { TopLevelLoop, BranchLoop, LoopChildEvent } from '../../types.ts';
|
|
12
12
|
import type { EventDelegationPlan } from './types.ts';
|
|
13
|
-
|
|
13
|
+
import type { ContainerOwnHandler } from './event-collision.ts';
|
|
14
|
+
export declare function buildDynamicLoopDelegationPlan(elem: TopLevelLoop, profileComponentName?: string, ownHandlers?: Map<string, ContainerOwnHandler>): EventDelegationPlan;
|
|
14
15
|
export declare function buildBranchLoopDelegationPlan(loop: BranchLoop, cv: string, profileComponentName?: string): EventDelegationPlan;
|
|
15
16
|
/**
|
|
16
17
|
* Build a Plan for the static-array event-delegation block. Static arrays have
|
|
17
18
|
* no `data-key` markers, so the lookup walks up to the container's direct
|
|
18
19
|
* child and uses `indexOf` (with optional sibling offset).
|
|
19
20
|
*/
|
|
20
|
-
export declare function buildStaticArrayDelegationPlan(elem: TopLevelLoop, profileComponentName?: string): EventDelegationPlan;
|
|
21
|
+
export declare function buildStaticArrayDelegationPlan(elem: TopLevelLoop, profileComponentName?: string, ownHandlers?: Map<string, ContainerOwnHandler>): EventDelegationPlan;
|
|
21
22
|
export type { LoopChildEvent };
|
|
22
23
|
//# sourceMappingURL=build-event-delegation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAI9E,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"build-event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAI9E,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,YAAY,EAClB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAC7C,mBAAmB,CA+BrB;AAKD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,MAAM,EACV,oBAAoB,CAAC,EAAE,MAAM,GAC5B,mBAAmB,CAuBrB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,YAAY,EAClB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAC7C,mBAAmB,CA0BrB;AA6CD,YAAY,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -35,9 +35,19 @@ export interface BuildLoopPlanOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
lazyScope?: LazyRowScopeInfo;
|
|
37
37
|
}
|
|
38
|
+
/** Which `LoopPlan` variant `buildLoopPlan` would build for a given loop. */
|
|
39
|
+
export type LoopVariantKind = 'plain' | 'static' | 'composite' | 'component';
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* Classify which variant `buildLoopPlan` would build for `elem`, without
|
|
42
|
+
* building it. Mirrors the decision tree below exactly — pulled out so a
|
|
43
|
+
* caller that only needs the classification (e.g. the event-delegation
|
|
44
|
+
* eligibility precompute, #2930) doesn't have to duplicate these predicates
|
|
45
|
+
* or pay for building the full `LoopPlan`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function classifyLoopKind(elem: TopLevelLoop): LoopVariantKind;
|
|
48
|
+
/**
|
|
49
|
+
* The single public builder. Dispatches via `classifyLoopKind` and returns
|
|
50
|
+
* the discriminated `LoopPlan`.
|
|
41
51
|
*/
|
|
42
52
|
export declare function buildLoopPlan(elem: TopLevelLoop, opts: BuildLoopPlanOptions): LoopPlan;
|
|
43
53
|
/** @internal — prefer `buildLoopPlan`. Exported for the branch-loop wrapper only. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,gBAAgB,CAAA;AAcvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAIjE,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EAEb,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,8FAA8F;IAC9F,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,qFAAqF;IACrF,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"build-loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/build-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,gBAAgB,CAAA;AAcvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAIjE,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EAEb,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,8FAA8F;IAC9F,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,qFAAqF;IACrF,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAA;AAE5E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAcpE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,GAAG,QAAQ,CAYtF;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,YAAY,EAClB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,SAAS,CAAC,EAAE,gBAAgB,GAC3B,aAAa,CAmGf;AAED,0CAA0C;AAC1C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,cAAc,CAmCpI"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find a container's own directly-authored event handler that collides with
|
|
3
|
+
* a `.map()` row's delegated dispatcher for the same DOM event (#2930).
|
|
4
|
+
*
|
|
5
|
+
* `.map()` rows compiled via delegation share their delegated listener's
|
|
6
|
+
* node with the loop's static container — the compiler registers ONE
|
|
7
|
+
* `addEventListener` on the container, resolving `event.target` back to a
|
|
8
|
+
* row. When the container ALSO carries its own handler for the same event,
|
|
9
|
+
* both end up as separate `addEventListener` calls on the identical DOM
|
|
10
|
+
* node, so a row's `stopPropagation()` can't stop the container's own
|
|
11
|
+
* handler: native DOM `stopPropagation()` only blocks bubbling to *other
|
|
12
|
+
* nodes*, never other listeners already registered on the *same* node.
|
|
13
|
+
*
|
|
14
|
+
* This is the one place that answers "does this container slot have its own
|
|
15
|
+
* handler for this event" — both `phases/event-handlers.ts` (which must
|
|
16
|
+
* suppress the direct listener when the answer is yes) and
|
|
17
|
+
* `control-flow.ts` (which must fold that handler into the delegated
|
|
18
|
+
* dispatcher instead) call it, rather than answering the question twice.
|
|
19
|
+
*/
|
|
20
|
+
import type { InteractiveElement } from '../../types.ts';
|
|
21
|
+
export interface ContainerOwnHandler {
|
|
22
|
+
/** The container element's own slot id (used for profile-mode turn ids). */
|
|
23
|
+
slotId: string;
|
|
24
|
+
/** Original (pre-DOM-mapped) event name, e.g. 'contextmenu'. */
|
|
25
|
+
eventName: string;
|
|
26
|
+
handler: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Find the container's own handler for `domEventName`, if any.
|
|
30
|
+
*
|
|
31
|
+
* Returns `null` for a non-bubbling event (focus/blur/…) — those delegate
|
|
32
|
+
* in capture mode, and a container's own bubble-phase handler there only
|
|
33
|
+
* ever fires when the container itself is the event target, never for a
|
|
34
|
+
* descendant row, so there is no collision to resolve. Also returns `null`
|
|
35
|
+
* when `containerSlotId` lives inside a conditional branch — that slot's
|
|
36
|
+
* own handler (if any) is bound by `insert()`'s `bindEvents` in a separate
|
|
37
|
+
* scope this check doesn't cover.
|
|
38
|
+
*/
|
|
39
|
+
export declare function findContainerOwnHandler(interactiveElements: InteractiveElement[], conditionalSlotIds: Set<string>, containerSlotId: string, domEventName: string): ContainerOwnHandler | null;
|
|
40
|
+
//# sourceMappingURL=event-collision.d.ts.map
|
|
@@ -0,0 +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;AAGxD,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB;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,6 +5,7 @@
|
|
|
5
5
|
* container variable and the per-event item-lookup strategy.
|
|
6
6
|
*/
|
|
7
7
|
import type { LoopChildEvent, LoopOffset, TopLevelLoop } from '../../types.ts';
|
|
8
|
+
import type { ContainerOwnHandler } from './event-collision.ts';
|
|
8
9
|
/**
|
|
9
10
|
* Plan for a loop's event-delegation block. Covers three legacy emitters:
|
|
10
11
|
* - `emitDynamicLoopEventDelegation` (top-level dynamic loop)
|
|
@@ -31,6 +32,18 @@ export interface EventDelegationPlan {
|
|
|
31
32
|
* profiling is off, so the emitted dispatcher is unchanged (SR8).
|
|
32
33
|
*/
|
|
33
34
|
profileComponentName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The container's own directly-authored handler(s) to invoke after this
|
|
37
|
+
* plan's delegated dispatch(es) run — and only if none of them called
|
|
38
|
+
* `stopPropagation()`/`stopImmediatePropagation()` (#2930). Keyed by DOM
|
|
39
|
+
* event name (the `eventsByName` grouping key the stringifier already
|
|
40
|
+
* builds). Populated only on the ONE delegation plan chosen as "last" for
|
|
41
|
+
* a given (container slot, DOM event) pair — see `LoopDelegationIndex`
|
|
42
|
+
* (`plan/loop-delegation-index.ts`) — so every other plan sharing that
|
|
43
|
+
* pair keeps emitting its listener byte-identical to before. `undefined`
|
|
44
|
+
* (the common case: no collision) keeps the emitted listener unchanged.
|
|
45
|
+
*/
|
|
46
|
+
ownHandlers?: Map<string, ContainerOwnHandler>;
|
|
34
47
|
}
|
|
35
48
|
/**
|
|
36
49
|
* How to look up the loop item from an event target. Each variant is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE/D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,kBAAkB,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;CAC/C;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,sBAAsB,GACtB,qBAAqB,CAAA;AAEzB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,sFAAsF;IACtF,aAAa,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IAC5C;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,uFAAuF;IACvF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B;;;;;;;;;OASG;IACH,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,6EAA6E;IAC7E,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,eAAe,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,sDAAsD;IACtD,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,WAAW,EAAE,OAAO,CAAA;IACpB,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,sDAAsD;IACtD,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;;;;OAKG;IACH,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;CAC1B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Precompute which `.map()` loops will emit a delegated event listener for
|
|
3
|
+
* which (container slot, DOM event) pairs — the fact both the direct-handler
|
|
4
|
+
* phase and the loop-delegation phase need to agree on when a container also
|
|
5
|
+
* carries its own handler for the same event (#2930).
|
|
6
|
+
*
|
|
7
|
+
* Built once (independent of the phases that actually emit code, and before
|
|
8
|
+
* either of them runs — `event-handlers` precedes `loop-updates` in
|
|
9
|
+
* `phases.ts`) from `ClientJsContext.loopElements` alone, via
|
|
10
|
+
* `classifyLoopKind` — the same predicates `buildLoopPlan` uses, without
|
|
11
|
+
* building the full `LoopPlan`.
|
|
12
|
+
*/
|
|
13
|
+
import type { TopLevelLoop } from '../../types.ts';
|
|
14
|
+
import { type LoopVariantKind } from './build-loop.ts';
|
|
15
|
+
export interface LoopDelegationIndex {
|
|
16
|
+
/**
|
|
17
|
+
* True when SOME loop under `containerSlotId` delegates `domEventName`.
|
|
18
|
+
* The direct listener in `phases/event-handlers.ts` must be suppressed
|
|
19
|
+
* whenever this is true, regardless of how many loops share the pair —
|
|
20
|
+
* only one of them (see `isLastDelegator`) actually invokes the
|
|
21
|
+
* container's own handler; the others must not also emit it separately.
|
|
22
|
+
*/
|
|
23
|
+
isDelegated(containerSlotId: string, domEventName: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* True when the loop at `loopIndex` (its position in `loopElements`,
|
|
26
|
+
* matching emission order) is the LAST loop delegating this pair. Only
|
|
27
|
+
* that loop's dispatcher can safely gate the container's own handler: an
|
|
28
|
+
* earlier delegated listener sharing the pair may still see a row call
|
|
29
|
+
* `stopPropagation()` after its own dispatch has already run and decided
|
|
30
|
+
* whether to fire the container's own handler.
|
|
31
|
+
*/
|
|
32
|
+
isLastDelegator(containerSlotId: string, domEventName: string, loopIndex: number): boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildLoopDelegationIndex(loopElements: readonly TopLevelLoop[]): LoopDelegationIndex;
|
|
35
|
+
/**
|
|
36
|
+
* Which delegation builder (`control-flow.ts`'s `emitLoopEventDelegation`)
|
|
37
|
+
* would use for `elem`, or `null` if it doesn't delegate at all —
|
|
38
|
+
* `'component'`/`'composite'` loops' events ride on the child component's
|
|
39
|
+
* own event surface instead. The single shared gate so this index and the
|
|
40
|
+
* actual emission can't silently diverge (#2930 review) — previously each
|
|
41
|
+
* re-implemented the same `kind === 'static' && !childComponent` /
|
|
42
|
+
* `kind === 'plain' && !useElementReconciliation` check inline.
|
|
43
|
+
*/
|
|
44
|
+
export declare function loopEventDelegationVariant(elem: TopLevelLoop, kind: LoopVariantKind): 'static' | 'dynamic' | null;
|
|
45
|
+
//# sourceMappingURL=loop-delegation-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-delegation-index.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/loop-delegation-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAExE,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAA;IACnE;;;;;;;OAOG;IACH,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3F;AAED,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,SAAS,YAAY,EAAE,GAAG,mBAAmB,CAcnG;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,eAAe,GACpB,QAAQ,GAAG,SAAS,GAAG,IAAI,CAK7B"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* `CompositeLoopPlan`, `StaticLoopPlan`),
|
|
15
15
|
* `NestedComponentInit`
|
|
16
16
|
* event-delegation.ts — `EventDelegationPlan`, `ItemLookup` family
|
|
17
|
+
* event-collision.ts — `ContainerOwnHandler`
|
|
17
18
|
*
|
|
18
19
|
* This file lets callers continue to write
|
|
19
20
|
* `import type { ... } from '../plan/types.ts'` without caring which file
|
|
@@ -24,5 +25,6 @@ export type { ReactiveEffectsPlan, ReactiveAttrSlot, ReactiveAttrEffect, Reactiv
|
|
|
24
25
|
export type { InsertPlan, InsertArm, ArmBody, ArmEventBind, ArmRefBind, ArmChildComponentInit, ArmTextEffect, } from './insert.ts';
|
|
25
26
|
export type { LoopPlan, PlainLoopPlan, ComponentLoopPlan, CompositeLoopPlan, StaticLoopPlan, StaticLoopMaterializePlan, NestedComponentInit, LoopChildRefBinding, } from './loop.ts';
|
|
26
27
|
export type { EventDelegationPlan, ItemLookup, KeyedItemLookup, DynamicIndexItemLookup, StaticIndexItemLookup, } from './event-delegation.ts';
|
|
28
|
+
export type { ContainerOwnHandler } from './event-collision.ts';
|
|
27
29
|
export type { ConditionalElement, LoopChildConditional, BranchLoop, LoopChildEvent, } from '../../types.ts';
|
|
28
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/plan/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EACV,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,aAAa,GACd,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG/D,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,cAAc,GACf,MAAM,gBAAgB,CAAA"}
|
|
@@ -30,6 +30,18 @@
|
|
|
30
30
|
*
|
|
31
31
|
* Each shape has a `hasBindings` variant that lands on a `__bfLoopItem`
|
|
32
32
|
* sentinel before destructuring (#951 TDZ-safe).
|
|
33
|
+
*
|
|
34
|
+
* When `plan.ownHandlers` has an entry for the group's DOM event name
|
|
35
|
+
* (#2930 — the container itself also carries a directly-authored handler for
|
|
36
|
+
* this event), the shape above grows two additions, BOTH gated on
|
|
37
|
+
* `!__bfEvt.cancelBubble`: right after `<handlerCall>` (so a row's own
|
|
38
|
+
* `stopPropagation()` suppresses it), and again after the last event in the
|
|
39
|
+
* group (so a sibling `.map()` loop sharing this container/event — whose
|
|
40
|
+
* listener already ran, matched one of ITS rows, and called
|
|
41
|
+
* `stopPropagation()` — also suppresses it here, even though none of THIS
|
|
42
|
+
* loop's rows matched). A dispatch nothing has stopped (e.g. a click on the
|
|
43
|
+
* container's own background) still fires it, same as today's separate
|
|
44
|
+
* listener would.
|
|
33
45
|
*/
|
|
34
46
|
import type { EventDelegationPlan } from '../plan/types.ts';
|
|
35
47
|
export declare function stringifyEventDelegation(lines: string[], plan: EventDelegationPlan): void;
|
|
@@ -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
|
|
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;AA+CzB,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAsFzF"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* control-flow.ts -> control-flow/{plan,stringify}/* -> legacy-helpers.ts
|
|
21
21
|
*/
|
|
22
22
|
import type { ClientJsContext } from './types.ts';
|
|
23
|
+
import { type LoopDelegationIndex } from './control-flow/plan/loop-delegation-index.ts';
|
|
23
24
|
/** Emit insert() calls for server-rendered reactive conditionals with branch configs. */
|
|
24
25
|
export declare function emitConditionalUpdates(lines: string[], ctx: ClientJsContext): void;
|
|
25
26
|
/** Emit insert() calls for client-only conditionals (not server-rendered). */
|
|
@@ -36,5 +37,5 @@ export declare function emitClientOnlyConditionals(lines: string[], ctx: ClientJ
|
|
|
36
37
|
* - `'component' / 'composite'` → events ride on the component's own
|
|
37
38
|
* event surface, no delegation pass needed
|
|
38
39
|
*/
|
|
39
|
-
export declare function emitLoopUpdates(lines: string[], ctx: ClientJsContext, unsafeLocalNames: Set<string
|
|
40
|
+
export declare function emitLoopUpdates(lines: string[], ctx: ClientJsContext, unsafeLocalNames: Set<string>, conditionalSlotIds: Set<string>, loopDelegationIndex: LoopDelegationIndex): void;
|
|
40
41
|
//# sourceMappingURL=control-flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-flow.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/control-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;AAa/D,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAOlF;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAQtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"control-flow.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/control-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;AAa/D,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,8CAA8C,CAAA;AAGnH,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAOlF;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAQtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC/B,mBAAmB,EAAE,mBAAmB,GACvC,IAAI,CAyCN"}
|
|
@@ -75,9 +75,13 @@ export declare function emitDedupedAttrUpdate(target: string, attrName: string,
|
|
|
75
75
|
* or a name shadowed by an inner binding (`items.map((tag) => tag.x)`).
|
|
76
76
|
* This function used to run its own `\btag\b`-style regex over the raw
|
|
77
77
|
* expression text with no such distinction, so `queryHref(base, { tag: tag })`
|
|
78
|
-
* rewrote the KEY too (`{ _p.tag: _p.tag }`, a syntax error) — #2741.
|
|
79
|
-
*
|
|
80
|
-
*
|
|
78
|
+
* rewrote the KEY too (`{ _p.tag: _p.tag }`, a syntax error) — #2741.
|
|
79
|
+
*
|
|
80
|
+
* No `usage`/`usedAsCondition` is passed to `livePropReadExpr`: an attribute
|
|
81
|
+
* read is never a loop-array source or a conditional guard, so only the
|
|
82
|
+
* explicit destructure default applies here. The result survives the later
|
|
83
|
+
* whole-init-body rewrite (`rewriteDestructuredPropReads`) untouched — the
|
|
84
|
+
* `.name` slot of the `_p.x` it produces is a non-value position.
|
|
81
85
|
*/
|
|
82
86
|
export declare function rewriteDestructuredPropsInExpr(expr: string, ctx: ClientJsContext): string;
|
|
83
87
|
/** Emit createEffect blocks that update text nodes for reactive expressions. */
|
|
@@ -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,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;
|
|
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,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA2EjD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAsC7G;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAEhD;;;;;;;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,GACzC,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,CA2DpF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAiDlF"}
|
|
@@ -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;AAiBjD,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,eAAe,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAC7B,MAAM,CA6GR"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Import detection and DOM import management.
|
|
3
3
|
*/
|
|
4
4
|
import type { ComponentIR } from '../types.ts';
|
|
5
|
-
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', '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', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate'];
|
|
5
|
+
export declare const RUNTIME_IMPORT_CANDIDATES: readonly ['createSignal', 'createMemo', 'createEffect', 'onCleanup', 'onMount', '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', 'qsaChildScope', 'qsaChildScopes', 'upsertChildItem', '__slot', '__bfSlot', '__bfText', 'claimSlots', 'lazySlots', 'lazyClaimSlots', 'textOrNode', 'beginTurn', 'endTurn', 'date', 'formatDate', 'ownScopeId'];
|
|
6
6
|
/** @deprecated Use RUNTIME_IMPORT_CANDIDATES */
|
|
7
|
-
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "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", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate"];
|
|
7
|
+
export declare const DOM_IMPORT_CANDIDATES: readonly ["createSignal", "createMemo", "createEffect", "onCleanup", "onMount", "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", "qsaChildScope", "qsaChildScopes", "upsertChildItem", "__slot", "__bfSlot", "__bfText", "claimSlots", "lazySlots", "lazyClaimSlots", "textOrNode", "beginTurn", "endTurn", "date", "formatDate", "ownScopeId"];
|
|
8
8
|
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__ */";
|
|
@@ -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;AAMtD,eAAO,MAAM,yBAAyB,YACpC,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EACpE,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,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAUxG,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAEzD,WAAW,EAAE,SAAS,EAItB,MAAM,EAIN,YAAY,CACJ,CAAA;AAEV,gDAAgD;AAChD,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3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,GAAG,MAAM,EAAE,CAoB/D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAWxF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,SAAS,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CASV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,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"}
|
|
@@ -49,5 +49,6 @@ export declare function generateClientJsWithSourceMap(ir: ComponentIR, siblingCo
|
|
|
49
49
|
export declare function analyzeClientNeeds(ir: ComponentIR): {
|
|
50
50
|
needsInit: boolean;
|
|
51
51
|
usedProps: string[];
|
|
52
|
+
liveOnlyProps: Record<string, string>;
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAcjC,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceR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;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"}
|
|
@@ -7,7 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* `__scope` is the synthetic root slot id used when the component's
|
|
9
9
|
* root element carries the listener (no `bf=` slot).
|
|
10
|
+
*
|
|
11
|
+
* A slot that is ALSO a `.map()` loop's container, with its own handler for
|
|
12
|
+
* the same DOM event a loop delegates, is skipped here too (#2930):
|
|
13
|
+
* `loopDelegationIndex` says so, and `control-flow.ts`'s `emitLoopUpdates`
|
|
14
|
+
* folds that handler into the delegated listener instead — emitting it here
|
|
15
|
+
* too would double-wire it back onto a separate `addEventListener` call,
|
|
16
|
+
* which is exactly the bug this split avoids.
|
|
10
17
|
*/
|
|
11
18
|
import type { ClientJsContext } from '../types.ts';
|
|
12
|
-
|
|
19
|
+
import type { LoopDelegationIndex } from '../control-flow/plan/loop-delegation-index.ts';
|
|
20
|
+
export declare function emitEventHandlers(lines: string[], ctx: ClientJsContext, conditionalSlotIds: Set<string>, loopDelegationIndex: LoopDelegationIndex): void;
|
|
13
21
|
//# sourceMappingURL=event-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/event-handlers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/event-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAExF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC/B,mBAAmB,EAAE,mBAAmB,GACvC,IAAI,CAmBN"}
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* function / constant or destructured prop), emit
|
|
7
7
|
* `const handlerName = _p.handlerName`. Subsequent emission can call
|
|
8
8
|
* `handlerName(...)` without writing the prop accessor inline.
|
|
9
|
+
*
|
|
10
|
+
* Only for props-object mode, where a bare `handlerName` would otherwise be
|
|
11
|
+
* a `ReferenceError`. In destructured mode `rewriteDestructuredPropReads`
|
|
12
|
+
* already turns every handler-name read into a live `_p.handlerName`, so the
|
|
13
|
+
* alias would only be emitted to be left unused.
|
|
9
14
|
*/
|
|
10
15
|
import type { ClientJsContext } from '../types.ts';
|
|
11
16
|
export declare function emitPropsEventHandlers(lines: string[], ctx: ClientJsContext, usedFunctions: Set<string>, neededProps: Set<string>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-event-handlers.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/props-event-handlers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"props-event-handlers.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/phases/props-event-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,EAC1B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,IAAI,CAiBN"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `props-extraction` phase — emit
|
|
3
|
-
*
|
|
2
|
+
* `props-extraction` phase — emit the one surviving one-time prop
|
|
3
|
+
* extraction, `const children = _p.children [?? <default>]`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* so falsy values stay falsy)
|
|
12
|
-
* - otherwise → no default
|
|
5
|
+
* `children` must stay a ONE-TIME read: a prop's slot-children value is a
|
|
6
|
+
* getter that INSTANTIATES child components when read (see
|
|
7
|
+
* `prune-unused-prop-extractions.ts`), so reading it live at every
|
|
8
|
+
* `{children}` reference would re-mount the children each time. Every
|
|
9
|
+
* other destructured prop is rewritten to a live read instead, by
|
|
10
|
+
* `rewriteDestructuredPropReads` (`generate-init.ts`).
|
|
13
11
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `_p.X`
|
|
12
|
+
* The line is composed from `propReadBase`/`propReadFallback` rather than
|
|
13
|
+
* `livePropReadExpr` so it stays unparenthesized — that exact
|
|
14
|
+
* `const X = _p.X [?? d]` shape is what `pruneUnusedPropExtractions`'s AST
|
|
15
|
+
* matcher recognizes when the init body never reads `children`.
|
|
16
|
+
*
|
|
17
|
+
* Skipped entirely for an opaque props object (`propsObjectName != null`):
|
|
18
|
+
* downstream code there reads `_p.X` directly via the late-stage rename.
|
|
17
19
|
*/
|
|
18
20
|
import type { PropUsage } from '../../types.ts';
|
|
19
21
|
import type { ClientJsContext } from '../types.ts';
|
|
@@ -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;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAKlD,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,CAcN"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { ComponentIR, PropUsage, ReferencesGraph } from '../types.ts';
|
|
16
16
|
import type { ClientJsContext } from './types.ts';
|
|
17
17
|
import type { LocalClassification } from './init-declarations.ts';
|
|
18
|
+
import { type LoopDelegationIndex } from './control-flow/plan/loop-delegation-index.ts';
|
|
18
19
|
/**
|
|
19
20
|
* Inputs available to every phase. Built once by `generateInitFunction`
|
|
20
21
|
* before phase execution starts; phases read but never mutate.
|
|
@@ -28,6 +29,16 @@ export interface PhaseCtx {
|
|
|
28
29
|
/** Slots that live inside a conditional branch (handled via `insert()`).
|
|
29
30
|
* Cached so `event-handlers` and `ref-callbacks` don't recompute. */
|
|
30
31
|
conditionalSlotIds: Set<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Which (container slot, DOM event) pairs a top-level `.map()` loop will
|
|
34
|
+
* delegate, and which loop is last among those sharing a pair (#2930).
|
|
35
|
+
* Computed once, ahead of both `event-handlers` (which must suppress a
|
|
36
|
+
* container's own listener for a delegated pair) and `loop-updates`
|
|
37
|
+
* (which folds that handler into the delegated listener instead) — those
|
|
38
|
+
* two phases run in that order, so this can't be computed by either one
|
|
39
|
+
* lazily on first use.
|
|
40
|
+
*/
|
|
41
|
+
loopDelegationIndex: LoopDelegationIndex;
|
|
31
42
|
/** Local names that resolve to component-scope expressions and therefore
|
|
32
43
|
* become `[]` / `undefined` when referenced from the CSR template (the
|
|
33
44
|
* same set the registration emitter feeds `generateCsrTemplate`).
|
|
@@ -36,7 +47,7 @@ export interface PhaseCtx {
|
|
|
36
47
|
unsafeLocalNames: Set<string>;
|
|
37
48
|
}
|
|
38
49
|
/** Build the read-only carrier that every phase consumes. */
|
|
39
|
-
export declare function buildPhaseCtx(args: Omit<PhaseCtx, 'conditionalSlotIds'>): PhaseCtx;
|
|
50
|
+
export declare function buildPhaseCtx(args: Omit<PhaseCtx, 'conditionalSlotIds' | 'loopDelegationIndex'>): PhaseCtx;
|
|
40
51
|
/**
|
|
41
52
|
* String literal union of every phase id in `PHASES`. Typing `id` and
|
|
42
53
|
* `dependsOn` against this union turns a typo (e.g. `'props-extractio'`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phases.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"phases.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAEjE,OAAO,EAA4B,KAAK,mBAAmB,EAAE,MAAM,8CAA8C,CAAA;AAsBjH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,eAAe,CAAA;IACpB,EAAE,EAAE,WAAW,CAAA;IACf,KAAK,EAAE,eAAe,CAAA;IACtB,cAAc,EAAE,mBAAmB,CAAA;IACnC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC;0EACsE;IACtE,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC/B;;;;;;;;OAQG;IACH,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;;;oEAIgE;IAChE,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,oBAAoB,GAAG,qBAAqB,CAAC,GACjE,QAAQ,CAMV;AAED;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GACf,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,sBAAsB,GACtB,yBAAyB,GACzB,4BAA4B,GAC5B,qBAAqB,GACrB,0BAA0B,GAC1B,wBAAwB,GACxB,gBAAgB,GAChB,wBAAwB,GACxB,sBAAsB,GACtB,eAAe,GACf,uBAAuB,GACvB,0BAA0B,GAC1B,cAAc,GACd,0BAA0B,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,OAAO,CAAA;IACX,wEAAwE;IACxE,SAAS,EAAE,SAAS,OAAO,EAAE,CAAA;IAC7B,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;CAC/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,IAAI,CAsBN;AAWD,eAAO,MAAM,MAAM,EAAE,SAAS,SAAS,EA4GtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-declaration-emit.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/build-declaration-emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-declaration-emit.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/build-declaration-emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAI3D,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;IAC7D,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CAC3C;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,eAAe,EACpB,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,GAC7C,sBAAsB,CAMxB;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,sBAAsB,GAC9B,mBAAmB,CAkCrB"}
|
|
@@ -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,EAAE,SAAS,EAAE,UAAU,EAAE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