@barefootjs/xslate 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
CHANGED
|
@@ -189191,7 +189191,11 @@ var conformancePins = {
|
|
|
189191
189191
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }]
|
|
189192
189192
|
};
|
|
189193
189193
|
// src/render-divergences.ts
|
|
189194
|
-
var renderDivergences = {
|
|
189194
|
+
var renderDivergences = {
|
|
189195
|
+
"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 `undef`; 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)",
|
|
189196
|
+
"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, but Kolon's `for` iterates an undef list as empty rather than raising, so it SSRs an empty `<ul class=\"todo-list\">` with the toggle-all controls also absent, regardless of `initialTodos`",
|
|
189197
|
+
"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)"
|
|
189198
|
+
};
|
|
189195
189199
|
export {
|
|
189196
189200
|
xslateAdapter,
|
|
189197
189201
|
renderDivergences,
|
|
@@ -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;AASxD,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;AASxD,eAAO,MAAM,iBAAiB,EAAE,iBAO/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/xslate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.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,7 +55,7 @@
|
|
|
55
55
|
"directory": "packages/adapter-xslate"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@barefootjs/shared": "0.
|
|
58
|
+
"@barefootjs/shared": "0.32.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
75
|
-
"@barefootjs/jsx": "0.
|
|
76
|
-
"@barefootjs/vite": "0.
|
|
77
|
-
"@barefootjs/client": "0.
|
|
75
|
+
"@barefootjs/jsx": "0.32.0",
|
|
76
|
+
"@barefootjs/vite": "0.32.0",
|
|
77
|
+
"@barefootjs/client": "0.32.0",
|
|
78
78
|
"typescript": "^5.0.0",
|
|
79
79
|
"vite": "^6.0.0"
|
|
80
80
|
}
|
|
@@ -16,4 +16,11 @@ import type { RenderDivergences } from '@barefootjs/jsx'
|
|
|
16
16
|
// the real name off that capture — the same in-template recompute the other
|
|
17
17
|
// six template-stash backends already had. Keep the file even when the set
|
|
18
18
|
// is empty — the next divergence lands here, not in a re-created file.
|
|
19
|
-
export const renderDivergences: RenderDivergences = {
|
|
19
|
+
export const renderDivergences: RenderDivergences = {
|
|
20
|
+
'todo-app':
|
|
21
|
+
'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 `undef`; 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)',
|
|
22
|
+
'todo-app-ssr':
|
|
23
|
+
"same root cause as `todo-app` (https://github.com/piconic-ai/barefootjs/issues/2696); this fixture's todo-list loop carries no `/* @client */` marker, but Kolon's `for` iterates an undef list as empty rather than raising, so it SSRs an empty `<ul class=\"todo-list\">` with the toggle-all controls also absent, regardless of `initialTodos`",
|
|
24
|
+
'callback-param-shadows-prop':
|
|
25
|
+
"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)",
|
|
26
|
+
}
|
package/src/test-render.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* than the Mojo harness's literal `test_<sN>`.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams
|
|
20
|
+
import { compileJSX, extractSsrDefaults, deriveStashFromDefaults, importsSearchParams } from '@barefootjs/jsx'
|
|
21
21
|
import type { ComponentIR, SsrDefault } from '@barefootjs/jsx'
|
|
22
22
|
import { mkdir, rm } from 'node:fs/promises'
|
|
23
23
|
import { resolve } from 'node:path'
|
|
@@ -563,39 +563,22 @@ function buildPerlProps(
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
-
//
|
|
566
|
+
// No initializer re-evaluation against raw props — production's
|
|
567
|
+
// before_render seeds only from `deriveStashFromDefaults` (#2696).
|
|
567
568
|
for (const signal of ir.metadata.signals) {
|
|
568
569
|
// Env signals (#2057) are bound below via `search_params('')`, not from a
|
|
569
570
|
// static initial value.
|
|
570
571
|
if (signal.envReader) continue
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
// 'Default')`) already got the correct RAW-prop seed above via
|
|
574
|
-
// `derivedProps` / the user-props loop — `extractSsrDefaults` marks that
|
|
575
|
-
// with a `propName`-carrying entry (see its docstring's invariant).
|
|
576
|
-
// Re-seeding here with this harness's OWN recompute
|
|
577
|
-
// (`evaluateSignalInit`) would clobber the correctly-derived caller
|
|
578
|
-
// value with the harness's evaluated-from-static-props number, papering
|
|
579
|
-
// over the exact production bug this fixture exists to catch.
|
|
580
|
-
if (rootSsrDefaults[signal.getter]?.propName !== undefined) continue
|
|
581
|
-
const value = evaluateSignalInit(signal.initialValue.trim(), props)
|
|
582
|
-
if (value !== null) {
|
|
583
|
-
entries.push(`${signal.getter} => ${toPerlLiteral(value)}`)
|
|
572
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, signal.getter)) {
|
|
573
|
+
entries.push(`${signal.getter} => ${toPerlLiteral(derivedProps[signal.getter])}`)
|
|
584
574
|
}
|
|
585
575
|
}
|
|
586
576
|
|
|
587
|
-
//
|
|
588
|
-
// as the production plugin's before_render hook.
|
|
577
|
+
// No `?? 0` for entries the manifest lacks — production seeds nothing there (#2696).
|
|
589
578
|
for (const memo of ir.metadata.memos) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
// value (which for a non-idempotent derivation is already the WRONG,
|
|
594
|
-
// double-applied number).
|
|
595
|
-
if (rootSsrDefaults[memo.name]?.propName !== undefined) continue
|
|
596
|
-
const entry = rootSsrDefaults[memo.name]
|
|
597
|
-
const value = entry ? entry.value : 0
|
|
598
|
-
entries.push(`${memo.name} => ${toPerlLiteral(value ?? 0)}`)
|
|
579
|
+
if (Object.prototype.hasOwnProperty.call(derivedProps, memo.name)) {
|
|
580
|
+
entries.push(`${memo.name} => ${toPerlLiteral(derivedProps[memo.name])}`)
|
|
581
|
+
}
|
|
599
582
|
}
|
|
600
583
|
|
|
601
584
|
// (#1922) Request-scoped `searchParams()`: bind `$searchParams` to an
|