@barefootjs/xslate 0.33.4 → 0.34.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/emit-context.d.ts +11 -1
- package/dist/adapter/emit-context.d.ts.map +1 -1
- package/dist/adapter/expr/emitters.d.ts +11 -1
- package/dist/adapter/expr/emitters.d.ts.map +1 -1
- package/dist/adapter/index.js +33 -23
- package/dist/adapter/xslate-adapter.d.ts +16 -0
- package/dist/adapter/xslate-adapter.d.ts.map +1 -1
- package/dist/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +38 -25
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +197 -135
- package/lib/BarefootJS/Backend/Xslate.pm +1 -1
- package/package.json +5 -5
- package/src/adapter/emit-context.ts +12 -1
- package/src/adapter/expr/emitters.ts +33 -0
- package/src/adapter/xslate-adapter.ts +52 -43
- package/src/conformance-pins.ts +11 -0
- package/src/render-divergences.ts +4 -1
|
@@ -17,13 +17,23 @@
|
|
|
17
17
|
* genuinely needs it, so the seam documents the real cross-module coupling
|
|
18
18
|
* rather than re-exposing the whole adapter.
|
|
19
19
|
*/
|
|
20
|
-
import type { ParsedExpr, CompilerError, IRMetadata } from '@barefootjs/jsx';
|
|
20
|
+
import type { ParsedExpr, CompilerError, IRMetadata, LoweringMatcher } from '@barefootjs/jsx';
|
|
21
21
|
export interface XslateEmitContext {
|
|
22
22
|
/**
|
|
23
23
|
* (#1922) Local binding names the request-scoped `searchParams()` env signal
|
|
24
24
|
* is imported under. Non-empty enables the env-signal method-call lowering.
|
|
25
25
|
*/
|
|
26
26
|
readonly _searchParamsLocals: Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Registered lowering-plugin matchers (#2057), bound to this component's
|
|
29
|
+
* metadata at init. Read by `XslateTopLevelEmitter`'s `lowering` seam
|
|
30
|
+
* (#2843) so a registered call — the built-in `queryHref`, or any
|
|
31
|
+
* userland plugin — is recognised no matter where it sits in an
|
|
32
|
+
* expression tree (a ternary branch, a template-literal interpolation, …),
|
|
33
|
+
* not only when it's the call the adapter's own top-level conversion
|
|
34
|
+
* entry point (`convertExpressionToKolon`) is asked to lower directly.
|
|
35
|
+
*/
|
|
36
|
+
readonly _loweringMatchers: readonly LoweringMatcher[];
|
|
27
37
|
/**
|
|
28
38
|
* Inline a module-scope pure string-literal const by name as the resolved
|
|
29
39
|
* literal value, or null when the name is not such a const.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-context.d.ts","sourceRoot":"","sources":["../../src/adapter/emit-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"emit-context.d.ts","sourceRoot":"","sources":["../../src/adapter/emit-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE7F,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAEzC;;;;;;;;OAQG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,eAAe,EAAE,CAAA;IAEtD;;;OAGG;IACH,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAEtD,oFAAoF;IACpF,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAEjD;;;OAGG;IACH,2BAA2B,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAE3E,uEAAuE;IACvE,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAEzC,wDAAwD;IACxD,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAExD,yEAAyE;IACzE,4BAA4B,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACtE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAE9B,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;IAEhC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAA;IAErD,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAExC;;;;;;;;;OASG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;CACvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAA;CACnG"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - `XslateTopLevelEmitter` — top-level / per-render-var context; depends on
|
|
11
11
|
* the adapter only through the narrow `XslateEmitContext` seam.
|
|
12
12
|
*/
|
|
13
|
-
import { type ParsedExprEmitter, type ArrayMethod, type LiteralType, type ParsedExpr, type ObjectLiteralProperty, type FlatDepth, type TemplatePart } from '@barefootjs/jsx';
|
|
13
|
+
import { type ParsedExprEmitter, type LoweringEmitter, type ArrayMethod, type LiteralType, type ParsedExpr, type ObjectLiteralProperty, type FlatDepth, type TemplatePart } from '@barefootjs/jsx';
|
|
14
14
|
import type { XslateEmitContext } from '../emit-context.ts';
|
|
15
15
|
/**
|
|
16
16
|
* Lowering for the predicate body of a filter / every / some / find, plus the
|
|
@@ -63,6 +63,16 @@ export declare class XslateFilterEmitter implements ParsedExprEmitter {
|
|
|
63
63
|
export declare class XslateTopLevelEmitter implements ParsedExprEmitter {
|
|
64
64
|
private readonly ctx;
|
|
65
65
|
constructor(ctx: XslateEmitContext);
|
|
66
|
+
/**
|
|
67
|
+
* Registered-lowering seam (#2843): `emitParsedExpr`'s shared `call` case
|
|
68
|
+
* tries every matcher here BEFORE `call()` itself, so a registered call
|
|
69
|
+
* (the built-in `queryHref`, or any userland plugin) is recognised no
|
|
70
|
+
* matter where it sits in the tree. `render` is what used to live inline
|
|
71
|
+
* in `XslateAdapter.convertExpressionToKolon` before the object-literal
|
|
72
|
+
* support-gate refusal (`checkSupport`'s `call` arm, now itself
|
|
73
|
+
* registry-aware) made the pre-gate special case unnecessary.
|
|
74
|
+
*/
|
|
75
|
+
get lowering(): LoweringEmitter;
|
|
66
76
|
identifier(name: string): string;
|
|
67
77
|
literal(value: string | number | boolean | null, literalType: LiteralType): string;
|
|
68
78
|
member(object: ParsedExpr, property: string, _computed: boolean, _optional: 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,EAGL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"emitters.d.ts","sourceRoot":"","sources":["../../../src/adapter/expr/emitters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAGpB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,YAAY,EAMlB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IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,UAAU,EACrB,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAC9B,MAAM,CAER;IAED,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,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,UAAU,EAAE,qBAAqB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,GAAG,MAAM,CAoBxG;CACF"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -187306,8 +187306,6 @@ import {
|
|
|
187306
187306
|
lookupStaticRecordLiteral,
|
|
187307
187307
|
searchParamsLocalNames,
|
|
187308
187308
|
prepareLoweringMatchers,
|
|
187309
|
-
queryHrefArgs,
|
|
187310
|
-
isValidHelperId,
|
|
187311
187309
|
sortComparatorFromArrow as sortComparatorFromArrow2,
|
|
187312
187310
|
isLowerableLoopDestructure,
|
|
187313
187311
|
isDangerousInnerHtmlAttr,
|
|
@@ -187316,7 +187314,8 @@ import {
|
|
|
187316
187314
|
dangerousInnerHtmlDiagnostic,
|
|
187317
187315
|
resolveStaticLoopSource,
|
|
187318
187316
|
derivesScopeFromSlot,
|
|
187319
|
-
BindingScope
|
|
187317
|
+
BindingScope,
|
|
187318
|
+
buildImportAliasMap
|
|
187320
187319
|
} from "@barefootjs/jsx";
|
|
187321
187320
|
|
|
187322
187321
|
// src/adapter/boolean-result.ts
|
|
@@ -187639,7 +187638,9 @@ import {
|
|
|
187639
187638
|
isStringConcatBinary,
|
|
187640
187639
|
identifierPath,
|
|
187641
187640
|
matchSearchParamsMethodCall,
|
|
187642
|
-
sortComparatorFromArrow
|
|
187641
|
+
sortComparatorFromArrow,
|
|
187642
|
+
queryHrefArgs,
|
|
187643
|
+
isValidHelperId
|
|
187643
187644
|
} from "@barefootjs/jsx";
|
|
187644
187645
|
var PREDICATE_METHODS = new Set([
|
|
187645
187646
|
"filter",
|
|
@@ -187771,6 +187772,21 @@ class XslateTopLevelEmitter {
|
|
|
187771
187772
|
constructor(ctx) {
|
|
187772
187773
|
this.ctx = ctx;
|
|
187773
187774
|
}
|
|
187775
|
+
get lowering() {
|
|
187776
|
+
return {
|
|
187777
|
+
matchers: this.ctx._loweringMatchers,
|
|
187778
|
+
render: (node, emit) => {
|
|
187779
|
+
if (node.kind === "guard-list" && node.helper === "query") {
|
|
187780
|
+
const qArgs = queryHrefArgs(node, emit);
|
|
187781
|
+
return `$bf.query(${qArgs.join(", ")})`;
|
|
187782
|
+
}
|
|
187783
|
+
if (node.kind === "helper-call" && isValidHelperId(node.helper)) {
|
|
187784
|
+
return `$bf.${node.helper}(${node.args.map(emit).join(", ")})`;
|
|
187785
|
+
}
|
|
187786
|
+
return null;
|
|
187787
|
+
}
|
|
187788
|
+
};
|
|
187789
|
+
}
|
|
187774
187790
|
identifier(name) {
|
|
187775
187791
|
if (name === "undefined" || name === "null")
|
|
187776
187792
|
return "nil";
|
|
@@ -188262,6 +188278,7 @@ class XslateAdapter extends BaseAdapter {
|
|
|
188262
188278
|
localConstants = [];
|
|
188263
188279
|
scope = BindingScope.EMPTY;
|
|
188264
188280
|
nullableOptionalProps = new Set;
|
|
188281
|
+
importAliases = new Map;
|
|
188265
188282
|
constructor(options = {}) {
|
|
188266
188283
|
super();
|
|
188267
188284
|
this.options = {
|
|
@@ -188282,6 +188299,7 @@ class XslateAdapter extends BaseAdapter {
|
|
|
188282
188299
|
this.moduleStringConsts = collectModuleStringConsts(ir.metadata.localConstants);
|
|
188283
188300
|
this._searchParamsLocals = searchParamsLocalNames(ir.metadata);
|
|
188284
188301
|
this._loweringMatchers = prepareLoweringMatchers(ir.metadata);
|
|
188302
|
+
this.importAliases = buildImportAliasMap(ir.metadata.imports ?? []);
|
|
188285
188303
|
this.errors = [];
|
|
188286
188304
|
this.childrenCaptureCounter = 0;
|
|
188287
188305
|
if (!options?.siblingTemplatesRegistered) {
|
|
@@ -188749,7 +188767,8 @@ ${childrenUnderLoop}` : childrenUnderLoop;
|
|
|
188749
188767
|
childrenCaptureCounter = 0;
|
|
188750
188768
|
presenceVarCounter = 0;
|
|
188751
188769
|
toTemplateName(componentName) {
|
|
188752
|
-
|
|
188770
|
+
const declaredName = this.importAliases.get(componentName) ?? componentName;
|
|
188771
|
+
return declaredName.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
|
|
188753
188772
|
}
|
|
188754
188773
|
renderIfStatement(ifStmt) {
|
|
188755
188774
|
const condition = this.convertExpressionToKolon(ifStmt.condition);
|
|
@@ -188827,8 +188846,8 @@ ${body}
|
|
|
188827
188846
|
{
|
|
188828
188847
|
const m = this.parseUndefinedAlternateTernary(value.expr);
|
|
188829
188848
|
if (m) {
|
|
188830
|
-
const cond = this.convertExpressionToKolon(m.
|
|
188831
|
-
const val = this.convertExpressionToKolon(m.
|
|
188849
|
+
const cond = this.convertExpressionToKolon("", m.testParsed);
|
|
188850
|
+
const val = this.convertExpressionToKolon("", m.consequentParsed);
|
|
188832
188851
|
return `
|
|
188833
188852
|
: if (${cond}) {
|
|
188834
188853
|
${name}="<: ${val} :>"
|
|
@@ -188961,7 +188980,7 @@ ${name}="<: ${val} :>"
|
|
|
188961
188980
|
if (!startsAsObjectLiteral && !hasTaggedTemplate)
|
|
188962
188981
|
return false;
|
|
188963
188982
|
const parsed = parseExpression2(expr.trim());
|
|
188964
|
-
const support = isSupported(parsed);
|
|
188983
|
+
const support = isSupported(parsed, { loweringMatchers: this._loweringMatchers });
|
|
188965
188984
|
if (parsed.kind !== "unsupported" && support.supported)
|
|
188966
188985
|
return false;
|
|
188967
188986
|
const reason = support.reason ?? (parsed.kind === "unsupported" ? parsed.reason : undefined);
|
|
@@ -188981,6 +189000,7 @@ ${reason}` : "";
|
|
|
188981
189000
|
get emitCtx() {
|
|
188982
189001
|
return {
|
|
188983
189002
|
_searchParamsLocals: this._searchParamsLocals,
|
|
189003
|
+
_loweringMatchers: this._loweringMatchers,
|
|
188984
189004
|
_resolveModuleStringConst: (name) => this._resolveModuleStringConst(name),
|
|
188985
189005
|
_resolveLiteralConst: (name) => this._resolveLiteralConst(name),
|
|
188986
189006
|
_resolveStaticRecordLiteral: (o, k) => this._resolveStaticRecordLiteral(o, k),
|
|
@@ -189011,20 +189031,8 @@ ${reason}` : "";
|
|
|
189011
189031
|
return "''";
|
|
189012
189032
|
parsed = parseExpression2(trimmed);
|
|
189013
189033
|
}
|
|
189014
|
-
|
|
189015
|
-
|
|
189016
|
-
const node = matcher(parsed.callee, parsed.args);
|
|
189017
|
-
if (node?.kind === "guard-list" && node.helper === "query") {
|
|
189018
|
-
const qArgs = queryHrefArgs(node, (n) => this.renderParsedExprToKolon(n));
|
|
189019
|
-
return `$bf.query(${qArgs.join(", ")})`;
|
|
189020
|
-
}
|
|
189021
|
-
if (node?.kind === "helper-call" && isValidHelperId(node.helper)) {
|
|
189022
|
-
const argsX = node.args.map((a) => this.renderParsedExprToKolon(a));
|
|
189023
|
-
return `$bf.${node.helper}(${argsX.join(", ")})`;
|
|
189024
|
-
}
|
|
189025
|
-
}
|
|
189026
|
-
}
|
|
189027
|
-
const support = pos === "value" ? isSupportedValue(parsed) : isSupported(parsed);
|
|
189034
|
+
const supportOpts = { loweringMatchers: this._loweringMatchers };
|
|
189035
|
+
const support = pos === "value" ? isSupportedValue(parsed, supportOpts) : isSupported(parsed, supportOpts);
|
|
189028
189036
|
if (!support.supported) {
|
|
189029
189037
|
this.errors.push({
|
|
189030
189038
|
code: "BF101",
|
|
@@ -189061,7 +189069,9 @@ Options:
|
|
|
189061
189069
|
return null;
|
|
189062
189070
|
return {
|
|
189063
189071
|
condition: exprToString(parsed.test),
|
|
189064
|
-
consequent: exprToString(parsed.consequent)
|
|
189072
|
+
consequent: exprToString(parsed.consequent),
|
|
189073
|
+
testParsed: parsed.test,
|
|
189074
|
+
consequentParsed: parsed.consequent
|
|
189065
189075
|
};
|
|
189066
189076
|
}
|
|
189067
189077
|
isBooleanTypedPropRef(expr) {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { ComponentIR, IRNode, IRElement, IRText, IRExpression, IRConditional, IRLoop, IRComponent, IRFragment, IRSlot, IRIfStatement, IRProvider, IRAsync, TemplatePrimitiveRegistry } from '@barefootjs/jsx';
|
|
23
23
|
import { BaseAdapter, type AdapterOutput, type AdapterGenerateOptions, type IRNodeEmitter, type EmitIRNode } from '@barefootjs/jsx';
|
|
24
|
+
import type { ParsedExpr } from '@barefootjs/jsx';
|
|
24
25
|
import type { XslateRenderCtx } from './lib/types.ts';
|
|
25
26
|
export type { XslateAdapterOptions } from './lib/types.ts';
|
|
26
27
|
import type { XslateAdapterOptions } from './lib/types.ts';
|
|
@@ -117,6 +118,19 @@ export declare class XslateAdapter extends BaseAdapter implements IRNodeEmitter<
|
|
|
117
118
|
* defaulted, rest, and concrete-primitive props.
|
|
118
119
|
*/
|
|
119
120
|
private nullableOptionalProps;
|
|
121
|
+
/**
|
|
122
|
+
* Local alias -> declared/exported name for imported components (#2822,
|
|
123
|
+
* the SSR-side counterpart of #2777's client-JS registry-key fix). A
|
|
124
|
+
* child referenced under an import alias (`import { Foo as Bar }`,
|
|
125
|
+
* `<Bar/>`) must build its cross-template call against the child's own
|
|
126
|
+
* declared name (`Foo`, what `foo.tsx` registers its Kolon partial as) —
|
|
127
|
+
* never the caller-local binding. Xslate's unresolved-reference case
|
|
128
|
+
* silently drops the child rather than raising, so this was the worst
|
|
129
|
+
* variant of the bug class. Built once per compile from
|
|
130
|
+
* `ir.metadata.imports` via the shared `buildImportAliasMap`
|
|
131
|
+
* (`@barefootjs/jsx`) and read by `toTemplateName`.
|
|
132
|
+
*/
|
|
133
|
+
private importAliases;
|
|
120
134
|
constructor(options?: XslateAdapterOptions);
|
|
121
135
|
generate(ir: ComponentIR, options?: AdapterGenerateOptions): AdapterOutput;
|
|
122
136
|
private generateScriptRegistrations;
|
|
@@ -319,6 +333,8 @@ export declare class XslateAdapter extends BaseAdapter implements IRNodeEmitter<
|
|
|
319
333
|
parseUndefinedAlternateTernary(expr: string): {
|
|
320
334
|
condition: string;
|
|
321
335
|
consequent: string;
|
|
336
|
+
testParsed: ParsedExpr;
|
|
337
|
+
consequentParsed: ParsedExpr;
|
|
322
338
|
} | null;
|
|
323
339
|
isBooleanTypedPropRef(expr: string): boolean;
|
|
324
340
|
/** Position-accurate loop-bound-name check — see `this.scope`'s docstring. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xslate-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/xslate-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,OAAO,EAKP,yBAAyB,EAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"xslate-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/xslate-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAAa,EACb,MAAM,EACN,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version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"conformance-pins.d.ts","sourceRoot":"","sources":["../src/conformance-pins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,eAiE7B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -187306,8 +187306,6 @@ import {
|
|
|
187306
187306
|
lookupStaticRecordLiteral,
|
|
187307
187307
|
searchParamsLocalNames,
|
|
187308
187308
|
prepareLoweringMatchers,
|
|
187309
|
-
queryHrefArgs,
|
|
187310
|
-
isValidHelperId,
|
|
187311
187309
|
sortComparatorFromArrow as sortComparatorFromArrow2,
|
|
187312
187310
|
isLowerableLoopDestructure,
|
|
187313
187311
|
isDangerousInnerHtmlAttr,
|
|
@@ -187316,7 +187314,8 @@ import {
|
|
|
187316
187314
|
dangerousInnerHtmlDiagnostic,
|
|
187317
187315
|
resolveStaticLoopSource,
|
|
187318
187316
|
derivesScopeFromSlot,
|
|
187319
|
-
BindingScope
|
|
187317
|
+
BindingScope,
|
|
187318
|
+
buildImportAliasMap
|
|
187320
187319
|
} from "@barefootjs/jsx";
|
|
187321
187320
|
|
|
187322
187321
|
// src/adapter/boolean-result.ts
|
|
@@ -187639,7 +187638,9 @@ import {
|
|
|
187639
187638
|
isStringConcatBinary,
|
|
187640
187639
|
identifierPath,
|
|
187641
187640
|
matchSearchParamsMethodCall,
|
|
187642
|
-
sortComparatorFromArrow
|
|
187641
|
+
sortComparatorFromArrow,
|
|
187642
|
+
queryHrefArgs,
|
|
187643
|
+
isValidHelperId
|
|
187643
187644
|
} from "@barefootjs/jsx";
|
|
187644
187645
|
var PREDICATE_METHODS = new Set([
|
|
187645
187646
|
"filter",
|
|
@@ -187771,6 +187772,21 @@ class XslateTopLevelEmitter {
|
|
|
187771
187772
|
constructor(ctx) {
|
|
187772
187773
|
this.ctx = ctx;
|
|
187773
187774
|
}
|
|
187775
|
+
get lowering() {
|
|
187776
|
+
return {
|
|
187777
|
+
matchers: this.ctx._loweringMatchers,
|
|
187778
|
+
render: (node, emit) => {
|
|
187779
|
+
if (node.kind === "guard-list" && node.helper === "query") {
|
|
187780
|
+
const qArgs = queryHrefArgs(node, emit);
|
|
187781
|
+
return `$bf.query(${qArgs.join(", ")})`;
|
|
187782
|
+
}
|
|
187783
|
+
if (node.kind === "helper-call" && isValidHelperId(node.helper)) {
|
|
187784
|
+
return `$bf.${node.helper}(${node.args.map(emit).join(", ")})`;
|
|
187785
|
+
}
|
|
187786
|
+
return null;
|
|
187787
|
+
}
|
|
187788
|
+
};
|
|
187789
|
+
}
|
|
187774
187790
|
identifier(name) {
|
|
187775
187791
|
if (name === "undefined" || name === "null")
|
|
187776
187792
|
return "nil";
|
|
@@ -188262,6 +188278,7 @@ class XslateAdapter extends BaseAdapter {
|
|
|
188262
188278
|
localConstants = [];
|
|
188263
188279
|
scope = BindingScope.EMPTY;
|
|
188264
188280
|
nullableOptionalProps = new Set;
|
|
188281
|
+
importAliases = new Map;
|
|
188265
188282
|
constructor(options = {}) {
|
|
188266
188283
|
super();
|
|
188267
188284
|
this.options = {
|
|
@@ -188282,6 +188299,7 @@ class XslateAdapter extends BaseAdapter {
|
|
|
188282
188299
|
this.moduleStringConsts = collectModuleStringConsts(ir.metadata.localConstants);
|
|
188283
188300
|
this._searchParamsLocals = searchParamsLocalNames(ir.metadata);
|
|
188284
188301
|
this._loweringMatchers = prepareLoweringMatchers(ir.metadata);
|
|
188302
|
+
this.importAliases = buildImportAliasMap(ir.metadata.imports ?? []);
|
|
188285
188303
|
this.errors = [];
|
|
188286
188304
|
this.childrenCaptureCounter = 0;
|
|
188287
188305
|
if (!options?.siblingTemplatesRegistered) {
|
|
@@ -188749,7 +188767,8 @@ ${childrenUnderLoop}` : childrenUnderLoop;
|
|
|
188749
188767
|
childrenCaptureCounter = 0;
|
|
188750
188768
|
presenceVarCounter = 0;
|
|
188751
188769
|
toTemplateName(componentName) {
|
|
188752
|
-
|
|
188770
|
+
const declaredName = this.importAliases.get(componentName) ?? componentName;
|
|
188771
|
+
return declaredName.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
|
|
188753
188772
|
}
|
|
188754
188773
|
renderIfStatement(ifStmt) {
|
|
188755
188774
|
const condition = this.convertExpressionToKolon(ifStmt.condition);
|
|
@@ -188827,8 +188846,8 @@ ${body}
|
|
|
188827
188846
|
{
|
|
188828
188847
|
const m = this.parseUndefinedAlternateTernary(value.expr);
|
|
188829
188848
|
if (m) {
|
|
188830
|
-
const cond = this.convertExpressionToKolon(m.
|
|
188831
|
-
const val = this.convertExpressionToKolon(m.
|
|
188849
|
+
const cond = this.convertExpressionToKolon("", m.testParsed);
|
|
188850
|
+
const val = this.convertExpressionToKolon("", m.consequentParsed);
|
|
188832
188851
|
return `
|
|
188833
188852
|
: if (${cond}) {
|
|
188834
188853
|
${name}="<: ${val} :>"
|
|
@@ -188961,7 +188980,7 @@ ${name}="<: ${val} :>"
|
|
|
188961
188980
|
if (!startsAsObjectLiteral && !hasTaggedTemplate)
|
|
188962
188981
|
return false;
|
|
188963
188982
|
const parsed = parseExpression2(expr.trim());
|
|
188964
|
-
const support = isSupported(parsed);
|
|
188983
|
+
const support = isSupported(parsed, { loweringMatchers: this._loweringMatchers });
|
|
188965
188984
|
if (parsed.kind !== "unsupported" && support.supported)
|
|
188966
188985
|
return false;
|
|
188967
188986
|
const reason = support.reason ?? (parsed.kind === "unsupported" ? parsed.reason : undefined);
|
|
@@ -188981,6 +189000,7 @@ ${reason}` : "";
|
|
|
188981
189000
|
get emitCtx() {
|
|
188982
189001
|
return {
|
|
188983
189002
|
_searchParamsLocals: this._searchParamsLocals,
|
|
189003
|
+
_loweringMatchers: this._loweringMatchers,
|
|
188984
189004
|
_resolveModuleStringConst: (name) => this._resolveModuleStringConst(name),
|
|
188985
189005
|
_resolveLiteralConst: (name) => this._resolveLiteralConst(name),
|
|
188986
189006
|
_resolveStaticRecordLiteral: (o, k) => this._resolveStaticRecordLiteral(o, k),
|
|
@@ -189011,20 +189031,8 @@ ${reason}` : "";
|
|
|
189011
189031
|
return "''";
|
|
189012
189032
|
parsed = parseExpression2(trimmed);
|
|
189013
189033
|
}
|
|
189014
|
-
|
|
189015
|
-
|
|
189016
|
-
const node = matcher(parsed.callee, parsed.args);
|
|
189017
|
-
if (node?.kind === "guard-list" && node.helper === "query") {
|
|
189018
|
-
const qArgs = queryHrefArgs(node, (n) => this.renderParsedExprToKolon(n));
|
|
189019
|
-
return `$bf.query(${qArgs.join(", ")})`;
|
|
189020
|
-
}
|
|
189021
|
-
if (node?.kind === "helper-call" && isValidHelperId(node.helper)) {
|
|
189022
|
-
const argsX = node.args.map((a) => this.renderParsedExprToKolon(a));
|
|
189023
|
-
return `$bf.${node.helper}(${argsX.join(", ")})`;
|
|
189024
|
-
}
|
|
189025
|
-
}
|
|
189026
|
-
}
|
|
189027
|
-
const support = pos === "value" ? isSupportedValue(parsed) : isSupported(parsed);
|
|
189034
|
+
const supportOpts = { loweringMatchers: this._loweringMatchers };
|
|
189035
|
+
const support = pos === "value" ? isSupportedValue(parsed, supportOpts) : isSupported(parsed, supportOpts);
|
|
189028
189036
|
if (!support.supported) {
|
|
189029
189037
|
this.errors.push({
|
|
189030
189038
|
code: "BF101",
|
|
@@ -189061,7 +189069,9 @@ Options:
|
|
|
189061
189069
|
return null;
|
|
189062
189070
|
return {
|
|
189063
189071
|
condition: exprToString(parsed.test),
|
|
189064
|
-
consequent: exprToString(parsed.consequent)
|
|
189072
|
+
consequent: exprToString(parsed.consequent),
|
|
189073
|
+
testParsed: parsed.test,
|
|
189074
|
+
consequentParsed: parsed.consequent
|
|
189065
189075
|
};
|
|
189066
189076
|
}
|
|
189067
189077
|
isBooleanTypedPropRef(expr) {
|
|
@@ -189163,10 +189173,13 @@ var conformancePins = {
|
|
|
189163
189173
|
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
189164
189174
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }],
|
|
189165
189175
|
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2667" }],
|
|
189166
|
-
"jsx-element-prop-array": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2667" }]
|
|
189176
|
+
"jsx-element-prop-array": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2667" }],
|
|
189177
|
+
"namespace-import-primitive": [{ code: "BF013", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2771" }]
|
|
189167
189178
|
};
|
|
189168
189179
|
// src/render-divergences.ts
|
|
189169
|
-
var renderDivergences = {
|
|
189180
|
+
var renderDivergences = {
|
|
189181
|
+
"aliased-loop-source": "A `.map()` loop whose source is a local const alias of a signal getter (`const items__alias = items`) SSRs an empty `<ul>` on real Text::Xslate — 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."
|
|
189182
|
+
};
|
|
189170
189183
|
export {
|
|
189171
189184
|
xslateAdapter,
|
|
189172
189185
|
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;AAexD,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;AAexD,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAA"}
|