@barefootjs/xslate 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 +3 -2
- package/dist/adapter/props/prop-classes.d.ts.map +1 -1
- package/dist/build.js +1 -1
- package/dist/index.js +1 -1
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +3 -3
- package/src/__tests__/xslate-adapter.test.ts +17 -0
- package/src/adapter/props/prop-classes.ts +4 -3
package/dist/adapter/index.js
CHANGED
|
@@ -188226,7 +188226,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188226
188226
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188227
188227
|
}
|
|
188228
188228
|
function collectNullableOptionalProps(ir) {
|
|
188229
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188229
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188230
188230
|
}
|
|
188231
188231
|
function collectStringValueNames(ir) {
|
|
188232
188232
|
const names = new Set;
|
|
@@ -15,8 +15,9 @@ import { type ComponentIR } from '@barefootjs/jsx';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function collectBooleanTypedProps(ir: ComponentIR): Set<string>;
|
|
17
17
|
/**
|
|
18
|
-
* Bare references to
|
|
19
|
-
* textarea's `rows`) are
|
|
18
|
+
* Bare references to presence-uncertain no-default props (non-primitive
|
|
19
|
+
* typed OR declared optional, #2259 — e.g. textarea's `rows`) are
|
|
20
|
+
* `undef` when omitted → `defined`-guarded in
|
|
20
21
|
* `emitExpression`. See the `nullableOptionalProps` field docstring.
|
|
21
22
|
*/
|
|
22
23
|
export declare function collectNullableOptionalProps(ir: ComponentIR): Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-classes.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGzE;;;;;GAKG;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,EAAyB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGzE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAWzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAepE"}
|
package/dist/build.js
CHANGED
|
@@ -188226,7 +188226,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188226
188226
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188227
188227
|
}
|
|
188228
188228
|
function collectNullableOptionalProps(ir) {
|
|
188229
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188229
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188230
188230
|
}
|
|
188231
188231
|
function collectStringValueNames(ir) {
|
|
188232
188232
|
const names = new Set;
|
package/dist/index.js
CHANGED
|
@@ -188226,7 +188226,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188226
188226
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188227
188227
|
}
|
|
188228
188228
|
function collectNullableOptionalProps(ir) {
|
|
188229
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188229
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188230
188230
|
}
|
|
188231
188231
|
function collectStringValueNames(ir) {
|
|
188232
188232
|
const names = new Set;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/xslate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Text::Xslate (Kolon) adapter for BarefootJS — compiles IR to .tx templates and ships the Xslate rendering backend; runs under any PSGI/Plack app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"directory": "packages/adapter-xslate"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@barefootjs/shared": "0.
|
|
58
|
+
"@barefootjs/shared": "0.19.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@barefootjs/jsx": ">=0.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
65
|
-
"@barefootjs/jsx": "0.
|
|
65
|
+
"@barefootjs/jsx": "0.19.0",
|
|
66
66
|
"typescript": "^5.0.0"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -63,6 +63,23 @@ runAdapterConformanceTests({
|
|
|
63
63
|
// #1467 Phase 2e: same `/* @client */` keyed-map elision (data-table).
|
|
64
64
|
'data-table',
|
|
65
65
|
]),
|
|
66
|
+
skipDataPoints: new Set<string>([
|
|
67
|
+
// #2255 — Perl length() counts codepoints under utf8; JS counts
|
|
68
|
+
// UTF-16 code units, so a surrogate-pair character is 2 in JS, 1 here.
|
|
69
|
+
'string-length-text:astral',
|
|
70
|
+
// #2260 — controlled boolean props: the SSR seed evaluates only the
|
|
71
|
+
// static fallback of `props.X ?? internal()` chains.
|
|
72
|
+
'toggle:gen:pressed:true',
|
|
73
|
+
'switch:gen:checked:true',
|
|
74
|
+
'checkbox:gen:checked:true',
|
|
75
|
+
// #2261 — invalid dynamic CSS value kept (escaped) where the oracle
|
|
76
|
+
// drops the property.
|
|
77
|
+
'style-object-dynamic:gen:color:markup',
|
|
78
|
+
// #2262 — dynamic `.flat` depth 0/negative violates the documented
|
|
79
|
+
// shallow-copy contract (shared with the Mojo Perl runtime).
|
|
80
|
+
'array-flat-dynamic-depth:gen:depth:zero',
|
|
81
|
+
'array-flat-dynamic-depth:gen:depth:negative',
|
|
82
|
+
]),
|
|
66
83
|
onRenderError: (err, id) => {
|
|
67
84
|
if (err instanceof XslateNotAvailableError) {
|
|
68
85
|
console.log(`Skipping [${id}]: ${err.message}`)
|
|
@@ -25,8 +25,9 @@ export function collectBooleanTypedProps(ir: ComponentIR): Set<string> {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Bare references to
|
|
29
|
-
* textarea's `rows`) are
|
|
28
|
+
* Bare references to presence-uncertain no-default props (non-primitive
|
|
29
|
+
* typed OR declared optional, #2259 — e.g. textarea's `rows`) are
|
|
30
|
+
* `undef` when omitted → `defined`-guarded in
|
|
30
31
|
* `emitExpression`. See the `nullableOptionalProps` field docstring.
|
|
31
32
|
*/
|
|
32
33
|
export function collectNullableOptionalProps(ir: ComponentIR): Set<string> {
|
|
@@ -36,7 +37,7 @@ export function collectNullableOptionalProps(ir: ComponentIR): Set<string> {
|
|
|
36
37
|
p =>
|
|
37
38
|
p.defaultValue === undefined &&
|
|
38
39
|
!p.isRest &&
|
|
39
|
-
p.type?.kind !== 'primitive',
|
|
40
|
+
(p.type?.kind !== 'primitive' || p.optional),
|
|
40
41
|
)
|
|
41
42
|
.map(p => p.name),
|
|
42
43
|
)
|