@barefootjs/mojolicious 0.34.0 → 0.35.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/mojo-adapter.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +10 -2
- package/lib/BarefootJS/Backend/Mojo.pm +1 -1
- package/lib/Mojolicious/Plugin/BarefootJS/DevReload.pm +1 -1
- package/lib/Mojolicious/Plugin/BarefootJS.pm +1 -1
- package/package.json +5 -5
- package/src/adapter/mojo-adapter.ts +5 -1
- package/src/render-divergences.ts +1 -16
- package/src/test-render.ts +38 -0
package/dist/adapter/index.js
CHANGED
|
@@ -1446,7 +1446,7 @@ ${whenTrue}
|
|
|
1446
1446
|
const prevScope = this.scope;
|
|
1447
1447
|
this.scope = prevScope.enterLoopRow(loop);
|
|
1448
1448
|
const renderedChildren = this.renderChildren(loop.children);
|
|
1449
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
1449
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
1450
1450
|
${renderedChildren}` : renderedChildren;
|
|
1451
1451
|
const lines = [];
|
|
1452
1452
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mojo-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/mojo-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,WAAW,EAEX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAMP,yBAAyB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scope;
|
|
1447
1447
|
this.scope = prevScope.enterLoopRow(loop);
|
|
1448
1448
|
const renderedChildren = this.renderChildren(loop.children);
|
|
1449
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
1449
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
1450
1450
|
${renderedChildren}` : renderedChildren;
|
|
1451
1451
|
const lines = [];
|
|
1452
1452
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
|
@@ -1914,10 +1914,7 @@ var conformancePins = {
|
|
|
1914
1914
|
"namespace-import-primitive": [{ code: "BF013", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2771" }]
|
|
1915
1915
|
};
|
|
1916
1916
|
// src/render-divergences.ts
|
|
1917
|
-
var renderDivergences = {
|
|
1918
|
-
"children-passthrough-renamed": "A renamed `children` destructure emits the local alias as a template variable; the stash defines only `children`, so the Perl render dies (#2788).",
|
|
1919
|
-
"aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) dies inside `Mojo::Template::process` on real Mojolicious — the seeded loop data is keyed by the signal's real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker."
|
|
1920
|
-
};
|
|
1917
|
+
var renderDivergences = {};
|
|
1921
1918
|
export {
|
|
1922
1919
|
renderDivergences,
|
|
1923
1920
|
mojoAdapter,
|
|
@@ -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;
|
|
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;AAQxD,eAAO,MAAM,iBAAiB,EAAE,iBAAsB,CAAA"}
|
package/dist/vite.js
CHANGED
|
@@ -2274,6 +2274,12 @@ class BindingScope {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
|
|
2277
|
+
// ../jsx/src/ir-to-client-js/safe-html.ts
|
|
2278
|
+
function safeHtml(expr) {
|
|
2279
|
+
return expr;
|
|
2280
|
+
}
|
|
2281
|
+
var EMPTY_MARKUP = safeHtml("''");
|
|
2282
|
+
|
|
2277
2283
|
// ../jsx/src/ir-to-client-js/html-template.ts
|
|
2278
2284
|
var VOID_ELEMENTS = new Set([
|
|
2279
2285
|
"area",
|
|
@@ -2560,6 +2566,7 @@ var CLIENT_EXPORTS = new Set([
|
|
|
2560
2566
|
"isSSRPortal",
|
|
2561
2567
|
"findSiblingSlot",
|
|
2562
2568
|
"cleanupPortalPlaceholder",
|
|
2569
|
+
"trackPosition",
|
|
2563
2570
|
"createSearchParams",
|
|
2564
2571
|
"queryHref",
|
|
2565
2572
|
"formatDate",
|
|
@@ -2620,7 +2627,8 @@ var BROWSER_ONLY_CLIENT_APIS = new Set([
|
|
|
2620
2627
|
"createPortal",
|
|
2621
2628
|
"isSSRPortal",
|
|
2622
2629
|
"findSiblingSlot",
|
|
2623
|
-
"cleanupPortalPlaceholder"
|
|
2630
|
+
"cleanupPortalPlaceholder",
|
|
2631
|
+
"trackPosition"
|
|
2624
2632
|
]);
|
|
2625
2633
|
var REACTIVE_PRIMITIVES = new Set([
|
|
2626
2634
|
"createSignal",
|
|
@@ -6673,7 +6681,7 @@ ${whenTrue}
|
|
|
6673
6681
|
const prevScope = this.scope;
|
|
6674
6682
|
this.scope = prevScope.enterLoopRow(loop);
|
|
6675
6683
|
const renderedChildren = this.renderChildren(loop.children);
|
|
6676
|
-
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>
|
|
6684
|
+
const children = loop.bodyIsItemConditional && loop.key ? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>
|
|
6677
6685
|
${renderedChildren}` : renderedChildren;
|
|
6678
6686
|
const lines = [];
|
|
6679
6687
|
lines.push(`<%== bf->comment("loop:${loop.markerId}") %>`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/mojolicious",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Mojolicious EP template adapter for BarefootJS - generates .html.ep files from IR",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"directory": "packages/adapter-mojolicious"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@barefootjs/shared": "0.
|
|
55
|
+
"@barefootjs/shared": "0.35.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@barefootjs/jsx": ">=0.2.0",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
73
|
-
"@barefootjs/jsx": "0.
|
|
74
|
-
"@barefootjs/vite": "0.
|
|
75
|
-
"@barefootjs/client": "0.
|
|
73
|
+
"@barefootjs/jsx": "0.35.0",
|
|
74
|
+
"@barefootjs/vite": "0.35.0",
|
|
75
|
+
"@barefootjs/client": "0.35.0",
|
|
76
76
|
"vite": "^6.0.0"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -995,9 +995,13 @@ export class MojoAdapter extends BaseAdapter implements IRNodeEmitter<MojoRender
|
|
|
995
995
|
// conditional content so the client's `mapArrayAnchored` can hydrate
|
|
996
996
|
// every SSR-rendered item by its anchor. `bf->comment` prepends `bf-`,
|
|
997
997
|
// so `"loop-i:" . KEY` yields `<!--bf-loop-i:KEY-->`.
|
|
998
|
+
// `bf->escape_comment_key` (#2795 follow-up) both stringifies the key
|
|
999
|
+
// (JS `String()` semantics, matching the other adapters) and neutralizes
|
|
1000
|
+
// `-` so it can't spell `-->` and close the comment early — see its doc
|
|
1001
|
+
// in `BarefootJS.pm`.
|
|
998
1002
|
const children =
|
|
999
1003
|
loop.bodyIsItemConditional && loop.key
|
|
1000
|
-
? `<%== bf->comment("loop-i:" . ${this.convertExpressionToPerl(loop.key)}) %>\n${renderedChildren}`
|
|
1004
|
+
? `<%== bf->comment("loop-i:" . bf->escape_comment_key(${this.convertExpressionToPerl(loop.key)})) %>\n${renderedChildren}`
|
|
1001
1005
|
: renderedChildren
|
|
1002
1006
|
|
|
1003
1007
|
const lines: string[] = []
|
|
@@ -15,19 +15,4 @@ import type { RenderDivergences } from '@barefootjs/jsx'
|
|
|
15
15
|
// at value position and the runtime evaluator's `object-literal` case
|
|
16
16
|
// now merges it, so the seed classifies `derived` and SSRs identically
|
|
17
17
|
// to Hono.
|
|
18
|
-
|
|
19
|
-
// `children` destructure (`const { children: kids } = props`) interpolates
|
|
20
|
-
// the LOCAL alias into the `.html.ep`, and the stash only carries the
|
|
21
|
-
// caller-facing `children`, so Perl dies inside `Mojo::Template::process`
|
|
22
|
-
// at render time rather than at build. Seven adapters resolve the alias;
|
|
23
|
-
// only Mojo does not. Same family as `aliased-destructured-prop`'s
|
|
24
|
-
// `{ n: count }` shape, one level in — the reserved children slot.
|
|
25
|
-
// Delete this entry when #2788 is fixed: `children-passthrough-renamed`
|
|
26
|
-
// already asserts the correct (Hono-generated) output, so it becomes the
|
|
27
|
-
// regression test the moment the skip comes off.
|
|
28
|
-
export const renderDivergences: RenderDivergences = {
|
|
29
|
-
'children-passthrough-renamed':
|
|
30
|
-
'A renamed `children` destructure emits the local alias as a template variable; the stash defines only `children`, so the Perl render dies (#2788).',
|
|
31
|
-
'aliased-loop-source':
|
|
32
|
-
'A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) dies inside `Mojo::Template::process` on real Mojolicious — the seeded loop data is keyed by the signal\'s real name (`items`), and the alias hop is never resolved when deciding what to seed under `items__alias`. This is the SSR-side twin of #2778 (fixed for the CSR client-JS template in the same PR that added this fixture) — that fix only touches client-JS emission, not SSR data-seeding. Tracked at https://github.com/piconic-ai/barefootjs/issues/2813; graduate by resolving the alias hop at SSR-seeding time using the same `resolveAliasOrigin`/`resolveGetterAliases` mechanism #2778 introduced, rather than a third alias-hop walker.',
|
|
33
|
-
}
|
|
18
|
+
export const renderDivergences: RenderDivergences = {}
|
package/src/test-render.ts
CHANGED
|
@@ -548,6 +548,21 @@ function buildChildDefaultsPerl(ir: ComponentIR): string {
|
|
|
548
548
|
`${memo.name} => ${value !== undefined && value !== null ? toPerlLiteral(value) : 'undef'}`,
|
|
549
549
|
)
|
|
550
550
|
}
|
|
551
|
+
// #2788: `extractSsrDefaults` can seed an entry under a name that is
|
|
552
|
+
// none of `propsParams` / `signals` / `memos` above — a bare-props-form
|
|
553
|
+
// component's body-level RENAMED destructure (`const { children: kids }
|
|
554
|
+
// = props`) seeds `kids` alongside the caller-facing `children`
|
|
555
|
+
// (`ssr-defaults.ts`). Real production hands `$entry->{ssrDefaults}`
|
|
556
|
+
// straight through to `_derive_stash_from_defaults`, which iterates
|
|
557
|
+
// every key it contains — so any leftover entry here must be added too,
|
|
558
|
+
// or this harness's hand-built stash literal would silently omit a key
|
|
559
|
+
// production's manifest-driven path already provides, mismeasuring
|
|
560
|
+
// this conformance case's real behavior.
|
|
561
|
+
for (const name of Object.keys(ssrDefaults)) {
|
|
562
|
+
if (declared.has(name)) continue
|
|
563
|
+
declared.add(name)
|
|
564
|
+
entries.push(`${name} => ${ssrDefaultEntryToPerl(ssrDefaults[name])}`)
|
|
565
|
+
}
|
|
551
566
|
return `{${entries.join(', ')}}`
|
|
552
567
|
}
|
|
553
568
|
|
|
@@ -758,6 +773,29 @@ function buildPerlProps(
|
|
|
758
773
|
}
|
|
759
774
|
}
|
|
760
775
|
|
|
776
|
+
// #2813: `extractSsrDefaults` can seed an entry under a name that is
|
|
777
|
+
// none of `propsParams` / the inherited-attribute scan / `signals` /
|
|
778
|
+
// `memos` above — a bare local-const alias of a signal/memo getter
|
|
779
|
+
// (`const items__alias = items`, `ssr-defaults.ts`) seeds `items__alias`
|
|
780
|
+
// alongside `items`. Production hands the whole manifest-derived stash
|
|
781
|
+
// straight through (`deriveStashFromDefaults` IS the production seeding
|
|
782
|
+
// mechanism here, not a harness stand-in), so any leftover
|
|
783
|
+
// `derivedProps` key must be pushed too, or this harness would silently
|
|
784
|
+
// omit what production actually provides, mismeasuring this
|
|
785
|
+
// conformance case — the same gap `buildChildDefaultsPerl` (above) was
|
|
786
|
+
// already fixed for child components.
|
|
787
|
+
const seededNames = new Set<string>([
|
|
788
|
+
...ir.metadata.propsParams.map(p => p.name),
|
|
789
|
+
...(ir.metadata.propsObjectName ? [...collectPropsObjectAccesses(ir, ir.metadata.propsObjectName)] : []),
|
|
790
|
+
...(restPropsName ? [restPropsName] : []),
|
|
791
|
+
...ir.metadata.signals.filter(s => !s.envReader).map(s => s.getter),
|
|
792
|
+
...ir.metadata.memos.map(m => m.name),
|
|
793
|
+
])
|
|
794
|
+
for (const [name, value] of Object.entries(derivedProps)) {
|
|
795
|
+
if (seededNames.has(name)) continue
|
|
796
|
+
entries.push(`${name} => ${toPerlLiteral(value)}`)
|
|
797
|
+
}
|
|
798
|
+
|
|
761
799
|
// (#1922) Request-scoped `searchParams()`: bind `$searchParams` to an
|
|
762
800
|
// empty-query reader via the lazy-loading factory (so the render script
|
|
763
801
|
// needn't `use BarefootJS::SearchParams`). The conformance harness issues no
|