@barefootjs/go-template 0.31.4 → 0.31.6
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/go-template-adapter.d.ts +109 -8
- package/dist/adapter/go-template-adapter.d.ts.map +1 -1
- package/dist/adapter/index.js +47 -43
- package/dist/adapter/lib/compile-state.d.ts +6 -2
- package/dist/adapter/lib/compile-state.d.ts.map +1 -1
- package/dist/adapter/lib/types.d.ts +15 -0
- package/dist/adapter/lib/types.d.ts.map +1 -1
- package/dist/conformance-pins.d.ts.map +1 -1
- package/dist/index.js +61 -49
- package/dist/render-divergences.d.ts +9 -3
- package/dist/render-divergences.d.ts.map +1 -1
- package/dist/vite.js +167 -118
- package/package.json +5 -5
- package/src/adapter/analysis/component-tree.ts +1 -0
- package/src/adapter/go-template-adapter.ts +217 -76
- package/src/adapter/lib/compile-state.ts +6 -2
- package/src/adapter/lib/types.ts +15 -0
- package/src/conformance-pins.ts +21 -5
- package/src/render-divergences.ts +29 -3
package/src/conformance-pins.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const conformancePins: ConformancePins = {
|
|
|
15
15
|
// JS-runtime target runs it, a DSL adapter surfaces BF021 + `/* @client */`.
|
|
16
16
|
// See spec/callback-fidelity.md.
|
|
17
17
|
'filter-typeof-predicate': [{ code: 'BF021', severity: 'error' }],
|
|
18
|
+
// Array-builder `.map()` body (imperative `push`-into-array preamble):
|
|
19
|
+
// BF021, with a verified `/* @client */` escape — `map-array-builder-
|
|
20
|
+
// body-client` (#2613). See that fixture's docstring.
|
|
18
21
|
'map-array-builder-body': [{ code: 'BF021', severity: 'error' }],
|
|
19
22
|
'map-array-builder-escaping': [{ code: 'BF021', severity: 'error' }],
|
|
20
23
|
// `.fill(value)` mutates the receiver in place — no template lowering
|
|
@@ -80,14 +83,29 @@ export const conformancePins: ConformancePins = {
|
|
|
80
83
|
// array bound to such a const. See the `renderLoop` comment at the check
|
|
81
84
|
// site; Jinja / ERB apply the same narrow check for the same reason.
|
|
82
85
|
'static-array-from-props': [
|
|
83
|
-
{
|
|
86
|
+
{
|
|
87
|
+
code: 'BF101',
|
|
88
|
+
severity: 'error',
|
|
89
|
+
issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
|
|
90
|
+
},
|
|
84
91
|
],
|
|
85
92
|
// Same computed-const array as above — the destructure param itself no
|
|
86
93
|
// longer contributes a diagnostic, and BF103 (sibling-imported child
|
|
87
94
|
// component in the loop body) no longer fires either now that the
|
|
88
95
|
// conformance harness passes `siblingTemplatesRegistered: true` (#2205).
|
|
96
|
+
// #2627 graduated: the `/* @client */` twin
|
|
97
|
+
// (`static-array-from-props-with-component-client`) now renders clean on
|
|
98
|
+
// real Go (its clientOnly nested `<Tag>` loop is excluded from the
|
|
99
|
+
// Input/Props/NewProps codegen instead of colliding with the `tags` prop's
|
|
100
|
+
// own field — see `GoTemplateAdapter.isOrphanedClientOnlyNested`), so this
|
|
101
|
+
// adapter has a verified escape for this fixture like every other one —
|
|
102
|
+
// no more `unescapable` line.
|
|
89
103
|
'static-array-from-props-with-component': [
|
|
90
|
-
{
|
|
104
|
+
{
|
|
105
|
+
code: 'BF101',
|
|
106
|
+
severity: 'error',
|
|
107
|
+
issue: 'https://github.com/piconic-ai/barefootjs/issues/2321',
|
|
108
|
+
},
|
|
91
109
|
],
|
|
92
110
|
// (`style-3-signals` graduated alongside `style-object-dynamic` — see note
|
|
93
111
|
// above; the `style={{ … }}` object now lowers to a CSS string.)
|
|
@@ -106,9 +124,7 @@ export const conformancePins: ConformancePins = {
|
|
|
106
124
|
'filter-nested-callback-predicate': [
|
|
107
125
|
{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
|
|
108
126
|
],
|
|
109
|
-
'filter-nested-find-predicate': [
|
|
110
|
-
{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' },
|
|
111
|
-
],
|
|
127
|
+
'filter-nested-find-predicate': [{ code: 'BF101', severity: 'error', issue: 'https://github.com/piconic-ai/barefootjs/issues/2320' }],
|
|
112
128
|
// #1310 / #2087: rest destructure in .map() callback. `isLowerableLoopDestructure`
|
|
113
129
|
// now admits every shape this fixture family exercises — each fixed/rest
|
|
114
130
|
// binding resolves via `buildSegmentAccessor`/`buildDestructureBindingMap`
|
|
@@ -13,9 +13,15 @@
|
|
|
13
13
|
* the docs compatibility-matrix page. Graduating an entry means fixing
|
|
14
14
|
* the adapter (or the shared compiler layer) and deleting the line.
|
|
15
15
|
*
|
|
16
|
-
* Empty — the file's last live entry (`
|
|
17
|
-
* graduated:
|
|
18
|
-
*
|
|
16
|
+
* Empty — the file's last live entry (`static-array-from-props-with-
|
|
17
|
+
* component-client`, #2627) graduated: a clientOnly child-component loop
|
|
18
|
+
* whose array is neither a signal/memo nor a direct prop reference (e.g.
|
|
19
|
+
* `Object.entries(props.tags).filter(...)` feeding a `<Tag>` loop) is now
|
|
20
|
+
* excluded entirely from the Input/Props/NewProps codegen instead of
|
|
21
|
+
* colliding with the driving prop's own field — see
|
|
22
|
+
* `GoTemplateAdapter.isOrphanedClientOnlyNested`. The caller-side composite
|
|
23
|
+
* literal for the `tags` prop now type-checks against its own `interface{}`
|
|
24
|
+
* field and `go run`s clean.
|
|
19
25
|
* Keep the file (and this header) when the set is empty — the next
|
|
20
26
|
* divergence lands here, not in a re-created file.
|
|
21
27
|
*/
|
|
@@ -23,6 +29,26 @@
|
|
|
23
29
|
import type { RenderDivergences } from '@barefootjs/jsx'
|
|
24
30
|
|
|
25
31
|
export const renderDivergences: RenderDivergences = {
|
|
32
|
+
// #2630: a prop-backed loop whose BODY is a child component renders the
|
|
33
|
+
// loop host empty — compiles clean, `go run`s clean, emits no children.
|
|
34
|
+
// Its sibling `static-array-from-props-precomputed` (same fixture,
|
|
35
|
+
// inline element body instead of a `<Tag>` child) renders correctly on
|
|
36
|
+
// every adapter, so this is specific to child-component bodies over a
|
|
37
|
+
// prop-backed array — plausibly the same missing server-side population
|
|
38
|
+
// path the `todo-app-ssr` note below describes, where
|
|
39
|
+
// `buildDynamicChildLoopSeeding` covers only the SIGNAL-backed dynamic
|
|
40
|
+
// case and a prop-backed static child loop has no analogue.
|
|
41
|
+
//
|
|
42
|
+
// This one costs a user something concrete: the BF101 diagnostic for
|
|
43
|
+
// #2321 lists pass-as-prop FIRST because it is the escape that keeps
|
|
44
|
+
// full server output, so a go-template user following that advice for a
|
|
45
|
+
// child-component loop gets an empty container at SSR with nothing
|
|
46
|
+
// reporting it. The fixture asserts the CORRECT (reference) output, so
|
|
47
|
+
// deleting this entry once the gap is fixed turns it into the
|
|
48
|
+
// regression test.
|
|
49
|
+
'static-array-from-props-with-component-precomputed':
|
|
50
|
+
'prop-backed child-component loop renders the loop host empty at SSR (https://github.com/piconic-ai/barefootjs/issues/2630)',
|
|
51
|
+
|
|
26
52
|
// `todo-app-ssr` no longer diverges (#2209). Two parts: (1) `.Todos`
|
|
27
53
|
// (the loop's DATUM slice) is already seeded straight from the caller's
|
|
28
54
|
// Input — the constructor derives it from `initialTodos`, and `[]Todo`
|