@barefootjs/jinja 0.35.0 → 0.35.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/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/vite.js +28 -28
- package/package.json +5 -5
- package/src/conformance-pins.ts +13 -7
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,eAuE7B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -189239,9 +189239,9 @@ var conformancePins = {
|
|
|
189239
189239
|
"filter-nested-find-predicate": [{ code: "BF101", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2320" }],
|
|
189240
189240
|
"date-method-uncatalogued": [{ code: "BF021", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2356" }],
|
|
189241
189241
|
"rich-prop-client-read": [{ code: "BF049", severity: "error", issue: "https://github.com/piconic-ai/barefootjs/issues/2648" }],
|
|
189242
|
-
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error"
|
|
189243
|
-
"jsx-element-prop-array": [{ code: "BF021", severity: "error"
|
|
189244
|
-
"namespace-import-primitive": [{ code: "BF013", severity: "error"
|
|
189242
|
+
"jsx-element-prop-ternary": [{ code: "BF021", severity: "error" }],
|
|
189243
|
+
"jsx-element-prop-array": [{ code: "BF021", severity: "error" }],
|
|
189244
|
+
"namespace-import-primitive": [{ code: "BF013", severity: "error" }]
|
|
189245
189245
|
};
|
|
189246
189246
|
// src/render-divergences.ts
|
|
189247
189247
|
var renderDivergences = {};
|
package/dist/vite.js
CHANGED
|
@@ -8,7 +8,7 @@ import { devModuleUrl, loadManifest, resolveDevOrigin, resolveScriptAssets, toPo
|
|
|
8
8
|
import ts25 from "typescript";
|
|
9
9
|
|
|
10
10
|
// ../jsx/src/analyzer.ts
|
|
11
|
-
import
|
|
11
|
+
import ts11 from "typescript";
|
|
12
12
|
|
|
13
13
|
// ../jsx/src/expression-parser.ts
|
|
14
14
|
import ts from "typescript";
|
|
@@ -2389,14 +2389,17 @@ function freshCounters() {
|
|
|
2389
2389
|
}
|
|
2390
2390
|
|
|
2391
2391
|
// ../jsx/src/analyzer-context.ts
|
|
2392
|
-
import
|
|
2392
|
+
import ts10 from "typescript";
|
|
2393
2393
|
|
|
2394
2394
|
// ../jsx/src/strip-types.ts
|
|
2395
2395
|
import ts8 from "typescript";
|
|
2396
2396
|
|
|
2397
|
+
// ../jsx/src/reactivity-checker.ts
|
|
2398
|
+
import ts9 from "typescript";
|
|
2399
|
+
|
|
2397
2400
|
// ../jsx/src/analyzer-context.ts
|
|
2398
|
-
var _typePrinter =
|
|
2399
|
-
var _blankTypeSourceFile =
|
|
2401
|
+
var _typePrinter = ts10.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
2402
|
+
var _blankTypeSourceFile = ts10.createSourceFile("__bf_types__.ts", "", ts10.ScriptTarget.Latest);
|
|
2400
2403
|
|
|
2401
2404
|
// ../jsx/src/errors.ts
|
|
2402
2405
|
var ErrorCodes = {
|
|
@@ -2629,46 +2632,46 @@ function extractFreeIdentifiersFromNode(node) {
|
|
|
2629
2632
|
const ids = new Set;
|
|
2630
2633
|
const boundNames = new Set;
|
|
2631
2634
|
function addBindingNames(name, out) {
|
|
2632
|
-
if (
|
|
2635
|
+
if (ts11.isIdentifier(name))
|
|
2633
2636
|
out.push(name.text);
|
|
2634
|
-
else if (
|
|
2637
|
+
else if (ts11.isObjectBindingPattern(name))
|
|
2635
2638
|
name.elements.forEach((e) => addBindingNames(e.name, out));
|
|
2636
|
-
else if (
|
|
2639
|
+
else if (ts11.isArrayBindingPattern(name))
|
|
2637
2640
|
name.elements.forEach((e) => {
|
|
2638
|
-
if (!
|
|
2641
|
+
if (!ts11.isOmittedExpression(e))
|
|
2639
2642
|
addBindingNames(e.name, out);
|
|
2640
2643
|
});
|
|
2641
2644
|
}
|
|
2642
2645
|
function visit(n) {
|
|
2643
|
-
if (
|
|
2646
|
+
if (ts11.isTypeNode(n))
|
|
2644
2647
|
return;
|
|
2645
|
-
if (
|
|
2648
|
+
if (ts11.isIdentifier(n)) {
|
|
2646
2649
|
const parent = n.parent;
|
|
2647
|
-
if (parent &&
|
|
2650
|
+
if (parent && ts11.isPropertyAccessExpression(parent) && parent.name === n)
|
|
2648
2651
|
return;
|
|
2649
|
-
if (parent &&
|
|
2652
|
+
if (parent && ts11.isPropertyAssignment(parent) && parent.name === n)
|
|
2650
2653
|
return;
|
|
2651
|
-
if (parent &&
|
|
2654
|
+
if (parent && ts11.isParameter(parent) && parent.name === n)
|
|
2652
2655
|
return;
|
|
2653
|
-
if (parent &&
|
|
2656
|
+
if (parent && ts11.isVariableDeclaration(parent) && parent.name === n)
|
|
2654
2657
|
return;
|
|
2655
2658
|
if (boundNames.has(n.text))
|
|
2656
2659
|
return;
|
|
2657
2660
|
ids.add(n.text);
|
|
2658
2661
|
return;
|
|
2659
2662
|
}
|
|
2660
|
-
if (
|
|
2663
|
+
if (ts11.isArrowFunction(n)) {
|
|
2661
2664
|
const params = [];
|
|
2662
2665
|
for (const p of n.parameters)
|
|
2663
2666
|
addBindingNames(p.name, params);
|
|
2664
2667
|
for (const name of params)
|
|
2665
2668
|
boundNames.add(name);
|
|
2666
|
-
|
|
2669
|
+
ts11.forEachChild(n, visit);
|
|
2667
2670
|
for (const name of params)
|
|
2668
2671
|
boundNames.delete(name);
|
|
2669
2672
|
return;
|
|
2670
2673
|
}
|
|
2671
|
-
|
|
2674
|
+
ts11.forEachChild(n, visit);
|
|
2672
2675
|
}
|
|
2673
2676
|
visit(node);
|
|
2674
2677
|
return ids;
|
|
@@ -2742,7 +2745,7 @@ function preambleAnalysisTemplateText(p) {
|
|
|
2742
2745
|
}
|
|
2743
2746
|
|
|
2744
2747
|
// ../jsx/src/module-exports.ts
|
|
2745
|
-
import
|
|
2748
|
+
import ts12 from "typescript";
|
|
2746
2749
|
function formatParamWithType(p) {
|
|
2747
2750
|
const rest = p.isRest ? "..." : "";
|
|
2748
2751
|
const optional = p.optional ? "?" : "";
|
|
@@ -2777,21 +2780,21 @@ function findAssignedNames(bodyText, candidates) {
|
|
|
2777
2780
|
const assigned = new Set;
|
|
2778
2781
|
if (candidates.size === 0)
|
|
2779
2782
|
return assigned;
|
|
2780
|
-
const sf =
|
|
2783
|
+
const sf = ts12.createSourceFile("bf-assignment-scan.tsx", bodyText, ts12.ScriptTarget.Latest, false, ts12.ScriptKind.TSX);
|
|
2781
2784
|
const record = (target) => {
|
|
2782
|
-
if (
|
|
2785
|
+
if (ts12.isIdentifier(target) && candidates.has(target.text)) {
|
|
2783
2786
|
assigned.add(target.text);
|
|
2784
2787
|
}
|
|
2785
2788
|
};
|
|
2786
2789
|
const visit = (node) => {
|
|
2787
|
-
if (
|
|
2790
|
+
if (ts12.isBinaryExpression(node) && isAssignmentOperator(node.operatorToken.kind)) {
|
|
2788
2791
|
record(node.left);
|
|
2789
|
-
} else if ((
|
|
2792
|
+
} else if ((ts12.isPrefixUnaryExpression(node) || ts12.isPostfixUnaryExpression(node)) && (node.operator === ts12.SyntaxKind.PlusPlusToken || node.operator === ts12.SyntaxKind.MinusMinusToken)) {
|
|
2790
2793
|
record(node.operand);
|
|
2791
2794
|
}
|
|
2792
|
-
|
|
2795
|
+
ts12.forEachChild(node, visit);
|
|
2793
2796
|
};
|
|
2794
|
-
|
|
2797
|
+
ts12.forEachChild(sf, visit);
|
|
2795
2798
|
return assigned;
|
|
2796
2799
|
}
|
|
2797
2800
|
function closeOverWritersOfMutableBindings(primaryRefs, declarations, mutableNames) {
|
|
@@ -2814,12 +2817,9 @@ function closeOverWritersOfMutableBindings(primaryRefs, declarations, mutableNam
|
|
|
2814
2817
|
return reachable;
|
|
2815
2818
|
}
|
|
2816
2819
|
function isAssignmentOperator(kind) {
|
|
2817
|
-
return kind >=
|
|
2820
|
+
return kind >= ts12.SyntaxKind.FirstAssignment && kind <= ts12.SyntaxKind.LastAssignment;
|
|
2818
2821
|
}
|
|
2819
2822
|
|
|
2820
|
-
// ../jsx/src/reactivity-checker.ts
|
|
2821
|
-
import ts12 from "typescript";
|
|
2822
|
-
|
|
2823
2823
|
// ../jsx/src/free-refs.ts
|
|
2824
2824
|
import ts13 from "typescript";
|
|
2825
2825
|
var _bindingMapCache = new WeakMap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jinja",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"description": "Jinja2 adapter for BarefootJS — compiles IR to .jinja templates and ships the Python BarefootJS rendering runtime; runs under any Python web framework (Flask, etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"directory": "packages/adapter-jinja"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@barefootjs/shared": "0.35.
|
|
56
|
+
"@barefootjs/shared": "0.35.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@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.35.
|
|
74
|
-
"@barefootjs/vite": "0.35.
|
|
75
|
-
"@barefootjs/client": "0.35.
|
|
73
|
+
"@barefootjs/jsx": "0.35.1",
|
|
74
|
+
"@barefootjs/vite": "0.35.1",
|
|
75
|
+
"@barefootjs/client": "0.35.1",
|
|
76
76
|
"typescript": "^5.0.0",
|
|
77
77
|
"vite": "^6.0.0"
|
|
78
78
|
}
|
package/src/conformance-pins.ts
CHANGED
|
@@ -60,18 +60,24 @@ export const conformancePins: ConformancePins = {
|
|
|
60
60
|
// above is refused.
|
|
61
61
|
'date-method-uncatalogued': [{ code: 'BF021', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2356' }],
|
|
62
62
|
'rich-prop-client-read': [{ code: 'BF049', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2648' }],
|
|
63
|
-
//
|
|
63
|
+
// A ternary or array literal LITERALLY WRAPPING JSX at a non-children prop
|
|
64
64
|
// position (e.g. `header={cond ? <a/> : <b/>}`) is refused ahead of
|
|
65
65
|
// `adapter.generate()` in the shared jsx-to-ir.ts phase, so it is pinned
|
|
66
66
|
// identically on every adapter (including Hono) — same reasoning as
|
|
67
|
-
// `rich-prop-client-read` above.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
67
|
+
// `rich-prop-client-read` above. This is the permanent, intended behavior
|
|
68
|
+
// (formerly tracked as #2667, closed): the issue's own acceptance criteria
|
|
69
|
+
// treated a loud refusal as fully resolving the silent-divergence bug, so
|
|
70
|
+
// no open issue tracks further work here.
|
|
71
|
+
'jsx-element-prop-ternary': [{ code: 'BF021', severity: 'error' }],
|
|
72
|
+
'jsx-element-prop-array': [{ code: 'BF021', severity: 'error' }],
|
|
73
|
+
// A reactive primitive invoked through a namespace import
|
|
71
74
|
// (`import * as bf from '@barefootjs/client'`, `bf.createSignal(...)`)
|
|
72
75
|
// that the analyzer's checker-less fast path cannot recognize refuses
|
|
73
76
|
// loudly (BF013) instead of silently dropping the declaration — fired
|
|
74
77
|
// in the shared analyzer pass ahead of any adapter's `adapter.generate()`,
|
|
75
|
-
// so all nine adapters (including Hono) pin this identically.
|
|
76
|
-
|
|
78
|
+
// so all nine adapters (including Hono) pin this identically. A compile
|
|
79
|
+
// that supplies a shared `ts.Program` (e.g. via `@barefootjs/vite`)
|
|
80
|
+
// resolves the primitive normally and never reaches this refusal (formerly
|
|
81
|
+
// tracked as #2771, closed) — no open issue tracks further work.
|
|
82
|
+
'namespace-import-primitive': [{ code: 'BF013', severity: 'error' }],
|
|
77
83
|
}
|