@barefootjs/jsx 0.35.2 → 0.35.4
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/debug.d.ts +33 -3
- package/dist/debug.d.ts.map +1 -1
- package/dist/index.js +2995 -2851
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/build-static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/plan/static-array-child-init.d.ts +19 -1
- package/dist/ir-to-client-js/plan/static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/stringify/static-array-child-init.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +25 -0
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/jsx-to-ir.d.ts.map +1 -1
- package/dist/prop-rewrite.d.ts +26 -0
- package/dist/prop-rewrite.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/branch-local-in-attr-position.test.ts +24 -12
- package/src/__tests__/client-only-date-lowering.test.ts +29 -1
- package/src/__tests__/debug.test.ts +246 -0
- package/src/__tests__/issue-2798-static-nested-loop-bindings.test.ts +127 -0
- package/src/__tests__/issue-2856-branch-local-shorthand.test.ts +86 -0
- package/src/__tests__/issue-2897-static-loop-conditional.test.ts +340 -0
- package/src/__tests__/lazy-conditional.test.ts +1 -0
- package/src/__tests__/rewrite-destructured-props.test.ts +10 -5
- package/src/debug.ts +214 -84
- package/src/ir-to-client-js/collect-elements.ts +83 -3
- package/src/ir-to-client-js/plan/build-static-array-child-init.ts +59 -19
- package/src/ir-to-client-js/plan/static-array-child-init.ts +19 -1
- package/src/ir-to-client-js/stringify/static-array-child-init.ts +39 -0
- package/src/ir-to-client-js/types.ts +37 -1
- package/src/jsx-to-ir.ts +16 -4
- package/src/prop-rewrite.ts +74 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-elements.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/collect-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AAQ,GACxB,IAAI,CAqYN;AAodD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE,GAAG,SAAS;AAChF;;;;GAIG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;;GAIG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,iBAAiB,CAenB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE;AACrE;;;;;;;;GAQG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;GAGG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;AACzB;;;;;;;;;;;;;;GAcG;AACH,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC;AAClD,uFAAuF;AACvF,WAAW,CAAC,EAAE,YAAY,GACzB,oBAAoB,EAAE,CAsFxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/build-static-array-child-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"build-static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/build-static-array-child-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAmD,MAAM,aAAa,CAAA;AAoBnG,OAAO,KAAK,EAQV,yBAAyB,EAC1B,MAAM,8BAA8B,CAAA;AAErC,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,eAAe,GACnB,yBAAyB,CA4D3B"}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* - `outer-nested` — depth 0 の `nestedComponents`。outer forEach で
|
|
8
8
|
* `__iterEl.querySelector(...)` 経由で initChild。
|
|
9
9
|
* - `inner-loop-nested` — depth > 0 の `nestedComponents`。outer + inner
|
|
10
|
-
* forEach の二重ループで initChild
|
|
10
|
+
* forEach の二重ループで initChild。同じ二重ループで
|
|
11
|
+
* プレーン要素の ref / reactive text / reactive attr
|
|
12
|
+
* も配線する (#2798、depth 1 のみ)。
|
|
11
13
|
* - `component-rooted-inner-loop`
|
|
12
14
|
* — outer の loop item root が **child component**
|
|
13
15
|
* (`loop.childComponent`) で、その JSX children に
|
|
@@ -23,6 +25,8 @@
|
|
|
23
25
|
* shapes were determined by inline branching on the IR.
|
|
24
26
|
*/
|
|
25
27
|
import type { PreludeStatements } from '../control-flow/plan/inner-loop.ts';
|
|
28
|
+
import type { LoopChildRefBinding } from '../control-flow/plan/loop.ts';
|
|
29
|
+
import type { LoopChildReactiveAttr, LoopChildReactiveText } from '../types.ts';
|
|
26
30
|
/** Pre-built `{ name: value, ... }` props object expression. */
|
|
27
31
|
export type PropsExpr = string;
|
|
28
32
|
/** A single child-component initialiser inside an inner-loop body. */
|
|
@@ -137,6 +141,20 @@ export interface InnerLoopNestedInitPlan {
|
|
|
137
141
|
depth: number;
|
|
138
142
|
/** Per-component initialisers emitted inside the inner forEach body. */
|
|
139
143
|
comps: readonly InnerLoopComp[];
|
|
144
|
+
/**
|
|
145
|
+
* Reactive attrs on plain elements inside this inner loop's body,
|
|
146
|
+
* grouped by child slot id (#2798 — a static outer array's nested
|
|
147
|
+
* `.map()` over plain elements used to wire up NOTHING: no refs, no
|
|
148
|
+
* reactive text/attr effects, since the whole `elem.innerLoops` pass
|
|
149
|
+
* only ever ran for depth-N CHILD COMPONENTS). Only populated for a
|
|
150
|
+
* depth-1 inner loop under a plain-element-rooted outer item — see
|
|
151
|
+
* `buildStaticArrayChildInitsPlan`'s docstring.
|
|
152
|
+
*/
|
|
153
|
+
attrsBySlot: ReadonlyArray<readonly [string, readonly LoopChildReactiveAttr[]]>;
|
|
154
|
+
/** Reactive text interpolations inside this inner loop's body (#2798). */
|
|
155
|
+
texts: readonly LoopChildReactiveText[];
|
|
156
|
+
/** Imperative ref callbacks on elements inside this inner loop's body (#2798). */
|
|
157
|
+
refs: readonly LoopChildRefBinding[];
|
|
140
158
|
}
|
|
141
159
|
/**
|
|
142
160
|
* Plan for an inner `.map()` of components living inside a **component-rooted**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/static-array-child-init.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/plan/static-array-child-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE/E,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAA;CACrB;AAED,6EAA6E;AAC7E,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@@
|
|
|
1
|
-
{"version":3,"file":"static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/stringify/static-array-child-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAMV,yBAAyB,EAC1B,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"static-array-child-init.d.ts","sourceRoot":"","sources":["../../../src/ir-to-client-js/stringify/static-array-child-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAMV,yBAAyB,EAC1B,MAAM,oCAAoC,CAAA;AAO3C,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,yBAAyB,GAC/B,IAAI,CAIN"}
|
|
@@ -577,6 +577,31 @@ export interface LoopChildConditional {
|
|
|
577
577
|
* preamble-bound identifier unexpanded on purpose (#2482 Stage 1b).
|
|
578
578
|
*/
|
|
579
579
|
readsPreamble?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* `condition` can change value after first render — it reads a signal,
|
|
582
|
+
* memo, prop, or preamble-derived reactive local, as opposed to reading
|
|
583
|
+
* ONLY the (for a static array, fixed-forever) loop item/index (#2897
|
|
584
|
+
* follow-up). `classifyReactivity`'s `kind` can't answer this: it
|
|
585
|
+
* reports `'loop-param'` for ANY expression referencing a loop-bound
|
|
586
|
+
* name, even one that ALSO reads a signal (`item.x && flag()`) — that
|
|
587
|
+
* precedence is deliberate for its own two `ReactivitySource`-typed
|
|
588
|
+
* callers and must not change. This field is computed independently,
|
|
589
|
+
* at collection time, as `n.reactive || readsPreamble ||
|
|
590
|
+
* needsEffectWrapper(...)` — the same "does it need a patchable slot
|
|
591
|
+
* beyond the row's own item" question, without the loop-param
|
|
592
|
+
* short-circuit.
|
|
593
|
+
*
|
|
594
|
+
* Consumers: a static array's row/inner-loop conditional only needs
|
|
595
|
+
* escalation off the compile-time-bakeable static path when THIS is
|
|
596
|
+
* true — a condition that reads only the item/index never changes for
|
|
597
|
+
* a static array, so the row's branch decision (bare element OR child
|
|
598
|
+
* component) is correctly baked once by SSR and wired once by the
|
|
599
|
+
* static `initChild` pass, exactly as it was before #2897. A dynamic
|
|
600
|
+
* (signal-backed) array's `mapArray`/`insert()` path is unaffected by
|
|
601
|
+
* this field — every loop-param conditional is genuinely per-row
|
|
602
|
+
* reactive there, so `bindings.conditionals` itself is never filtered.
|
|
603
|
+
*/
|
|
604
|
+
reactiveBeyondLoopScope: boolean;
|
|
580
605
|
}
|
|
581
606
|
export interface TopLevelLoop extends LoopCore {
|
|
582
607
|
kind: 'top-level';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAChC;;;OAGG;IACH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,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC/B;AAGD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB"}
|
package/dist/jsx-to-ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-to-ir.d.ts","sourceRoot":"","sources":["../src/jsx-to-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,MAAM,EAgCZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"jsx-to-ir.d.ts","sourceRoot":"","sources":["../src/jsx-to-ir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,MAAM,EAgCZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,eAAe,EAA0E,MAAM,uBAAuB,CAAA;AAmhCpI,wBAAgB,OAAO,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAOhE"}
|
package/dist/prop-rewrite.d.ts
CHANGED
|
@@ -33,6 +33,32 @@ import ts from 'typescript';
|
|
|
33
33
|
* #1425).
|
|
34
34
|
*/
|
|
35
35
|
export declare function collectAstPropRefs(node: ts.Node, propNames: Set<string>, out: Set<string>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Scope-aware rewrite: parse `text` as an expression, walk it with the
|
|
38
|
+
* binding stack, and splice `replacementFor(name)` onto exactly the
|
|
39
|
+
* identifier references that are (a) in `names` and (b) not shadowed by
|
|
40
|
+
* a binding inside the text. Shorthand properties expand
|
|
41
|
+
* (`{ org }` → `{ org: <replacement> }`) so the result stays
|
|
42
|
+
* syntactically valid — this is the one place in the compiler that
|
|
43
|
+
* correctly distinguishes a value reference from an object-literal key
|
|
44
|
+
* / property-access name / shorthand property / binding name, so every
|
|
45
|
+
* caller doing this class of substitution (prop refs, #1425 branch-local
|
|
46
|
+
* refs, …) should route through this rather than growing its own
|
|
47
|
+
* regex-based text splice (#2856 — a second, regex-based substitution
|
|
48
|
+
* mechanism doesn't know shorthand is simultaneously a key and a value,
|
|
49
|
+
* and drops the key).
|
|
50
|
+
*
|
|
51
|
+
* With `allowStatements`, a `text` that fails to parse as a bare
|
|
52
|
+
* expression is retried as a standalone statement list (no wrapping
|
|
53
|
+
* parens) — for callers whose raw-captured text isn't guaranteed to be
|
|
54
|
+
* expression-shaped (e.g. a `.map()`-callback preamble statement).
|
|
55
|
+
*
|
|
56
|
+
* Returns null when `text` doesn't parse cleanly under either attempt —
|
|
57
|
+
* the caller falls back to its own legacy mechanism.
|
|
58
|
+
*/
|
|
59
|
+
export declare function rewriteScopedValueRefs(text: string, names: ReadonlySet<string>, replacementFor: (name: string) => string, opts?: {
|
|
60
|
+
allowStatements?: boolean;
|
|
61
|
+
}): string | null;
|
|
36
62
|
/**
|
|
37
63
|
* Apply the targeted regex rewrite for one or more prop names on a
|
|
38
64
|
* type-stripped expression text. Idempotent under `_p.X` (negative
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-rewrite.d.ts","sourceRoot":"","sources":["../src/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CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAChE,MAAM,GAAG,SAAS,CAcpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jsx",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.4",
|
|
4
4
|
"description": "JSX compiler for BarefootJS - transforms JSX to server HTML + client JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"directory": "packages/jsx"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@barefootjs/shared": "0.35.
|
|
52
|
+
"@barefootjs/shared": "0.35.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@barefootjs/client": ">=0.2.0",
|
|
@@ -305,19 +305,28 @@ describe('branch-local at element-attribute position (#1414)', () => {
|
|
|
305
305
|
expect(hydrate).toContain('foo bar')
|
|
306
306
|
})
|
|
307
307
|
|
|
308
|
-
test('branch-local substitution skips string
|
|
308
|
+
test('branch-local substitution skips string-literal text and correctly resolves a `$`-prefixed identifier', () => {
|
|
309
309
|
// The substitution machinery used to scan with `text.replace(/\b
|
|
310
310
|
// (name1|name2)\b/g, ...)`, which would (a) rewrite occurrences
|
|
311
311
|
// of the name inside string literals into invalid JS and
|
|
312
312
|
// (b) mis-match `\b` between `$` and a word char, splitting an
|
|
313
313
|
// identifier like `$kind` and rewriting just its `kind` tail.
|
|
314
|
-
// The
|
|
315
|
-
//
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
314
|
+
// The regex-scanner fallback (`replaceInExprContexts`, still used
|
|
315
|
+
// when text doesn't parse as an expression/statement list) fixes
|
|
316
|
+
// both by skipping opaque tokens — strings, regex, template
|
|
317
|
+
// bodies, comments — and replacing `\b` with `[\w$]` lookarounds.
|
|
318
|
+
// But it treats an entire template literal as one opaque token,
|
|
319
|
+
// so it can't reach a branch-local reference INSIDE a `${...}`
|
|
320
|
+
// hole either — `$kind` used to survive as a literal, undeclared
|
|
321
|
+
// identifier in the emitted output (a latent ReferenceError, the
|
|
322
|
+
// same failure class as #2856). The AST-based
|
|
323
|
+
// `rewriteScopedValueRefs` (#2856) parses the template literal
|
|
324
|
+
// properly and resolves the hole like any other expression
|
|
325
|
+
// position, while still leaving the cooked text (`label:kind=`)
|
|
326
|
+
// alone since it's not an identifier. This test pins a branch-local
|
|
327
|
+
// whose name collides with a token inside a string literal *and*
|
|
328
|
+
// with the tail of a `$`-prefixed identifier used inside a
|
|
329
|
+
// template-literal hole.
|
|
321
330
|
const source = `
|
|
322
331
|
'use client'
|
|
323
332
|
import { createSignal } from '@barefootjs/client'
|
|
@@ -345,9 +354,12 @@ describe('branch-local at element-attribute position (#1414)', () => {
|
|
|
345
354
|
// verbatim — pre-fix, the `kind` inside the template-literal head
|
|
346
355
|
// would have been rewritten into `('plain')`, mangling the string.
|
|
347
356
|
expect(clientJs).toContain('label:kind=')
|
|
348
|
-
// The `$kind` identifier
|
|
349
|
-
//
|
|
350
|
-
//
|
|
351
|
-
|
|
357
|
+
// The `$kind` identifier (distinct from the branch-local `kind`)
|
|
358
|
+
// must resolve to its own branch-local value, not leak through
|
|
359
|
+
// unresolved (which would be a ReferenceError at hydrate — no
|
|
360
|
+
// `$kind` binding exists in the emitted module scope) and not have
|
|
361
|
+
// its `kind` tail mistakenly matched by the `kind` substitution.
|
|
362
|
+
expect(clientJs).not.toMatch(/[^(]\$kind\b/)
|
|
363
|
+
expect(clientJs).toContain("label:kind=${('dollar')}")
|
|
352
364
|
})
|
|
353
365
|
})
|
|
@@ -22,10 +22,38 @@
|
|
|
22
22
|
* about would fire BF021 and never reach the reactive-emission sites this
|
|
23
23
|
* suite is about.
|
|
24
24
|
*/
|
|
25
|
-
import { describe, test, expect } from 'bun:test'
|
|
25
|
+
import { describe, test, expect, beforeAll } from 'bun:test'
|
|
26
26
|
import { compileJSX } from '../index'
|
|
27
27
|
import { TestAdapter } from '../adapters/test-adapter'
|
|
28
28
|
import { ErrorCodes } from '../errors'
|
|
29
|
+
import { getLoweringPlugins } from '../lowering-registry'
|
|
30
|
+
import { BUILTIN_LOWERING_PLUGINS } from '../builtin-lowering-plugins'
|
|
31
|
+
|
|
32
|
+
// #2831 — the persistent, CI-only "test (jsx-2)" flake on this suite's own
|
|
33
|
+
// assertions traced to `date-lowering.test.ts`'s per-test `afterEach`
|
|
34
|
+
// filtering the built-in `'date'` plugin out of the SHARED, module-level
|
|
35
|
+
// `lowering-registry.ts` registry (fixed: dbaba32, "date-lowering.test.ts
|
|
36
|
+
// leaked the built-in 'date' plugin out of the shared registry"). `bun
|
|
37
|
+
// test` runs every file in one process with no guaranteed file order, so a
|
|
38
|
+
// leak in one file's registry manipulation silently starves every
|
|
39
|
+
// LATER-running file that depends on a built-in plugin — this suite's own
|
|
40
|
+
// `datePlugin`/`toLocaleDatePlugin` dependency was the victim. A future
|
|
41
|
+
// leak of the same shape would again fail here as a confusing "lowering
|
|
42
|
+
// wasn't applied" assertion with no clue why. This guard converts that
|
|
43
|
+
// into a named, up-front failure instead.
|
|
44
|
+
beforeAll(() => {
|
|
45
|
+
const registered = new Set(getLoweringPlugins().map((p) => p.name))
|
|
46
|
+
const missing = BUILTIN_LOWERING_PLUGINS.map((p) => p.name).filter((name) => !registered.has(name))
|
|
47
|
+
if (missing.length > 0) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Built-in lowering plugin(s) missing from the shared registry before this suite ran: ${missing.join(', ')}. ` +
|
|
50
|
+
`This suite's assertions depend on them being registered — a SIBLING test file most likely reset or ` +
|
|
51
|
+
`filtered the shared \`lowering-registry.ts\` registry without restoring it (the #2831 bug class: use ` +
|
|
52
|
+
`\`beforeAll\`/\`afterAll\` snapshot-and-restore around a describe block, never a per-test \`afterEach\` ` +
|
|
53
|
+
`filter, when touching this shared, module-level registry).`,
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
})
|
|
29
57
|
|
|
30
58
|
function compile(src: string) {
|
|
31
59
|
const result = compileJSX(src.trimStart(), 'T.tsx', { adapter: new TestAdapter() })
|
|
@@ -1400,3 +1400,249 @@ describe('formatComponentSummary', () => {
|
|
|
1400
1400
|
expect(output).toContain('dynamic text bindings:')
|
|
1401
1401
|
})
|
|
1402
1402
|
})
|
|
1403
|
+
|
|
1404
|
+
describe('prop reads are tracked deps (#2903)', () => {
|
|
1405
|
+
// The issue's own repro: `props.value` read in an attribute AND a
|
|
1406
|
+
// conditional. The IR marks both `reactive: true`; the graph must not
|
|
1407
|
+
// print `(no tracked deps)` for a read the compiler itself proved reactive.
|
|
1408
|
+
const reproChildSource = `
|
|
1409
|
+
'use client'
|
|
1410
|
+
|
|
1411
|
+
export interface ReproChildProps {
|
|
1412
|
+
value: boolean
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
export function ReproChild(props: ReproChildProps) {
|
|
1416
|
+
return <button disabled={props.value}>{props.value ? 'busy' : 'idle'}</button>
|
|
1417
|
+
}
|
|
1418
|
+
`
|
|
1419
|
+
|
|
1420
|
+
test('props.value in attribute and conditional lists props.value as a dep', () => {
|
|
1421
|
+
const graph = buildComponentGraph(reproChildSource, 'ReproChild.tsx')
|
|
1422
|
+
const attr = graph.domBindings.find(d => d.label === 'disabled')
|
|
1423
|
+
const cond = graph.domBindings.find(d => d.type === 'conditional')
|
|
1424
|
+
expect(attr).toBeDefined()
|
|
1425
|
+
expect(cond).toBeDefined()
|
|
1426
|
+
expect(attr!.classification).toBe('reactive')
|
|
1427
|
+
expect(cond!.classification).toBe('reactive')
|
|
1428
|
+
expect(attr!.deps).toEqual(['props.value'])
|
|
1429
|
+
expect(cond!.deps).toEqual(['props.value'])
|
|
1430
|
+
})
|
|
1431
|
+
|
|
1432
|
+
test('formatComponentGraph shows the prop as the source, never (no tracked deps)', () => {
|
|
1433
|
+
const output = formatComponentGraph(buildComponentGraph(reproChildSource, 'ReproChild.tsx'))
|
|
1434
|
+
expect(output).toContain('props.value -> <button disabled={props.value}>')
|
|
1435
|
+
expect(output).toContain('props.value -> {props.value ? ... : ...}')
|
|
1436
|
+
expect(output).not.toContain('(no tracked deps)')
|
|
1437
|
+
// Props get their own node section and dependency-graph edges, exactly
|
|
1438
|
+
// like signals and memos do.
|
|
1439
|
+
expect(output).toContain(' props:\n props.value')
|
|
1440
|
+
expect(output).toContain('dependency graph:')
|
|
1441
|
+
expect(output).toContain('props.value -> dom:disabled')
|
|
1442
|
+
expect(output).toContain('props.value -> dom:conditional "s0"')
|
|
1443
|
+
})
|
|
1444
|
+
|
|
1445
|
+
test('graph.props carries one node per read prop with consumers; JSON mirrors it', () => {
|
|
1446
|
+
const graph = buildComponentGraph(reproChildSource, 'ReproChild.tsx')
|
|
1447
|
+
expect(graph.props).toHaveLength(1)
|
|
1448
|
+
expect(graph.props[0].kind).toBe('prop')
|
|
1449
|
+
expect(graph.props[0].name).toBe('props.value')
|
|
1450
|
+
expect(graph.props[0].consumers).toEqual(['dom:disabled', 'dom:conditional "s0"'])
|
|
1451
|
+
const json = graphToJSON(graph) as { props: Array<{ name: string; consumers: string[] }> }
|
|
1452
|
+
expect(json.props).toEqual([{ name: 'props.value', consumers: ['dom:disabled', 'dom:conditional "s0"'] }])
|
|
1453
|
+
})
|
|
1454
|
+
|
|
1455
|
+
test('a reactive non-event binding never has an empty deps list for a prop read', () => {
|
|
1456
|
+
// The invariant the issue is really about: `classification: 'reactive'`
|
|
1457
|
+
// with `deps: []` is what rendered as `(no tracked deps)`.
|
|
1458
|
+
const graph = buildComponentGraph(reproChildSource, 'ReproChild.tsx')
|
|
1459
|
+
for (const d of graph.domBindings) {
|
|
1460
|
+
if (d.type === 'event') continue
|
|
1461
|
+
if (d.classification === 'reactive') expect(d.deps.length).toBeGreaterThan(0)
|
|
1462
|
+
}
|
|
1463
|
+
})
|
|
1464
|
+
|
|
1465
|
+
test('destructured props are deps by name in text, attribute, conditional and child prop', () => {
|
|
1466
|
+
const source = `
|
|
1467
|
+
'use client'
|
|
1468
|
+
import { Card } from './Card'
|
|
1469
|
+
|
|
1470
|
+
export function A({ title, count, children }: { title: string; count: number; children?: any }) {
|
|
1471
|
+
return (
|
|
1472
|
+
<div data-n={count}>
|
|
1473
|
+
<Card title={title} />
|
|
1474
|
+
<span>{title}</span>
|
|
1475
|
+
{count > 0 ? 'y' : 'n'}
|
|
1476
|
+
{children}
|
|
1477
|
+
</div>
|
|
1478
|
+
)
|
|
1479
|
+
}
|
|
1480
|
+
`
|
|
1481
|
+
const graph = buildComponentGraph(source, 'A.tsx')
|
|
1482
|
+
const byLabel = (l: string) => graph.domBindings.find(d => d.label === l)!
|
|
1483
|
+
expect(byLabel('data-n').deps).toEqual(['count'])
|
|
1484
|
+
expect(byLabel('Card.title').deps).toEqual(['title'])
|
|
1485
|
+
expect(graph.domBindings.find(d => d.type === 'text')!.deps).toEqual(['title'])
|
|
1486
|
+
expect(graph.domBindings.find(d => d.type === 'conditional')!.deps).toEqual(['count'])
|
|
1487
|
+
// `children` is server-rendered, never a reactive dep — and never a node.
|
|
1488
|
+
expect(graph.props.map(p => p.name).sort()).toEqual(['count', 'title'])
|
|
1489
|
+
expect(graph.domBindings.every(d => !d.deps.includes('children'))).toBe(true)
|
|
1490
|
+
})
|
|
1491
|
+
|
|
1492
|
+
test('a prop read through a prop-derived local const reports the underlying props, not the const', () => {
|
|
1493
|
+
// The #1863 Slot-composed-button shape: `class={classes}` where `classes`
|
|
1494
|
+
// captures `props.variant` / `props.className`. The const is not a reactive
|
|
1495
|
+
// source; the props it captures are.
|
|
1496
|
+
const source = `
|
|
1497
|
+
'use client'
|
|
1498
|
+
|
|
1499
|
+
export function B(props: { title: string; variant: 'a' | 'b'; className?: string }) {
|
|
1500
|
+
const label = props.title + '!'
|
|
1501
|
+
const classes = \`btn-\${props.variant} \${props.className ?? ''}\`
|
|
1502
|
+
return <div class={classes}>{label}</div>
|
|
1503
|
+
}
|
|
1504
|
+
`
|
|
1505
|
+
const graph = buildComponentGraph(source, 'B.tsx')
|
|
1506
|
+
const cls = graph.domBindings.find(d => d.label === 'class')!
|
|
1507
|
+
expect(cls.classification).toBe('reactive')
|
|
1508
|
+
expect(cls.deps).toEqual(['props.variant', 'props.className'])
|
|
1509
|
+
const text = graph.domBindings.find(d => d.type === 'text')!
|
|
1510
|
+
expect(text.deps).toEqual(['props.title'])
|
|
1511
|
+
expect(graph.domBindings.every(d => !d.deps.includes('classes') && !d.deps.includes('label'))).toBe(true)
|
|
1512
|
+
})
|
|
1513
|
+
|
|
1514
|
+
test('props.children, bare props, and props.x inside a string literal are not deps', () => {
|
|
1515
|
+
const source = `
|
|
1516
|
+
'use client'
|
|
1517
|
+
|
|
1518
|
+
export function C(props: { title: string; children?: any }) {
|
|
1519
|
+
return <div title="props.title" data-x={props}>{props.children}</div>
|
|
1520
|
+
}
|
|
1521
|
+
`
|
|
1522
|
+
const graph = buildComponentGraph(source, 'C.tsx')
|
|
1523
|
+
expect(graph.props).toHaveLength(0)
|
|
1524
|
+
for (const d of graph.domBindings) {
|
|
1525
|
+
expect(d.deps).toHaveLength(0)
|
|
1526
|
+
}
|
|
1527
|
+
})
|
|
1528
|
+
|
|
1529
|
+
test('signal, memo and prop deps coexist in one binding, in that order', () => {
|
|
1530
|
+
const source = `
|
|
1531
|
+
'use client'
|
|
1532
|
+
import { createSignal, createMemo } from '@barefootjs/client'
|
|
1533
|
+
|
|
1534
|
+
export function M(props: { base: number }) {
|
|
1535
|
+
const [n, setN] = createSignal(0)
|
|
1536
|
+
const total = createMemo(() => n() + props.base)
|
|
1537
|
+
return (
|
|
1538
|
+
<button onClick={() => setN(v => v + 1)} aria-label={\`\${props.base}/\${n()}\`}>
|
|
1539
|
+
{total()}
|
|
1540
|
+
</button>
|
|
1541
|
+
)
|
|
1542
|
+
}
|
|
1543
|
+
`
|
|
1544
|
+
const graph = buildComponentGraph(source, 'M.tsx')
|
|
1545
|
+
const aria = graph.domBindings.find(d => d.label === 'aria-label')!
|
|
1546
|
+
expect(aria.deps).toEqual(['n', 'props.base'])
|
|
1547
|
+
// The memo's own `props.base` read is memo metadata, not a DOM binding —
|
|
1548
|
+
// so the prop node's consumers are the DOM sites only.
|
|
1549
|
+
expect(graph.props).toEqual([{ kind: 'prop', name: 'props.base', consumers: ['dom:aria-label'] }])
|
|
1550
|
+
const output = formatComponentGraph(graph)
|
|
1551
|
+
expect(output).toContain('n, props.base -> <button aria-label=')
|
|
1552
|
+
expect(output).toContain('props.base -> dom:aria-label')
|
|
1553
|
+
})
|
|
1554
|
+
|
|
1555
|
+
test('buildWhyUpdate reports a prop dep with kind "prop"', () => {
|
|
1556
|
+
const result = buildWhyUpdate(reproChildSource, 'ReproChild.tsx', 'disabled')!
|
|
1557
|
+
expect(result).not.toBeNull()
|
|
1558
|
+
expect(result.deps).toEqual([{ name: 'props.value', kind: 'prop', dependsOn: [], changedBy: [] }])
|
|
1559
|
+
const output = formatWhyUpdate(result)
|
|
1560
|
+
expect(output).toContain('disabled updates because:')
|
|
1561
|
+
expect(output).toContain('props.value changes from:')
|
|
1562
|
+
expect(output).toContain('(prop — the parent component passes a new value)')
|
|
1563
|
+
})
|
|
1564
|
+
|
|
1565
|
+
test('traceUpdatePath accepts a prop name and lists its DOM consumers', () => {
|
|
1566
|
+
const graph = buildComponentGraph(reproChildSource, 'ReproChild.tsx')
|
|
1567
|
+
const path = traceUpdatePath(graph, 'props.value')
|
|
1568
|
+
expect(path).not.toBeNull()
|
|
1569
|
+
expect(path!.kind).toBe('prop')
|
|
1570
|
+
expect(path!.dependents.map(d => d.name)).toEqual(['disabled', 'conditional "s0"'])
|
|
1571
|
+
expect(formatUpdatePath(path!)).toContain('props.value (prop)')
|
|
1572
|
+
})
|
|
1573
|
+
|
|
1574
|
+
test('a prop shadowed by a .map() row binding of the same name is not a prop dep', () => {
|
|
1575
|
+
// `item` inside the row is the loop item, not the outer prop — the
|
|
1576
|
+
// shadow guard (`BindingScope.isBound`) keeps it out of `deps` / `props`.
|
|
1577
|
+
const source = `
|
|
1578
|
+
'use client'
|
|
1579
|
+
|
|
1580
|
+
export function S({ item, rows }: { item: string; rows: string[] }) {
|
|
1581
|
+
return (
|
|
1582
|
+
<div>
|
|
1583
|
+
<span>{item}</span>
|
|
1584
|
+
<ul>{rows.map(item => <li title={item}>{item}</li>)}</ul>
|
|
1585
|
+
</div>
|
|
1586
|
+
)
|
|
1587
|
+
}
|
|
1588
|
+
`
|
|
1589
|
+
const graph = buildComponentGraph(source, 'S.tsx')
|
|
1590
|
+
// (`rows` feeds the loop's array, which is a loop binding, not a prop
|
|
1591
|
+
// dep — loop-array sources are outside this fix.)
|
|
1592
|
+
expect(graph.props.map(p => p.name)).toEqual(['item'])
|
|
1593
|
+
const outer = graph.props[0]
|
|
1594
|
+
// Only the outer `<span>{item}</span>` consumes the prop.
|
|
1595
|
+
expect(outer.consumers).toHaveLength(1)
|
|
1596
|
+
expect(outer.consumers[0]).toMatch(/^dom:text/)
|
|
1597
|
+
const rowTitle = graph.domBindings.find(d => d.label === 'title')!
|
|
1598
|
+
expect(rowTitle.classification).toBe('reactive')
|
|
1599
|
+
expect(rowTitle.deps).not.toContain('item')
|
|
1600
|
+
})
|
|
1601
|
+
|
|
1602
|
+
test('a .map() row param literally named like the props object shadows props.x reads', () => {
|
|
1603
|
+
// The props-object branch of `propDepsOf` needs the same shadow guard as
|
|
1604
|
+
// the destructured / const branches: inside `rows.map(props => …)` the
|
|
1605
|
+
// name `props` is the row item, so `props.label` is not an outer-prop
|
|
1606
|
+
// read — neither as a text binding nor as a forwarded child prop.
|
|
1607
|
+
const source = `
|
|
1608
|
+
'use client'
|
|
1609
|
+
import { Card } from './Card'
|
|
1610
|
+
|
|
1611
|
+
export function S(props: { title: string; rows: Array<{ label: string }> }) {
|
|
1612
|
+
return (
|
|
1613
|
+
<div>
|
|
1614
|
+
<span>{props.title}</span>
|
|
1615
|
+
<ul>{props.rows.map(props => <li title={props.label}><Card label={props.label} />{props.label}</li>)}</ul>
|
|
1616
|
+
</div>
|
|
1617
|
+
)
|
|
1618
|
+
}
|
|
1619
|
+
`
|
|
1620
|
+
const graph = buildComponentGraph(source, 'S.tsx')
|
|
1621
|
+
expect(graph.props.map(p => p.name)).toEqual(['props.title'])
|
|
1622
|
+
expect(graph.props[0].consumers).toHaveLength(1)
|
|
1623
|
+
for (const d of graph.domBindings) {
|
|
1624
|
+
expect(d.deps).not.toContain('props.label')
|
|
1625
|
+
}
|
|
1626
|
+
})
|
|
1627
|
+
|
|
1628
|
+
test('a fallback binding with no proven source still reads (no tracked deps)', () => {
|
|
1629
|
+
// Guard the other direction: the fix must not invent a prop dep for an
|
|
1630
|
+
// opaque call the analyzer genuinely cannot see through.
|
|
1631
|
+
const source = `
|
|
1632
|
+
'use client'
|
|
1633
|
+
import { createSignal } from '@barefootjs/client'
|
|
1634
|
+
import { pick } from './pick'
|
|
1635
|
+
|
|
1636
|
+
export function F(props: { id: string }) {
|
|
1637
|
+
const [, setFoo] = createSignal(0)
|
|
1638
|
+
return <div onClick={() => setFoo(1)} title={pick()}>x</div>
|
|
1639
|
+
}
|
|
1640
|
+
`
|
|
1641
|
+
const graph = buildComponentGraph(source, 'F.tsx')
|
|
1642
|
+
const title = graph.domBindings.find(d => d.label === 'title')!
|
|
1643
|
+
expect(title.classification).toBe('fallback')
|
|
1644
|
+
expect(title.deps).toEqual([])
|
|
1645
|
+
expect(graph.props).toHaveLength(0)
|
|
1646
|
+
expect(formatComponentGraph(graph)).toContain('~ <div title={pick()}> (no tracked deps)')
|
|
1647
|
+
})
|
|
1648
|
+
})
|