@barefootjs/rust 0.31.10 → 0.32.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.
- package/dist/index.js +5 -1
- package/dist/render-divergences.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/render-divergences.ts +6 -0
- package/src/test-render.ts +9 -17
package/dist/index.js
CHANGED
|
@@ -189248,7 +189248,11 @@ var conformancePins = {
|
|
|
189248
189248
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }]
|
|
189249
189249
|
};
|
|
189250
189250
|
// src/render-divergences.ts
|
|
189251
|
-
var renderDivergences = {
|
|
189251
|
+
var renderDivergences = {
|
|
189252
|
+
"todo-app": "the `todos` signal seeds from `(props.initialTodos ?? []).map(t => ({ ...t, editing: false }))` — a different-prop-derived `.map()` chain `extractSsrDefaults` cannot statically resolve, and `computeSsrSeedPlan` classifies it opaque (no in-template recompute), so it seeds `null`; the non-`/* @client */`-marked `{todos().length > 0 && ...}` toggle-all block SSRs as if there are zero todos regardless of `initialTodos` (https://github.com/piconic-ai/barefootjs/issues/2696)",
|
|
189253
|
+
"todo-app-ssr": "same root cause as `todo-app` (https://github.com/piconic-ai/barefootjs/issues/2696); this fixture's todo-list loop carries no `/* @client */` marker and minijinja's `{% for %}` over a null value renders zero rows rather than throwing, so it SSRs an empty `<ul class=\"todo-list\">` with the toggle-all controls also absent, regardless of `initialTodos`",
|
|
189254
|
+
"callback-param-shadows-prop": "the `first` signal seeds from `[{ a: 'p' }].map((title) => title.a).join(',')` — a constant expression `extractSsrDefaults` still cannot statically resolve (`.map()` is unsupported for any receiver) and, unlike the sibling `joined` memo's structurally similar chain, gets no in-template recompute (`computeSsrSeedPlan` classifies it opaque too); `<span>{first()}</span>` SSRs empty instead of `p` (https://github.com/piconic-ai/barefootjs/issues/2696)"
|
|
189255
|
+
};
|
|
189252
189256
|
export {
|
|
189253
189257
|
renderDivergences,
|
|
189254
189258
|
minijinjaAdapter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"render-divergences.d.ts","sourceRoot":"","sources":["../src/render-divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAO/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/rust",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "minijinja (Rust) adapter for BarefootJS — compiles IR to .j2 templates and ships a Rust rendering runtime (packages/adapter-rust/runtime/); runs under any Rust web framework (axum, etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"directory": "packages/adapter-rust"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@barefootjs/shared": "0.
|
|
57
|
+
"@barefootjs/shared": "0.32.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
74
|
-
"@barefootjs/jsx": "0.
|
|
75
|
-
"@barefootjs/vite": "0.
|
|
76
|
-
"@barefootjs/client": "0.
|
|
74
|
+
"@barefootjs/jsx": "0.32.0",
|
|
75
|
+
"@barefootjs/vite": "0.32.0",
|
|
76
|
+
"@barefootjs/client": "0.32.0",
|
|
77
77
|
"typescript": "^5.0.0",
|
|
78
78
|
"vite": "^6.0.0"
|
|
79
79
|
}
|
|
@@ -12,4 +12,10 @@
|
|
|
12
12
|
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
13
13
|
|
|
14
14
|
export const renderDivergences: RenderDivergences = {
|
|
15
|
+
'todo-app':
|
|
16
|
+
'the `todos` signal seeds from `(props.initialTodos ?? []).map(t => ({ ...t, editing: false }))` — a different-prop-derived `.map()` chain `extractSsrDefaults` cannot statically resolve, and `computeSsrSeedPlan` classifies it opaque (no in-template recompute), so it seeds `null`; the non-`/* @client */`-marked `{todos().length > 0 && ...}` toggle-all block SSRs as if there are zero todos regardless of `initialTodos` (https://github.com/piconic-ai/barefootjs/issues/2696)',
|
|
17
|
+
'todo-app-ssr':
|
|
18
|
+
"same root cause as `todo-app` (https://github.com/piconic-ai/barefootjs/issues/2696); this fixture's todo-list loop carries no `/* @client */` marker and minijinja's `{% for %}` over a null value renders zero rows rather than throwing, so it SSRs an empty `<ul class=\"todo-list\">` with the toggle-all controls also absent, regardless of `initialTodos`",
|
|
19
|
+
'callback-param-shadows-prop':
|
|
20
|
+
"the `first` signal seeds from `[{ a: 'p' }].map((title) => title.a).join(',')` — a constant expression `extractSsrDefaults` still cannot statically resolve (`.map()` is unsupported for any receiver) and, unlike the sibling `joined` memo's structurally similar chain, gets no in-template recompute (`computeSsrSeedPlan` classifies it opaque too); `<span>{first()}</span>` SSRs empty instead of `p` (https://github.com/piconic-ai/barefootjs/issues/2696)",
|
|
15
21
|
}
|
package/src/test-render.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* that closes that gap.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams
|
|
31
|
+
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams } from '@barefootjs/jsx'
|
|
32
32
|
import type { ComponentIR, SsrDefault } from '@barefootjs/jsx'
|
|
33
33
|
import { mkdir, rm } from 'node:fs/promises'
|
|
34
34
|
import { resolve } from 'node:path'
|
|
@@ -501,30 +501,22 @@ function buildVars(
|
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
//
|
|
504
|
+
// No initializer re-evaluation against raw props — production's
|
|
505
|
+
// before_render seeds only from `deriveStashFromDefaults` (#2696).
|
|
505
506
|
for (const signal of ir.metadata.signals) {
|
|
506
507
|
// Env signals (#2057) are bound below via `search_params`, not from a
|
|
507
508
|
// static initial value.
|
|
508
509
|
if (signal.envReader) continue
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
// a `propName`-carrying entry (see its docstring's invariant). Skip
|
|
512
|
-
// re-seeding here or this harness's own `evaluateSignalInit` recompute
|
|
513
|
-
// clobbers the correctly-derived caller value.
|
|
514
|
-
if (rootSsrDefaults[signal.getter]?.propName !== undefined) continue
|
|
515
|
-
const value = evaluateSignalInit(signal.initialValue.trim(), props)
|
|
516
|
-
if (value !== null) {
|
|
517
|
-
vars[signal.getter] = value
|
|
510
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, signal.getter)) {
|
|
511
|
+
vars[signal.getter] = derivedProps[signal.getter]
|
|
518
512
|
}
|
|
519
513
|
}
|
|
520
514
|
|
|
521
|
-
//
|
|
522
|
-
// as the production plugin's before_render hook.
|
|
515
|
+
// No `?? 0` for entries the manifest lacks — production seeds nothing there (#2696).
|
|
523
516
|
for (const memo of ir.metadata.memos) {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
vars[memo.name] = entry ? (entry.value ?? 0) : 0
|
|
517
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, memo.name)) {
|
|
518
|
+
vars[memo.name] = derivedProps[memo.name]
|
|
519
|
+
}
|
|
528
520
|
}
|
|
529
521
|
|
|
530
522
|
return vars
|