@barefootjs/xslate 0.17.0 → 0.17.1
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/expr/array-method.d.ts +10 -0
- package/dist/adapter/expr/array-method.d.ts.map +1 -1
- package/dist/adapter/expr/emitters.d.ts +6 -7
- package/dist/adapter/expr/emitters.d.ts.map +1 -1
- package/dist/adapter/index.js +42 -55
- package/dist/adapter/lib/ir-scope.d.ts +0 -5
- package/dist/adapter/lib/ir-scope.d.ts.map +1 -1
- package/dist/adapter/memo/seed.d.ts +14 -14
- package/dist/adapter/memo/seed.d.ts.map +1 -1
- package/dist/adapter/xslate-adapter.d.ts.map +1 -1
- package/dist/build.js +42 -55
- package/dist/index.js +42 -55
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +3 -3
- package/src/__tests__/xslate-adapter.test.ts +148 -11
- package/src/adapter/expr/array-method.ts +21 -0
- package/src/adapter/expr/emitters.ts +30 -12
- package/src/adapter/lib/ir-scope.ts +0 -11
- package/src/adapter/memo/seed.ts +25 -72
- package/src/adapter/xslate-adapter.ts +21 -3
|
@@ -52,6 +52,16 @@ export declare function renderPredicateEval(funcName: string, recv: string, pred
|
|
|
52
52
|
* projection is outside the evaluator surface (→ caller refuses with BF101).
|
|
53
53
|
*/
|
|
54
54
|
export declare function renderFlatMapEval(recv: string, body: ParsedExpr, param: string, emit: (e: ParsedExpr) => string): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Emit a value-producing `.map(cb)` via the runtime evaluator (#2073): the
|
|
57
|
+
* projection body serializes to JSON and `$bf.map_eval` projects each element,
|
|
58
|
+
* one result per element (no flatten — the JS `.map` contract). Composes
|
|
59
|
+
* through the array-method chain (`.map(cb).join(' ')`). Returns null when
|
|
60
|
+
* the projection is outside the evaluator surface (→ caller refuses with
|
|
61
|
+
* BF101). The JSX-returning `.map` is an IRLoop upstream and never reaches
|
|
62
|
+
* this emit.
|
|
63
|
+
*/
|
|
64
|
+
export declare function renderMapEval(recv: string, body: ParsedExpr, param: string, emit: (e: ParsedExpr) => string): string | null;
|
|
55
65
|
/**
|
|
56
66
|
* Shared Kolon emit for `.sort(cmp)` / `.toSorted(cmp)`. Used by both the
|
|
57
67
|
* filter-context emitter and the top-level emitter, plus the loop-array
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-method.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/array-method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,iBAAiB,CAAA;AAExB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAAE,EAClB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,CA4HR;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,EAC3B,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAkBf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,C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AAG,OAAO,EAC3B,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAkBf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,EAC/B,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,GAAG,IAAI,CAMf;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAKf;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,GAAG,IAAI,CAKf;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,GAAG,MAAM,CASxE;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAGvE"}
|
|
@@ -18,18 +18,17 @@ import type { XslateEmitContext } from '../emit-context.ts';
|
|
|
18
18
|
* filters. Higher-order predicates are emitted using Kolon's own scalar
|
|
19
19
|
* comparison operators (which delegate to Perl semantics).
|
|
20
20
|
*
|
|
21
|
-
* NOTE: Kolon has no `grep { } @{...}` form, so nested higher-order
|
|
22
|
-
* (`x.tags.filter(...).
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* use; richer nested shapes fall back to the helper or surface as BF101 via
|
|
26
|
-
* the top-level emitter.
|
|
21
|
+
* NOTE: Kolon has no `grep { } @{...}` form, so a nested higher-order call
|
|
22
|
+
* (`x.tags.filter(...)`, `other.some(...)`) inside a predicate has no faithful
|
|
23
|
+
* scalar lowering here. Such predicates surface BF101 via `onUnsupported`
|
|
24
|
+
* (#2038) instead of silently degrading to the callback's receiver.
|
|
27
25
|
*/
|
|
28
26
|
export declare class XslateFilterEmitter implements ParsedExprEmitter {
|
|
29
27
|
private readonly param;
|
|
30
28
|
private readonly localVarMap;
|
|
31
29
|
private readonly isStringName;
|
|
32
|
-
|
|
30
|
+
private readonly onUnsupported?;
|
|
31
|
+
constructor(param: string, localVarMap: Map<string, string>, isStringName?: (n: string) => boolean, onUnsupported?: ((message: string, reason?: string) => void) | undefined);
|
|
33
32
|
identifier(name: string): string;
|
|
34
33
|
literal(value: string | number | boolean | null, literalType: LiteralType): string;
|
|
35
34
|
member(object: ParsedExpr, property: string, _computed: boolean, emit: (e: ParsedExpr) => string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitters.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/emitters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"emitters.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/emitters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS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AAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAAG,MAAM,CAoB9E;IAED,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAKlD;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG1B;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;IAED,aAAa,CAAC,WAAW,EAAE,qBAAqB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAAG,MAAM,CAO1G;CACF"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -187291,12 +187291,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
187291
187291
|
import {
|
|
187292
187292
|
BaseAdapter,
|
|
187293
187293
|
isBooleanAttr,
|
|
187294
|
-
parseExpression as
|
|
187294
|
+
parseExpression as parseExpression2,
|
|
187295
187295
|
stringifyParsedExpr as stringifyParsedExpr2,
|
|
187296
187296
|
exprToString,
|
|
187297
187297
|
parseProviderObjectLiteral,
|
|
187298
187298
|
parseStyleObjectEntries,
|
|
187299
|
-
isSupported
|
|
187299
|
+
isSupported,
|
|
187300
187300
|
emitParsedExpr,
|
|
187301
187301
|
emitIRNode,
|
|
187302
187302
|
emitAttrValue,
|
|
@@ -187417,13 +187417,6 @@ function collectRootScopeNodes(node) {
|
|
|
187417
187417
|
visit(node);
|
|
187418
187418
|
return out;
|
|
187419
187419
|
}
|
|
187420
|
-
function referencedVarsAreAvailable(expr, available) {
|
|
187421
|
-
for (const m of expr.matchAll(/\$([A-Za-z_]\w*)/g)) {
|
|
187422
|
-
if (!available.has(m[1]))
|
|
187423
|
-
return false;
|
|
187424
|
-
}
|
|
187425
|
-
return true;
|
|
187426
|
-
}
|
|
187427
187420
|
|
|
187428
187421
|
// src/adapter/expr/array-method.ts
|
|
187429
187422
|
import {
|
|
@@ -187593,6 +187586,13 @@ function renderFlatMapEval(recv, body, param, emit) {
|
|
|
187593
187586
|
const env = emitEvalEnvArg(body, [param], emit);
|
|
187594
187587
|
return `$bf.flat_map_eval(${recv}, '${escapePerlSingleQuote(json)}', '${param}', ${env})`;
|
|
187595
187588
|
}
|
|
187589
|
+
function renderMapEval(recv, body, param, emit) {
|
|
187590
|
+
const json = serializeParsedExpr(body);
|
|
187591
|
+
if (json === null)
|
|
187592
|
+
return null;
|
|
187593
|
+
const env = emitEvalEnvArg(body, [param], emit);
|
|
187594
|
+
return `$bf.map_eval(${recv}, '${escapePerlSingleQuote(json)}', '${param}', ${env})`;
|
|
187595
|
+
}
|
|
187596
187596
|
function renderSortMethod(recv, c) {
|
|
187597
187597
|
const keyHashes = c.keys.map((k) => {
|
|
187598
187598
|
const keyEntry = k.key.kind === "self" ? `key_kind => 'self'` : `key_kind => 'field', key => '${k.key.field}'`;
|
|
@@ -187625,10 +187625,12 @@ class XslateFilterEmitter {
|
|
|
187625
187625
|
param;
|
|
187626
187626
|
localVarMap;
|
|
187627
187627
|
isStringName;
|
|
187628
|
-
|
|
187628
|
+
onUnsupported;
|
|
187629
|
+
constructor(param, localVarMap, isStringName = () => false, onUnsupported) {
|
|
187629
187630
|
this.param = param;
|
|
187630
187631
|
this.localVarMap = localVarMap;
|
|
187631
187632
|
this.isStringName = isStringName;
|
|
187633
|
+
this.onUnsupported = onUnsupported;
|
|
187632
187634
|
}
|
|
187633
187635
|
identifier(name) {
|
|
187634
187636
|
if (name === this.param)
|
|
@@ -187699,6 +187701,7 @@ class XslateFilterEmitter {
|
|
|
187699
187701
|
return `(${l} // ${r})`;
|
|
187700
187702
|
}
|
|
187701
187703
|
callbackMethod(method, object, _arrow, _restArgs, emit) {
|
|
187704
|
+
this.onUnsupported?.(`Filter predicate contains a nested '.${method}(...)' callback, which has no Kolon scalar form`, `Rewrite the predicate without a nested callback method, or add /* @client */ for client-only evaluation (no SSR).`);
|
|
187702
187705
|
return emit(object);
|
|
187703
187706
|
}
|
|
187704
187707
|
arrayLiteral(elements, emit) {
|
|
@@ -187859,6 +187862,13 @@ class XslateTopLevelEmitter {
|
|
|
187859
187862
|
this.ctx._recordExprBF101(`'.flatMap(...)' projection is outside the Xslate adapter's evaluable surface`, `Pre-compute the projected array, or move this position to a '/* @client */' boundary.`);
|
|
187860
187863
|
return "''";
|
|
187861
187864
|
}
|
|
187865
|
+
if (method === "map") {
|
|
187866
|
+
const evalForm = renderMapEval(recv, body, params[0], emit);
|
|
187867
|
+
if (evalForm !== null)
|
|
187868
|
+
return evalForm;
|
|
187869
|
+
this.ctx._recordExprBF101(`'.map(...)' projection is outside the Xslate adapter's evaluable surface`, `Pre-compute the projected array, or move this position to a '/* @client */' boundary.`);
|
|
187870
|
+
return "''";
|
|
187871
|
+
}
|
|
187862
187872
|
return recv;
|
|
187863
187873
|
}
|
|
187864
187874
|
_emitPredicateCallback(call, arrayExpr, emit) {
|
|
@@ -188092,9 +188102,7 @@ function recordIndexAccessToKolon(ctx, val) {
|
|
|
188092
188102
|
// src/adapter/memo/seed.ts
|
|
188093
188103
|
import {
|
|
188094
188104
|
collectContextConsumers,
|
|
188095
|
-
|
|
188096
|
-
isSupported,
|
|
188097
|
-
parseExpression as parseExpression2
|
|
188105
|
+
computeSsrSeedPlan
|
|
188098
188106
|
} from "@barefootjs/jsx";
|
|
188099
188107
|
function contextDefaultKolon(c) {
|
|
188100
188108
|
const d = c.defaultValue;
|
|
@@ -188115,44 +188123,22 @@ function generateContextConsumerSeed(ir) {
|
|
|
188115
188123
|
`;
|
|
188116
188124
|
}
|
|
188117
188125
|
function generateDerivedMemoSeed(ctx, ir) {
|
|
188118
|
-
const
|
|
188119
|
-
const signals = ir.metadata.signals ?? [];
|
|
188120
|
-
if (memos.length === 0 && signals.length === 0)
|
|
188121
|
-
return "";
|
|
188122
|
-
const available = new Set(ir.metadata.propsParams.map((p) => p.name));
|
|
188126
|
+
const plan = ir.metadata.ssrSeedPlan ?? computeSsrSeedPlan(ir.metadata);
|
|
188123
188127
|
const lines = [];
|
|
188124
|
-
for (const
|
|
188125
|
-
|
|
188126
|
-
|
|
188127
|
-
|
|
188128
|
-
|
|
188129
|
-
|
|
188130
|
-
|
|
188131
|
-
|
|
188132
|
-
|
|
188133
|
-
if (body !== null) {
|
|
188134
|
-
const kolon = tryLowerToKolon(ctx, body, available);
|
|
188135
|
-
const refsSelf = kolon !== null && new RegExp(`\\$${memo.name}\\b`).test(kolon);
|
|
188136
|
-
if (kolon !== null && !refsSelf)
|
|
188137
|
-
lines.push(`: my $${memo.name} = ${kolon};`);
|
|
188138
|
-
}
|
|
188139
|
-
available.add(memo.name);
|
|
188128
|
+
for (const step of plan.steps) {
|
|
188129
|
+
if (step.kind !== "derived")
|
|
188130
|
+
continue;
|
|
188131
|
+
const kolon = ctx.convertExpressionToKolon(step.expr, step.parsed);
|
|
188132
|
+
if (kolon === "" || !/\$[A-Za-z_]\w*/.test(kolon))
|
|
188133
|
+
continue;
|
|
188134
|
+
if (new RegExp(`\\$${step.name}\\b`).test(kolon))
|
|
188135
|
+
continue;
|
|
188136
|
+
lines.push(`: my $${step.name} = ${kolon};`);
|
|
188140
188137
|
}
|
|
188141
188138
|
return lines.length > 0 ? lines.join(`
|
|
188142
188139
|
`) + `
|
|
188143
188140
|
` : "";
|
|
188144
188141
|
}
|
|
188145
|
-
function tryLowerToKolon(ctx, expr, available) {
|
|
188146
|
-
const trimmed = expr.trim();
|
|
188147
|
-
if (!trimmed)
|
|
188148
|
-
return null;
|
|
188149
|
-
if (!isSupported(parseExpression2(trimmed)).supported)
|
|
188150
|
-
return null;
|
|
188151
|
-
const kolon = ctx.convertExpressionToKolon(trimmed);
|
|
188152
|
-
if (kolon === "" || !/\$[A-Za-z_]\w*/.test(kolon))
|
|
188153
|
-
return null;
|
|
188154
|
-
return referencedVarsAreAvailable(kolon, available) ? kolon : null;
|
|
188155
|
-
}
|
|
188156
188142
|
|
|
188157
188143
|
// src/adapter/value/parsed-literal.ts
|
|
188158
188144
|
import { evalStringArrayJoin } from "@barefootjs/jsx";
|
|
@@ -188452,8 +188438,9 @@ ${whenTrue}
|
|
|
188452
188438
|
return `<: $bf.comment("cond-start:${condId}") | mark_raw :>${content}<: $bf.comment("cond-end:${condId}") | mark_raw :>`;
|
|
188453
188439
|
}
|
|
188454
188440
|
renderLoop(loop) {
|
|
188455
|
-
if (loop.clientOnly)
|
|
188456
|
-
return ""
|
|
188441
|
+
if (loop.clientOnly) {
|
|
188442
|
+
return `<: $bf.comment("loop:${loop.markerId}") | mark_raw :><: $bf.comment("/loop:${loop.markerId}") | mark_raw :>`;
|
|
188443
|
+
}
|
|
188457
188444
|
const destructure = !!(loop.paramBindings && loop.paramBindings.length > 0);
|
|
188458
188445
|
const supportableDestructure = destructure && isLowerableObjectRestDestructure(loop);
|
|
188459
188446
|
if (destructure && !supportableDestructure) {
|
|
@@ -188709,7 +188696,7 @@ ${name}="<: ${val} :>"
|
|
|
188709
188696
|
if (localConst?.value !== undefined) {
|
|
188710
188697
|
const initTrimmed = localConst.value.trim();
|
|
188711
188698
|
if (!/^[A-Za-z_$][\w$]*$/.test(initTrimmed)) {
|
|
188712
|
-
const resolved = conditionalSpreadToKolon(this.spreadCtx,
|
|
188699
|
+
const resolved = conditionalSpreadToKolon(this.spreadCtx, parseExpression2(initTrimmed));
|
|
188713
188700
|
if (resolved !== null) {
|
|
188714
188701
|
return `<: $bf.spread_attrs(${resolved}) | mark_raw :>`;
|
|
188715
188702
|
}
|
|
@@ -188727,7 +188714,7 @@ ${name}="<: ${val} :>"
|
|
|
188727
188714
|
if (!entries)
|
|
188728
188715
|
return null;
|
|
188729
188716
|
for (const e of entries) {
|
|
188730
|
-
if (e.kind === "expr" && !
|
|
188717
|
+
if (e.kind === "expr" && !isSupported(parseExpression2(e.expr)).supported)
|
|
188731
188718
|
return null;
|
|
188732
188719
|
}
|
|
188733
188720
|
return entries.map((e) => e.kind === "literal" ? `${this.escapeAttrText(e.cssKey)}:${this.escapeAttrText(e.value)}` : `${this.escapeAttrText(e.cssKey)}:<: ${this.convertExpressionToKolon(e.expr)} :>`).join(";");
|
|
@@ -188763,7 +188750,7 @@ ${name}="<: ${val} :>"
|
|
|
188763
188750
|
return `${BF_COND}="${condId}"`;
|
|
188764
188751
|
}
|
|
188765
188752
|
renderKolonFilterExpr(expr, param, localVarMap = new Map) {
|
|
188766
|
-
return emitParsedExpr(expr, new XslateFilterEmitter(param, localVarMap, (n) => this._isStringValueName(n)));
|
|
188753
|
+
return emitParsedExpr(expr, new XslateFilterEmitter(param, localVarMap, (n) => this._isStringValueName(n), (message, reason) => this._recordExprBF101(message, reason)));
|
|
188767
188754
|
}
|
|
188768
188755
|
convertTemplateLiteralPartsToKolon(literalParts) {
|
|
188769
188756
|
const parts = [];
|
|
@@ -188808,8 +188795,8 @@ ${name}="<: ${val} :>"
|
|
|
188808
188795
|
const hasTaggedTemplate = /[A-Za-z_$][\w$]*\s*`/.test(probe);
|
|
188809
188796
|
if (!startsAsObjectLiteral && !hasTaggedTemplate)
|
|
188810
188797
|
return false;
|
|
188811
|
-
const parsed =
|
|
188812
|
-
const support =
|
|
188798
|
+
const parsed = parseExpression2(expr.trim());
|
|
188799
|
+
const support = isSupported(parsed);
|
|
188813
188800
|
if (parsed.kind !== "unsupported" && support.supported)
|
|
188814
188801
|
return false;
|
|
188815
188802
|
const reason = support.reason ?? (parsed.kind === "unsupported" ? parsed.reason : undefined);
|
|
@@ -188856,7 +188843,7 @@ ${reason}` : "";
|
|
|
188856
188843
|
const trimmed = expr.trim();
|
|
188857
188844
|
if (trimmed === "")
|
|
188858
188845
|
return "''";
|
|
188859
|
-
parsed =
|
|
188846
|
+
parsed = parseExpression2(trimmed);
|
|
188860
188847
|
}
|
|
188861
188848
|
if (parsed.kind === "call") {
|
|
188862
188849
|
for (const matcher of this._loweringMatchers) {
|
|
@@ -188867,7 +188854,7 @@ ${reason}` : "";
|
|
|
188867
188854
|
}
|
|
188868
188855
|
}
|
|
188869
188856
|
}
|
|
188870
|
-
const support =
|
|
188857
|
+
const support = isSupported(parsed);
|
|
188871
188858
|
if (!support.supported) {
|
|
188872
188859
|
this.errors.push({
|
|
188873
188860
|
code: "BF101",
|
|
@@ -188895,7 +188882,7 @@ Options:
|
|
|
188895
188882
|
return this.stringValueNames.has(name);
|
|
188896
188883
|
}
|
|
188897
188884
|
parseUndefinedAlternateTernary(expr) {
|
|
188898
|
-
const parsed =
|
|
188885
|
+
const parsed = parseExpression2(expr.trim());
|
|
188899
188886
|
if (parsed?.kind !== "conditional")
|
|
188900
188887
|
return null;
|
|
188901
188888
|
const alt = parsed.alternate;
|
|
@@ -26,9 +26,4 @@ export declare function resolveJsxChildrenProp(props: readonly IRProp[]): IRNode
|
|
|
26
26
|
* runtime. (#1297)
|
|
27
27
|
*/
|
|
28
28
|
export declare function collectRootScopeNodes(node: IRNode): Set<IRNode>;
|
|
29
|
-
/**
|
|
30
|
-
* True when every `$var` the lowered Kolon expression references is already in
|
|
31
|
-
* scope — guards in-template memo seeding against an out-of-scope binding. (#1297)
|
|
32
|
-
*/
|
|
33
|
-
export declare function referencedVarsAreAvailable(expr: string, available: ReadonlySet<string>): boolean;
|
|
34
29
|
//# sourceMappingURL=ir-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-scope.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/ir-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA6B,MAAM,iBAAiB,CAAA;AAEhF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAiB/D
|
|
1
|
+
{"version":3,"file":"ir-scope.d.ts","sourceRoot":"","sources":["../../../src/adapter/lib/ir-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA6B,MAAM,iBAAiB,CAAA;AAEhF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAiB/D"}
|
|
@@ -19,20 +19,20 @@ export declare function contextDefaultKolon(c: ContextConsumer): string;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function generateContextConsumerSeed(ir: ComponentIR): string;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* this
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
* Emit `: my $<name> = <kolon>;` line-statements for every `derived` step of
|
|
23
|
+
* the backend-neutral SSR seed plan — the scope/availability/ordering
|
|
24
|
+
* analysis lives in `computeSsrSeedPlan` (packages/jsx/src/ssr-seed-plan.ts);
|
|
25
|
+
* this only lowers each step's expression to Kolon and applies the
|
|
26
|
+
* backend-specific emit guards: skip an empty lowering, skip a lowering that
|
|
27
|
+
* references no `$var` at all (a constant init/body — e.g. a `derived` step
|
|
28
|
+
* with empty `frees` — keeps the existing static ssr-defaults seed instead),
|
|
29
|
+
* and skip a self-referencing lowering (Kolon's `my` shadows the RHS, so
|
|
30
|
+
* `: my $x = … $x …` would read the just-declared undefined lexical rather
|
|
31
|
+
* than the render var — the plan rules out SOURCE-level self-refs, but a
|
|
32
|
+
* lowered canonical name could still collide, so this stays as the cheap
|
|
33
|
+
* defense it always was). `env-reader` and `opaque` steps emit nothing (the
|
|
34
|
+
* runtime supplies the reader, or the adapter's ssr-defaults path already
|
|
35
|
+
* covers it). (#1297, #2075)
|
|
28
36
|
*/
|
|
29
37
|
export declare function generateDerivedMemoSeed(ctx: XslateMemoContext, ir: ComponentIR): string;
|
|
30
|
-
/**
|
|
31
|
-
* Lower a signal init / memo body to Kolon for an in-template SSR seed, or
|
|
32
|
-
* `null` when it shouldn't be seeded this way: not a supported shape
|
|
33
|
-
* (`isSupported` pre-check, so object/array literals don't fail the build),
|
|
34
|
-
* references no in-scope var (a constant — keep ssr-defaults seeding), or
|
|
35
|
-
* references an out-of-scope binding. (#1297)
|
|
36
|
-
*/
|
|
37
|
-
export declare function tryLowerToKolon(ctx: XslateMemoContext, expr: string, available: ReadonlySet<string>): string | null;
|
|
38
38
|
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/adapter/memo/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/adapter/memo/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EAGrB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAWnE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,WAAW,GAAG,MAAM,CAcvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xslate-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/xslate-adapter.ts"],"names":[],"mappings":"AAAA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AI1B;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;;OAKG;IACH;;;;OAIG;IACH,8BAA8B,CAC5B,IAAI,EAAE,MAAM,GACX;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAgBlD;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO3C;IAED;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,yBAAyB;IASjC,OAAO,CAAC,gBAAgB;IAcxB,iFAAiF;IACjF,OAAO,CAAC,4BAA4B;CAGrC;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
|
package/dist/build.js
CHANGED
|
@@ -187291,12 +187291,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
187291
187291
|
import {
|
|
187292
187292
|
BaseAdapter,
|
|
187293
187293
|
isBooleanAttr,
|
|
187294
|
-
parseExpression as
|
|
187294
|
+
parseExpression as parseExpression2,
|
|
187295
187295
|
stringifyParsedExpr as stringifyParsedExpr2,
|
|
187296
187296
|
exprToString,
|
|
187297
187297
|
parseProviderObjectLiteral,
|
|
187298
187298
|
parseStyleObjectEntries,
|
|
187299
|
-
isSupported
|
|
187299
|
+
isSupported,
|
|
187300
187300
|
emitParsedExpr,
|
|
187301
187301
|
emitIRNode,
|
|
187302
187302
|
emitAttrValue,
|
|
@@ -187417,13 +187417,6 @@ function collectRootScopeNodes(node) {
|
|
|
187417
187417
|
visit(node);
|
|
187418
187418
|
return out;
|
|
187419
187419
|
}
|
|
187420
|
-
function referencedVarsAreAvailable(expr, available) {
|
|
187421
|
-
for (const m of expr.matchAll(/\$([A-Za-z_]\w*)/g)) {
|
|
187422
|
-
if (!available.has(m[1]))
|
|
187423
|
-
return false;
|
|
187424
|
-
}
|
|
187425
|
-
return true;
|
|
187426
|
-
}
|
|
187427
187420
|
|
|
187428
187421
|
// src/adapter/expr/array-method.ts
|
|
187429
187422
|
import {
|
|
@@ -187593,6 +187586,13 @@ function renderFlatMapEval(recv, body, param, emit) {
|
|
|
187593
187586
|
const env = emitEvalEnvArg(body, [param], emit);
|
|
187594
187587
|
return `$bf.flat_map_eval(${recv}, '${escapePerlSingleQuote(json)}', '${param}', ${env})`;
|
|
187595
187588
|
}
|
|
187589
|
+
function renderMapEval(recv, body, param, emit) {
|
|
187590
|
+
const json = serializeParsedExpr(body);
|
|
187591
|
+
if (json === null)
|
|
187592
|
+
return null;
|
|
187593
|
+
const env = emitEvalEnvArg(body, [param], emit);
|
|
187594
|
+
return `$bf.map_eval(${recv}, '${escapePerlSingleQuote(json)}', '${param}', ${env})`;
|
|
187595
|
+
}
|
|
187596
187596
|
function renderSortMethod(recv, c) {
|
|
187597
187597
|
const keyHashes = c.keys.map((k) => {
|
|
187598
187598
|
const keyEntry = k.key.kind === "self" ? `key_kind => 'self'` : `key_kind => 'field', key => '${k.key.field}'`;
|
|
@@ -187625,10 +187625,12 @@ class XslateFilterEmitter {
|
|
|
187625
187625
|
param;
|
|
187626
187626
|
localVarMap;
|
|
187627
187627
|
isStringName;
|
|
187628
|
-
|
|
187628
|
+
onUnsupported;
|
|
187629
|
+
constructor(param, localVarMap, isStringName = () => false, onUnsupported) {
|
|
187629
187630
|
this.param = param;
|
|
187630
187631
|
this.localVarMap = localVarMap;
|
|
187631
187632
|
this.isStringName = isStringName;
|
|
187633
|
+
this.onUnsupported = onUnsupported;
|
|
187632
187634
|
}
|
|
187633
187635
|
identifier(name) {
|
|
187634
187636
|
if (name === this.param)
|
|
@@ -187699,6 +187701,7 @@ class XslateFilterEmitter {
|
|
|
187699
187701
|
return `(${l} // ${r})`;
|
|
187700
187702
|
}
|
|
187701
187703
|
callbackMethod(method, object, _arrow, _restArgs, emit) {
|
|
187704
|
+
this.onUnsupported?.(`Filter predicate contains a nested '.${method}(...)' callback, which has no Kolon scalar form`, `Rewrite the predicate without a nested callback method, or add /* @client */ for client-only evaluation (no SSR).`);
|
|
187702
187705
|
return emit(object);
|
|
187703
187706
|
}
|
|
187704
187707
|
arrayLiteral(elements, emit) {
|
|
@@ -187859,6 +187862,13 @@ class XslateTopLevelEmitter {
|
|
|
187859
187862
|
this.ctx._recordExprBF101(`'.flatMap(...)' projection is outside the Xslate adapter's evaluable surface`, `Pre-compute the projected array, or move this position to a '/* @client */' boundary.`);
|
|
187860
187863
|
return "''";
|
|
187861
187864
|
}
|
|
187865
|
+
if (method === "map") {
|
|
187866
|
+
const evalForm = renderMapEval(recv, body, params[0], emit);
|
|
187867
|
+
if (evalForm !== null)
|
|
187868
|
+
return evalForm;
|
|
187869
|
+
this.ctx._recordExprBF101(`'.map(...)' projection is outside the Xslate adapter's evaluable surface`, `Pre-compute the projected array, or move this position to a '/* @client */' boundary.`);
|
|
187870
|
+
return "''";
|
|
187871
|
+
}
|
|
187862
187872
|
return recv;
|
|
187863
187873
|
}
|
|
187864
187874
|
_emitPredicateCallback(call, arrayExpr, emit) {
|
|
@@ -188092,9 +188102,7 @@ function recordIndexAccessToKolon(ctx, val) {
|
|
|
188092
188102
|
// src/adapter/memo/seed.ts
|
|
188093
188103
|
import {
|
|
188094
188104
|
collectContextConsumers,
|
|
188095
|
-
|
|
188096
|
-
isSupported,
|
|
188097
|
-
parseExpression as parseExpression2
|
|
188105
|
+
computeSsrSeedPlan
|
|
188098
188106
|
} from "@barefootjs/jsx";
|
|
188099
188107
|
function contextDefaultKolon(c) {
|
|
188100
188108
|
const d = c.defaultValue;
|
|
@@ -188115,44 +188123,22 @@ function generateContextConsumerSeed(ir) {
|
|
|
188115
188123
|
`;
|
|
188116
188124
|
}
|
|
188117
188125
|
function generateDerivedMemoSeed(ctx, ir) {
|
|
188118
|
-
const
|
|
188119
|
-
const signals = ir.metadata.signals ?? [];
|
|
188120
|
-
if (memos.length === 0 && signals.length === 0)
|
|
188121
|
-
return "";
|
|
188122
|
-
const available = new Set(ir.metadata.propsParams.map((p) => p.name));
|
|
188126
|
+
const plan = ir.metadata.ssrSeedPlan ?? computeSsrSeedPlan(ir.metadata);
|
|
188123
188127
|
const lines = [];
|
|
188124
|
-
for (const
|
|
188125
|
-
|
|
188126
|
-
|
|
188127
|
-
|
|
188128
|
-
|
|
188129
|
-
|
|
188130
|
-
|
|
188131
|
-
|
|
188132
|
-
|
|
188133
|
-
if (body !== null) {
|
|
188134
|
-
const kolon = tryLowerToKolon(ctx, body, available);
|
|
188135
|
-
const refsSelf = kolon !== null && new RegExp(`\\$${memo.name}\\b`).test(kolon);
|
|
188136
|
-
if (kolon !== null && !refsSelf)
|
|
188137
|
-
lines.push(`: my $${memo.name} = ${kolon};`);
|
|
188138
|
-
}
|
|
188139
|
-
available.add(memo.name);
|
|
188128
|
+
for (const step of plan.steps) {
|
|
188129
|
+
if (step.kind !== "derived")
|
|
188130
|
+
continue;
|
|
188131
|
+
const kolon = ctx.convertExpressionToKolon(step.expr, step.parsed);
|
|
188132
|
+
if (kolon === "" || !/\$[A-Za-z_]\w*/.test(kolon))
|
|
188133
|
+
continue;
|
|
188134
|
+
if (new RegExp(`\\$${step.name}\\b`).test(kolon))
|
|
188135
|
+
continue;
|
|
188136
|
+
lines.push(`: my $${step.name} = ${kolon};`);
|
|
188140
188137
|
}
|
|
188141
188138
|
return lines.length > 0 ? lines.join(`
|
|
188142
188139
|
`) + `
|
|
188143
188140
|
` : "";
|
|
188144
188141
|
}
|
|
188145
|
-
function tryLowerToKolon(ctx, expr, available) {
|
|
188146
|
-
const trimmed = expr.trim();
|
|
188147
|
-
if (!trimmed)
|
|
188148
|
-
return null;
|
|
188149
|
-
if (!isSupported(parseExpression2(trimmed)).supported)
|
|
188150
|
-
return null;
|
|
188151
|
-
const kolon = ctx.convertExpressionToKolon(trimmed);
|
|
188152
|
-
if (kolon === "" || !/\$[A-Za-z_]\w*/.test(kolon))
|
|
188153
|
-
return null;
|
|
188154
|
-
return referencedVarsAreAvailable(kolon, available) ? kolon : null;
|
|
188155
|
-
}
|
|
188156
188142
|
|
|
188157
188143
|
// src/adapter/value/parsed-literal.ts
|
|
188158
188144
|
import { evalStringArrayJoin } from "@barefootjs/jsx";
|
|
@@ -188452,8 +188438,9 @@ ${whenTrue}
|
|
|
188452
188438
|
return `<: $bf.comment("cond-start:${condId}") | mark_raw :>${content}<: $bf.comment("cond-end:${condId}") | mark_raw :>`;
|
|
188453
188439
|
}
|
|
188454
188440
|
renderLoop(loop) {
|
|
188455
|
-
if (loop.clientOnly)
|
|
188456
|
-
return ""
|
|
188441
|
+
if (loop.clientOnly) {
|
|
188442
|
+
return `<: $bf.comment("loop:${loop.markerId}") | mark_raw :><: $bf.comment("/loop:${loop.markerId}") | mark_raw :>`;
|
|
188443
|
+
}
|
|
188457
188444
|
const destructure = !!(loop.paramBindings && loop.paramBindings.length > 0);
|
|
188458
188445
|
const supportableDestructure = destructure && isLowerableObjectRestDestructure(loop);
|
|
188459
188446
|
if (destructure && !supportableDestructure) {
|
|
@@ -188709,7 +188696,7 @@ ${name}="<: ${val} :>"
|
|
|
188709
188696
|
if (localConst?.value !== undefined) {
|
|
188710
188697
|
const initTrimmed = localConst.value.trim();
|
|
188711
188698
|
if (!/^[A-Za-z_$][\w$]*$/.test(initTrimmed)) {
|
|
188712
|
-
const resolved = conditionalSpreadToKolon(this.spreadCtx,
|
|
188699
|
+
const resolved = conditionalSpreadToKolon(this.spreadCtx, parseExpression2(initTrimmed));
|
|
188713
188700
|
if (resolved !== null) {
|
|
188714
188701
|
return `<: $bf.spread_attrs(${resolved}) | mark_raw :>`;
|
|
188715
188702
|
}
|
|
@@ -188727,7 +188714,7 @@ ${name}="<: ${val} :>"
|
|
|
188727
188714
|
if (!entries)
|
|
188728
188715
|
return null;
|
|
188729
188716
|
for (const e of entries) {
|
|
188730
|
-
if (e.kind === "expr" && !
|
|
188717
|
+
if (e.kind === "expr" && !isSupported(parseExpression2(e.expr)).supported)
|
|
188731
188718
|
return null;
|
|
188732
188719
|
}
|
|
188733
188720
|
return entries.map((e) => e.kind === "literal" ? `${this.escapeAttrText(e.cssKey)}:${this.escapeAttrText(e.value)}` : `${this.escapeAttrText(e.cssKey)}:<: ${this.convertExpressionToKolon(e.expr)} :>`).join(";");
|
|
@@ -188763,7 +188750,7 @@ ${name}="<: ${val} :>"
|
|
|
188763
188750
|
return `${BF_COND}="${condId}"`;
|
|
188764
188751
|
}
|
|
188765
188752
|
renderKolonFilterExpr(expr, param, localVarMap = new Map) {
|
|
188766
|
-
return emitParsedExpr(expr, new XslateFilterEmitter(param, localVarMap, (n) => this._isStringValueName(n)));
|
|
188753
|
+
return emitParsedExpr(expr, new XslateFilterEmitter(param, localVarMap, (n) => this._isStringValueName(n), (message, reason) => this._recordExprBF101(message, reason)));
|
|
188767
188754
|
}
|
|
188768
188755
|
convertTemplateLiteralPartsToKolon(literalParts) {
|
|
188769
188756
|
const parts = [];
|
|
@@ -188808,8 +188795,8 @@ ${name}="<: ${val} :>"
|
|
|
188808
188795
|
const hasTaggedTemplate = /[A-Za-z_$][\w$]*\s*`/.test(probe);
|
|
188809
188796
|
if (!startsAsObjectLiteral && !hasTaggedTemplate)
|
|
188810
188797
|
return false;
|
|
188811
|
-
const parsed =
|
|
188812
|
-
const support =
|
|
188798
|
+
const parsed = parseExpression2(expr.trim());
|
|
188799
|
+
const support = isSupported(parsed);
|
|
188813
188800
|
if (parsed.kind !== "unsupported" && support.supported)
|
|
188814
188801
|
return false;
|
|
188815
188802
|
const reason = support.reason ?? (parsed.kind === "unsupported" ? parsed.reason : undefined);
|
|
@@ -188856,7 +188843,7 @@ ${reason}` : "";
|
|
|
188856
188843
|
const trimmed = expr.trim();
|
|
188857
188844
|
if (trimmed === "")
|
|
188858
188845
|
return "''";
|
|
188859
|
-
parsed =
|
|
188846
|
+
parsed = parseExpression2(trimmed);
|
|
188860
188847
|
}
|
|
188861
188848
|
if (parsed.kind === "call") {
|
|
188862
188849
|
for (const matcher of this._loweringMatchers) {
|
|
@@ -188867,7 +188854,7 @@ ${reason}` : "";
|
|
|
188867
188854
|
}
|
|
188868
188855
|
}
|
|
188869
188856
|
}
|
|
188870
|
-
const support =
|
|
188857
|
+
const support = isSupported(parsed);
|
|
188871
188858
|
if (!support.supported) {
|
|
188872
188859
|
this.errors.push({
|
|
188873
188860
|
code: "BF101",
|
|
@@ -188895,7 +188882,7 @@ Options:
|
|
|
188895
188882
|
return this.stringValueNames.has(name);
|
|
188896
188883
|
}
|
|
188897
188884
|
parseUndefinedAlternateTernary(expr) {
|
|
188898
|
-
const parsed =
|
|
188885
|
+
const parsed = parseExpression2(expr.trim());
|
|
188899
188886
|
if (parsed?.kind !== "conditional")
|
|
188900
188887
|
return null;
|
|
188901
188888
|
const alt = parsed.alternate;
|