@barefootjs/rust 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/package.json +3 -3
- package/src/__tests__/minijinja-adapter.test.ts +13 -0
- package/src/adapter/props/prop-classes.ts +4 -3
package/dist/adapter/index.js
CHANGED
|
@@ -188270,7 +188270,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188270
188270
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188271
188271
|
}
|
|
188272
188272
|
function collectNullableOptionalProps(ir) {
|
|
188273
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188273
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188274
188274
|
}
|
|
188275
188275
|
function collectStringValueNames(ir) {
|
|
188276
188276
|
const names = new Set;
|
|
@@ -14,8 +14,9 @@ import type { ComponentIR } from '@barefootjs/jsx';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function collectBooleanTypedProps(ir: ComponentIR): Set<string>;
|
|
16
16
|
/**
|
|
17
|
-
* Bare references to
|
|
18
|
-
* textarea's `rows`) are
|
|
17
|
+
* Bare references to presence-uncertain no-default props (non-primitive
|
|
18
|
+
* typed OR declared optional, #2259 — e.g. textarea's `rows`) are
|
|
19
|
+
* `None` when omitted → guarded with
|
|
19
20
|
* `is defined and is not none` in `emitExpression`. See the
|
|
20
21
|
* `nullableOptionalProps` field docstring in `minijinja-adapter.ts`.
|
|
21
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-classes.d.ts","sourceRoot":"","sources":["../../../src/adapter/props/prop-classes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;;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;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAWzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAWpE"}
|
package/dist/build.js
CHANGED
|
@@ -188270,7 +188270,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188270
188270
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188271
188271
|
}
|
|
188272
188272
|
function collectNullableOptionalProps(ir) {
|
|
188273
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188273
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188274
188274
|
}
|
|
188275
188275
|
function collectStringValueNames(ir) {
|
|
188276
188276
|
const names = new Set;
|
package/dist/index.js
CHANGED
|
@@ -188270,7 +188270,7 @@ function collectBooleanTypedProps(ir) {
|
|
|
188270
188270
|
return new Set(ir.metadata.propsParams.filter((prop) => prop.type?.primitive === "boolean" || prop.type?.raw === "boolean").map((prop) => prop.name));
|
|
188271
188271
|
}
|
|
188272
188272
|
function collectNullableOptionalProps(ir) {
|
|
188273
|
-
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && p.type?.kind !== "primitive").map((p) => p.name));
|
|
188273
|
+
return new Set(ir.metadata.propsParams.filter((p) => p.defaultValue === undefined && !p.isRest && (p.type?.kind !== "primitive" || p.optional)).map((p) => p.name));
|
|
188274
188274
|
}
|
|
188275
188275
|
function collectStringValueNames(ir) {
|
|
188276
188276
|
const names = new Set;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/rust",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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,14 +54,14 @@
|
|
|
54
54
|
"directory": "packages/adapter-rust"
|
|
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
|
}
|
|
@@ -56,6 +56,19 @@ runAdapterConformanceTests({
|
|
|
56
56
|
// Same `/* @client */` keyed-map elision (data-table).
|
|
57
57
|
'data-table',
|
|
58
58
|
]),
|
|
59
|
+
skipDataPoints: new Set<string>([
|
|
60
|
+
// #2255 — minijinja's length counts chars (codepoints); JS counts
|
|
61
|
+
// UTF-16 code units, so a surrogate-pair character is 2 in JS, 1 here.
|
|
62
|
+
'string-length-text:astral',
|
|
63
|
+
// #2260 — controlled boolean props: the SSR seed evaluates only the
|
|
64
|
+
// static fallback of `props.X ?? internal()` chains.
|
|
65
|
+
'toggle:gen:pressed:true',
|
|
66
|
+
'switch:gen:checked:true',
|
|
67
|
+
'checkbox:gen:checked:true',
|
|
68
|
+
// #2261 — invalid dynamic CSS value kept (escaped) where the oracle
|
|
69
|
+
// drops the property.
|
|
70
|
+
'style-object-dynamic:gen:color:markup',
|
|
71
|
+
]),
|
|
59
72
|
onRenderError: (err, id) => {
|
|
60
73
|
if (err instanceof RustNotAvailableError) {
|
|
61
74
|
console.log(`Skipping [${id}]: ${err.message}`)
|
|
@@ -24,8 +24,9 @@ export function collectBooleanTypedProps(ir: ComponentIR): Set<string> {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Bare references to
|
|
28
|
-
* textarea's `rows`) are
|
|
27
|
+
* Bare references to presence-uncertain no-default props (non-primitive
|
|
28
|
+
* typed OR declared optional, #2259 — e.g. textarea's `rows`) are
|
|
29
|
+
* `None` when omitted → guarded with
|
|
29
30
|
* `is defined and is not none` in `emitExpression`. See the
|
|
30
31
|
* `nullableOptionalProps` field docstring in `minijinja-adapter.ts`.
|
|
31
32
|
*/
|
|
@@ -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
|
)
|