@barefootjs/jinja 0.34.0 → 0.35.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.
@@ -188692,7 +188692,7 @@ ${whenTrue}
188692
188692
  const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `{% set ${jinjaIdent(d.name)} = ${this.convertExpressionToJinja(d.raw, d.valueParsed)} %}`);
188693
188693
  const childrenUnderLoop = this.renderChildren(loop.children);
188694
188694
  this.inLoop = prevInLoop;
188695
- const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.string(${this.convertExpressionToJinja(loop.key)})) | safe }}
188695
+ const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.escape_comment_key(${this.convertExpressionToJinja(loop.key)})) | safe }}
188696
188696
  ${childrenUnderLoop}` : childrenUnderLoop;
188697
188697
  this.scope = prevScope;
188698
188698
  const lines = [];
@@ -1 +1 @@
1
- {"version":3,"file":"jinja-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/jinja-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAKP,yBAAyB,EAE1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,UAAU,EAgChB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAA;AAGlE,OAAO,KAAK,EAAE,c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;IAUjC,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,4BAA4B;CAGrC;AAED,eAAO,MAAM,YAAY,cAAqB,CAAA"}
package/dist/index.js CHANGED
@@ -188692,7 +188692,7 @@ ${whenTrue}
188692
188692
  const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `{% set ${jinjaIdent(d.name)} = ${this.convertExpressionToJinja(d.raw, d.valueParsed)} %}`);
188693
188693
  const childrenUnderLoop = this.renderChildren(loop.children);
188694
188694
  this.inLoop = prevInLoop;
188695
- const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.string(${this.convertExpressionToJinja(loop.key)})) | safe }}
188695
+ const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.escape_comment_key(${this.convertExpressionToJinja(loop.key)})) | safe }}
188696
188696
  ${childrenUnderLoop}` : childrenUnderLoop;
188697
188697
  this.scope = prevScope;
188698
188698
  const lines = [];
@@ -189244,9 +189244,7 @@ var conformancePins = {
189244
189244
  "namespace-import-primitive": [{ code: "BF013", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2771" }]
189245
189245
  };
189246
189246
  // src/render-divergences.ts
189247
- var renderDivergences = {
189248
- "aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) SSRs an empty `<ul>` on real Jinja2 — the seeded loop data is keyed by the signal's real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker."
189249
- };
189247
+ var renderDivergences = {};
189250
189248
  export {
189251
189249
  renderDivergences,
189252
189250
  jinjaAdapter,
@@ -1 +1 @@
1
- {"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAQxD,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAA"}
1
+ {"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAQxD,eAAO,MAAM,iBAAiB,EAAE,iBAAsB,CAAA"}
package/dist/vite.js CHANGED
@@ -2326,6 +2326,12 @@ class BindingScope {
2326
2326
  }
2327
2327
  }
2328
2328
 
2329
+ // ../jsx/src/ir-to-client-js/safe-html.ts
2330
+ function safeHtml(expr) {
2331
+ return expr;
2332
+ }
2333
+ var EMPTY_MARKUP = safeHtml("''");
2334
+
2329
2335
  // ../jsx/src/ir-to-client-js/html-template.ts
2330
2336
  var VOID_ELEMENTS = new Set([
2331
2337
  "area",
@@ -2612,6 +2618,7 @@ var CLIENT_EXPORTS = new Set([
2612
2618
  "isSSRPortal",
2613
2619
  "findSiblingSlot",
2614
2620
  "cleanupPortalPlaceholder",
2621
+ "trackPosition",
2615
2622
  "createSearchParams",
2616
2623
  "queryHref",
2617
2624
  "formatDate",
@@ -2672,7 +2679,8 @@ var BROWSER_ONLY_CLIENT_APIS = new Set([
2672
2679
  "createPortal",
2673
2680
  "isSSRPortal",
2674
2681
  "findSiblingSlot",
2675
- "cleanupPortalPlaceholder"
2682
+ "cleanupPortalPlaceholder",
2683
+ "trackPosition"
2676
2684
  ]);
2677
2685
  var REACTIVE_PRIMITIVES = new Set([
2678
2686
  "createSignal",
@@ -6619,7 +6627,7 @@ ${whenTrue}
6619
6627
  const preambleLines = (loop.preamble?.declarations ?? []).map((d) => `{% set ${jinjaIdent(d.name)} = ${this.convertExpressionToJinja(d.raw, d.valueParsed)} %}`);
6620
6628
  const childrenUnderLoop = this.renderChildren(loop.children);
6621
6629
  this.inLoop = prevInLoop;
6622
- const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.string(${this.convertExpressionToJinja(loop.key)})) | safe }}
6630
+ const bodyChildren = loop.bodyIsItemConditional && loop.key ? `{{ bf.comment("loop-i:" ~ bf.escape_comment_key(${this.convertExpressionToJinja(loop.key)})) | safe }}
6623
6631
  ${childrenUnderLoop}` : childrenUnderLoop;
6624
6632
  this.scope = prevScope;
6625
6633
  const lines = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/jinja",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Jinja2 adapter for BarefootJS — compiles IR to .jinja templates and ships the Python BarefootJS rendering runtime; runs under any Python web framework (Flask, etc.)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,7 +53,7 @@
53
53
  "directory": "packages/adapter-jinja"
54
54
  },
55
55
  "dependencies": {
56
- "@barefootjs/shared": "0.34.0"
56
+ "@barefootjs/shared": "0.35.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@barefootjs/jsx": ">=0.2.0",
@@ -70,9 +70,9 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@barefootjs/adapter-tests": "0.1.0",
73
- "@barefootjs/jsx": "0.34.0",
74
- "@barefootjs/vite": "0.34.0",
75
- "@barefootjs/client": "0.34.0",
73
+ "@barefootjs/jsx": "0.35.0",
74
+ "@barefootjs/vite": "0.35.0",
75
+ "@barefootjs/client": "0.35.0",
76
76
  "typescript": "^5.0.0",
77
77
  "vite": "^6.0.0"
78
78
  }
@@ -659,6 +659,22 @@ class BarefootJS:
659
659
  def comment(self, text: str) -> str:
660
660
  return f"<!--bf-{text}-->"
661
661
 
662
+ def escape_comment_key(self, value: Any) -> str:
663
+ """Neutralize a value for splicing into `comment`'s HTML comment
664
+ content (#2795 follow-up). `comment` itself does no escaping --
665
+ fine for every other caller (marker IDs like "cond-start:s0",
666
+ "loop:l0", ...), which are entirely compiler-generated, but the
667
+ whole-item-conditional loop's "loop-i:<key>" anchor carries a
668
+ user-controlled key. Standard HTML escaping doesn't help inside a
669
+ comment -- only the literal sequence "-->" terminates it early, and
670
+ &/</>/"/' are not special there. The key's exact text doesn't need
671
+ to round-trip (the client's mapArrayAnchored matches items
672
+ positionally and by its own JS-computed key, never by re-parsing
673
+ the anchor Comment.nodeValue), so replacing every "-" with the
674
+ visually-similar U+2010 is sufficient and needs no decoding.
675
+ """
676
+ return self.string(value).replace("-", "‐")
677
+
662
678
  # -----------------------------------------------------------------
663
679
  # JS-equivalent value stringification
664
680
  # -----------------------------------------------------------------
@@ -549,8 +549,8 @@ function Widget({ values }: { values: number[] }) {
549
549
  return <ul>{values.map((label) => (label > 0 ? <li key={label}>{label}</li> : null))}</ul>
550
550
  }
551
551
  `)
552
- expect(template).toContain('bf.comment("loop-i:" ~ bf.string(label))')
553
- expect(template).not.toContain("bf.comment(\"loop-i:\" ~ bf.string('x'))")
552
+ expect(template).toContain('bf.comment("loop-i:" ~ bf.escape_comment_key(label))')
553
+ expect(template).not.toContain("bf.comment(\"loop-i:\" ~ bf.escape_comment_key('x'))")
554
554
  })
555
555
 
556
556
  test('a loop param shadowing an outer const resolves to the row value inside a .map() preamble local initializer', () => {
@@ -993,9 +993,12 @@ export class JinjaAdapter extends BaseAdapter implements IRNodeEmitter<JinjaRend
993
993
  // client's `mapArrayAnchored` can hydrate every SSR-rendered item by its
994
994
  // anchor. Still under the row scope (see above) — `loop.key` is a
995
995
  // per-row expression.
996
+ // `bf.escape_comment_key` (#2795 follow-up) both stringifies the key and
997
+ // neutralizes `-` so it can't spell `-->` and close the comment early —
998
+ // see its doc in `runtime.py`.
996
999
  const bodyChildren =
997
1000
  loop.bodyIsItemConditional && loop.key
998
- ? `{{ bf.comment("loop-i:" ~ bf.string(${this.convertExpressionToJinja(loop.key)})) | safe }}\n${childrenUnderLoop}`
1001
+ ? `{{ bf.comment("loop-i:" ~ bf.escape_comment_key(${this.convertExpressionToJinja(loop.key)})) | safe }}\n${childrenUnderLoop}`
999
1002
  : childrenUnderLoop
1000
1003
  this.scope = prevScope
1001
1004
 
@@ -15,7 +15,4 @@ import type { RenderDivergences } from '@barefootjs/jsx'
15
15
  // at value position and the runtime evaluator's `object-literal` case
16
16
  // now merges it, so the seed classifies `derived` and SSRs identically
17
17
  // to Hono.
18
- export const renderDivergences: RenderDivergences = {
19
- 'aliased-loop-source':
20
- 'A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) SSRs an empty `<ul>` on real Jinja2 — the seeded loop data is keyed by the signal\'s real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker.',
21
- }
18
+ export const renderDivergences: RenderDivergences = {}
@@ -613,6 +613,26 @@ function buildPythonProps(
613
613
  }
614
614
  }
615
615
 
616
+ // #2813: `extractSsrDefaults` can seed an entry under a name that is
617
+ // none of `propsParams` / `signals` / `memos` above — a bare local-const
618
+ // alias of a signal/memo getter (`const items__alias = items`,
619
+ // `ssr-defaults.ts`) seeds `items__alias` alongside `items`. Production
620
+ // hands the whole manifest-derived stash straight through
621
+ // (`deriveStashFromDefaults` IS the production seeding mechanism here,
622
+ // not a harness stand-in), so any leftover `derivedProps` key must be
623
+ // pushed too, or this harness would silently omit what production
624
+ // actually provides, mismeasuring this conformance case.
625
+ const seededNames = new Set<string>([
626
+ ...ir.metadata.propsParams.filter(p => !p.isRest).map(p => p.name),
627
+ ...(restPropsName ? [restPropsName] : []),
628
+ ...ir.metadata.signals.filter(s => !s.envReader).map(s => s.getter),
629
+ ...ir.metadata.memos.map(m => m.name),
630
+ ])
631
+ for (const [name, value] of Object.entries(derivedProps)) {
632
+ if (seededNames.has(name)) continue
633
+ fullEntries.push(`${pyStr(name)}: ${toPyLiteral(value)}`)
634
+ }
635
+
616
636
  // (#1922) Request-scoped `searchParams()`: bind `searchParams` to an
617
637
  // empty-query reader (so the render script needn't build one from a real
618
638
  // request). The conformance harness issues no query string (the