@barefootjs/erb 0.18.7 → 0.19.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/adapter/index.js +1 -1
- package/dist/adapter/props/prop-classes.d.ts +5 -4
- package/dist/adapter/props/prop-classes.d.ts.map +1 -1
- package/dist/build.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/__tests__/erb-adapter.test.ts +17 -0
- package/src/adapter/props/prop-classes.ts +6 -5
package/dist/adapter/index.js
CHANGED
|
@@ -188339,7 +188339,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188339
188339
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188340
188340
|
}
|
|
188341
188341
|
function collectNullableOptionalProps(ir) {
|
|
188342
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188342
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188343
188343
|
}
|
|
188344
188344
|
function collectStringValueNames(ir) {
|
|
188345
188345
|
const names = new Set;
|
|
@@ -26,10 +26,11 @@ export declare function collectBooleanTypedProps(ir: ComponentIR): Set<string>;
|
|
|
26
26
|
* omission). A prop WITH a destructure default (`value = ''`) is never
|
|
27
27
|
* `nil` in the body and must stay unconditional, so it is excluded. Mirrors
|
|
28
28
|
* the Go adapter's nillable-field guard: there the witness is the resolved
|
|
29
|
-
* `interface{}` field type; here it is the absence of a default.
|
|
30
|
-
* concrete-primitive
|
|
31
|
-
*
|
|
32
|
-
* fields
|
|
29
|
+
* `interface{}` field type; here it is the absence of a default. A REQUIRED
|
|
30
|
+
* concrete-primitive prop (`string`/`number`/`boolean`) is excluded — the
|
|
31
|
+
* caller always supplies it, matching the Go adapter's unconditional
|
|
32
|
+
* concrete fields — but an OPTIONAL primitive is presence-uncertain and
|
|
33
|
+
* stays guarded (#2259).
|
|
33
34
|
*/
|
|
34
35
|
export declare function collectNullableOptionalProps(ir: ComponentIR): Set<string>;
|
|
35
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-classes.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED
|
|
1
|
+
{"version":3,"file":"prop-classes.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAWzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAWpE"}
|
package/dist/build.js
CHANGED
|
@@ -188339,7 +188339,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188339
188339
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188340
188340
|
}
|
|
188341
188341
|
function collectNullableOptionalProps(ir) {
|
|
188342
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188342
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188343
188343
|
}
|
|
188344
188344
|
function collectStringValueNames(ir) {
|
|
188345
188345
|
const names = new Set;
|
package/dist/index.js
CHANGED
|
@@ -188339,7 +188339,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188339
188339
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188340
188340
|
}
|
|
188341
188341
|
function collectNullableOptionalProps(ir) {
|
|
188342
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188342
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188343
188343
|
}
|
|
188344
188344
|
function collectStringValueNames(ir) {
|
|
188345
188345
|
const names = new Set;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/erb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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,14 +54,14 @@
|
|
|
54
54
|
"directory": "packages/adapter-erb"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@barefootjs/shared": "0.
|
|
57
|
+
"@barefootjs/shared": "0.19.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@barefootjs/jsx": ">=0.2.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
64
|
-
"@barefootjs/jsx": "0.
|
|
64
|
+
"@barefootjs/jsx": "0.19.0",
|
|
65
65
|
"typescript": "^5.0.0"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -70,6 +70,23 @@ runAdapterConformanceTests({
|
|
|
70
70
|
// #1467 Phase 2e: same `/* @client */` keyed-map elision (data-table).
|
|
71
71
|
'data-table',
|
|
72
72
|
]),
|
|
73
|
+
skipDataPoints: new Set<string>([
|
|
74
|
+
// #2255 — Ruby String#length counts codepoints; JS counts UTF-16
|
|
75
|
+
// code units, so a surrogate-pair character is 2 in JS, 1 here.
|
|
76
|
+
'string-length-text:astral',
|
|
77
|
+
// #2260 — controlled boolean props: the SSR seed evaluates only the
|
|
78
|
+
// static fallback of `props.X ?? internal()` chains.
|
|
79
|
+
'toggle:gen:pressed:true',
|
|
80
|
+
'switch:gen:checked:true',
|
|
81
|
+
'checkbox:gen:checked:true',
|
|
82
|
+
// #2261 — invalid dynamic CSS value kept (escaped) where the oracle
|
|
83
|
+
// drops the property.
|
|
84
|
+
'style-object-dynamic:gen:color:markup',
|
|
85
|
+
// #2262 — dynamic `.flat` depth 0/negative: the unflattened nested
|
|
86
|
+
// result stringifies Ruby-style instead of the JS join.
|
|
87
|
+
'array-flat-dynamic-depth:gen:depth:zero',
|
|
88
|
+
'array-flat-dynamic-depth:gen:depth:negative',
|
|
89
|
+
]),
|
|
73
90
|
onRenderError: (err, id) => {
|
|
74
91
|
if (err instanceof ErbNotAvailableError) {
|
|
75
92
|
console.log(`Skipping [${id}]: ${err.message}`)
|
|
@@ -43,10 +43,11 @@ export function collectBooleanTypedProps(ir: ComponentIR): Set<string> {
|
|
|
43
43
|
* omission). A prop WITH a destructure default (`value = ''`) is never
|
|
44
44
|
* `nil` in the body and must stay unconditional, so it is excluded. Mirrors
|
|
45
45
|
* the Go adapter's nillable-field guard: there the witness is the resolved
|
|
46
|
-
* `interface{}` field type; here it is the absence of a default.
|
|
47
|
-
* concrete-primitive
|
|
48
|
-
*
|
|
49
|
-
* fields
|
|
46
|
+
* `interface{}` field type; here it is the absence of a default. A REQUIRED
|
|
47
|
+
* concrete-primitive prop (`string`/`number`/`boolean`) is excluded — the
|
|
48
|
+
* caller always supplies it, matching the Go adapter's unconditional
|
|
49
|
+
* concrete fields — but an OPTIONAL primitive is presence-uncertain and
|
|
50
|
+
* stays guarded (#2259).
|
|
50
51
|
*/
|
|
51
52
|
export function collectNullableOptionalProps(ir: ComponentIR): Set<string> {
|
|
52
53
|
return new Set(
|
|
@@ -55,7 +56,7 @@ export function collectNullableOptionalProps(ir: ComponentIR): Set<string> {
|
|
|
55
56
|
p =>
|
|
56
57
|
p.defaultValue === undefined &&
|
|
57
58
|
!p.isRest &&
|
|
58
|
-
p.type?.kind !== 'primitive',
|
|
59
|
+
(p.type?.kind !== 'primitive' || p.optional),
|
|
59
60
|
)
|
|
60
61
|
.map(p => p.name),
|
|
61
62
|
)
|