@barefootjs/jsx 0.16.0 → 0.17.0

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.
Files changed (57) hide show
  1. package/dist/adapters/env-signal.d.ts +38 -15
  2. package/dist/adapters/env-signal.d.ts.map +1 -1
  3. package/dist/adapters/jsx-adapter.d.ts.map +1 -1
  4. package/dist/adapters/parsed-expr-emitter.d.ts +7 -6
  5. package/dist/adapters/parsed-expr-emitter.d.ts.map +1 -1
  6. package/dist/analyzer-context.d.ts +29 -1
  7. package/dist/analyzer-context.d.ts.map +1 -1
  8. package/dist/analyzer.d.ts.map +1 -1
  9. package/dist/builtin-lowering-plugins.d.ts +34 -0
  10. package/dist/builtin-lowering-plugins.d.ts.map +1 -0
  11. package/dist/expression-parser.d.ts +219 -163
  12. package/dist/expression-parser.d.ts.map +1 -1
  13. package/dist/index.d.ts +7 -4
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +6754 -6129
  16. package/dist/ir-to-client-js/csr-substitute.d.ts.map +1 -1
  17. package/dist/ir-to-client-js/plan/build-declaration-emit.d.ts.map +1 -1
  18. package/dist/ir-to-client-js/plan/declaration-emit.d.ts +9 -0
  19. package/dist/ir-to-client-js/plan/declaration-emit.d.ts.map +1 -1
  20. package/dist/jsx-to-ir.d.ts.map +1 -1
  21. package/dist/lowering-registry.d.ts +122 -0
  22. package/dist/lowering-registry.d.ts.map +1 -0
  23. package/dist/query-href-lowering.d.ts +63 -0
  24. package/dist/query-href-lowering.d.ts.map +1 -0
  25. package/dist/ssr-defaults.d.ts.map +1 -1
  26. package/dist/types.d.ts +169 -11
  27. package/dist/types.d.ts.map +1 -1
  28. package/package.json +2 -2
  29. package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +68 -3
  30. package/src/__tests__/analyzer.test.ts +53 -0
  31. package/src/__tests__/expression-parser.test.ts +703 -391
  32. package/src/__tests__/ir-reduce-op.test.ts +18 -21
  33. package/src/__tests__/ir-sort-comparator.test.ts +19 -20
  34. package/src/__tests__/lowering-registry.test.ts +141 -0
  35. package/src/__tests__/primitive-resolver-alias.test.ts +23 -0
  36. package/src/__tests__/query-href-recognition.test.ts +58 -0
  37. package/src/__tests__/serialize-parsed-expr.test.ts +204 -0
  38. package/src/__tests__/unsupported-expression.test.ts +98 -4
  39. package/src/adapters/env-signal.ts +60 -21
  40. package/src/adapters/jsx-adapter.ts +17 -0
  41. package/src/adapters/parsed-expr-emitter.ts +39 -41
  42. package/src/analyzer-context.ts +72 -27
  43. package/src/analyzer.ts +226 -9
  44. package/src/builtin-lowering-plugins.ts +54 -0
  45. package/src/expression-parser.ts +1183 -927
  46. package/src/index.ts +26 -3
  47. package/src/ir-to-client-js/csr-substitute.ts +5 -0
  48. package/src/ir-to-client-js/plan/build-declaration-emit.ts +16 -0
  49. package/src/ir-to-client-js/plan/declaration-emit.ts +9 -0
  50. package/src/ir-to-client-js/stringify/declaration-emit.ts +11 -0
  51. package/src/jsx-to-ir.ts +182 -43
  52. package/src/lowering-registry.ts +160 -0
  53. package/src/query-href-lowering.ts +147 -0
  54. package/src/ssr-defaults.ts +5 -1
  55. package/src/types.ts +171 -12
  56. package/src/__tests__/flatmap-support.test.ts +0 -218
  57. package/src/__tests__/reduce-op.test.ts +0 -201
@@ -13,6 +13,7 @@ export type ParsedExpr = {
13
13
  kind: 'literal';
14
14
  value: string | number | boolean | null;
15
15
  literalType: 'string' | 'number' | 'boolean' | 'null';
16
+ raw?: string;
16
17
  } | {
17
18
  kind: 'call';
18
19
  callee: ParsedExpr;
@@ -49,52 +50,48 @@ export type ParsedExpr = {
49
50
  kind: 'template-literal';
50
51
  parts: TemplatePart[];
51
52
  } | {
52
- kind: 'arrow-fn';
53
- param: string;
53
+ kind: 'arrow';
54
+ params: string[];
54
55
  body: ParsedExpr;
55
56
  } | {
56
- kind: 'higher-order';
57
- method: 'filter' | 'every' | 'some' | 'find' | 'findIndex' | 'findLast' | 'findLastIndex';
58
- object: ParsedExpr;
59
- param: string;
60
- predicate: ParsedExpr;
57
+ kind: 'regex';
58
+ raw: string;
61
59
  } | {
62
60
  kind: 'array-literal';
63
61
  elements: ParsedExpr[];
62
+ } | {
63
+ kind: 'object-literal';
64
+ properties: ObjectLiteralProperty[];
65
+ raw: string;
64
66
  } | {
65
67
  kind: 'array-method';
66
68
  method: 'join' | 'includes' | 'indexOf' | 'lastIndexOf' | 'at' | 'concat' | 'slice' | 'reverse' | 'toReversed' | 'toLowerCase' | 'toUpperCase' | 'trim' | 'toFixed' | 'split' | 'startsWith' | 'endsWith' | 'replace' | 'repeat' | 'padStart' | 'padEnd';
67
69
  object: ParsedExpr;
68
70
  args: ParsedExpr[];
69
- } | {
70
- kind: 'array-method';
71
- method: 'sort' | 'toSorted';
72
- object: ParsedExpr;
73
- args: [];
74
- comparator: SortComparator;
75
- } | {
76
- kind: 'array-method';
77
- method: 'reduce' | 'reduceRight';
78
- object: ParsedExpr;
79
- args: [];
80
- reduceOp: ReduceOp;
81
71
  } | {
82
72
  kind: 'array-method';
83
73
  method: 'flat';
84
74
  object: ParsedExpr;
85
75
  args: [];
86
76
  flatDepth: FlatDepth;
87
- } | {
88
- kind: 'array-method';
89
- method: 'flatMap';
90
- object: ParsedExpr;
91
- args: [];
92
- flatMapOp: FlatMapOp;
93
77
  } | {
94
78
  kind: 'unsupported';
95
79
  raw: string;
96
80
  reason: string;
97
81
  };
82
+ /**
83
+ * One property of an `object-literal` `ParsedExpr`. The key is the
84
+ * resolved (non-computed) property name — for `{ a: 1 }` and shorthand
85
+ * `{ a }` it is `a`; for `{ 'a-b': 1 }` it is `a-b`. Computed keys
86
+ * (`{ [k]: 1 }`) are not represented; such literals fall through to
87
+ * `unsupported` at parse time.
88
+ */
89
+ export type ObjectLiteralProperty = {
90
+ key: string;
91
+ keyKind?: 'identifier' | 'string' | 'numeric';
92
+ shorthand: boolean;
93
+ value: ParsedExpr;
94
+ };
98
95
  /**
99
96
  * One comparison key inside a sort comparator. A simple
100
97
  * `(a, b) => a.f - b.f` produces a single key; a multi-key
@@ -112,40 +109,16 @@ export type SortKey = {
112
109
  direction: 'asc' | 'desc';
113
110
  };
114
111
  /**
115
- * Structured form of a JS `(a, b) => …` sort comparator. Built once
116
- * at parse time and consumed by both adapters' arrayMethod emit and
117
- * (when chained directly before `.map()`) the loop-hoist path in
118
- * `jsx-to-ir.ts`. The shape is intentionally finite — see
119
- * `extractSortComparatorFromTS` for the accepted catalogue.
112
+ * Structured form of a JS `(a, b) => …` sort comparator. Recovered from
113
+ * the generic `arrow` callback body by {@link sortComparatorFromArrow} as
114
+ * the LEGACY fallback for a comparator the runtime evaluator can't model
115
+ * (`localeCompare` string sorts `serializeParsedExpr` refuses them).
116
+ * Consumed by the adapters' `bf_sort` / `bf->sort` emit. The shape is
117
+ * intentionally finite — see {@link sortComparatorFromArrow} for the
118
+ * accepted catalogue.
120
119
  */
121
120
  export type SortComparator = {
122
121
  keys: SortKey[];
123
- raw: string;
124
- paramA: string;
125
- paramB: string;
126
- method: 'sort' | 'toSorted';
127
- };
128
- /**
129
- * Structured form of a JS `.reduce((acc, item) => …, init)` call,
130
- * built once at parse time and consumed by both template adapters'
131
- * `reduceMethod()` emit (#1448 Tier C). The shape is intentionally
132
- * finite — only the arithmetic-fold family is lowerable in a
133
- * declarative template; arbitrary accumulator bodies are not. See
134
- * `extractReduceOpFromTS` for the accepted catalogue.
135
- */
136
- export type ReduceOp = {
137
- op: '+' | '*';
138
- key: {
139
- kind: 'self';
140
- } | {
141
- kind: 'field';
142
- field: string;
143
- };
144
- type: 'numeric' | 'string';
145
- init: string;
146
- raw: string;
147
- paramAcc: string;
148
- paramItem: string;
149
122
  };
150
123
  /**
151
124
  * Flatten depth for `.flat(depth?)` (#1448 Tier C). A finite non-negative
@@ -156,41 +129,6 @@ export type ReduceOp = {
156
129
  * template time and refuses with BF101.
157
130
  */
158
131
  export type FlatDepth = number | 'infinity';
159
- /**
160
- * A single non-computed projection leaf on the flatMap callback param —
161
- * the item itself (`i`) or one of its fields (`i.field`). Shared by the
162
- * scalar and tuple `FlatMapOp` projections.
163
- */
164
- export type FlatMapLeaf = {
165
- kind: 'self';
166
- } | {
167
- kind: 'field';
168
- field: string;
169
- };
170
- /**
171
- * Structured form of a value-returning `.flatMap(fn)` callback (#1448
172
- * Tier C). The accepted catalogue:
173
- *
174
- * i => i → self projection (flatten one level)
175
- * i => i.field → field projection (flatten a per-item array field)
176
- * i => [i.a, i.b] → tuple projection (gather per-item leaves)
177
- *
178
- * The scalar `self` / `field` projections return a value that is then
179
- * flattened one level (flatMap = map + flat(1)) — a non-array value is
180
- * kept as-is, matching JS. The `tuple` projection returns an array
181
- * literal; flat(1) removes only that literal's wrapper, so each leaf is
182
- * appended verbatim (an array-valued leaf is NOT spread). Leaves outside
183
- * self / field (literals, `i.a + 1`, calls, deep access) refuse with
184
- * BF101. See `extractFlatMapOpFromTS`.
185
- */
186
- export type FlatMapOp = {
187
- projection: FlatMapLeaf | {
188
- kind: 'tuple';
189
- elements: FlatMapLeaf[];
190
- };
191
- param: string;
192
- raw: string;
193
- };
194
132
  export type TemplatePart = {
195
133
  type: 'string';
196
134
  value: string;
@@ -315,95 +253,72 @@ export declare function parseStyleObjectEntries(source: string): StyleObjectEntr
315
253
  */
316
254
  export declare function parseExpression(expr: string): ParsedExpr;
317
255
  /**
318
- * Recover a `SortComparator` from the comparator arg of `.sort(cmp)` /
319
- * `.toSorted(cmp)` (#1448 Tier B). Operates on the raw TS AST rather
320
- * than the converted ParsedExpr because the standard `convertNode`
321
- * arrow-fn path rejects two-param arrows (it was built for the
322
- * single-param higher-order shape `.filter(x => …)`); for sort we
323
- * need both param names to decide direction (`a-b` asc vs `b-a` desc).
324
- *
325
- * The accepted catalogue is finite so the walker stays shallow — no
326
- * constant folding, no symbol resolution, no inference of "this looks
327
- * like it might sort numerically". Returns null if the shape doesn't
328
- * match exactly, in which case the caller emits an `unsupported` IR
329
- * node and adapters surface BF101.
256
+ * Convert an already-parsed TypeScript node directly into a {@link ParsedExpr},
257
+ * for a consumer that already holds a `ts.Node` (e.g. a `.sort()` callback at
258
+ * the loop-hoist site) and wants the structured conversion without re-parsing
259
+ * source via `ts.createSourceFile`. An `unsupported` result still carries the
260
+ * node's text in `raw` for debugging (a synthetic node with no source file
261
+ * falls back to '').
262
+ */
263
+ export declare function tsNodeToParsedExpr(node: ts.Node): ParsedExpr;
264
+ /**
265
+ * Higher-order array methods whose callback body the runtime evaluator drives
266
+ * (#2018). Recognised generically as a `call` whose callee is `<recv>.<method>`
267
+ * and whose first argument is an `arrow`; the adapter serializes the arrow body
268
+ * to the evaluator. `map` is excluded — a JSX-returning `.map` is an IRLoop
269
+ * upstream, and a value-returning `.map` has no template lowering.
270
+ */
271
+ export declare const CALLBACK_METHODS: ReadonlySet<string>;
272
+ /**
273
+ * A recognised higher-order callback method call: `<object>.<method>(<arrow>,
274
+ * …rest)` where `method ∈` {@link CALLBACK_METHODS} and the first argument is a
275
+ * generic `arrow`. Returns the receiver, the callback arrow, and any trailing
276
+ * args (e.g. the `.reduce` init), or `null` if the shape doesn't match. The
277
+ * single recognition point shared by the support gate and the adapter dispatch.
278
+ */
279
+ export declare function asCallbackMethodCall(expr: ParsedExpr): {
280
+ method: string;
281
+ object: ParsedExpr;
282
+ arrow: Extract<ParsedExpr, {
283
+ kind: 'arrow';
284
+ }>;
285
+ args: ParsedExpr[];
286
+ } | null;
287
+ /**
288
+ * Recover a {@link SortComparator} from a generic `(a, b) => …` sort callback
289
+ * arrow (#2018 P5). The LEGACY fallback for a comparator the runtime evaluator
290
+ * can't model (`localeCompare` string sorts — `serializeParsedExpr` refuses
291
+ * them); the adapter calls this only when the eval path returns null. Operates
292
+ * on the generic `arrow` ParsedExpr (params + body subtree) — no `ts` re-parse.
330
293
  *
331
- * Body shapes:
332
- * - expression-bodied arrow (`(a, b) => …`)
333
- * - single-`return` block body both arrow (`(a, b) => { return …; }`)
334
- * and function expression. Multi-statement / local-var bodies stay
335
- * refused (deferred follow-up).
294
+ * The accepted catalogue is finite so the walker stays shallow — no constant
295
+ * folding, no symbol resolution. Returns null if the shape doesn't match
296
+ * exactly, in which case the adapter surfaces BF101.
336
297
  *
337
- * A body is split on top-level `||` into one leaf per operand, giving
338
- * a multi-key comparator (`a.x - b.x || a.y - b.y` → sort by x, then y).
339
- * Accepted leaf shapes (each paired ascending / descending by operand
340
- * order):
298
+ * A body is split on top-level `||` into one leaf per operand, giving a
299
+ * multi-key comparator (`a.x - b.x || a.y - b.y` → sort by x, then y). Accepted
300
+ * leaf shapes (each paired ascending / descending by operand order):
341
301
  *
342
302
  * a.field - b.field → field, numeric
343
303
  * a - b → self, numeric
344
304
  * a.field.localeCompare(b.field) → field, string
345
305
  * a.localeCompare(b) → self, string
346
306
  * a.field > b.field ? 1 : -1 → field, auto (relational ternary)
347
- * a.field < b.field ? -1 : 1 → field, auto
348
307
  * a < b ? -1 : a > b ? 1 : 0 → self/field, auto (3-way)
349
308
  * a === b ? 0 : <relational ternary> → leading-tie 3-way
350
309
  *
351
- * Function-reference comparators and `localeCompare(b, locale, opts)`
352
- * (the multi-arg form) return null — deferred follow-ups.
353
- */
354
- export declare function extractSortComparatorFromTS(node: ts.Node, method: 'sort' | 'toSorted'): SortComparator | null;
355
- /**
356
- * Recover a `ReduceOp` from the `(reducer, init)` args of
357
- * `.reduce(...)` (#1448 Tier C). Operates on the raw TS AST because the
358
- * standard `convertNode` arrow-fn path rejects two-param arrows.
359
- *
360
- * The accepted catalogue is intentionally finite — only the
361
- * arithmetic-fold family lowers to a declarative template:
362
- *
363
- * (acc, x) => acc + x → self, numeric (init: number)
364
- * (acc, x) => acc + x.field → field, numeric (init: number)
365
- * (acc, x) => acc * x → self, numeric (init: number)
366
- * (acc, x) => acc * x.field → field, numeric (init: number)
367
- * (acc, x) => acc + x → self, string (init: string → concat)
368
- * (acc, x) => acc + x.field → field, string (init: string → concat)
369
- *
370
- * The accumulator must be the binary expression's *left* operand
371
- * (canonical reduce form; reversed operands change string-concat
372
- * order), the per-item value must be the item param itself or a
373
- * single non-computed field access on it, and the init must be a
374
- * number or string literal (negative numbers via prefix `-` allowed).
375
- * String concatenation requires `+`. Block bodies reduce to a single
376
- * `return`, mirroring the sort extractor. Anything else returns null
377
- * and the caller emits `unsupported` (BF101).
310
+ * Function-reference comparators and `localeCompare(b, locale, opts)` (the
311
+ * multi-arg form) return null — deferred follow-ups.
378
312
  */
379
- export declare function extractReduceOpFromTS(reducerNode: ts.Node, initNode: ts.Node): ReduceOp | null;
380
- /**
381
- * Recover a `FlatMapOp` from the single-argument callback of a
382
- * value-returning `.flatMap(fn)` (#1448 Tier C). Operates on the raw TS
383
- * AST, mirroring `extractReduceOpFromTS`.
384
- *
385
- * The accepted catalogue:
386
- *
387
- * i => i → self (flatMap(identity) === flat(1))
388
- * i => i.field → field (flatten a per-item array field)
389
- * i => [i.a, i.b] → tuple (gather per-item self / field leaves)
390
- *
391
- * The callback must take exactly one identifier param (the index / array
392
- * params can't be expressed in a template projection), and the body must
393
- * be the param itself, a single non-computed field access on it, or an
394
- * array literal whose every element is one of those leaves. Block bodies
395
- * reduce to a single `return`, like the reduce / sort extractors. Any
396
- * other body (deep access, computed members, calls, arithmetic, a
397
- * literal element) returns null and the caller emits `unsupported`
398
- * (BF101).
399
- */
400
- export declare function extractFlatMapOpFromTS(cbNode: ts.Node): FlatMapOp | null;
313
+ export declare function sortComparatorFromArrow(arrow: ParsedExpr): SortComparator | null;
401
314
  /**
402
315
  * Check if a parsed expression is supported for SSR template conversion.
403
316
  */
404
317
  export declare function isSupported(expr: ParsedExpr): SupportResult;
405
318
  /**
406
- * Check if expression contains any higher-order method calls.
319
+ * Check if expression contains any higher-order callback method call
320
+ * (`.filter`/`.sort`/`.reduce`/… with an arrow argument — see
321
+ * {@link asCallbackMethodCall}) anywhere in the tree.
407
322
  */
408
323
  export declare function containsHigherOrder(expr: ParsedExpr): boolean;
409
324
  /**
@@ -418,6 +333,118 @@ export declare function containsHigherOrder(expr: ParsedExpr): boolean;
418
333
  * ```
419
334
  */
420
335
  export declare function parseBlockBody(block: ts.Block, sourceFile: ts.SourceFile, getJS: (node: ts.Node) => string): ParsedStatement[] | null;
336
+ /**
337
+ * Like {@link parseBlockBody} but tolerant: a statement `parseStatement` can't
338
+ * represent is **skipped** rather than failing the whole block. Used to carry a
339
+ * block-body memo's structure on the IR for adapters that only pattern-match a
340
+ * recognised prefix of statements (e.g. a `const k = getter(); if (!k) return
341
+ * CONST` guard) and ignore the rest — including a trailing client-directive
342
+ * (`@client`) return that the strict parser would reject. Mirrors the tolerant
343
+ * `continue`-on-unrecognised walks those adapters previously ran over a
344
+ * re-parsed source string, so it never carries a *more* permissive result.
345
+ */
346
+ export declare function parseBlockBodyTolerant(block: ts.Block, sourceFile: ts.SourceFile, getJS: (node: ts.Node) => string): ParsedStatement[];
347
+ /**
348
+ * The actionable refusal reason for a block body that is not purely-functionally
349
+ * expressible. Carried on the `unsupported` ParsedExpr so adapters surface it as
350
+ * the BF101 message. A loop that mutates a local to accumulate a value is a fold
351
+ * (already expressible via `.reduce`); a loop that does anything else, a `break`,
352
+ * a re-assignment, or a side-effecting/I-O call is genuinely imperative and has
353
+ * no value-position lowering.
354
+ */
355
+ export declare const IMPERATIVE_BLOCK_REASON: string;
356
+ /**
357
+ * Refusal reason when inlining a `const` binding would capture a free variable
358
+ * of its initializer under a nested callback parameter of the same name. The
359
+ * let-inline substitution is not a hygienic (alpha-renaming) substitution, so
360
+ * rather than silently miscompile the callback we refuse and adapters surface
361
+ * BF101.
362
+ */
363
+ export declare const CAPTURE_BLOCK_REASON: string;
364
+ /**
365
+ * Refusal reason when a `const` initializer may have side effects (it contains
366
+ * a function/method call) and the binding is NOT used exactly once on a single
367
+ * runtime path. Let-inline substitutes the initializer at each use site, which
368
+ * would drop the effect (zero uses) or duplicate it (multiple uses / a use
369
+ * inside a callback that runs per element) — exactly the side-effecting shape
370
+ * the fold must refuse rather than miscompile.
371
+ */
372
+ export declare const IMPURE_INLINE_BLOCK_REASON: string;
373
+ /**
374
+ * Options for {@link foldBlockToExpr}.
375
+ */
376
+ export interface FoldBlockOptions {
377
+ /**
378
+ * Names of zero-argument calls that are idempotent reads with no observable
379
+ * side effect — chiefly reactive getters (signal / memo accessors), which
380
+ * return the same value each time within a render. Inlining such a read at
381
+ * multiple sites is evaluation-count-neutral, so the fold may treat
382
+ * `getter()` as pure. The caller (e.g. `jsx-to-ir`) supplies the set from its
383
+ * analyzer-collected signal/memo names; callers without that context (the
384
+ * plain `convertNode` callback path) omit it and every call stays "possibly
385
+ * impure". A non-empty arg list or a member-call (`a.b()`) is never treated as
386
+ * pure by this set.
387
+ */
388
+ pureCallNames?: ReadonlySet<string>;
389
+ }
390
+ /**
391
+ * Fold a value-producing block body — a {@link ParsedStatement} sequence of
392
+ * `const` bindings, value-producing `if` / early `return`, and a terminal
393
+ * `return` — into a single {@link ParsedExpr}, so block-bodied memos / derived /
394
+ * callbacks flow through the same expression surface as expression-bodied ones
395
+ * (#2040, carved from #2018 stage 5). This generalizes the per-idiom block-memo
396
+ * recognizers (#1897 / #1945 / #2015) the same way the evaluator replaced the
397
+ * `bf_sort` / `bf_reduce` catalogue: one normalization, no growing pattern list.
398
+ *
399
+ * Transformations:
400
+ * - `const x = <init>; …` → inline `x`'s init into the rest (let-inline).
401
+ * - `if (c) <then> [else <else>] …` → `c ? fold(then-path) : fold(else-path)`,
402
+ * where a branch that does not itself terminate continues into the
403
+ * statements following the `if` (the early-return idiom).
404
+ * - `return <v>` → `<v>`.
405
+ *
406
+ * The rest is folded first, leaving each binding as a free identifier, so its
407
+ * use count can be measured before inlining. Inlining is refused (→ `ok: false`)
408
+ * when it would be unsound:
409
+ * - a possibly-impure init (one containing a call) used zero or more than once
410
+ * on a path would drop or duplicate the side effect (a pure init is always
411
+ * safe to inline any number of times);
412
+ * - a substitution would capture a free variable of the init under a nested
413
+ * callback parameter of the same name (substitution is not hygienic).
414
+ *
415
+ * Returns `{ ok: false }` for a sequence that cannot produce a value on some
416
+ * path (falls through with no `return`) — the genuinely-imperative residue that
417
+ * {@link IMPERATIVE_BLOCK_REASON} describes. The input is assumed to be the
418
+ * STRICT parse ({@link parseBlockBody}, not the tolerant variant): every source
419
+ * statement is represented, so a `false` here reflects the real shape rather
420
+ * than a silently-dropped statement.
421
+ */
422
+ export declare function foldBlockToExpr(stmts: ParsedStatement[], opts?: FoldBlockOptions): {
423
+ ok: true;
424
+ expr: ParsedExpr;
425
+ } | {
426
+ ok: false;
427
+ reason: string;
428
+ };
429
+ /**
430
+ * Rewrite a ternary whose arms are used in BOOLEAN context — e.g. the result of
431
+ * folding a block-bodied filter predicate (`if (c) return A; return B` →
432
+ * `c ? A : B`) — into an equivalent `&&` / `||` expression, so it flows through
433
+ * the ordinary boolean-expression lowering instead of needing a dedicated
434
+ * block-condition renderer per adapter (#2040). Boolean-literal arms collapse:
435
+ *
436
+ * c ? true : false → c
437
+ * c ? true : f → c || f
438
+ * c ? t : false → c && t
439
+ * c ? false : f → !c && f
440
+ * c ? t : true → !c || t
441
+ * c ? t : f → (c && t) || (!c && f)
442
+ *
443
+ * Arms are flattened recursively (an `else if` chain is a nested ternary); the
444
+ * test is left as-is. Only valid where the consumer interprets the value as a
445
+ * boolean (a filter predicate). Non-conditional input is returned unchanged.
446
+ */
447
+ export declare function predicateTernaryToLogical(expr: ParsedExpr): ParsedExpr;
421
448
  /**
422
449
  * Convert ParsedExpr back to a string for debugging.
423
450
  */
@@ -432,6 +459,35 @@ export declare function exprToString(expr: ParsedExpr): string;
432
459
  * downstream conversion pipeline.
433
460
  */
434
461
  export declare function stringifyParsedExpr(expr: ParsedExpr): string;
462
+ /**
463
+ * Serialize a pure-expression `ParsedExpr` (a higher-order callback body) into
464
+ * the minimal JSON the runtime evaluator consumes — the format pinned by the
465
+ * `eval-vectors` golden cases and read by Go `eval.go` `EvalNode` / Perl
466
+ * `Evaluator.pm` `evaluate`. Only the evaluator-recognized fields are emitted
467
+ * per kind (a literal carries just `value`; `literalType` / `raw` are dropped —
468
+ * the evaluator never reads them; `member.computed` is kept when set so a
469
+ * computed member stays distinguishable), keeping the embedded body blob small
470
+ * and stable.
471
+ *
472
+ * Returns `null` when the tree contains a shape outside the evaluator's surface
473
+ * — a folded `higher-order` / `array-method`, an `arrow-fn`, an `unsupported`
474
+ * node, an operator the evaluator doesn't implement, or a `call` whose callee
475
+ * isn't an allowlisted builtin (`Math.*` / `String` / `Number` / `Boolean`) — so
476
+ * the caller refuses the body (BF101 / `@client`) instead of emitting a blob the
477
+ * evaluator would read as nil. The evaluator's support criterion is
478
+ * purely-functional expressibility; this is its compile-time gate. (#2018)
479
+ */
480
+ export declare function serializeParsedExpr(expr: ParsedExpr): string | null;
481
+ /**
482
+ * The free variables a higher-order callback body references — every bare
483
+ * identifier in a value position, minus the callback's own `params`. The
484
+ * adapter materializes each into the evaluator's `base_env` (mapping the JS name
485
+ * to its SSR value). Walks exactly the value positions {@link serializeParsedExpr}
486
+ * serializes (so it sees object-literal *values* and template-expression parts,
487
+ * and skips member property names / object keys, which are not references).
488
+ * Returns a sorted, de-duplicated list for stable emit. (#2018)
489
+ */
490
+ export declare function freeVarsInBody(body: ParsedExpr, params: ReadonlySet<string>): string[];
435
491
  /**
436
492
  * Extract the textual identifier path from a parsed expression's
437
493
  * callee — `{kind:'identifier', name:'String'}` → `"String"`,
@@ -1 +1 @@
1
- {"version":3,"file":"expression-parser.d.ts","sourceRoot":"","sources":["../src/expression-parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAM3B,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;CAAE,GACnH;IAAE,IAA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AE,MAAM,CAAA;CAAE,CA6DhE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAgBtE;AAuBD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAmDrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CA8D5D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA4DtF;AAgJD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAOhE"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { compileJSX, buildMetadata } from './compiler.ts';
7
7
  export type { CompileResult, CompileOptions, CompileOptionsWithAdapter, FileOutput } from './compiler.ts';
8
8
  export { extractSsrDefaults } from './ssr-defaults.ts';
9
9
  export type { SsrDefault } from './ssr-defaults.ts';
10
- export type { ComponentIR, IRNode, IRElement, IRText, IRExpression, IRConditional, IRLoop, IRLoopChildComponent, IRComponent, IRFragment, IRSlot, IRIfStatement, IRProvider, IRAsync, IRMetadata, AttrValue, LiteralAttr, ExpressionAttr, BooleanAttr, BooleanShorthandAttr, TemplateAttr, SpreadAttr, JsxChildrenAttr, IRTemplatePart, IRProp, ParamInfo, PropertyInfo, TypeInfo, TypeDefinition, SourceLocation, CompilerError, } from './types.ts';
10
+ export type { ComponentIR, IRNode, IRElement, IRText, IRExpression, IRConditional, IRLoop, IRLoopChildComponent, IRComponent, IRFragment, IRSlot, IRIfStatement, IRProvider, IRAsync, IRMetadata, AttrValue, LiteralAttr, ExpressionAttr, BooleanAttr, BooleanShorthandAttr, TemplateAttr, SpreadAttr, JsxChildrenAttr, IRTemplatePart, IRProp, ParamInfo, PropertyInfo, MemoInfo, TypeInfo, TypeDefinition, SourceLocation, CompilerError, } from './types.ts';
11
11
  export { analyzeComponent, listComponentFunctions, listComponentFunctions as listExportedComponents, createProgramForFile, needsTypeBasedDetection, REACTIVE_PRIMITIVES, BROWSER_ONLY_CLIENT_APIS, type AnalyzerContext } from './analyzer.ts';
12
12
  export { createProgramForCorpus, type SharedProgramOptions } from './shared-program.ts';
13
13
  export { jsxToIR } from './jsx-to-ir.ts';
@@ -20,7 +20,10 @@ export type { JsxAdapterConfig } from './adapters/jsx-adapter.ts';
20
20
  export { rewriteImportsForTemplate } from './adapters/template-imports.ts';
21
21
  export { emitParsedExpr } from './adapters/parsed-expr-emitter.ts';
22
22
  export type { ParsedExprEmitter, HigherOrderMethod, ArrayMethod, SortMethod, LiteralType } from './adapters/parsed-expr-emitter.ts';
23
- export { importsSearchParams, searchParamsLocalNames, matchSearchParamsMethodCall } from './adapters/env-signal.ts';
23
+ export { importsSearchParams, searchParamsLocalNames, queryHrefLocalNames, matchSearchParamsMethodCall } from './adapters/env-signal.ts';
24
+ export { matchQueryHrefCall, queryHrefArgs, type QueryHrefCall, type QueryHrefTriple } from './query-href-lowering.ts';
25
+ export { registerLoweringPlugin, getLoweringPlugins, prepareLoweringMatchers, matchLoweringCall, __resetLoweringPluginsForTest, type LoweringPlugin, type LoweringNode, type LoweringTriple, type LoweringMatcher, } from './lowering-registry.ts';
26
+ export { queryHrefPlugin, registerBuiltinLoweringPlugins, BUILTIN_LOWERING_PLUGINS, } from './builtin-lowering-plugins.ts';
24
27
  export { emitIRNode } from './adapters/ir-node-emitter.ts';
25
28
  export type { IRNodeEmitter, EmitIRNode } from './adapters/ir-node-emitter.ts';
26
29
  export { emitAttrValue } from './adapters/attr-value-emitter.ts';
@@ -174,9 +177,9 @@ export { AttrValueOf } from './types.ts';
174
177
  export { applyCssLayerPrefix } from './css-layer-prefixer.ts';
175
178
  export { enableCompilerInstrumentation, disableCompilerInstrumentation, resetCompilerCounters, getCompilerCounters, type CompilerCounters, } from './instrumentation.ts';
176
179
  export { ErrorCodes, createError, formatError, generateCodeFrame } from './errors.ts';
177
- export { parseExpression, isSupported, exprToString, stringifyParsedExpr, identifierPath, parseBlockBody, containsHigherOrder, extractArrowBodyExpression, parseStyleObjectEntries, parseProviderObjectLiteral, type ProviderObjectMember } from './expression-parser.ts';
180
+ export { parseExpression, tsNodeToParsedExpr, asCallbackMethodCall, CALLBACK_METHODS, sortComparatorFromArrow, serializeParsedExpr, freeVarsInBody, isSupported, exprToString, stringifyParsedExpr, identifierPath, parseBlockBody, parseBlockBodyTolerant, foldBlockToExpr, predicateTernaryToLogical, containsHigherOrder, extractArrowBodyExpression, parseStyleObjectEntries, parseProviderObjectLiteral, type ProviderObjectMember, type FoldBlockOptions } from './expression-parser.ts';
178
181
  export type { StyleObjectEntry } from './expression-parser.ts';
179
- export type { ParsedExpr, ParsedStatement, SortComparator, SortKey, ReduceOp, FlatDepth, FlatMapOp, FlatMapLeaf, SupportLevel, SupportResult, TemplatePart } from './expression-parser.ts';
182
+ export type { ParsedExpr, ObjectLiteralProperty, ParsedStatement, SortComparator, SortKey, FlatDepth, SupportLevel, SupportResult, TemplatePart } from './expression-parser.ts';
180
183
  export { buildLoopChainExpr } from './loop-chain.ts';
181
184
  export type { LoopChainInputs } from './loop-chain.ts';
182
185
  export { isLowerableObjectRestDestructure } from './loop-destructure.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACzD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGzG,OAAO,E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