@barefootjs/erb 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 -24
package/dist/index.js
CHANGED
|
@@ -189273,7 +189273,11 @@ var conformancePins = {
|
|
|
189273
189273
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }]
|
|
189274
189274
|
};
|
|
189275
189275
|
// src/render-divergences.ts
|
|
189276
|
-
var renderDivergences = {
|
|
189276
|
+
var renderDivergences = {
|
|
189277
|
+
"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 `nil`; 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)",
|
|
189278
|
+
"todo-app-ssr": "same root cause as `todo-app` (https://github.com/piconic-ai/barefootjs/issues/2696), but this fixture's todo-list loop carries no `/* @client */` marker — the compiled ERB loop iterates the nil-seeded `todos` directly and raises `NoMethodError: undefined method 'length' for nil` instead of rendering",
|
|
189279
|
+
"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)"
|
|
189280
|
+
};
|
|
189277
189281
|
export {
|
|
189278
189282
|
renderDivergences,
|
|
189279
189283
|
erbAdapter,
|
|
@@ -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;AAExD,eAAO,MAAM,iBAAiB,EAAE,
|
|
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;AAExD,eAAO,MAAM,iBAAiB,EAAE,iBAO/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/erb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "ERB (Embedded Ruby) adapter for BarefootJS — compiles IR to .erb templates and ships the Ruby rendering backend; runs under any Rack app (Sinatra, Rails)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"directory": "packages/adapter-erb"
|
|
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
|
}
|
|
@@ -10,4 +10,10 @@
|
|
|
10
10
|
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
11
11
|
|
|
12
12
|
export const renderDivergences: RenderDivergences = {
|
|
13
|
+
'todo-app':
|
|
14
|
+
'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 `nil`; 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)',
|
|
15
|
+
'todo-app-ssr':
|
|
16
|
+
'same root cause as `todo-app` (https://github.com/piconic-ai/barefootjs/issues/2696), but this fixture\'s todo-list loop carries no `/* @client */` marker — the compiled ERB loop iterates the nil-seeded `todos` directly and raises `NoMethodError: undefined method \'length\' for nil` instead of rendering',
|
|
17
|
+
'callback-param-shadows-prop':
|
|
18
|
+
"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)",
|
|
13
19
|
}
|
package/src/test-render.ts
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* regression test.
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams
|
|
39
|
+
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams } from '@barefootjs/jsx'
|
|
40
40
|
import type { ComponentIR, SsrDefault } from '@barefootjs/jsx'
|
|
41
41
|
import { mkdir, rm } from 'node:fs/promises'
|
|
42
42
|
import { resolve } from 'node:path'
|
|
@@ -600,37 +600,22 @@ function buildRubyProps(
|
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
|
|
603
|
-
//
|
|
603
|
+
// No initializer re-evaluation against raw props — production's
|
|
604
|
+
// before_render seeds only from `deriveStashFromDefaults` (#2696).
|
|
604
605
|
for (const signal of ir.metadata.signals) {
|
|
605
606
|
// Env signals (#2057 / #1922) are bound below via `search_params('')`,
|
|
606
607
|
// not from a static initial value.
|
|
607
608
|
if (signal.envReader) continue
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
// 'Default')`) already got the correct RAW-prop seed above via
|
|
611
|
-
// `derivedProps` / `obj[param.name]` — `extractSsrDefaults` marks that
|
|
612
|
-
// with a `propName`-carrying entry (see its docstring's invariant).
|
|
613
|
-
// Re-seeding here with this harness's OWN recompute
|
|
614
|
-
// (`evaluateSignalInit`) would clobber the correctly-derived caller
|
|
615
|
-
// value with the harness's evaluated-from-static-props number, papering
|
|
616
|
-
// over the exact production bug this fixture exists to catch.
|
|
617
|
-
if (rootSsrDefaults[signal.getter]?.propName !== undefined) continue
|
|
618
|
-
const value = evaluateSignalInit(signal.initialValue.trim(), props)
|
|
619
|
-
if (value !== null) {
|
|
620
|
-
obj[signal.getter] = value
|
|
609
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, signal.getter)) {
|
|
610
|
+
obj[signal.getter] = derivedProps[signal.getter]
|
|
621
611
|
}
|
|
622
612
|
}
|
|
623
613
|
|
|
624
|
-
//
|
|
625
|
-
// as the production plugin's before_render hook.
|
|
614
|
+
// No `?? 0` for entries the manifest lacks — production seeds nothing there (#2696).
|
|
626
615
|
for (const memo of ir.metadata.memos) {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
// value (which for a non-idempotent derivation is already the WRONG,
|
|
631
|
-
// double-applied number).
|
|
632
|
-
if (rootSsrDefaults[memo.name]?.propName !== undefined) continue
|
|
633
|
-
obj[memo.name] = rootSsrDefaults[memo.name]?.value ?? 0
|
|
616
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, memo.name)) {
|
|
617
|
+
obj[memo.name] = derivedProps[memo.name]
|
|
618
|
+
}
|
|
634
619
|
}
|
|
635
620
|
|
|
636
621
|
const needsSearchParams = importsSearchParams(ir.metadata)
|