@barefootjs/rust 0.1.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 (87) hide show
  1. package/README.md +194 -0
  2. package/dist/adapter/analysis/component-tree.d.ts +26 -0
  3. package/dist/adapter/analysis/component-tree.d.ts.map +1 -0
  4. package/dist/adapter/boolean-result.d.ts +85 -0
  5. package/dist/adapter/boolean-result.d.ts.map +1 -0
  6. package/dist/adapter/emit-context.d.ts +107 -0
  7. package/dist/adapter/emit-context.d.ts.map +1 -0
  8. package/dist/adapter/expr/array-method.d.ts +75 -0
  9. package/dist/adapter/expr/array-method.d.ts.map +1 -0
  10. package/dist/adapter/expr/emitters.d.ts +143 -0
  11. package/dist/adapter/expr/emitters.d.ts.map +1 -0
  12. package/dist/adapter/index.d.ts +6 -0
  13. package/dist/adapter/index.d.ts.map +1 -0
  14. package/dist/adapter/index.js +189091 -0
  15. package/dist/adapter/lib/constants.d.ts +25 -0
  16. package/dist/adapter/lib/constants.d.ts.map +1 -0
  17. package/dist/adapter/lib/ir-scope.d.ts +50 -0
  18. package/dist/adapter/lib/ir-scope.d.ts.map +1 -0
  19. package/dist/adapter/lib/minijinja-naming.d.ts +64 -0
  20. package/dist/adapter/lib/minijinja-naming.d.ts.map +1 -0
  21. package/dist/adapter/lib/types.d.ts +32 -0
  22. package/dist/adapter/lib/types.d.ts.map +1 -0
  23. package/dist/adapter/memo/seed.d.ts +84 -0
  24. package/dist/adapter/memo/seed.d.ts.map +1 -0
  25. package/dist/adapter/minijinja-adapter.d.ts +421 -0
  26. package/dist/adapter/minijinja-adapter.d.ts.map +1 -0
  27. package/dist/adapter/props/prop-classes.d.ts +33 -0
  28. package/dist/adapter/props/prop-classes.d.ts.map +1 -0
  29. package/dist/adapter/spread/spread-codegen.d.ts +63 -0
  30. package/dist/adapter/spread/spread-codegen.d.ts.map +1 -0
  31. package/dist/adapter/value/parsed-literal.d.ts +28 -0
  32. package/dist/adapter/value/parsed-literal.d.ts.map +1 -0
  33. package/dist/build.d.ts +29 -0
  34. package/dist/build.d.ts.map +1 -0
  35. package/dist/build.js +189111 -0
  36. package/dist/conformance-pins.d.ts +13 -0
  37. package/dist/conformance-pins.d.ts.map +1 -0
  38. package/dist/index.d.ts +12 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +189112 -0
  41. package/package.json +67 -0
  42. package/runtime/Cargo.lock +124 -0
  43. package/runtime/Cargo.toml +21 -0
  44. package/runtime/src/backend_minijinja.rs +176 -0
  45. package/runtime/src/bin/bf-render.rs +147 -0
  46. package/runtime/src/evaluator.rs +770 -0
  47. package/runtime/src/lib.rs +19 -0
  48. package/runtime/src/manifest.rs +258 -0
  49. package/runtime/src/num.rs +558 -0
  50. package/runtime/src/runtime.rs +1548 -0
  51. package/runtime/src/search_params.rs +173 -0
  52. package/runtime/tests/eval_vectors.rs +94 -0
  53. package/runtime/tests/evaluator.rs +407 -0
  54. package/runtime/tests/helper_vectors.rs +348 -0
  55. package/runtime/tests/manifest.rs +169 -0
  56. package/runtime/tests/omit.rs +79 -0
  57. package/runtime/tests/props_attr.rs +75 -0
  58. package/runtime/tests/query.rs +50 -0
  59. package/runtime/tests/render_child.rs +210 -0
  60. package/runtime/tests/search_params.rs +68 -0
  61. package/runtime/tests/spread_attrs.rs +94 -0
  62. package/runtime/tests/template_primitives.rs +376 -0
  63. package/runtime/tests/vector-divergences.json +33 -0
  64. package/src/__tests__/minijinja-adapter-unit.test.ts +392 -0
  65. package/src/__tests__/minijinja-adapter.test.ts +58 -0
  66. package/src/__tests__/minijinja-counter.test.ts +61 -0
  67. package/src/__tests__/minijinja-query-href.test.ts +101 -0
  68. package/src/__tests__/minijinja-spread-attrs.test.ts +227 -0
  69. package/src/adapter/analysis/component-tree.ts +119 -0
  70. package/src/adapter/boolean-result.ts +177 -0
  71. package/src/adapter/emit-context.ts +119 -0
  72. package/src/adapter/expr/array-method.ts +346 -0
  73. package/src/adapter/expr/emitters.ts +608 -0
  74. package/src/adapter/index.ts +6 -0
  75. package/src/adapter/lib/constants.ts +37 -0
  76. package/src/adapter/lib/ir-scope.ts +95 -0
  77. package/src/adapter/lib/minijinja-naming.ts +85 -0
  78. package/src/adapter/lib/types.ts +35 -0
  79. package/src/adapter/memo/seed.ts +135 -0
  80. package/src/adapter/minijinja-adapter.ts +1796 -0
  81. package/src/adapter/props/prop-classes.ts +65 -0
  82. package/src/adapter/spread/spread-codegen.ts +168 -0
  83. package/src/adapter/value/parsed-literal.ts +76 -0
  84. package/src/build.ts +38 -0
  85. package/src/conformance-pins.ts +101 -0
  86. package/src/index.ts +12 -0
  87. package/src/test-render.ts +680 -0
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Compile-time constant tables for the minijinja template adapter.
3
+ *
4
+ * Near-verbatim port of
5
+ * `packages/adapter-jinja/src/adapter/lib/constants.ts` (itself extracted
6
+ * the way `packages/adapter-xslate/src/adapter/lib/constants.ts` is) — the
7
+ * emitted Jinja2-compatible expression syntax is identical, so the table
8
+ * (and its `JINJA_*`-prefixed names) ports unchanged.
9
+ */
10
+ import type { PrimitiveSpec } from './types.ts';
11
+ /**
12
+ * Single source of truth for the adapter's template-primitive
13
+ * surface. Each entry pairs the expected arity with the emit function.
14
+ *
15
+ * The emit fn returns a Jinja expression (no surrounding `{{ }}`) suitable
16
+ * for embedding inside an interpolation — `bf.json(val)`, `bf.floor(val)`,
17
+ * etc. The same primitive names as the Xslate adapter, but invoked as
18
+ * `bf.NAME(args)` (bare, no `$` sigil) instead of `$bf.NAME(args)`.
19
+ */
20
+ export declare const JINJA_TEMPLATE_PRIMITIVES: Record<string, PrimitiveSpec>;
21
+ /**
22
+ * Module-scope `templatePrimitives` map derived once from the spec record.
23
+ */
24
+ export declare const JINJA_PRIMITIVE_EMIT_MAP: Record<string, (args: string[]) => string>;
25
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAOnE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAG7E,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * IR traversal helpers for the minijinja template adapter.
3
+ *
4
+ * Ported from `packages/adapter-xslate/src/adapter/lib/ir-scope.ts`.
5
+ * `resolveJsxChildrenProp` and `collectRootScopeNodes` are byte-identical
6
+ * (adapter-agnostic IR walks).
7
+ *
8
+ * `extractTopLevelIdentifiers` scans the RENDERED template text (rather than
9
+ * re-deriving free vars from the original JS AST) so it stays exactly in
10
+ * sync with whatever the emitter actually produced — but Jinja identifiers
11
+ * have no sigil (unlike Kolon's `$`, which made a trivially safe
12
+ * `\$([A-Za-z_]\w*)` scan possible): a bare word in the rendered text could
13
+ * be a genuine context-var reference, a `bf.` runtime-helper method name, a
14
+ * Jinja grammar keyword emitted by this adapter's own condition/ternary
15
+ * lowering (`if`/`else`/`is`/`not`/`and`/`or`/`none`/`true`/`false`), or
16
+ * content inside a single-quoted string literal. This helper makes the scan
17
+ * sound: it strips quoted string spans first, then matches identifier tokens
18
+ * NOT immediately preceded by a `.` (excluding dotted property/method names
19
+ * — the same exclusion the `$` sigil gave Kolon for free, since Kolon's
20
+ * regex only ever matched right after `$`), then drops the closed set of
21
+ * tokens this adapter's own codegen can emit that aren't context vars (`bf`
22
+ * and the Jinja keywords above). `memo/seed.ts` uses it to detect a
23
+ * constant lowering (no top-level identifier at all) that should keep the
24
+ * static ssr-defaults seed instead of an in-template `{% set %}`; scope
25
+ * AVAILABILITY itself is now the shared `computeSsrSeedPlan`'s job
26
+ * (packages/jsx/src/ssr-seed-plan.ts), not this module's (#2075).
27
+ */
28
+ import type { IRNode, IRProp } from '@barefootjs/jsx';
29
+ /**
30
+ * Extract the set of "top-level identifier" tokens from a rendered Jinja
31
+ * expression: bare words, excluding quoted-string content, dotted
32
+ * property/method names, and this adapter's own non-var keyword vocabulary.
33
+ * See the file header for why this replaces a direct `\w+` scan.
34
+ */
35
+ export declare function extractTopLevelIdentifiers(jinjaExpr: string): string[];
36
+ /**
37
+ * Find the `children` prop's `jsx-children` payload. Narrowed via the
38
+ * AttrValue `kind` discriminator so adapter code stays type-safe if the IR
39
+ * shape evolves.
40
+ */
41
+ export declare function resolveJsxChildrenProp(props: readonly IRProp[]): IRNode[];
42
+ /**
43
+ * Collect the component's root scope element node(s) — the elements that
44
+ * become the rendered root and so carry `data-key` for a keyed loop item. A
45
+ * plain element root is itself; an `if-statement` (early-return) root
46
+ * contributes the top element of each branch, since exactly one renders at
47
+ * runtime. (#1297)
48
+ */
49
+ export declare function collectRootScopeNodes(node: IRNode): Set<IRNode>;
50
+ //# sourceMappingURL=ir-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir-scope.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/ir-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA6B,MAAM,iBAAiB,CAAA;AAYhF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAUtE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAiB/D"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Jinja2 identifier and dict-key conventions for the minijinja adapter.
3
+ *
4
+ * Near-verbatim port of the adapter-jinja equivalent
5
+ * (`packages/adapter-jinja/src/adapter/lib/jinja-naming.ts`, itself ported
6
+ * from the Kolon equivalent,
7
+ * `packages/adapter-xslate/src/adapter/lib/kolon-naming.ts`), adjusted for
8
+ * two real syntax divergences between Kolon and Jinja2. The RESERVED_WORDS
9
+ * set below is the IDENTICAL Python-keyword list adapter-jinja uses — kept
10
+ * unchanged rather than re-derived for minijinja, since the point is for the
11
+ * TS emitter and the Rust runtime's `mangle_ident` to agree on one set, not
12
+ * to find the minimal set minijinja's own grammar requires:
13
+ *
14
+ * 1. **Dict-literal keys are always quoted.** Kolon's hashref fat-comma
15
+ * (`key => value`) auto-quotes a bareword key, so `kolonHashKey` only
16
+ * quotes a non-identifier-safe name (`'data-slot'`). A Jinja/Python dict
17
+ * LITERAL has no such bareword-key sugar — `{key: value}` means "look up
18
+ * the *variable* `key` and use its value as the key", not the string
19
+ * `"key"`. `minijinjaHashKey` therefore ALWAYS emits a quoted string literal,
20
+ * identifier-safe or not — the one place this port is NOT a bare 1:1
21
+ * syntax substitution, because treating it as one would silently change
22
+ * dict keys into undefined-variable lookups.
23
+ * 2. **Reserved-word identifier mangling.** adapter-jinja verified empirically
24
+ * against Python's Jinja 3.1 that most Python keywords (`class`, `import`,
25
+ * `for`, …) parse fine as bare Jinja variable / loop-target names — Jinja
26
+ * compiles every user template name to an internally-prefixed Python local
27
+ * (`l_0_…`), so the template layer itself mostly sidesteps Python's own
28
+ * reserved-word rules. minijinja 2.21 was re-verified compatible by the
29
+ * orchestrator spike (same dict-literal / `{% set %}` / elif / `~` concat
30
+ * / `| safe` behavior). The genuinely Jinja-reserved bare words are `not`
31
+ * / `and` / `or` / `in` / `is` / `if` / `else` (grammar keywords) plus the
32
+ * three constants `true` / `false` / `none` (rejected specifically as
33
+ * assignment targets). Per the adapter plan, `minijinjaIdent` mangles the
34
+ * FULL Python reserved-word list (a conservative superset of what Jinja's
35
+ * grammar strictly requires) with a trailing-underscore suffix, trivial
36
+ * and easy to keep in lock-step with the Rust runtime's identical rule
37
+ * (`mangle_ident` in `render_named`, `packages/adapter-rust/runtime/src/backend_minijinja.rs`)
38
+ * — the runtime applies the SAME mangling when it builds the per-render
39
+ * context, so a prop/signal named e.g. `class` is threaded through as
40
+ * context key `'class_'` on both sides.
41
+ */
42
+ /**
43
+ * Escape a string for a Jinja/Python single-quoted literal: backslash first
44
+ * (so it doesn't double-escape the quote we add next), then the quote.
45
+ * Python string-literal escaping treats `\\` / `\'` identically to Perl's,
46
+ * so this is byte-identical to `escapeKolonSingleQuoted`.
47
+ */
48
+ export declare function escapeMinijinjaSingleQuoted(s: string): string;
49
+ /**
50
+ * Quote a dict-literal KEY for Jinja. UNLIKE Kolon's `kolonHashKey`, this
51
+ * always quotes — see the file header for why a bareword key would silently
52
+ * become a variable lookup instead of a string key.
53
+ */
54
+ export declare function minijinjaHashKey(name: string): string;
55
+ /**
56
+ * Mangle a JS identifier (prop name, signal getter, loop param, …) into a
57
+ * Jinja-safe variable name: reserved words get a trailing `_` suffix,
58
+ * everything else passes through unchanged. Applied at every point the
59
+ * adapter emits a bare Jinja variable reference or `{% set %}` target —
60
+ * mirrors Kolon's `$name` sigil giving those references collision immunity
61
+ * for free; Jinja has no sigil, so the adapter mangles instead.
62
+ */
63
+ export declare function minijinjaIdent(name: string): string;
64
+ //# sourceMappingURL=minijinja-naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minijinja-naming.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/minijinja-naming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAeD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Shared type aliases for the minijinja template adapter.
3
+ *
4
+ * Near-verbatim port of `packages/adapter-jinja/src/adapter/lib/types.ts`
5
+ * (itself extracted the way `packages/adapter-xslate/src/adapter/lib/types.ts`
6
+ * is): pure type declarations — no runtime behaviour — so the extracted emit
7
+ * modules and the main adapter share one definition rather than
8
+ * re-declaring the render context / options shape. The emitted template
9
+ * syntax is identical to adapter-jinja's (both target Jinja2-compatible
10
+ * syntax); only the render engine (minijinja, Rust) and identity fields
11
+ * differ, so the type names below keep their `Jinja*` shape rather than
12
+ * being renamed per-file.
13
+ */
14
+ /** A template-primitive spec: expected call arity + the emit fn. */
15
+ export interface PrimitiveSpec {
16
+ arity: number;
17
+ emit: (args: string[]) => string;
18
+ }
19
+ /**
20
+ * The adapter's IRNode render context. Like the Xslate adapter, Jinja2's
21
+ * lowering doesn't consume any render-position flags, so the Ctx is empty.
22
+ * Kept as a named alias so future flags can extend it without changing the
23
+ * `IRNodeEmitter` interface.
24
+ */
25
+ export type JinjaRenderCtx = Record<string, never>;
26
+ export interface MinijinjaAdapterOptions {
27
+ /** Base path for client JS files (default: '/static/components/') */
28
+ clientJsBasePath?: string;
29
+ /** Path to barefoot.js runtime (default: '/static/components/barefoot.js') */
30
+ barefootJsPath?: string;
31
+ }
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CACjC;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAElD,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * In-template memo / context seeding for the minijinja template adapter.
3
+ *
4
+ * Near-verbatim port of `packages/adapter-jinja/src/adapter/memo/seed.ts`
5
+ * (itself ported from `packages/adapter-xslate/src/adapter/memo/seed.ts`).
6
+ * Free functions taking a `JinjaMemoContext` (built by the adapter's `memoCtx`
7
+ * getter) so the cluster depends only on the recursive expression entry, not
8
+ * the whole adapter class. These emit the `{% set x = ... %}` statements
9
+ * that let the body's bare `x` resolve to a derived signal/memo value or an
10
+ * active context value at SSR time.
11
+ *
12
+ * One deliberate behavioural IMPROVEMENT over the Kolon port: Kolon's `my`
13
+ * declares a NEW lexical, so `: my $x = … $x …;` reads the not-yet-assigned
14
+ * lexical on its own right-hand side — broken. Xslate therefore skips
15
+ * in-template seeding for a same-name signal/memo (a `refsSelf` guard in its
16
+ * `generateDerivedMemoSeed`). Jinja's `{% set %}` has no such shadowing
17
+ * hazard — `{% set x = x + 1 %}` resolves the right-hand `x` against the
18
+ * value ALREADY bound in the enclosing scope (verified empirically against
19
+ * Python's Jinja 3.1: `env.from_string("{% set x = x + 1 %}{{ x }}").render(x=5)`
20
+ * → `"6"`, not an error or a stale `5`; `{% set %}` inside `{% for %}` was
21
+ * independently re-verified against minijinja 2.21 by the orchestrator
22
+ * spike). This adapter therefore seeds a
23
+ * same-name signal/memo too, which is strictly more correct — the seed then
24
+ * re-derives from the already-bound prop instead of leaving the render var
25
+ * on its static (possibly per-callsite-wrong) default. No self-ref guard is
26
+ * ported for this reason.
27
+ */
28
+ import { type ComponentIR, type ContextConsumer } from '@barefootjs/jsx';
29
+ import type { JinjaMemoContext } from '../emit-context.ts';
30
+ /** Jinja literal for a context-consumer's `createContext` default. */
31
+ export declare function contextDefaultJinja(c: ContextConsumer): string;
32
+ /**
33
+ * Emit one `{% set <local> = bf.use_context(...) %}` statement per context
34
+ * consumer so the body's bare `<local>` resolves to the active provider
35
+ * value (or the `createContext` default). (#1297)
36
+ */
37
+ export declare function generateContextConsumerSeed(ir: ComponentIR): string;
38
+ /**
39
+ * Emit `{% set <name> = <jinja> %}` statements for every `derived` step of
40
+ * the backend-neutral SSR seed plan — the scope/availability/ordering
41
+ * analysis lives in `computeSsrSeedPlan` (packages/jsx/src/ssr-seed-plan.ts);
42
+ * this only lowers each step's expression to Jinja and applies the
43
+ * backend-specific emit guards: skip an empty lowering, and skip a lowering
44
+ * that references no top-level identifier at all (a constant init/body —
45
+ * e.g. a `derived` step with empty `frees` — keeps the existing static
46
+ * ssr-defaults seed instead). Unlike the Kolon port there is no self-ref
47
+ * guard — see the file header. `env-reader` and `opaque` steps emit nothing
48
+ * (the runtime supplies the reader, or the adapter's ssr-defaults path
49
+ * already covers it). (#1297, #2075)
50
+ *
51
+ * `convertExpressionToJinja` can still fail DEEPER than the plan's
52
+ * structural `isSupported` pre-check — e.g. a `.filter(predicate)` whose
53
+ * predicate isn't evaluator-serializable has NO lambda fallback on this
54
+ * adapter (divergence 3, `minijinja-adapter.ts`'s file header: unlike Kolon/Perl,
55
+ * Jinja has no lambda-expression form), so the lowering records a HARD
56
+ * BF101 as a side effect rather than degrading. That's correct for every
57
+ * OTHER `convertExpressionToJinja` call site (which commit to using the
58
+ * lowered text), but wrong here: this is a SPECULATIVE "recompute the memo
59
+ * in-template, else keep the static ssrDefault seed" attempt, so a deeper
60
+ * refusal must degrade silently, not fail the whole component compile.
61
+ * Snapshot the diagnostic list and roll back any errors appended during each
62
+ * step's attempt before moving on.
63
+ *
64
+ * A second, related Jinja-only gap divergence 3 opens up: a predicate
65
+ * referencing a SIBLING getter (`props.items.filter((p) => !tag() || …)`,
66
+ * `tag` a sibling memo) contains a zero-arg CALL node (`tag()`), which the
67
+ * evaluator's pure-expression surface refuses (`toEvalNode`'s `call` arm
68
+ * only allows a builtin callee, e.g. `Math.floor`) — with no lambda
69
+ * fallback to fall back to, the whole predicate would refuse. Kolon/Perl
70
+ * never hit this: their lambda form closes over the sibling's ALREADY-SEEDED
71
+ * lexical directly, without going through the evaluator at all. Go hits the
72
+ * identical gap (it also has no closures at SSR-constructor time) and fixes
73
+ * it the same way its `memo/memo-compute.ts` (`matchFilterArmMemo`) does:
74
+ * `materializeGetterCalls` rewrites a getter call into a bare identifier
75
+ * BEFORE serialization, so the evaluator captures it as a free-var read from
76
+ * `base_env` instead of an unsupported call node — and that free var then
77
+ * resolves against the sibling's own `{% set %}` line, which (being an
78
+ * EARLIER step per the plan's ordering guarantee) is always already bound.
79
+ * `env-reader` names are excluded from the materializable set — the runtime
80
+ * supplies those via the per-request reader, not a template-var lexical, so
81
+ * a call to one (`searchParams()`) must stay a real call, not a bare var.
82
+ */
83
+ export declare function generateDerivedMemoSeed(ctx: JinjaMemoContext, ir: ComponentIR): string;
84
+ //# sourceMappingURL=seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/adapter/memo/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EAIrB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAI1D,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAWnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,EAAE,EAAE,EAAE,WAAW,GAAG,MAAM,CAsBtF"}