@barefootjs/jsx 0.26.4 → 0.28.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/compiler.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +941 -130
- package/dist/ir-to-client-js/client-only-elision.d.ts +103 -0
- package/dist/ir-to-client-js/client-only-elision.d.ts.map +1 -0
- package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts +6 -0
- package/dist/ir-to-client-js/control-flow/plan/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts +2 -1
- package/dist/ir-to-client-js/control-flow/plan/build-branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts +7 -0
- package/dist/ir-to-client-js/control-flow/plan/build-insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts +107 -0
- package/dist/ir-to-client-js/control-flow/plan/build-lazy-row.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts +9 -1
- package/dist/ir-to-client-js/control-flow/plan/build-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts +203 -0
- package/dist/ir-to-client-js/control-flow/plan/lazy-row-eligibility.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts +10 -0
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/shared.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/branch-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/claim-plan.d.ts +54 -0
- package/dist/ir-to-client-js/control-flow/stringify/claim-plan.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/stringify/inner-loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/insert.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts +98 -0
- package/dist/ir-to-client-js/control-flow/stringify/lazy-row.d.ts.map +1 -0
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts +5 -0
- package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts +17 -20
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts +63 -4
- package/dist/ir-to-client-js/control-flow/stringify/reactive-effects.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts +1 -1
- package/dist/ir-to-client-js/control-flow.d.ts.map +1 -1
- package/dist/ir-to-client-js/element-refs.d.ts +8 -3
- package/dist/ir-to-client-js/element-refs.d.ts.map +1 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts +8 -1
- package/dist/ir-to-client-js/emit-reactive.d.ts.map +1 -1
- package/dist/ir-to-client-js/html-template.d.ts +24 -0
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/imports.d.ts +2 -2
- package/dist/ir-to-client-js/imports.d.ts.map +1 -1
- package/dist/ir-to-client-js/reactivity.d.ts.map +1 -1
- package/dist/ir-to-client-js/types.d.ts +9 -1
- package/dist/ir-to-client-js/types.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts +1 -1
- package/dist/types.d.ts +25 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +542 -689
- package/src/__tests__/child-components-in-map.test.ts +4 -4
- package/src/__tests__/client-js-generation.test.ts +23 -12
- package/src/__tests__/composite-branch-loop.test.ts +14 -5
- package/src/__tests__/conditional-mapArray-key.test.ts +7 -1
- package/src/__tests__/create-selector.test.ts +21 -7
- package/src/__tests__/cross-file-client-signal.test.ts +5 -1
- package/src/__tests__/early-return-scope-var-ref.test.ts +10 -11
- package/src/__tests__/inline-jsx-callback.test.ts +6 -4
- package/src/__tests__/ir-jsx-props.test.ts +6 -5
- package/src/__tests__/lazy-row-eligibility.test.ts +692 -0
- package/src/__tests__/loop-branch-bare-expression-reactive-text.test.ts +98 -0
- package/src/__tests__/loop-fallback-wrap.test.ts +34 -16
- package/src/__tests__/loop-hoisted-template.test.ts +10 -6
- package/src/__tests__/module-level-signal.audit.test.ts +7 -2
- package/src/__tests__/nested-loop-conditional.test.ts +9 -7
- package/src/__tests__/nested-loop-reactive-attrs.test.ts +2 -2
- package/src/__tests__/preamble-region-patch.test.ts +18 -12
- package/src/__tests__/profile-cond-binding-ids.test.ts +3 -2
- package/src/__tests__/profile-loop-binding-ids.test.ts +4 -3
- package/src/__tests__/profile-nested-binding-ids.test.ts +11 -6
- package/src/__tests__/reactive-attrs-in-map.test.ts +6 -4
- package/src/__tests__/static-loop-csr-materialize.test.ts +6 -1
- package/src/__tests__/template-closure.test.ts +1 -1
- package/src/compiler.ts +11 -0
- package/src/index.ts +1 -0
- package/src/ir-to-client-js/client-only-elision.ts +273 -0
- package/src/ir-to-client-js/collect-elements.ts +56 -17
- package/src/ir-to-client-js/control-flow/plan/branch-loop.ts +6 -0
- package/src/ir-to-client-js/control-flow/plan/build-branch-loop.ts +35 -12
- package/src/ir-to-client-js/control-flow/plan/build-insert.ts +9 -2
- package/src/ir-to-client-js/control-flow/plan/build-lazy-row.ts +305 -0
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +44 -12
- package/src/ir-to-client-js/control-flow/plan/lazy-row-eligibility.ts +440 -0
- package/src/ir-to-client-js/control-flow/plan/loop.ts +10 -0
- package/src/ir-to-client-js/control-flow/shared.ts +1 -1
- package/src/ir-to-client-js/control-flow/stringify/branch-loop.ts +34 -4
- package/src/ir-to-client-js/control-flow/stringify/claim-plan.ts +68 -0
- package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +18 -9
- package/src/ir-to-client-js/control-flow/stringify/insert.ts +17 -11
- package/src/ir-to-client-js/control-flow/stringify/lazy-row.ts +478 -0
- package/src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts +41 -17
- package/src/ir-to-client-js/control-flow/stringify/loop.ts +71 -46
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +241 -31
- package/src/ir-to-client-js/control-flow.ts +8 -3
- package/src/ir-to-client-js/element-refs.ts +9 -11
- package/src/ir-to-client-js/emit-reactive.ts +50 -14
- package/src/ir-to-client-js/html-template.ts +29 -9
- package/src/ir-to-client-js/imports.ts +13 -4
- package/src/ir-to-client-js/reactivity.ts +3 -2
- package/src/ir-to-client-js/types.ts +10 -2
- package/src/ir-to-client-js/utils.ts +1 -1
- package/src/jsx-to-ir.ts +26 -8
- package/src/types.ts +25 -2
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
2
|
|
|
3
3
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L15 — Ternary 1`] = `
|
|
4
|
-
"import { $,
|
|
4
|
+
"import { $, __bfSlot, createComponent, createDisposableEffect, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
5
5
|
|
|
6
6
|
export function initTodoItem(__scope, _p = {}) {
|
|
7
7
|
if (!__scope) return
|
|
8
8
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
let __anchor_s0 = _s0
|
|
10
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
13
11
|
createEffect(() => {
|
|
14
12
|
const __val = String(_p.todo)
|
|
15
|
-
|
|
13
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
16
14
|
})
|
|
17
15
|
|
|
18
16
|
}
|
|
@@ -23,12 +21,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
23
21
|
if (!__scope) return
|
|
24
22
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
25
23
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
let __anchor_s0 = _s0
|
|
24
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
29
25
|
createEffect(() => {
|
|
30
26
|
const __val = String(_p.item)
|
|
31
|
-
|
|
27
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
32
28
|
})
|
|
33
29
|
|
|
34
30
|
}
|
|
@@ -58,11 +54,8 @@ export function initExample(__scope, _p = {}) {
|
|
|
58
54
|
template: () => { const __slots = []; return { html: \`<p bf-c="s0" bf="s2"><!--bf:s1-->\${__bfSlot(count(), __slots)}<!--/--> items</p>\`, slots: __slots } },
|
|
59
55
|
bindEvents: (__branchScope, { isFirstRun: __bfFirstRun = false } = {}) => {
|
|
60
56
|
const __disposers = []
|
|
61
|
-
|
|
62
|
-
__disposers.push(createDisposableEffect(() => {
|
|
63
|
-
const __val = count()
|
|
64
|
-
__anchor_s1 = __bfText(__anchor_s1, __val)
|
|
65
|
-
}))
|
|
57
|
+
const __bfw_s1 = lazySlots(__branchScope, [{ id: 's1', kind: 'markup', path: [] }])
|
|
58
|
+
__disposers.push(createDisposableEffect(() => { __bfw_s1('s1', escapeTextOrNode(count())) }))
|
|
66
59
|
return () => __disposers.forEach(d => d())
|
|
67
60
|
}
|
|
68
61
|
}, {
|
|
@@ -78,18 +71,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
78
71
|
`;
|
|
79
72
|
|
|
80
73
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L18 — Logical AND 1`] = `
|
|
81
|
-
"import { $, $c,
|
|
74
|
+
"import { $, $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, insert, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
82
75
|
|
|
83
76
|
export function initTodoItem(__scope, _p = {}) {
|
|
84
77
|
if (!__scope) return
|
|
85
78
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
86
79
|
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
let __anchor_s0 = _s0
|
|
80
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
90
81
|
createEffect(() => {
|
|
91
82
|
const __val = String(_p.todo)
|
|
92
|
-
|
|
83
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
93
84
|
})
|
|
94
85
|
|
|
95
86
|
}
|
|
@@ -100,12 +91,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
100
91
|
if (!__scope) return
|
|
101
92
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
102
93
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
let __anchor_s0 = _s0
|
|
94
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
106
95
|
createEffect(() => {
|
|
107
96
|
const __val = String(_p.item)
|
|
108
|
-
|
|
97
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
109
98
|
})
|
|
110
99
|
|
|
111
100
|
}
|
|
@@ -154,18 +143,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
154
143
|
`;
|
|
155
144
|
|
|
156
145
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L31 — (no label) 1`] = `
|
|
157
|
-
"import { $,
|
|
146
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
158
147
|
|
|
159
148
|
export function initTodoItem(__scope, _p = {}) {
|
|
160
149
|
if (!__scope) return
|
|
161
150
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
162
151
|
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
let __anchor_s0 = _s0
|
|
152
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
166
153
|
createEffect(() => {
|
|
167
154
|
const __val = String(_p.todo)
|
|
168
|
-
|
|
155
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
169
156
|
})
|
|
170
157
|
|
|
171
158
|
}
|
|
@@ -176,12 +163,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
176
163
|
if (!__scope) return
|
|
177
164
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
178
165
|
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
let __anchor_s0 = _s0
|
|
166
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
182
167
|
createEffect(() => {
|
|
183
168
|
const __val = String(_p.item)
|
|
184
|
-
|
|
169
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
185
170
|
})
|
|
186
171
|
|
|
187
172
|
}
|
|
@@ -219,18 +204,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
219
204
|
`;
|
|
220
205
|
|
|
221
206
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L40 — ✅ Simple predicate 1`] = `
|
|
222
|
-
"import { $,
|
|
207
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
223
208
|
|
|
224
209
|
export function initTodoItem(__scope, _p = {}) {
|
|
225
210
|
if (!__scope) return
|
|
226
211
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
227
212
|
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
let __anchor_s0 = _s0
|
|
213
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
231
214
|
createEffect(() => {
|
|
232
215
|
const __val = String(_p.todo)
|
|
233
|
-
|
|
216
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
234
217
|
})
|
|
235
218
|
|
|
236
219
|
}
|
|
@@ -241,12 +224,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
241
224
|
if (!__scope) return
|
|
242
225
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
243
226
|
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
let __anchor_s0 = _s0
|
|
227
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
247
228
|
createEffect(() => {
|
|
248
229
|
const __val = String(_p.item)
|
|
249
|
-
|
|
230
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
250
231
|
})
|
|
251
232
|
|
|
252
233
|
}
|
|
@@ -284,18 +265,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
284
265
|
`;
|
|
285
266
|
|
|
286
267
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L45 — ✅ Block body with simple statements — also works 1`] = `
|
|
287
|
-
"import { $,
|
|
268
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
288
269
|
|
|
289
270
|
export function initTodoItem(__scope, _p = {}) {
|
|
290
271
|
if (!__scope) return
|
|
291
272
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
292
273
|
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
let __anchor_s0 = _s0
|
|
274
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
296
275
|
createEffect(() => {
|
|
297
276
|
const __val = String(_p.todo)
|
|
298
|
-
|
|
277
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
299
278
|
})
|
|
300
279
|
|
|
301
280
|
}
|
|
@@ -306,12 +285,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
306
285
|
if (!__scope) return
|
|
307
286
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
308
287
|
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
let __anchor_s0 = _s0
|
|
288
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
312
289
|
createEffect(() => {
|
|
313
290
|
const __val = String(_p.item)
|
|
314
|
-
|
|
291
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
315
292
|
})
|
|
316
293
|
|
|
317
294
|
}
|
|
@@ -359,18 +336,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
359
336
|
`;
|
|
360
337
|
|
|
361
338
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L59 — ✅ Projection — works on every adapter 1`] = `
|
|
362
|
-
"import { $,
|
|
339
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray, patchLeaf } from '@barefootjs/client/runtime'
|
|
363
340
|
|
|
364
341
|
export function initTodoItem(__scope, _p = {}) {
|
|
365
342
|
if (!__scope) return
|
|
366
343
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
367
344
|
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
let __anchor_s0 = _s0
|
|
345
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
371
346
|
createEffect(() => {
|
|
372
347
|
const __val = String(_p.todo)
|
|
373
|
-
|
|
348
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
374
349
|
})
|
|
375
350
|
|
|
376
351
|
}
|
|
@@ -381,12 +356,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
381
356
|
if (!__scope) return
|
|
382
357
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
383
358
|
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
let __anchor_s0 = _s0
|
|
359
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
387
360
|
createEffect(() => {
|
|
388
361
|
const __val = String(_p.item)
|
|
389
|
-
|
|
362
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
390
363
|
})
|
|
391
364
|
|
|
392
365
|
}
|
|
@@ -431,18 +404,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
431
404
|
`;
|
|
432
405
|
|
|
433
406
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L64 — ✅ Statement body — JS-runtime adapters; /* @client */ on Go/Mojo etc. 1`] = `
|
|
434
|
-
"import { $,
|
|
407
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray, patchLeaf } from '@barefootjs/client/runtime'
|
|
435
408
|
|
|
436
409
|
export function initTodoItem(__scope, _p = {}) {
|
|
437
410
|
if (!__scope) return
|
|
438
411
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
439
412
|
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
let __anchor_s0 = _s0
|
|
413
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
443
414
|
createEffect(() => {
|
|
444
415
|
const __val = String(_p.todo)
|
|
445
|
-
|
|
416
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
446
417
|
})
|
|
447
418
|
|
|
448
419
|
}
|
|
@@ -453,12 +424,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
453
424
|
if (!__scope) return
|
|
454
425
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
455
426
|
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
let __anchor_s0 = _s0
|
|
427
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
459
428
|
createEffect(() => {
|
|
460
429
|
const __val = String(_p.item)
|
|
461
|
-
|
|
430
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
462
431
|
})
|
|
463
432
|
|
|
464
433
|
}
|
|
@@ -509,18 +478,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
509
478
|
`;
|
|
510
479
|
|
|
511
480
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L74 — ✅ Sort then render 1`] = `
|
|
512
|
-
"import { $,
|
|
481
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
513
482
|
|
|
514
483
|
export function initTodoItem(__scope, _p = {}) {
|
|
515
484
|
if (!__scope) return
|
|
516
485
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
517
486
|
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
let __anchor_s0 = _s0
|
|
487
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
521
488
|
createEffect(() => {
|
|
522
489
|
const __val = String(_p.todo)
|
|
523
|
-
|
|
490
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
524
491
|
})
|
|
525
492
|
|
|
526
493
|
}
|
|
@@ -531,12 +498,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
531
498
|
if (!__scope) return
|
|
532
499
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
533
500
|
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
let __anchor_s0 = _s0
|
|
501
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
537
502
|
createEffect(() => {
|
|
538
503
|
const __val = String(_p.item)
|
|
539
|
-
|
|
504
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
540
505
|
})
|
|
541
506
|
|
|
542
507
|
}
|
|
@@ -574,18 +539,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
574
539
|
`;
|
|
575
540
|
|
|
576
541
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L79 — ✅ Filter, sort, then render 1`] = `
|
|
577
|
-
"import { $,
|
|
542
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
578
543
|
|
|
579
544
|
export function initTodoItem(__scope, _p = {}) {
|
|
580
545
|
if (!__scope) return
|
|
581
546
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
582
547
|
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
let __anchor_s0 = _s0
|
|
548
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
586
549
|
createEffect(() => {
|
|
587
550
|
const __val = String(_p.todo)
|
|
588
|
-
|
|
551
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
589
552
|
})
|
|
590
553
|
|
|
591
554
|
}
|
|
@@ -596,12 +559,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
596
559
|
if (!__scope) return
|
|
597
560
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
598
561
|
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
let __anchor_s0 = _s0
|
|
562
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
602
563
|
createEffect(() => {
|
|
603
564
|
const __val = String(_p.item)
|
|
604
|
-
|
|
565
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
605
566
|
})
|
|
606
567
|
|
|
607
568
|
}
|
|
@@ -639,18 +600,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
639
600
|
`;
|
|
640
601
|
|
|
641
602
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L84 — ✅ Multi-key: sort by price, break ties by name 1`] = `
|
|
642
|
-
"import { $,
|
|
603
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
643
604
|
|
|
644
605
|
export function initTodoItem(__scope, _p = {}) {
|
|
645
606
|
if (!__scope) return
|
|
646
607
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
647
608
|
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
let __anchor_s0 = _s0
|
|
609
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
651
610
|
createEffect(() => {
|
|
652
611
|
const __val = String(_p.todo)
|
|
653
|
-
|
|
612
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
654
613
|
})
|
|
655
614
|
|
|
656
615
|
}
|
|
@@ -661,12 +620,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
661
620
|
if (!__scope) return
|
|
662
621
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
663
622
|
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
let __anchor_s0 = _s0
|
|
623
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
667
624
|
createEffect(() => {
|
|
668
625
|
const __val = String(_p.item)
|
|
669
|
-
|
|
626
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
670
627
|
})
|
|
671
628
|
|
|
672
629
|
}
|
|
@@ -704,18 +661,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
704
661
|
`;
|
|
705
662
|
|
|
706
663
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L89 — ✅ Relational ternary 1`] = `
|
|
707
|
-
"import { $,
|
|
664
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
708
665
|
|
|
709
666
|
export function initTodoItem(__scope, _p = {}) {
|
|
710
667
|
if (!__scope) return
|
|
711
668
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
712
669
|
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
let __anchor_s0 = _s0
|
|
670
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
716
671
|
createEffect(() => {
|
|
717
672
|
const __val = String(_p.todo)
|
|
718
|
-
|
|
673
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
719
674
|
})
|
|
720
675
|
|
|
721
676
|
}
|
|
@@ -726,12 +681,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
726
681
|
if (!__scope) return
|
|
727
682
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
728
683
|
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
let __anchor_s0 = _s0
|
|
684
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
732
685
|
createEffect(() => {
|
|
733
686
|
const __val = String(_p.item)
|
|
734
|
-
|
|
687
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
735
688
|
})
|
|
736
689
|
|
|
737
690
|
}
|
|
@@ -769,18 +722,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
769
722
|
`;
|
|
770
723
|
|
|
771
724
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L100 — (no label) 1`] = `
|
|
772
|
-
"import { $,
|
|
725
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
773
726
|
|
|
774
727
|
export function initTodoItem(__scope, _p = {}) {
|
|
775
728
|
if (!__scope) return
|
|
776
729
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
777
730
|
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
let __anchor_s0 = _s0
|
|
731
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
781
732
|
createEffect(() => {
|
|
782
733
|
const __val = String(_p.todo)
|
|
783
|
-
|
|
734
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
784
735
|
})
|
|
785
736
|
|
|
786
737
|
}
|
|
@@ -791,12 +742,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
791
742
|
if (!__scope) return
|
|
792
743
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
793
744
|
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
let __anchor_s0 = _s0
|
|
745
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
797
746
|
createEffect(() => {
|
|
798
747
|
const __val = String(_p.item)
|
|
799
|
-
|
|
748
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
800
749
|
})
|
|
801
750
|
|
|
802
751
|
}
|
|
@@ -833,18 +782,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
833
782
|
`;
|
|
834
783
|
|
|
835
784
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L142 — ✅ Nested \`.filter()\` / \`.map()\` now compiles everywhere 1`] = `
|
|
836
|
-
"import {
|
|
785
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
837
786
|
|
|
838
787
|
export function initTodoItem(__scope, _p = {}) {
|
|
839
788
|
if (!__scope) return
|
|
840
789
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
841
790
|
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
let __anchor_s0 = _s0
|
|
791
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
845
792
|
createEffect(() => {
|
|
846
793
|
const __val = String(_p.todo)
|
|
847
|
-
|
|
794
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
848
795
|
})
|
|
849
796
|
|
|
850
797
|
}
|
|
@@ -855,12 +802,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
855
802
|
if (!__scope) return
|
|
856
803
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
857
804
|
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
let __anchor_s0 = _s0
|
|
805
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
861
806
|
createEffect(() => {
|
|
862
807
|
const __val = String(_p.item)
|
|
863
|
-
|
|
808
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
864
809
|
})
|
|
865
810
|
|
|
866
811
|
}
|
|
@@ -884,12 +829,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
884
829
|
const [accepted] = createSignal(false)
|
|
885
830
|
const [text, setText] = createSignal('')
|
|
886
831
|
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
let __anchor_s0 = _s0
|
|
832
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
890
833
|
createEffect(() => {
|
|
891
834
|
const __val = items().filter(x => x.tags.filter(t => t.active).length > 0).map(t => t.name)
|
|
892
|
-
|
|
835
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
893
836
|
})
|
|
894
837
|
|
|
895
838
|
}
|
|
@@ -899,18 +842,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
899
842
|
`;
|
|
900
843
|
|
|
901
844
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L149 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
902
|
-
"import {
|
|
845
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
903
846
|
|
|
904
847
|
export function initTodoItem(__scope, _p = {}) {
|
|
905
848
|
if (!__scope) return
|
|
906
849
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
907
850
|
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
let __anchor_s0 = _s0
|
|
851
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
911
852
|
createEffect(() => {
|
|
912
853
|
const __val = String(_p.todo)
|
|
913
|
-
|
|
854
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
914
855
|
})
|
|
915
856
|
|
|
916
857
|
}
|
|
@@ -921,12 +862,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
921
862
|
if (!__scope) return
|
|
922
863
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
923
864
|
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
let __anchor_s0 = _s0
|
|
865
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
927
866
|
createEffect(() => {
|
|
928
867
|
const __val = String(_p.item)
|
|
929
|
-
|
|
868
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
930
869
|
})
|
|
931
870
|
|
|
932
871
|
}
|
|
@@ -950,12 +889,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
950
889
|
const [accepted] = createSignal(false)
|
|
951
890
|
const [text, setText] = createSignal('')
|
|
952
891
|
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
let __anchor_s0 = _s0
|
|
892
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
956
893
|
createEffect(() => {
|
|
957
894
|
const __val = items().filter(x => x.tags.some(t => t.active)).map(t => t.name)
|
|
958
|
-
|
|
895
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
959
896
|
})
|
|
960
897
|
|
|
961
898
|
}
|
|
@@ -965,18 +902,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
965
902
|
`;
|
|
966
903
|
|
|
967
904
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L152 — ✅ Add /* @client */ to evaluate on the client 1`] = `
|
|
968
|
-
"import {
|
|
905
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
969
906
|
|
|
970
907
|
export function initTodoItem(__scope, _p = {}) {
|
|
971
908
|
if (!__scope) return
|
|
972
909
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
973
910
|
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
let __anchor_s0 = _s0
|
|
911
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
977
912
|
createEffect(() => {
|
|
978
913
|
const __val = String(_p.todo)
|
|
979
|
-
|
|
914
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
980
915
|
})
|
|
981
916
|
|
|
982
917
|
}
|
|
@@ -987,12 +922,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
987
922
|
if (!__scope) return
|
|
988
923
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
989
924
|
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
let __anchor_s0 = _s0
|
|
925
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
993
926
|
createEffect(() => {
|
|
994
927
|
const __val = String(_p.item)
|
|
995
|
-
|
|
928
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
996
929
|
})
|
|
997
930
|
|
|
998
931
|
}
|
|
@@ -1017,29 +950,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1017
950
|
const [text, setText] = createSignal('')
|
|
1018
951
|
|
|
1019
952
|
// @client: s0
|
|
953
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1020
954
|
createEffect(() => {
|
|
1021
|
-
|
|
1022
|
-
})
|
|
955
|
+
__bfw_s0('s0', items().filter(x => x.tags.some(t => t.active)).map(t => t.name))
|
|
956
|
+
}) }
|
|
1023
957
|
|
|
1024
958
|
}
|
|
1025
959
|
|
|
1026
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
960
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1027
961
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1028
962
|
`;
|
|
1029
963
|
|
|
1030
964
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L159 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
1031
|
-
"import {
|
|
965
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1032
966
|
|
|
1033
967
|
export function initTodoItem(__scope, _p = {}) {
|
|
1034
968
|
if (!__scope) return
|
|
1035
969
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1036
970
|
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
let __anchor_s0 = _s0
|
|
971
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1040
972
|
createEffect(() => {
|
|
1041
973
|
const __val = String(_p.todo)
|
|
1042
|
-
|
|
974
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1043
975
|
})
|
|
1044
976
|
|
|
1045
977
|
}
|
|
@@ -1050,12 +982,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1050
982
|
if (!__scope) return
|
|
1051
983
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1052
984
|
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
let __anchor_s0 = _s0
|
|
985
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1056
986
|
createEffect(() => {
|
|
1057
987
|
const __val = String(_p.item)
|
|
1058
|
-
|
|
988
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1059
989
|
})
|
|
1060
990
|
|
|
1061
991
|
}
|
|
@@ -1079,12 +1009,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
1079
1009
|
const [accepted] = createSignal(false)
|
|
1080
1010
|
const [text, setText] = createSignal('')
|
|
1081
1011
|
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
let __anchor_s0 = _s0
|
|
1012
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1085
1013
|
createEffect(() => {
|
|
1086
1014
|
const __val = items().reduce((sum, x) => sum + x.price, 0)
|
|
1087
|
-
|
|
1015
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1088
1016
|
})
|
|
1089
1017
|
|
|
1090
1018
|
}
|
|
@@ -1094,18 +1022,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1094
1022
|
`;
|
|
1095
1023
|
|
|
1096
1024
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L162 — ✅ Use /* @client */ 1`] = `
|
|
1097
|
-
"import {
|
|
1025
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1098
1026
|
|
|
1099
1027
|
export function initTodoItem(__scope, _p = {}) {
|
|
1100
1028
|
if (!__scope) return
|
|
1101
1029
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1102
1030
|
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
let __anchor_s0 = _s0
|
|
1031
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1106
1032
|
createEffect(() => {
|
|
1107
1033
|
const __val = String(_p.todo)
|
|
1108
|
-
|
|
1034
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1109
1035
|
})
|
|
1110
1036
|
|
|
1111
1037
|
}
|
|
@@ -1116,12 +1042,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1116
1042
|
if (!__scope) return
|
|
1117
1043
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1118
1044
|
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
let __anchor_s0 = _s0
|
|
1045
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1122
1046
|
createEffect(() => {
|
|
1123
1047
|
const __val = String(_p.item)
|
|
1124
|
-
|
|
1048
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1125
1049
|
})
|
|
1126
1050
|
|
|
1127
1051
|
}
|
|
@@ -1146,29 +1070,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1146
1070
|
const [text, setText] = createSignal('')
|
|
1147
1071
|
|
|
1148
1072
|
// @client: s0
|
|
1073
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1149
1074
|
createEffect(() => {
|
|
1150
|
-
|
|
1151
|
-
})
|
|
1075
|
+
__bfw_s0('s0', items().reduce((sum, x) => sum + x.price, 0))
|
|
1076
|
+
}) }
|
|
1152
1077
|
|
|
1153
1078
|
}
|
|
1154
1079
|
|
|
1155
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1080
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1156
1081
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1157
1082
|
`;
|
|
1158
1083
|
|
|
1159
1084
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L179 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
1160
|
-
"import {
|
|
1085
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1161
1086
|
|
|
1162
1087
|
export function initTodoItem(__scope, _p = {}) {
|
|
1163
1088
|
if (!__scope) return
|
|
1164
1089
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1165
1090
|
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
let __anchor_s0 = _s0
|
|
1091
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1169
1092
|
createEffect(() => {
|
|
1170
1093
|
const __val = String(_p.todo)
|
|
1171
|
-
|
|
1094
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1172
1095
|
})
|
|
1173
1096
|
|
|
1174
1097
|
}
|
|
@@ -1179,12 +1102,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1179
1102
|
if (!__scope) return
|
|
1180
1103
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1181
1104
|
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
let __anchor_s0 = _s0
|
|
1105
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1185
1106
|
createEffect(() => {
|
|
1186
1107
|
const __val = String(_p.item)
|
|
1187
|
-
|
|
1108
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1188
1109
|
})
|
|
1189
1110
|
|
|
1190
1111
|
}
|
|
@@ -1208,12 +1129,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
1208
1129
|
const [accepted] = createSignal(false)
|
|
1209
1130
|
const [text, setText] = createSignal('')
|
|
1210
1131
|
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
let __anchor_s0 = _s0
|
|
1132
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1214
1133
|
createEffect(() => {
|
|
1215
1134
|
const __val = items().filter(function(x) { return x.done })
|
|
1216
|
-
|
|
1135
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1217
1136
|
})
|
|
1218
1137
|
|
|
1219
1138
|
}
|
|
@@ -1223,18 +1142,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1223
1142
|
`;
|
|
1224
1143
|
|
|
1225
1144
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L182 — ✅ Use arrow functions for adapter portability 1`] = `
|
|
1226
|
-
"import {
|
|
1145
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1227
1146
|
|
|
1228
1147
|
export function initTodoItem(__scope, _p = {}) {
|
|
1229
1148
|
if (!__scope) return
|
|
1230
1149
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1231
1150
|
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
let __anchor_s0 = _s0
|
|
1151
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1235
1152
|
createEffect(() => {
|
|
1236
1153
|
const __val = String(_p.todo)
|
|
1237
|
-
|
|
1154
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1238
1155
|
})
|
|
1239
1156
|
|
|
1240
1157
|
}
|
|
@@ -1245,12 +1162,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1245
1162
|
if (!__scope) return
|
|
1246
1163
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1247
1164
|
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
let __anchor_s0 = _s0
|
|
1165
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1251
1166
|
createEffect(() => {
|
|
1252
1167
|
const __val = String(_p.item)
|
|
1253
|
-
|
|
1168
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1254
1169
|
})
|
|
1255
1170
|
|
|
1256
1171
|
}
|
|
@@ -1274,12 +1189,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
1274
1189
|
const [accepted] = createSignal(false)
|
|
1275
1190
|
const [text, setText] = createSignal('')
|
|
1276
1191
|
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
let __anchor_s0 = _s0
|
|
1192
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1280
1193
|
createEffect(() => {
|
|
1281
1194
|
const __val = items().filter(x => x.done)
|
|
1282
|
-
|
|
1195
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1283
1196
|
})
|
|
1284
1197
|
|
|
1285
1198
|
}
|
|
@@ -1289,18 +1202,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1289
1202
|
`;
|
|
1290
1203
|
|
|
1291
1204
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L195 — ✅ Value-producing block bodies normalize (let-inline) and lower everywhere 1`] = `
|
|
1292
|
-
"import { $,
|
|
1205
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1293
1206
|
|
|
1294
1207
|
export function initTodoItem(__scope, _p = {}) {
|
|
1295
1208
|
if (!__scope) return
|
|
1296
1209
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1297
1210
|
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
let __anchor_s0 = _s0
|
|
1211
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1301
1212
|
createEffect(() => {
|
|
1302
1213
|
const __val = String(_p.todo)
|
|
1303
|
-
|
|
1214
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1304
1215
|
})
|
|
1305
1216
|
|
|
1306
1217
|
}
|
|
@@ -1311,12 +1222,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1311
1222
|
if (!__scope) return
|
|
1312
1223
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1313
1224
|
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
let __anchor_s0 = _s0
|
|
1225
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1317
1226
|
createEffect(() => {
|
|
1318
1227
|
const __val = String(_p.item)
|
|
1319
|
-
|
|
1228
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1320
1229
|
})
|
|
1321
1230
|
|
|
1322
1231
|
}
|
|
@@ -1354,18 +1263,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1354
1263
|
`;
|
|
1355
1264
|
|
|
1356
1265
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L205 — ❌ BF021 on Go/Mojo — a JS-runtime target (Hono, CSR) runs the comparator 1`] = `
|
|
1357
|
-
"import { $,
|
|
1266
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1358
1267
|
|
|
1359
1268
|
export function initTodoItem(__scope, _p = {}) {
|
|
1360
1269
|
if (!__scope) return
|
|
1361
1270
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1362
1271
|
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
let __anchor_s0 = _s0
|
|
1272
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1366
1273
|
createEffect(() => {
|
|
1367
1274
|
const __val = String(_p.todo)
|
|
1368
|
-
|
|
1275
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1369
1276
|
})
|
|
1370
1277
|
|
|
1371
1278
|
}
|
|
@@ -1376,12 +1283,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1376
1283
|
if (!__scope) return
|
|
1377
1284
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1378
1285
|
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
let __anchor_s0 = _s0
|
|
1286
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1382
1287
|
createEffect(() => {
|
|
1383
1288
|
const __val = String(_p.item)
|
|
1384
|
-
|
|
1289
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1385
1290
|
})
|
|
1386
1291
|
|
|
1387
1292
|
}
|
|
@@ -1419,18 +1324,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1419
1324
|
`;
|
|
1420
1325
|
|
|
1421
1326
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L210 — ✅ Use /* @client */ 1`] = `
|
|
1422
|
-
"import { $,
|
|
1327
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1423
1328
|
|
|
1424
1329
|
export function initTodoItem(__scope, _p = {}) {
|
|
1425
1330
|
if (!__scope) return
|
|
1426
1331
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1427
1332
|
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1430
|
-
let __anchor_s0 = _s0
|
|
1333
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1431
1334
|
createEffect(() => {
|
|
1432
1335
|
const __val = String(_p.todo)
|
|
1433
|
-
|
|
1336
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1434
1337
|
})
|
|
1435
1338
|
|
|
1436
1339
|
}
|
|
@@ -1441,12 +1344,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1441
1344
|
if (!__scope) return
|
|
1442
1345
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1443
1346
|
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
let __anchor_s0 = _s0
|
|
1347
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1447
1348
|
createEffect(() => {
|
|
1448
1349
|
const __val = String(_p.item)
|
|
1449
|
-
|
|
1350
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1450
1351
|
})
|
|
1451
1352
|
|
|
1452
1353
|
}
|
|
@@ -1484,7 +1385,7 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1484
1385
|
`;
|
|
1485
1386
|
|
|
1486
1387
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L222 — ❌ BF021 on Go/Mojo — \`byPrice\` is imported, not declared in this file 1`] = `
|
|
1487
|
-
"import { $,
|
|
1388
|
+
"import { $, createComponent, createEffect, escapeAttr, escapeText, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
1488
1389
|
import { byPrice } from './comparators'
|
|
1489
1390
|
|
|
1490
1391
|
|
|
@@ -1500,9 +1401,8 @@ export function initSortedList(__scope, _p = {}) {
|
|
|
1500
1401
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
1501
1402
|
mapArray(() => items.sort(byPrice), _s1, (item) => String(item.id), (item, __idx, __existing) => {
|
|
1502
1403
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1505
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item().name) }) }
|
|
1404
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
1405
|
+
createEffect(() => { __bfw_s0('s0', String(item().name)) })
|
|
1506
1406
|
return __el
|
|
1507
1407
|
}, 'l0')
|
|
1508
1408
|
|
|
@@ -1513,18 +1413,16 @@ export function SortedList(_p, __bfKey) { return createComponent('SortedList__b3
|
|
|
1513
1413
|
`;
|
|
1514
1414
|
|
|
1515
1415
|
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L228 — ✅ Use /* @client */, or inline / re-declare the comparator locally 1`] = `
|
|
1516
|
-
"import { $,
|
|
1416
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1517
1417
|
|
|
1518
1418
|
export function initTodoItem(__scope, _p = {}) {
|
|
1519
1419
|
if (!__scope) return
|
|
1520
1420
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1521
1421
|
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
let __anchor_s0 = _s0
|
|
1422
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1525
1423
|
createEffect(() => {
|
|
1526
1424
|
const __val = String(_p.todo)
|
|
1527
|
-
|
|
1425
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1528
1426
|
})
|
|
1529
1427
|
|
|
1530
1428
|
}
|
|
@@ -1535,12 +1433,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1535
1433
|
if (!__scope) return
|
|
1536
1434
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1537
1435
|
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1540
|
-
let __anchor_s0 = _s0
|
|
1436
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1541
1437
|
createEffect(() => {
|
|
1542
1438
|
const __val = String(_p.item)
|
|
1543
|
-
|
|
1439
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1544
1440
|
})
|
|
1545
1441
|
|
|
1546
1442
|
}
|
|
@@ -1577,19 +1473,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
1577
1473
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1578
1474
|
`;
|
|
1579
1475
|
|
|
1580
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1581
|
-
"import {
|
|
1476
|
+
exports[`docs/core/rendering/client-directive.md doc-examples L76 — Nested higher-order methods 1`] = `
|
|
1477
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1582
1478
|
|
|
1583
1479
|
export function initTodoItem(__scope, _p = {}) {
|
|
1584
1480
|
if (!__scope) return
|
|
1585
1481
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1586
1482
|
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
let __anchor_s0 = _s0
|
|
1483
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1590
1484
|
createEffect(() => {
|
|
1591
1485
|
const __val = String(_p.todo)
|
|
1592
|
-
|
|
1486
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1593
1487
|
})
|
|
1594
1488
|
|
|
1595
1489
|
}
|
|
@@ -1600,12 +1494,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1600
1494
|
if (!__scope) return
|
|
1601
1495
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1602
1496
|
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1605
|
-
let __anchor_s0 = _s0
|
|
1497
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1606
1498
|
createEffect(() => {
|
|
1607
1499
|
const __val = String(_p.item)
|
|
1608
|
-
|
|
1500
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1609
1501
|
})
|
|
1610
1502
|
|
|
1611
1503
|
}
|
|
@@ -1630,29 +1522,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1630
1522
|
const [text, setText] = createSignal('')
|
|
1631
1523
|
|
|
1632
1524
|
// @client: s0
|
|
1525
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1633
1526
|
createEffect(() => {
|
|
1634
|
-
|
|
1635
|
-
})
|
|
1527
|
+
__bfw_s0('s0', items().filter(x => x.tags().filter(t => t.active).length > 0))
|
|
1528
|
+
}) }
|
|
1636
1529
|
|
|
1637
1530
|
}
|
|
1638
1531
|
|
|
1639
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1532
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1640
1533
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1641
1534
|
`;
|
|
1642
1535
|
|
|
1643
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1644
|
-
"import {
|
|
1536
|
+
exports[`docs/core/rendering/client-directive.md doc-examples L79 — Unsupported array methods 1`] = `
|
|
1537
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1645
1538
|
|
|
1646
1539
|
export function initTodoItem(__scope, _p = {}) {
|
|
1647
1540
|
if (!__scope) return
|
|
1648
1541
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1649
1542
|
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1652
|
-
let __anchor_s0 = _s0
|
|
1543
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1653
1544
|
createEffect(() => {
|
|
1654
1545
|
const __val = String(_p.todo)
|
|
1655
|
-
|
|
1546
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1656
1547
|
})
|
|
1657
1548
|
|
|
1658
1549
|
}
|
|
@@ -1663,12 +1554,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1663
1554
|
if (!__scope) return
|
|
1664
1555
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1665
1556
|
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1668
|
-
let __anchor_s0 = _s0
|
|
1557
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1669
1558
|
createEffect(() => {
|
|
1670
1559
|
const __val = String(_p.item)
|
|
1671
|
-
|
|
1560
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1672
1561
|
})
|
|
1673
1562
|
|
|
1674
1563
|
}
|
|
@@ -1693,29 +1582,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1693
1582
|
const [text, setText] = createSignal('')
|
|
1694
1583
|
|
|
1695
1584
|
// @client: s0
|
|
1585
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1696
1586
|
createEffect(() => {
|
|
1697
|
-
|
|
1698
|
-
})
|
|
1587
|
+
__bfw_s0('s0', items().reduce((sum, x) => sum + x.price, 0))
|
|
1588
|
+
}) }
|
|
1699
1589
|
|
|
1700
1590
|
}
|
|
1701
1591
|
|
|
1702
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1592
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1703
1593
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1704
1594
|
`;
|
|
1705
1595
|
|
|
1706
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1707
|
-
"import {
|
|
1596
|
+
exports[`docs/core/rendering/client-directive.md doc-examples L91 — (no label) 1`] = `
|
|
1597
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1708
1598
|
|
|
1709
1599
|
export function initTodoItem(__scope, _p = {}) {
|
|
1710
1600
|
if (!__scope) return
|
|
1711
1601
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1712
1602
|
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1715
|
-
let __anchor_s0 = _s0
|
|
1603
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1716
1604
|
createEffect(() => {
|
|
1717
1605
|
const __val = String(_p.todo)
|
|
1718
|
-
|
|
1606
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1719
1607
|
})
|
|
1720
1608
|
|
|
1721
1609
|
}
|
|
@@ -1726,12 +1614,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1726
1614
|
if (!__scope) return
|
|
1727
1615
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1728
1616
|
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
let __anchor_s0 = _s0
|
|
1617
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1732
1618
|
createEffect(() => {
|
|
1733
1619
|
const __val = String(_p.item)
|
|
1734
|
-
|
|
1620
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1735
1621
|
})
|
|
1736
1622
|
|
|
1737
1623
|
}
|
|
@@ -1756,29 +1642,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1756
1642
|
const [text, setText] = createSignal('')
|
|
1757
1643
|
|
|
1758
1644
|
// @client: s0
|
|
1645
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0, 0], markerless: true }])
|
|
1759
1646
|
createEffect(() => {
|
|
1760
|
-
|
|
1761
|
-
})
|
|
1647
|
+
__bfw_s0('s0', todos().filter(t => !t.done).length)
|
|
1648
|
+
}) }
|
|
1762
1649
|
|
|
1763
1650
|
}
|
|
1764
1651
|
|
|
1765
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div><strong bf="s1"><!--bf
|
|
1652
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div><strong bf="s1"><!--bf:s0--><!--/--></strong></div>\` })
|
|
1766
1653
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1767
1654
|
`;
|
|
1768
1655
|
|
|
1769
1656
|
exports[`docs/core/rendering/fragment.md doc-examples L11 — (no label) 1`] = `
|
|
1770
|
-
"import {
|
|
1657
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1771
1658
|
|
|
1772
1659
|
export function initTodoItem(__scope, _p = {}) {
|
|
1773
1660
|
if (!__scope) return
|
|
1774
1661
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1775
1662
|
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
let __anchor_s0 = _s0
|
|
1663
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1779
1664
|
createEffect(() => {
|
|
1780
1665
|
const __val = String(_p.todo)
|
|
1781
|
-
|
|
1666
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1782
1667
|
})
|
|
1783
1668
|
|
|
1784
1669
|
}
|
|
@@ -1789,12 +1674,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1789
1674
|
if (!__scope) return
|
|
1790
1675
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1791
1676
|
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
let __anchor_s0 = _s0
|
|
1677
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1795
1678
|
createEffect(() => {
|
|
1796
1679
|
const __val = String(_p.item)
|
|
1797
|
-
|
|
1680
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1798
1681
|
})
|
|
1799
1682
|
|
|
1800
1683
|
}
|
|
@@ -1825,18 +1708,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1825
1708
|
`;
|
|
1826
1709
|
|
|
1827
1710
|
exports[`docs/core/rendering/fragment.md doc-examples L23 — (no label) 1`] = `
|
|
1828
|
-
"import {
|
|
1711
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1829
1712
|
|
|
1830
1713
|
export function initTodoItem(__scope, _p = {}) {
|
|
1831
1714
|
if (!__scope) return
|
|
1832
1715
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1833
1716
|
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
let __anchor_s0 = _s0
|
|
1717
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1837
1718
|
createEffect(() => {
|
|
1838
1719
|
const __val = String(_p.todo)
|
|
1839
|
-
|
|
1720
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1840
1721
|
})
|
|
1841
1722
|
|
|
1842
1723
|
}
|
|
@@ -1847,12 +1728,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1847
1728
|
if (!__scope) return
|
|
1848
1729
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1849
1730
|
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
let __anchor_s0 = _s0
|
|
1731
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1853
1732
|
createEffect(() => {
|
|
1854
1733
|
const __val = String(_p.item)
|
|
1855
|
-
|
|
1734
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1856
1735
|
})
|
|
1857
1736
|
|
|
1858
1737
|
}
|
|
@@ -2040,7 +1919,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2040
1919
|
`;
|
|
2041
1920
|
|
|
2042
1921
|
exports[`docs/core/reactivity/create-signal.md doc-examples L95 — (no label) 1`] = `
|
|
2043
|
-
"import { $,
|
|
1922
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2044
1923
|
|
|
2045
1924
|
|
|
2046
1925
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -2050,12 +1929,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
2050
1929
|
const [count, setCount] = createSignal(0)
|
|
2051
1930
|
|
|
2052
1931
|
const [_s2] = $(__scope, 's2')
|
|
2053
|
-
const [_s0] = $t(__scope, 's0')
|
|
2054
1932
|
|
|
2055
|
-
|
|
1933
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2056
1934
|
createEffect(() => {
|
|
2057
1935
|
const __val = count()
|
|
2058
|
-
|
|
1936
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2059
1937
|
})
|
|
2060
1938
|
|
|
2061
1939
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -2229,18 +2107,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2229
2107
|
`;
|
|
2230
2108
|
|
|
2231
2109
|
exports[`docs/core/reactivity/create-effect.md doc-examples L115 — (no label) 1`] = `
|
|
2232
|
-
"import {
|
|
2110
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2233
2111
|
|
|
2234
2112
|
export function initTodoItem(__scope, _p = {}) {
|
|
2235
2113
|
if (!__scope) return
|
|
2236
2114
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2237
2115
|
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2240
|
-
let __anchor_s0 = _s0
|
|
2116
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2241
2117
|
createEffect(() => {
|
|
2242
2118
|
const __val = String(_p.todo)
|
|
2243
|
-
|
|
2119
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2244
2120
|
})
|
|
2245
2121
|
|
|
2246
2122
|
}
|
|
@@ -2251,12 +2127,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2251
2127
|
if (!__scope) return
|
|
2252
2128
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2253
2129
|
|
|
2254
|
-
const
|
|
2255
|
-
|
|
2256
|
-
let __anchor_s0 = _s0
|
|
2130
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2257
2131
|
createEffect(() => {
|
|
2258
2132
|
const __val = String(_p.item)
|
|
2259
|
-
|
|
2133
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2260
2134
|
})
|
|
2261
2135
|
|
|
2262
2136
|
}
|
|
@@ -2363,18 +2237,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2363
2237
|
`;
|
|
2364
2238
|
|
|
2365
2239
|
exports[`docs/core/reactivity/create-memo.md doc-examples L60 — No memo needed 1`] = `
|
|
2366
|
-
"import {
|
|
2240
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2367
2241
|
|
|
2368
2242
|
export function initTodoItem(__scope, _p = {}) {
|
|
2369
2243
|
if (!__scope) return
|
|
2370
2244
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2371
2245
|
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2374
|
-
let __anchor_s0 = _s0
|
|
2246
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2375
2247
|
createEffect(() => {
|
|
2376
2248
|
const __val = String(_p.todo)
|
|
2377
|
-
|
|
2249
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2378
2250
|
})
|
|
2379
2251
|
|
|
2380
2252
|
}
|
|
@@ -2385,12 +2257,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2385
2257
|
if (!__scope) return
|
|
2386
2258
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2387
2259
|
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2390
|
-
let __anchor_s0 = _s0
|
|
2260
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2391
2261
|
createEffect(() => {
|
|
2392
2262
|
const __val = String(_p.item)
|
|
2393
|
-
|
|
2263
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2394
2264
|
})
|
|
2395
2265
|
|
|
2396
2266
|
}
|
|
@@ -2414,12 +2284,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
2414
2284
|
const [accepted] = createSignal(false)
|
|
2415
2285
|
const [text, setText] = createSignal('')
|
|
2416
2286
|
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2419
|
-
let __anchor_s0 = _s0
|
|
2287
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2420
2288
|
createEffect(() => {
|
|
2421
2289
|
const __val = count() * 2
|
|
2422
|
-
|
|
2290
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2423
2291
|
})
|
|
2424
2292
|
|
|
2425
2293
|
}
|
|
@@ -2670,19 +2538,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2670
2538
|
`;
|
|
2671
2539
|
|
|
2672
2540
|
exports[`docs/core/reactivity/props-reactivity.md doc-examples L82 — Parent 1`] = `
|
|
2673
|
-
"import { $c,
|
|
2541
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
2674
2542
|
import '/* @bf-child:Child */'
|
|
2675
2543
|
|
|
2676
2544
|
export function initTodoItem(__scope, _p = {}) {
|
|
2677
2545
|
if (!__scope) return
|
|
2678
2546
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2679
2547
|
|
|
2680
|
-
const
|
|
2681
|
-
|
|
2682
|
-
let __anchor_s0 = _s0
|
|
2548
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2683
2549
|
createEffect(() => {
|
|
2684
2550
|
const __val = String(_p.todo)
|
|
2685
|
-
|
|
2551
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2686
2552
|
})
|
|
2687
2553
|
|
|
2688
2554
|
}
|
|
@@ -2693,12 +2559,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2693
2559
|
if (!__scope) return
|
|
2694
2560
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2695
2561
|
|
|
2696
|
-
const
|
|
2697
|
-
|
|
2698
|
-
let __anchor_s0 = _s0
|
|
2562
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2699
2563
|
createEffect(() => {
|
|
2700
2564
|
const __val = String(_p.item)
|
|
2701
|
-
|
|
2565
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2702
2566
|
})
|
|
2703
2567
|
|
|
2704
2568
|
}
|
|
@@ -2751,18 +2615,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2751
2615
|
`;
|
|
2752
2616
|
|
|
2753
2617
|
exports[`docs/core/reactivity/props-reactivity.md doc-examples L85 — Compiled props object 1`] = `
|
|
2754
|
-
"import {
|
|
2618
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2755
2619
|
|
|
2756
2620
|
export function initTodoItem(__scope, _p = {}) {
|
|
2757
2621
|
if (!__scope) return
|
|
2758
2622
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2759
2623
|
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
let __anchor_s0 = _s0
|
|
2624
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2763
2625
|
createEffect(() => {
|
|
2764
2626
|
const __val = String(_p.todo)
|
|
2765
|
-
|
|
2627
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2766
2628
|
})
|
|
2767
2629
|
|
|
2768
2630
|
}
|
|
@@ -2773,12 +2635,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2773
2635
|
if (!__scope) return
|
|
2774
2636
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2775
2637
|
|
|
2776
|
-
const
|
|
2777
|
-
|
|
2778
|
-
let __anchor_s0 = _s0
|
|
2638
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2779
2639
|
createEffect(() => {
|
|
2780
2640
|
const __val = String(_p.item)
|
|
2781
|
-
|
|
2641
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2782
2642
|
})
|
|
2783
2643
|
|
|
2784
2644
|
}
|
|
@@ -2809,7 +2669,7 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2809
2669
|
`;
|
|
2810
2670
|
|
|
2811
2671
|
exports[`docs/core/components/component-authoring.mdx doc-examples L16 — (no label) 1`] = `
|
|
2812
|
-
"import {
|
|
2672
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2813
2673
|
|
|
2814
2674
|
|
|
2815
2675
|
export function initGreeting(__scope, _p = {}) {
|
|
@@ -2818,12 +2678,10 @@ export function initGreeting(__scope, _p = {}) {
|
|
|
2818
2678
|
|
|
2819
2679
|
const name = _p.name
|
|
2820
2680
|
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2823
|
-
let __anchor_s0 = _s0
|
|
2681
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2824
2682
|
createEffect(() => {
|
|
2825
2683
|
const __val = name
|
|
2826
|
-
|
|
2684
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2827
2685
|
})
|
|
2828
2686
|
|
|
2829
2687
|
}
|
|
@@ -2833,7 +2691,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
2833
2691
|
`;
|
|
2834
2692
|
|
|
2835
2693
|
exports[`docs/core/components/component-authoring.mdx doc-examples L29 — (no label) 1`] = `
|
|
2836
|
-
"import { $,
|
|
2694
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2837
2695
|
|
|
2838
2696
|
|
|
2839
2697
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -2843,12 +2701,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
2843
2701
|
const [count, setCount] = createSignal(0)
|
|
2844
2702
|
|
|
2845
2703
|
const [_s1] = $(__scope, 's1')
|
|
2846
|
-
const [_s0] = $t(__scope, 's0')
|
|
2847
2704
|
|
|
2848
|
-
|
|
2705
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2849
2706
|
createEffect(() => {
|
|
2850
2707
|
const __val = count()
|
|
2851
|
-
|
|
2708
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2852
2709
|
})
|
|
2853
2710
|
|
|
2854
2711
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -2940,19 +2797,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2940
2797
|
`;
|
|
2941
2798
|
|
|
2942
2799
|
exports[`docs/core/components/children-slots.md doc-examples L14 — (no label) 1`] = `
|
|
2943
|
-
"import { $c,
|
|
2800
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
2944
2801
|
import '/* @bf-child:Card */'
|
|
2945
2802
|
|
|
2946
2803
|
export function initTodoItem(__scope, _p = {}) {
|
|
2947
2804
|
if (!__scope) return
|
|
2948
2805
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2949
2806
|
|
|
2950
|
-
const
|
|
2951
|
-
|
|
2952
|
-
let __anchor_s0 = _s0
|
|
2807
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2953
2808
|
createEffect(() => {
|
|
2954
2809
|
const __val = String(_p.todo)
|
|
2955
|
-
|
|
2810
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2956
2811
|
})
|
|
2957
2812
|
|
|
2958
2813
|
}
|
|
@@ -2963,12 +2818,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2963
2818
|
if (!__scope) return
|
|
2964
2819
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2965
2820
|
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2968
|
-
let __anchor_s0 = _s0
|
|
2821
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2969
2822
|
createEffect(() => {
|
|
2970
2823
|
const __val = String(_p.item)
|
|
2971
|
-
|
|
2824
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2972
2825
|
})
|
|
2973
2826
|
|
|
2974
2827
|
}
|
|
@@ -3022,19 +2875,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3022
2875
|
`;
|
|
3023
2876
|
|
|
3024
2877
|
exports[`docs/core/components/children-slots.md doc-examples L68 — Input 1`] = `
|
|
3025
|
-
"import { $c,
|
|
2878
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3026
2879
|
import '/* @bf-child:Slot */'
|
|
3027
2880
|
|
|
3028
2881
|
export function initTodoItem(__scope, _p = {}) {
|
|
3029
2882
|
if (!__scope) return
|
|
3030
2883
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3031
2884
|
|
|
3032
|
-
const
|
|
3033
|
-
|
|
3034
|
-
let __anchor_s0 = _s0
|
|
2885
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3035
2886
|
createEffect(() => {
|
|
3036
2887
|
const __val = String(_p.todo)
|
|
3037
|
-
|
|
2888
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3038
2889
|
})
|
|
3039
2890
|
|
|
3040
2891
|
}
|
|
@@ -3045,12 +2896,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3045
2896
|
if (!__scope) return
|
|
3046
2897
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3047
2898
|
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3050
|
-
let __anchor_s0 = _s0
|
|
2899
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3051
2900
|
createEffect(() => {
|
|
3052
2901
|
const __val = String(_p.item)
|
|
3053
|
-
|
|
2902
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3054
2903
|
})
|
|
3055
2904
|
|
|
3056
2905
|
}
|
|
@@ -3086,18 +2935,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3086
2935
|
`;
|
|
3087
2936
|
|
|
3088
2937
|
exports[`docs/core/components/children-slots.md doc-examples L73 — Output 1`] = `
|
|
3089
|
-
"import { $,
|
|
2938
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
3090
2939
|
|
|
3091
2940
|
export function initTodoItem(__scope, _p = {}) {
|
|
3092
2941
|
if (!__scope) return
|
|
3093
2942
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3094
2943
|
|
|
3095
|
-
const
|
|
3096
|
-
|
|
3097
|
-
let __anchor_s0 = _s0
|
|
2944
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3098
2945
|
createEffect(() => {
|
|
3099
2946
|
const __val = String(_p.todo)
|
|
3100
|
-
|
|
2947
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3101
2948
|
})
|
|
3102
2949
|
|
|
3103
2950
|
}
|
|
@@ -3108,12 +2955,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3108
2955
|
if (!__scope) return
|
|
3109
2956
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3110
2957
|
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3113
|
-
let __anchor_s0 = _s0
|
|
2958
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3114
2959
|
createEffect(() => {
|
|
3115
2960
|
const __val = String(_p.item)
|
|
3116
|
-
|
|
2961
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3117
2962
|
})
|
|
3118
2963
|
|
|
3119
2964
|
}
|
|
@@ -3147,19 +2992,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3147
2992
|
`;
|
|
3148
2993
|
|
|
3149
2994
|
exports[`docs/core/components/children-slots.md doc-examples L86 — (no label) 1`] = `
|
|
3150
|
-
"import { $c,
|
|
2995
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3151
2996
|
import '/* @bf-child:Button */'
|
|
3152
2997
|
|
|
3153
2998
|
export function initTodoItem(__scope, _p = {}) {
|
|
3154
2999
|
if (!__scope) return
|
|
3155
3000
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3156
3001
|
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3159
|
-
let __anchor_s0 = _s0
|
|
3002
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3160
3003
|
createEffect(() => {
|
|
3161
3004
|
const __val = String(_p.todo)
|
|
3162
|
-
|
|
3005
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3163
3006
|
})
|
|
3164
3007
|
|
|
3165
3008
|
}
|
|
@@ -3170,12 +3013,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3170
3013
|
if (!__scope) return
|
|
3171
3014
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3172
3015
|
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3175
|
-
let __anchor_s0 = _s0
|
|
3016
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3176
3017
|
createEffect(() => {
|
|
3177
3018
|
const __val = String(_p.item)
|
|
3178
|
-
|
|
3019
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3179
3020
|
})
|
|
3180
3021
|
|
|
3181
3022
|
}
|
|
@@ -3211,19 +3052,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3211
3052
|
`;
|
|
3212
3053
|
|
|
3213
3054
|
exports[`docs/core/components/children-slots.md doc-examples L93 — (no label) 1`] = `
|
|
3214
|
-
"import { $c,
|
|
3055
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3215
3056
|
import '/* @bf-child:Button */'
|
|
3216
3057
|
|
|
3217
3058
|
export function initTodoItem(__scope, _p = {}) {
|
|
3218
3059
|
if (!__scope) return
|
|
3219
3060
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3220
3061
|
|
|
3221
|
-
const
|
|
3222
|
-
|
|
3223
|
-
let __anchor_s0 = _s0
|
|
3062
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3224
3063
|
createEffect(() => {
|
|
3225
3064
|
const __val = String(_p.todo)
|
|
3226
|
-
|
|
3065
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3227
3066
|
})
|
|
3228
3067
|
|
|
3229
3068
|
}
|
|
@@ -3234,12 +3073,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3234
3073
|
if (!__scope) return
|
|
3235
3074
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3236
3075
|
|
|
3237
|
-
const
|
|
3238
|
-
|
|
3239
|
-
let __anchor_s0 = _s0
|
|
3076
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3240
3077
|
createEffect(() => {
|
|
3241
3078
|
const __val = String(_p.item)
|
|
3242
|
-
|
|
3079
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3243
3080
|
})
|
|
3244
3081
|
|
|
3245
3082
|
}
|
|
@@ -3275,19 +3112,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3275
3112
|
`;
|
|
3276
3113
|
|
|
3277
3114
|
exports[`docs/core/components/children-slots.md doc-examples L109 — Dialog trigger as a custom element 1`] = `
|
|
3278
|
-
"import { $c,
|
|
3115
|
+
"import { $c, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3279
3116
|
import '/* @bf-child:DialogTrigger */'
|
|
3280
3117
|
|
|
3281
3118
|
export function initTodoItem(__scope, _p = {}) {
|
|
3282
3119
|
if (!__scope) return
|
|
3283
3120
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3284
3121
|
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3287
|
-
let __anchor_s0 = _s0
|
|
3122
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3288
3123
|
createEffect(() => {
|
|
3289
3124
|
const __val = String(_p.todo)
|
|
3290
|
-
|
|
3125
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3291
3126
|
})
|
|
3292
3127
|
|
|
3293
3128
|
}
|
|
@@ -3298,12 +3133,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3298
3133
|
if (!__scope) return
|
|
3299
3134
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3300
3135
|
|
|
3301
|
-
const
|
|
3302
|
-
|
|
3303
|
-
let __anchor_s0 = _s0
|
|
3136
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3304
3137
|
createEffect(() => {
|
|
3305
3138
|
const __val = String(_p.item)
|
|
3306
|
-
|
|
3139
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3307
3140
|
})
|
|
3308
3141
|
|
|
3309
3142
|
}
|
|
@@ -3339,7 +3172,7 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3339
3172
|
`;
|
|
3340
3173
|
|
|
3341
3174
|
exports[`docs/core/components/children-slots.md doc-examples L118 — (no label) 1`] = `
|
|
3342
|
-
"import { $c,
|
|
3175
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3343
3176
|
import '/* @bf-child:Dialog */'
|
|
3344
3177
|
import '/* @bf-child:DialogTrigger */'
|
|
3345
3178
|
import '/* @bf-child:DialogOverlay */'
|
|
@@ -3355,12 +3188,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3355
3188
|
if (!__scope) return
|
|
3356
3189
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3357
3190
|
|
|
3358
|
-
const
|
|
3359
|
-
|
|
3360
|
-
let __anchor_s0 = _s0
|
|
3191
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3361
3192
|
createEffect(() => {
|
|
3362
3193
|
const __val = String(_p.todo)
|
|
3363
|
-
|
|
3194
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3364
3195
|
})
|
|
3365
3196
|
|
|
3366
3197
|
}
|
|
@@ -3371,12 +3202,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3371
3202
|
if (!__scope) return
|
|
3372
3203
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3373
3204
|
|
|
3374
|
-
const
|
|
3375
|
-
|
|
3376
|
-
let __anchor_s0 = _s0
|
|
3205
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3377
3206
|
createEffect(() => {
|
|
3378
3207
|
const __val = String(_p.item)
|
|
3379
|
-
|
|
3208
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3380
3209
|
})
|
|
3381
3210
|
|
|
3382
3211
|
}
|
|
@@ -3429,18 +3258,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3429
3258
|
`;
|
|
3430
3259
|
|
|
3431
3260
|
exports[`docs/core/components/children-slots.md doc-examples L140 — (no label) 1`] = `
|
|
3432
|
-
"import { $,
|
|
3261
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
3433
3262
|
|
|
3434
3263
|
export function initTodoItem(__scope, _p = {}) {
|
|
3435
3264
|
if (!__scope) return
|
|
3436
3265
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3437
3266
|
|
|
3438
|
-
const
|
|
3439
|
-
|
|
3440
|
-
let __anchor_s0 = _s0
|
|
3267
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3441
3268
|
createEffect(() => {
|
|
3442
3269
|
const __val = String(_p.todo)
|
|
3443
|
-
|
|
3270
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3444
3271
|
})
|
|
3445
3272
|
|
|
3446
3273
|
}
|
|
@@ -3451,12 +3278,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3451
3278
|
if (!__scope) return
|
|
3452
3279
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3453
3280
|
|
|
3454
|
-
const
|
|
3455
|
-
|
|
3456
|
-
let __anchor_s0 = _s0
|
|
3281
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3457
3282
|
createEffect(() => {
|
|
3458
3283
|
const __val = String(_p.item)
|
|
3459
|
-
|
|
3284
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3460
3285
|
})
|
|
3461
3286
|
|
|
3462
3287
|
}
|
|
@@ -3503,18 +3328,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3503
3328
|
`;
|
|
3504
3329
|
|
|
3505
3330
|
exports[`docs/core/components/context-api.md doc-examples L40 — (no label) 1`] = `
|
|
3506
|
-
"import {
|
|
3331
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, provideContext } from '@barefootjs/client/runtime'
|
|
3507
3332
|
|
|
3508
3333
|
export function initTodoItem(__scope, _p = {}) {
|
|
3509
3334
|
if (!__scope) return
|
|
3510
3335
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3511
3336
|
|
|
3512
|
-
const
|
|
3513
|
-
|
|
3514
|
-
let __anchor_s0 = _s0
|
|
3337
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3515
3338
|
createEffect(() => {
|
|
3516
3339
|
const __val = String(_p.todo)
|
|
3517
|
-
|
|
3340
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3518
3341
|
})
|
|
3519
3342
|
|
|
3520
3343
|
}
|
|
@@ -3525,12 +3348,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3525
3348
|
if (!__scope) return
|
|
3526
3349
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3527
3350
|
|
|
3528
|
-
const
|
|
3529
|
-
|
|
3530
|
-
let __anchor_s0 = _s0
|
|
3351
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3531
3352
|
createEffect(() => {
|
|
3532
3353
|
const __val = String(_p.item)
|
|
3533
|
-
|
|
3354
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3534
3355
|
})
|
|
3535
3356
|
|
|
3536
3357
|
}
|
|
@@ -3616,7 +3437,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3616
3437
|
`;
|
|
3617
3438
|
|
|
3618
3439
|
exports[`docs/core/components/context-api.md doc-examples L94 — Usage 1`] = `
|
|
3619
|
-
"import { $c,
|
|
3440
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3620
3441
|
import '/* @bf-child:ThemeProvider */'
|
|
3621
3442
|
import '/* @bf-child:ThemedButton */'
|
|
3622
3443
|
|
|
@@ -3624,12 +3445,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3624
3445
|
if (!__scope) return
|
|
3625
3446
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3626
3447
|
|
|
3627
|
-
const
|
|
3628
|
-
|
|
3629
|
-
let __anchor_s0 = _s0
|
|
3448
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3630
3449
|
createEffect(() => {
|
|
3631
3450
|
const __val = String(_p.todo)
|
|
3632
|
-
|
|
3451
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3633
3452
|
})
|
|
3634
3453
|
|
|
3635
3454
|
}
|
|
@@ -3640,12 +3459,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3640
3459
|
if (!__scope) return
|
|
3641
3460
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3642
3461
|
|
|
3643
|
-
const
|
|
3644
|
-
|
|
3645
|
-
let __anchor_s0 = _s0
|
|
3462
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3646
3463
|
createEffect(() => {
|
|
3647
3464
|
const __val = String(_p.item)
|
|
3648
|
-
|
|
3465
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3649
3466
|
})
|
|
3650
3467
|
|
|
3651
3468
|
}
|
|
@@ -3769,7 +3586,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3769
3586
|
`;
|
|
3770
3587
|
|
|
3771
3588
|
exports[`docs/core/components/context-api.md doc-examples L170 — (no label) 1`] = `
|
|
3772
|
-
"import { $c,
|
|
3589
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3773
3590
|
import '/* @bf-child:Accordion */'
|
|
3774
3591
|
import '/* @bf-child:AccordionTrigger */'
|
|
3775
3592
|
import '/* @bf-child:AccordionContent */'
|
|
@@ -3778,12 +3595,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3778
3595
|
if (!__scope) return
|
|
3779
3596
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3780
3597
|
|
|
3781
|
-
const
|
|
3782
|
-
|
|
3783
|
-
let __anchor_s0 = _s0
|
|
3598
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3784
3599
|
createEffect(() => {
|
|
3785
3600
|
const __val = String(_p.todo)
|
|
3786
|
-
|
|
3601
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3787
3602
|
})
|
|
3788
3603
|
|
|
3789
3604
|
}
|
|
@@ -3794,12 +3609,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3794
3609
|
if (!__scope) return
|
|
3795
3610
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3796
3611
|
|
|
3797
|
-
const
|
|
3798
|
-
|
|
3799
|
-
let __anchor_s0 = _s0
|
|
3612
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3800
3613
|
createEffect(() => {
|
|
3801
3614
|
const __val = String(_p.item)
|
|
3802
|
-
|
|
3615
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3803
3616
|
})
|
|
3804
3617
|
|
|
3805
3618
|
}
|
|
@@ -3839,18 +3652,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3839
3652
|
`;
|
|
3840
3653
|
|
|
3841
3654
|
exports[`docs/core/components/context-api.md doc-examples L190 — Provider passes signal getter 1`] = `
|
|
3842
|
-
"import {
|
|
3655
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, provideContext } from '@barefootjs/client/runtime'
|
|
3843
3656
|
|
|
3844
3657
|
export function initTodoItem(__scope, _p = {}) {
|
|
3845
3658
|
if (!__scope) return
|
|
3846
3659
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3847
3660
|
|
|
3848
|
-
const
|
|
3849
|
-
|
|
3850
|
-
let __anchor_s0 = _s0
|
|
3661
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3851
3662
|
createEffect(() => {
|
|
3852
3663
|
const __val = String(_p.todo)
|
|
3853
|
-
|
|
3664
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3854
3665
|
})
|
|
3855
3666
|
|
|
3856
3667
|
}
|
|
@@ -3861,12 +3672,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3861
3672
|
if (!__scope) return
|
|
3862
3673
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3863
3674
|
|
|
3864
|
-
const
|
|
3865
|
-
|
|
3866
|
-
let __anchor_s0 = _s0
|
|
3675
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3867
3676
|
createEffect(() => {
|
|
3868
3677
|
const __val = String(_p.item)
|
|
3869
|
-
|
|
3678
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3870
3679
|
})
|
|
3871
3680
|
|
|
3872
3681
|
}
|
|
@@ -3956,7 +3765,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3956
3765
|
`;
|
|
3957
3766
|
|
|
3958
3767
|
exports[`docs/core/components/portals.md doc-examples L53 — (no label) 1`] = `
|
|
3959
|
-
"import { $,
|
|
3768
|
+
"import { $, createComponent, createEffect, createPortal, createSignal, escapeText, escapeTextOrNode, hydrate, isSSRPortal, lazySlots } from '@barefootjs/client/runtime'
|
|
3960
3769
|
|
|
3961
3770
|
|
|
3962
3771
|
export function initTooltip(__scope, _p = {}) {
|
|
@@ -3977,12 +3786,11 @@ export function initTooltip(__scope, _p = {}) {
|
|
|
3977
3786
|
}
|
|
3978
3787
|
|
|
3979
3788
|
const [_s0, _s2] = $(__scope, 's0', 's2')
|
|
3980
|
-
const [_s1] = $t(__scope, 's1')
|
|
3981
3789
|
|
|
3982
|
-
|
|
3790
|
+
const __bfw_s1 = lazySlots(__scope, [{ id: 's1', kind: 'markup', path: [] }])
|
|
3983
3791
|
createEffect(() => {
|
|
3984
3792
|
const __val = _p.text
|
|
3985
|
-
|
|
3793
|
+
__bfw_s1('s1', escapeTextOrNode(__val))
|
|
3986
3794
|
})
|
|
3987
3795
|
|
|
3988
3796
|
if (_s0) _s0.addEventListener('mouseenter', () => { setVisible(true) })
|
|
@@ -4061,25 +3869,23 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4061
3869
|
`;
|
|
4062
3870
|
|
|
4063
3871
|
exports[`docs/core/components/props-type-safety.md doc-examples L16 — (no label) 1`] = `
|
|
4064
|
-
"import {
|
|
3872
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4065
3873
|
|
|
4066
3874
|
|
|
4067
3875
|
export function initGreeting(__scope, _p = {}) {
|
|
4068
3876
|
if (!__scope) return
|
|
4069
3877
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4070
3878
|
|
|
4071
|
-
const
|
|
4072
|
-
|
|
4073
|
-
let __anchor_s0 = _s0
|
|
3879
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4074
3880
|
createEffect(() => {
|
|
4075
3881
|
const __val = _p.greeting ?? 'Hello'
|
|
4076
|
-
|
|
3882
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4077
3883
|
})
|
|
4078
3884
|
|
|
4079
|
-
|
|
3885
|
+
const __bfw_s1 = lazySlots(__scope, [{ id: 's1', kind: 'markup', path: [] }])
|
|
4080
3886
|
createEffect(() => {
|
|
4081
3887
|
const __val = _p.name
|
|
4082
|
-
|
|
3888
|
+
__bfw_s1('s1', escapeTextOrNode(__val))
|
|
4083
3889
|
})
|
|
4084
3890
|
|
|
4085
3891
|
}
|
|
@@ -4125,19 +3931,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4125
3931
|
`;
|
|
4126
3932
|
|
|
4127
3933
|
exports[`docs/core/components/props-type-safety.md doc-examples L89 — (no label) 1`] = `
|
|
4128
|
-
"import { $c,
|
|
3934
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
4129
3935
|
import '/* @bf-child:Card */'
|
|
4130
3936
|
|
|
4131
3937
|
export function initTodoItem(__scope, _p = {}) {
|
|
4132
3938
|
if (!__scope) return
|
|
4133
3939
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4134
3940
|
|
|
4135
|
-
const
|
|
4136
|
-
|
|
4137
|
-
let __anchor_s0 = _s0
|
|
3941
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4138
3942
|
createEffect(() => {
|
|
4139
3943
|
const __val = String(_p.todo)
|
|
4140
|
-
|
|
3944
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4141
3945
|
})
|
|
4142
3946
|
|
|
4143
3947
|
}
|
|
@@ -4148,12 +3952,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4148
3952
|
if (!__scope) return
|
|
4149
3953
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4150
3954
|
|
|
4151
|
-
const
|
|
4152
|
-
|
|
4153
|
-
let __anchor_s0 = _s0
|
|
3955
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4154
3956
|
createEffect(() => {
|
|
4155
3957
|
const __val = String(_p.item)
|
|
4156
|
-
|
|
3958
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4157
3959
|
})
|
|
4158
3960
|
|
|
4159
3961
|
}
|
|
@@ -4207,7 +4009,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4207
4009
|
`;
|
|
4208
4010
|
|
|
4209
4011
|
exports[`docs/core/core-concepts/how-it-works.mdx doc-examples L33 — (no label) 1`] = `
|
|
4210
|
-
"import { $,
|
|
4012
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4211
4013
|
|
|
4212
4014
|
|
|
4213
4015
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4217,12 +4019,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4217
4019
|
const [count, setCount] = createSignal(0)
|
|
4218
4020
|
|
|
4219
4021
|
const [_s1] = $(__scope, 's1')
|
|
4220
|
-
const [_s0] = $t(__scope, 's0')
|
|
4221
4022
|
|
|
4222
|
-
|
|
4023
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4223
4024
|
createEffect(() => {
|
|
4224
4025
|
const __val = count()
|
|
4225
|
-
|
|
4026
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4226
4027
|
})
|
|
4227
4028
|
|
|
4228
4029
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4255,7 +4056,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4255
4056
|
`;
|
|
4256
4057
|
|
|
4257
4058
|
exports[`docs/core/core-concepts/mpa-style.md doc-examples L23 — (no label) 1`] = `
|
|
4258
|
-
"import { $, $c,
|
|
4059
|
+
"import { $, $c, createComponent, createEffect, escapeAttr, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
4259
4060
|
import '/* @bf-child:ReviewStars */'
|
|
4260
4061
|
import '/* @bf-child:AddToCart */'
|
|
4261
4062
|
|
|
@@ -4267,19 +4068,18 @@ export function initProductPage(__scope, _p = {}) {
|
|
|
4267
4068
|
const product = _p.product ?? {}
|
|
4268
4069
|
|
|
4269
4070
|
const [_s4] = $(__scope, 's4')
|
|
4270
|
-
const [_s0, _s2] = $t(__scope, 's0', 's2')
|
|
4271
4071
|
const [_s5, _s6] = $c(__scope, 's5', 's6')
|
|
4272
4072
|
|
|
4273
|
-
|
|
4073
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4274
4074
|
createEffect(() => {
|
|
4275
4075
|
const __val = product.name
|
|
4276
|
-
|
|
4076
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4277
4077
|
})
|
|
4278
4078
|
|
|
4279
|
-
|
|
4079
|
+
const __bfw_s2 = lazySlots(__scope, [{ id: 's2', kind: 'markup', path: [] }])
|
|
4280
4080
|
createEffect(() => {
|
|
4281
4081
|
const __val = product.description
|
|
4282
|
-
|
|
4082
|
+
__bfw_s2('s2', escapeTextOrNode(__val))
|
|
4283
4083
|
})
|
|
4284
4084
|
|
|
4285
4085
|
createEffect(() => {
|
|
@@ -4311,19 +4111,17 @@ export function ProductPage(_p, __bfKey) { return createComponent('ProductPage',
|
|
|
4311
4111
|
`;
|
|
4312
4112
|
|
|
4313
4113
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L55 — (no label) 1`] = `
|
|
4314
|
-
"import {
|
|
4114
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4315
4115
|
|
|
4316
4116
|
|
|
4317
4117
|
export function initGreeting(__scope, _p = {}) {
|
|
4318
4118
|
if (!__scope) return
|
|
4319
4119
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4320
4120
|
|
|
4321
|
-
const
|
|
4322
|
-
|
|
4323
|
-
let __anchor_s0 = _s0
|
|
4121
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4324
4122
|
createEffect(() => {
|
|
4325
4123
|
const __val = _p.name
|
|
4326
|
-
|
|
4124
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4327
4125
|
})
|
|
4328
4126
|
|
|
4329
4127
|
}
|
|
@@ -4333,7 +4131,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
4333
4131
|
`;
|
|
4334
4132
|
|
|
4335
4133
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L82 — (no label) 1`] = `
|
|
4336
|
-
"import { $,
|
|
4134
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4337
4135
|
|
|
4338
4136
|
|
|
4339
4137
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4347,12 +4145,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4347
4145
|
})
|
|
4348
4146
|
|
|
4349
4147
|
const [_s2] = $(__scope, 's2')
|
|
4350
|
-
const [_s0] = $t(__scope, 's0')
|
|
4351
4148
|
|
|
4352
|
-
|
|
4149
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4353
4150
|
createEffect(() => {
|
|
4354
4151
|
const __val = count()
|
|
4355
|
-
|
|
4152
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4356
4153
|
})
|
|
4357
4154
|
|
|
4358
4155
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4385,18 +4182,16 @@ export function Layout(_p, __bfKey) { return createComponent('Layout', _p, __bfK
|
|
|
4385
4182
|
`;
|
|
4386
4183
|
|
|
4387
4184
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L167 — (no label) 1`] = `
|
|
4388
|
-
"import { $,
|
|
4185
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4389
4186
|
|
|
4390
4187
|
export function initTodoItem(__scope, _p = {}) {
|
|
4391
4188
|
if (!__scope) return
|
|
4392
4189
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4393
4190
|
|
|
4394
|
-
const
|
|
4395
|
-
|
|
4396
|
-
let __anchor_s0 = _s0
|
|
4191
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4397
4192
|
createEffect(() => {
|
|
4398
4193
|
const __val = String(_p.todo)
|
|
4399
|
-
|
|
4194
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4400
4195
|
})
|
|
4401
4196
|
|
|
4402
4197
|
}
|
|
@@ -4407,12 +4202,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4407
4202
|
if (!__scope) return
|
|
4408
4203
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4409
4204
|
|
|
4410
|
-
const
|
|
4411
|
-
|
|
4412
|
-
let __anchor_s0 = _s0
|
|
4205
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4413
4206
|
createEffect(() => {
|
|
4414
4207
|
const __val = String(_p.item)
|
|
4415
|
-
|
|
4208
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4416
4209
|
})
|
|
4417
4210
|
|
|
4418
4211
|
}
|
|
@@ -4455,18 +4248,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4455
4248
|
`;
|
|
4456
4249
|
|
|
4457
4250
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L171 — (no label) 1`] = `
|
|
4458
|
-
"import { $,
|
|
4251
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4459
4252
|
|
|
4460
4253
|
export function initTodoItem(__scope, _p = {}) {
|
|
4461
4254
|
if (!__scope) return
|
|
4462
4255
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4463
4256
|
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4466
|
-
let __anchor_s0 = _s0
|
|
4257
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4467
4258
|
createEffect(() => {
|
|
4468
4259
|
const __val = String(_p.todo)
|
|
4469
|
-
|
|
4260
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4470
4261
|
})
|
|
4471
4262
|
|
|
4472
4263
|
}
|
|
@@ -4477,12 +4268,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4477
4268
|
if (!__scope) return
|
|
4478
4269
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4479
4270
|
|
|
4480
|
-
const
|
|
4481
|
-
|
|
4482
|
-
let __anchor_s0 = _s0
|
|
4271
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4483
4272
|
createEffect(() => {
|
|
4484
4273
|
const __val = String(_p.item)
|
|
4485
|
-
|
|
4274
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4486
4275
|
})
|
|
4487
4276
|
|
|
4488
4277
|
}
|
|
@@ -4525,18 +4314,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4525
4314
|
`;
|
|
4526
4315
|
|
|
4527
4316
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L177 — (no label) 1`] = `
|
|
4528
|
-
"import { $,
|
|
4317
|
+
"import { $, __bfSlot, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4529
4318
|
|
|
4530
4319
|
export function initTodoItem(__scope, _p = {}) {
|
|
4531
4320
|
if (!__scope) return
|
|
4532
4321
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4533
4322
|
|
|
4534
|
-
const
|
|
4535
|
-
|
|
4536
|
-
let __anchor_s0 = _s0
|
|
4323
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4537
4324
|
createEffect(() => {
|
|
4538
4325
|
const __val = String(_p.todo)
|
|
4539
|
-
|
|
4326
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4540
4327
|
})
|
|
4541
4328
|
|
|
4542
4329
|
}
|
|
@@ -4547,12 +4334,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4547
4334
|
if (!__scope) return
|
|
4548
4335
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4549
4336
|
|
|
4550
|
-
const
|
|
4551
|
-
|
|
4552
|
-
let __anchor_s0 = _s0
|
|
4337
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4553
4338
|
createEffect(() => {
|
|
4554
4339
|
const __val = String(_p.item)
|
|
4555
|
-
|
|
4340
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4556
4341
|
})
|
|
4557
4342
|
|
|
4558
4343
|
}
|
|
@@ -4595,18 +4380,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4595
4380
|
`;
|
|
4596
4381
|
|
|
4597
4382
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L190 — (no label) 1`] = `
|
|
4598
|
-
"import { $,
|
|
4383
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
4599
4384
|
|
|
4600
4385
|
export function initTodoItem(__scope, _p = {}) {
|
|
4601
4386
|
if (!__scope) return
|
|
4602
4387
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4603
4388
|
|
|
4604
|
-
const
|
|
4605
|
-
|
|
4606
|
-
let __anchor_s0 = _s0
|
|
4389
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4607
4390
|
createEffect(() => {
|
|
4608
4391
|
const __val = String(_p.todo)
|
|
4609
|
-
|
|
4392
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4610
4393
|
})
|
|
4611
4394
|
|
|
4612
4395
|
}
|
|
@@ -4617,12 +4400,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4617
4400
|
if (!__scope) return
|
|
4618
4401
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4619
4402
|
|
|
4620
|
-
const
|
|
4621
|
-
|
|
4622
|
-
let __anchor_s0 = _s0
|
|
4403
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4623
4404
|
createEffect(() => {
|
|
4624
4405
|
const __val = String(_p.item)
|
|
4625
|
-
|
|
4406
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4626
4407
|
})
|
|
4627
4408
|
|
|
4628
4409
|
}
|
|
@@ -4650,12 +4431,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
4650
4431
|
|
|
4651
4432
|
const __tpl_l0 = document.createElement('template')
|
|
4652
4433
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4434
|
+
const __lzp_l0 = [[0]]
|
|
4435
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
4436
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
4437
|
+
const __lzc_l0 = (__e) => {
|
|
4438
|
+
return [null]
|
|
4439
|
+
}
|
|
4440
|
+
mapArrayLazy(() => items(), _s1, (item) => String(item), {
|
|
4441
|
+
createRow: (__e, __idx) => {
|
|
4442
|
+
const item = () => __e.item
|
|
4443
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4444
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
4445
|
+
const __l = __e.last = []
|
|
4446
|
+
{ const __x = item()
|
|
4447
|
+
__r[0]('s0', textOrNode(__x))
|
|
4448
|
+
__l[0] = __x }
|
|
4449
|
+
return __el
|
|
4450
|
+
},
|
|
4451
|
+
applyItem: (__e) => {
|
|
4452
|
+
const item = () => __e.item
|
|
4453
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
4454
|
+
const __l = __e.last ?? (__e.last = [])
|
|
4455
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
4456
|
+
{ const __x = item()
|
|
4457
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
4458
|
+
__l[0] = __x }
|
|
4459
|
+
},
|
|
4659
4460
|
}, 'l0')
|
|
4660
4461
|
|
|
4661
4462
|
}
|
|
@@ -4665,19 +4466,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4665
4466
|
`;
|
|
4666
4467
|
|
|
4667
4468
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L71 — (no label) 1`] = `
|
|
4668
|
-
"import {
|
|
4469
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4669
4470
|
|
|
4670
4471
|
|
|
4671
4472
|
export function initGreeting(__scope, _p = {}) {
|
|
4672
4473
|
if (!__scope) return
|
|
4673
4474
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4674
4475
|
|
|
4675
|
-
const
|
|
4676
|
-
|
|
4677
|
-
let __anchor_s0 = _s0
|
|
4476
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4678
4477
|
createEffect(() => {
|
|
4679
4478
|
const __val = _p.name
|
|
4680
|
-
|
|
4479
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4681
4480
|
})
|
|
4682
4481
|
|
|
4683
4482
|
}
|
|
@@ -4687,7 +4486,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
4687
4486
|
`;
|
|
4688
4487
|
|
|
4689
4488
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L95 — (no label) 1`] = `
|
|
4690
|
-
"import { $,
|
|
4489
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4691
4490
|
|
|
4692
4491
|
|
|
4693
4492
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4701,12 +4500,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4701
4500
|
})
|
|
4702
4501
|
|
|
4703
4502
|
const [_s2] = $(__scope, 's2')
|
|
4704
|
-
const [_s0] = $t(__scope, 's0')
|
|
4705
4503
|
|
|
4706
|
-
|
|
4504
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4707
4505
|
createEffect(() => {
|
|
4708
4506
|
const __val = count()
|
|
4709
|
-
|
|
4507
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4710
4508
|
})
|
|
4711
4509
|
|
|
4712
4510
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4717,18 +4515,16 @@ export function Counter(_p, __bfKey) { return createComponent('Counter', _p, __b
|
|
|
4717
4515
|
`;
|
|
4718
4516
|
|
|
4719
4517
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L168 — (no label) 1`] = `
|
|
4720
|
-
"import { $,
|
|
4518
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
4721
4519
|
|
|
4722
4520
|
export function initTodoItem(__scope, _p = {}) {
|
|
4723
4521
|
if (!__scope) return
|
|
4724
4522
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4725
4523
|
|
|
4726
|
-
const
|
|
4727
|
-
|
|
4728
|
-
let __anchor_s0 = _s0
|
|
4524
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4729
4525
|
createEffect(() => {
|
|
4730
4526
|
const __val = String(_p.todo)
|
|
4731
|
-
|
|
4527
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4732
4528
|
})
|
|
4733
4529
|
|
|
4734
4530
|
}
|
|
@@ -4739,12 +4535,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4739
4535
|
if (!__scope) return
|
|
4740
4536
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4741
4537
|
|
|
4742
|
-
const
|
|
4743
|
-
|
|
4744
|
-
let __anchor_s0 = _s0
|
|
4538
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4745
4539
|
createEffect(() => {
|
|
4746
4540
|
const __val = String(_p.item)
|
|
4747
|
-
|
|
4541
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4748
4542
|
})
|
|
4749
4543
|
|
|
4750
4544
|
}
|
|
@@ -4772,12 +4566,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
4772
4566
|
|
|
4773
4567
|
const __tpl_l0 = document.createElement('template')
|
|
4774
4568
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4569
|
+
const __lzp_l0 = [[0]]
|
|
4570
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
4571
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
4572
|
+
const __lzc_l0 = (__e) => {
|
|
4573
|
+
return [null]
|
|
4574
|
+
}
|
|
4575
|
+
mapArrayLazy(() => items(), _s1, (item) => String(item), {
|
|
4576
|
+
createRow: (__e, __idx) => {
|
|
4577
|
+
const item = () => __e.item
|
|
4578
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4579
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
4580
|
+
const __l = __e.last = []
|
|
4581
|
+
{ const __x = item()
|
|
4582
|
+
__r[0]('s0', textOrNode(__x))
|
|
4583
|
+
__l[0] = __x }
|
|
4584
|
+
return __el
|
|
4585
|
+
},
|
|
4586
|
+
applyItem: (__e) => {
|
|
4587
|
+
const item = () => __e.item
|
|
4588
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
4589
|
+
const __l = __e.last ?? (__e.last = [])
|
|
4590
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
4591
|
+
{ const __x = item()
|
|
4592
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
4593
|
+
__l[0] = __x }
|
|
4594
|
+
},
|
|
4781
4595
|
}, 'l0')
|
|
4782
4596
|
|
|
4783
4597
|
}
|
|
@@ -4787,18 +4601,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4787
4601
|
`;
|
|
4788
4602
|
|
|
4789
4603
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L180 — (no label) 1`] = `
|
|
4790
|
-
"import { $,
|
|
4604
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
4791
4605
|
|
|
4792
4606
|
export function initTodoItem(__scope, _p = {}) {
|
|
4793
4607
|
if (!__scope) return
|
|
4794
4608
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4795
4609
|
|
|
4796
|
-
const
|
|
4797
|
-
|
|
4798
|
-
let __anchor_s0 = _s0
|
|
4610
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4799
4611
|
createEffect(() => {
|
|
4800
4612
|
const __val = String(_p.todo)
|
|
4801
|
-
|
|
4613
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4802
4614
|
})
|
|
4803
4615
|
|
|
4804
4616
|
}
|
|
@@ -4809,12 +4621,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4809
4621
|
if (!__scope) return
|
|
4810
4622
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4811
4623
|
|
|
4812
|
-
const
|
|
4813
|
-
|
|
4814
|
-
let __anchor_s0 = _s0
|
|
4624
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4815
4625
|
createEffect(() => {
|
|
4816
4626
|
const __val = String(_p.item)
|
|
4817
|
-
|
|
4627
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4818
4628
|
})
|
|
4819
4629
|
|
|
4820
4630
|
}
|
|
@@ -4842,12 +4652,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
4842
4652
|
|
|
4843
4653
|
const __tpl_l0 = document.createElement('template')
|
|
4844
4654
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4655
|
+
const __lzp_l0 = [[0]]
|
|
4656
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
4657
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
4658
|
+
const __lzc_l0 = (__e) => {
|
|
4659
|
+
return [null]
|
|
4660
|
+
}
|
|
4661
|
+
mapArrayLazy(() => items().filter(item => item.active), _s1, (item) => String(item.id), {
|
|
4662
|
+
createRow: (__e, __idx) => {
|
|
4663
|
+
const item = () => __e.item
|
|
4664
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4665
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
4666
|
+
const __l = __e.last = []
|
|
4667
|
+
{ const __x = item().name
|
|
4668
|
+
__r[0]('s0', textOrNode(__x))
|
|
4669
|
+
__l[0] = __x }
|
|
4670
|
+
return __el
|
|
4671
|
+
},
|
|
4672
|
+
applyItem: (__e) => {
|
|
4673
|
+
const item = () => __e.item
|
|
4674
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
4675
|
+
const __l = __e.last ?? (__e.last = [])
|
|
4676
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
4677
|
+
{ const __x = item().name
|
|
4678
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
4679
|
+
__l[0] = __x }
|
|
4680
|
+
},
|
|
4851
4681
|
}, 'l0')
|
|
4852
4682
|
|
|
4853
4683
|
}
|
|
@@ -4857,18 +4687,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4857
4687
|
`;
|
|
4858
4688
|
|
|
4859
4689
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L194 — (no label) 1`] = `
|
|
4860
|
-
"import { $,
|
|
4690
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4861
4691
|
|
|
4862
4692
|
export function initTodoItem(__scope, _p = {}) {
|
|
4863
4693
|
if (!__scope) return
|
|
4864
4694
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4865
4695
|
|
|
4866
|
-
const
|
|
4867
|
-
|
|
4868
|
-
let __anchor_s0 = _s0
|
|
4696
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4869
4697
|
createEffect(() => {
|
|
4870
4698
|
const __val = String(_p.todo)
|
|
4871
|
-
|
|
4699
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4872
4700
|
})
|
|
4873
4701
|
|
|
4874
4702
|
}
|
|
@@ -4879,12 +4707,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4879
4707
|
if (!__scope) return
|
|
4880
4708
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4881
4709
|
|
|
4882
|
-
const
|
|
4883
|
-
|
|
4884
|
-
let __anchor_s0 = _s0
|
|
4710
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4885
4711
|
createEffect(() => {
|
|
4886
4712
|
const __val = String(_p.item)
|
|
4887
|
-
|
|
4713
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4888
4714
|
})
|
|
4889
4715
|
|
|
4890
4716
|
}
|
|
@@ -4915,8 +4741,8 @@ export function initExample(__scope, _p = {}) {
|
|
|
4915
4741
|
items.forEach((t, __idx) => {
|
|
4916
4742
|
let __iterEl = _s1.children[__idx]
|
|
4917
4743
|
if (__iterEl) {
|
|
4918
|
-
|
|
4919
|
-
|
|
4744
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
4745
|
+
createEffect(() => { __bfw_s0('s0', String(t.name)) })
|
|
4920
4746
|
}
|
|
4921
4747
|
})
|
|
4922
4748
|
}
|
|
@@ -4952,18 +4778,16 @@ export function TodoList(_p, __bfKey) { return createComponent('TodoList', _p, _
|
|
|
4952
4778
|
`;
|
|
4953
4779
|
|
|
4954
4780
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L260 — (no label) 1`] = `
|
|
4955
|
-
"import { $,
|
|
4781
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4956
4782
|
|
|
4957
4783
|
export function initTodoItem(__scope, _p = {}) {
|
|
4958
4784
|
if (!__scope) return
|
|
4959
4785
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4960
4786
|
|
|
4961
|
-
const
|
|
4962
|
-
|
|
4963
|
-
let __anchor_s0 = _s0
|
|
4787
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4964
4788
|
createEffect(() => {
|
|
4965
4789
|
const __val = String(_p.todo)
|
|
4966
|
-
|
|
4790
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4967
4791
|
})
|
|
4968
4792
|
|
|
4969
4793
|
}
|
|
@@ -4974,12 +4798,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4974
4798
|
if (!__scope) return
|
|
4975
4799
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4976
4800
|
|
|
4977
|
-
const
|
|
4978
|
-
|
|
4979
|
-
let __anchor_s0 = _s0
|
|
4801
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4980
4802
|
createEffect(() => {
|
|
4981
4803
|
const __val = String(_p.item)
|
|
4982
|
-
|
|
4804
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4983
4805
|
})
|
|
4984
4806
|
|
|
4985
4807
|
}
|
|
@@ -5022,18 +4844,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
5022
4844
|
`;
|
|
5023
4845
|
|
|
5024
4846
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L169 — (no label) 1`] = `
|
|
5025
|
-
"import {
|
|
4847
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5026
4848
|
|
|
5027
4849
|
export function initTodoItem(__scope, _p = {}) {
|
|
5028
4850
|
if (!__scope) return
|
|
5029
4851
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5030
4852
|
|
|
5031
|
-
const
|
|
5032
|
-
|
|
5033
|
-
let __anchor_s0 = _s0
|
|
4853
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5034
4854
|
createEffect(() => {
|
|
5035
4855
|
const __val = String(_p.todo)
|
|
5036
|
-
|
|
4856
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5037
4857
|
})
|
|
5038
4858
|
|
|
5039
4859
|
}
|
|
@@ -5044,12 +4864,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5044
4864
|
if (!__scope) return
|
|
5045
4865
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5046
4866
|
|
|
5047
|
-
const
|
|
5048
|
-
|
|
5049
|
-
let __anchor_s0 = _s0
|
|
4867
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5050
4868
|
createEffect(() => {
|
|
5051
4869
|
const __val = String(_p.item)
|
|
5052
|
-
|
|
4870
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5053
4871
|
})
|
|
5054
4872
|
|
|
5055
4873
|
}
|
|
@@ -5080,18 +4898,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
5080
4898
|
`;
|
|
5081
4899
|
|
|
5082
4900
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L174 — (no label) 1`] = `
|
|
5083
|
-
"import {
|
|
4901
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5084
4902
|
|
|
5085
4903
|
export function initTodoItem(__scope, _p = {}) {
|
|
5086
4904
|
if (!__scope) return
|
|
5087
4905
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5088
4906
|
|
|
5089
|
-
const
|
|
5090
|
-
|
|
5091
|
-
let __anchor_s0 = _s0
|
|
4907
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5092
4908
|
createEffect(() => {
|
|
5093
4909
|
const __val = String(_p.todo)
|
|
5094
|
-
|
|
4910
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5095
4911
|
})
|
|
5096
4912
|
|
|
5097
4913
|
}
|
|
@@ -5102,12 +4918,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5102
4918
|
if (!__scope) return
|
|
5103
4919
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5104
4920
|
|
|
5105
|
-
const
|
|
5106
|
-
|
|
5107
|
-
let __anchor_s0 = _s0
|
|
4921
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5108
4922
|
createEffect(() => {
|
|
5109
4923
|
const __val = String(_p.item)
|
|
5110
|
-
|
|
4924
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5111
4925
|
})
|
|
5112
4926
|
|
|
5113
4927
|
}
|
|
@@ -5138,18 +4952,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
5138
4952
|
`;
|
|
5139
4953
|
|
|
5140
4954
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L195 — (no label) 1`] = `
|
|
5141
|
-
"import { $,
|
|
4955
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5142
4956
|
|
|
5143
4957
|
export function initTodoItem(__scope, _p = {}) {
|
|
5144
4958
|
if (!__scope) return
|
|
5145
4959
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5146
4960
|
|
|
5147
|
-
const
|
|
5148
|
-
|
|
5149
|
-
let __anchor_s0 = _s0
|
|
4961
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5150
4962
|
createEffect(() => {
|
|
5151
4963
|
const __val = String(_p.todo)
|
|
5152
|
-
|
|
4964
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5153
4965
|
})
|
|
5154
4966
|
|
|
5155
4967
|
}
|
|
@@ -5160,12 +4972,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5160
4972
|
if (!__scope) return
|
|
5161
4973
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5162
4974
|
|
|
5163
|
-
const
|
|
5164
|
-
|
|
5165
|
-
let __anchor_s0 = _s0
|
|
4975
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5166
4976
|
createEffect(() => {
|
|
5167
4977
|
const __val = String(_p.item)
|
|
5168
|
-
|
|
4978
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5169
4979
|
})
|
|
5170
4980
|
|
|
5171
4981
|
}
|
|
@@ -5196,8 +5006,8 @@ export function initExample(__scope, _p = {}) {
|
|
|
5196
5006
|
items.forEach((item, __idx) => {
|
|
5197
5007
|
let __iterEl = _s1.children[__idx]
|
|
5198
5008
|
if (__iterEl) {
|
|
5199
|
-
|
|
5200
|
-
|
|
5009
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
5010
|
+
createEffect(() => { __bfw_s0('s0', String(item.name)) })
|
|
5201
5011
|
}
|
|
5202
5012
|
})
|
|
5203
5013
|
}
|
|
@@ -5209,18 +5019,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
5209
5019
|
`;
|
|
5210
5020
|
|
|
5211
5021
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L200 — (no label) 1`] = `
|
|
5212
|
-
"import { $,
|
|
5022
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5213
5023
|
|
|
5214
5024
|
export function initTodoItem(__scope, _p = {}) {
|
|
5215
5025
|
if (!__scope) return
|
|
5216
5026
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5217
5027
|
|
|
5218
|
-
const
|
|
5219
|
-
|
|
5220
|
-
let __anchor_s0 = _s0
|
|
5028
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5221
5029
|
createEffect(() => {
|
|
5222
5030
|
const __val = String(_p.todo)
|
|
5223
|
-
|
|
5031
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5224
5032
|
})
|
|
5225
5033
|
|
|
5226
5034
|
}
|
|
@@ -5231,12 +5039,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5231
5039
|
if (!__scope) return
|
|
5232
5040
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5233
5041
|
|
|
5234
|
-
const
|
|
5235
|
-
|
|
5236
|
-
let __anchor_s0 = _s0
|
|
5042
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5237
5043
|
createEffect(() => {
|
|
5238
5044
|
const __val = String(_p.item)
|
|
5239
|
-
|
|
5045
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5240
5046
|
})
|
|
5241
5047
|
|
|
5242
5048
|
}
|
|
@@ -5267,8 +5073,8 @@ export function initExample(__scope, _p = {}) {
|
|
|
5267
5073
|
items.forEach((item, __idx) => {
|
|
5268
5074
|
let __iterEl = _s1.children[__idx]
|
|
5269
5075
|
if (__iterEl) {
|
|
5270
|
-
|
|
5271
|
-
|
|
5076
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
5077
|
+
createEffect(() => { __bfw_s0('s0', String(item.name)) })
|
|
5272
5078
|
}
|
|
5273
5079
|
})
|
|
5274
5080
|
}
|
|
@@ -5289,18 +5095,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
5289
5095
|
`;
|
|
5290
5096
|
|
|
5291
5097
|
exports[`docs/core/advanced/compiler-internals.md doc-examples L126 — (no label) 1`] = `
|
|
5292
|
-
"import { $,
|
|
5098
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
5293
5099
|
|
|
5294
5100
|
export function initTodoItem(__scope, _p = {}) {
|
|
5295
5101
|
if (!__scope) return
|
|
5296
5102
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5297
5103
|
|
|
5298
|
-
const
|
|
5299
|
-
|
|
5300
|
-
let __anchor_s0 = _s0
|
|
5104
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5301
5105
|
createEffect(() => {
|
|
5302
5106
|
const __val = String(_p.todo)
|
|
5303
|
-
|
|
5107
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5304
5108
|
})
|
|
5305
5109
|
|
|
5306
5110
|
}
|
|
@@ -5311,12 +5115,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5311
5115
|
if (!__scope) return
|
|
5312
5116
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5313
5117
|
|
|
5314
|
-
const
|
|
5315
|
-
|
|
5316
|
-
let __anchor_s0 = _s0
|
|
5118
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5317
5119
|
createEffect(() => {
|
|
5318
5120
|
const __val = String(_p.item)
|
|
5319
|
-
|
|
5121
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5320
5122
|
})
|
|
5321
5123
|
|
|
5322
5124
|
}
|
|
@@ -5344,12 +5146,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
5344
5146
|
|
|
5345
5147
|
const __tpl_l0 = document.createElement('template')
|
|
5346
5148
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5149
|
+
const __lzp_l0 = [[0]]
|
|
5150
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
5151
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
5152
|
+
const __lzc_l0 = (__e) => {
|
|
5153
|
+
return [null]
|
|
5154
|
+
}
|
|
5155
|
+
mapArrayLazy(() => todos().filter(t => !t.done).toSorted((a, b) => a.date - b.date), _s1, (t) => String(t.id), {
|
|
5156
|
+
createRow: (__e, __idx) => {
|
|
5157
|
+
const t = () => __e.item
|
|
5158
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5159
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
5160
|
+
const __l = __e.last = []
|
|
5161
|
+
{ const __x = t().name
|
|
5162
|
+
__r[0]('s0', textOrNode(__x))
|
|
5163
|
+
__l[0] = __x }
|
|
5164
|
+
return __el
|
|
5165
|
+
},
|
|
5166
|
+
applyItem: (__e) => {
|
|
5167
|
+
const t = () => __e.item
|
|
5168
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
5169
|
+
const __l = __e.last ?? (__e.last = [])
|
|
5170
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
5171
|
+
{ const __x = t().name
|
|
5172
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
5173
|
+
__l[0] = __x }
|
|
5174
|
+
},
|
|
5353
5175
|
}, 'l0')
|
|
5354
5176
|
|
|
5355
5177
|
}
|
|
@@ -5421,18 +5243,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
5421
5243
|
`;
|
|
5422
5244
|
|
|
5423
5245
|
exports[`docs/core/advanced/performance.md doc-examples L67 — ✅ Stable key — DOM nodes reused when list changes 1`] = `
|
|
5424
|
-
"import { $,
|
|
5246
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
5425
5247
|
|
|
5426
5248
|
export function initTodoItem(__scope, _p = {}) {
|
|
5427
5249
|
if (!__scope) return
|
|
5428
5250
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5429
5251
|
|
|
5430
|
-
const
|
|
5431
|
-
|
|
5432
|
-
let __anchor_s0 = _s0
|
|
5252
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5433
5253
|
createEffect(() => {
|
|
5434
5254
|
const __val = String(_p.todo)
|
|
5435
|
-
|
|
5255
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5436
5256
|
})
|
|
5437
5257
|
|
|
5438
5258
|
}
|
|
@@ -5443,12 +5263,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5443
5263
|
if (!__scope) return
|
|
5444
5264
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5445
5265
|
|
|
5446
|
-
const
|
|
5447
|
-
|
|
5448
|
-
let __anchor_s0 = _s0
|
|
5266
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5449
5267
|
createEffect(() => {
|
|
5450
5268
|
const __val = String(_p.item)
|
|
5451
|
-
|
|
5269
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5452
5270
|
})
|
|
5453
5271
|
|
|
5454
5272
|
}
|
|
@@ -5476,12 +5294,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
5476
5294
|
|
|
5477
5295
|
const __tpl_l0 = document.createElement('template')
|
|
5478
5296
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5297
|
+
const __lzp_l0 = [[0]]
|
|
5298
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
5299
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
5300
|
+
const __lzc_l0 = (__e) => {
|
|
5301
|
+
return [null]
|
|
5302
|
+
}
|
|
5303
|
+
mapArrayLazy(() => items(), _s1, (item) => String(item.id), {
|
|
5304
|
+
createRow: (__e, __idx) => {
|
|
5305
|
+
const item = () => __e.item
|
|
5306
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5307
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
5308
|
+
const __l = __e.last = []
|
|
5309
|
+
{ const __x = item().name
|
|
5310
|
+
__r[0]('s0', textOrNode(__x))
|
|
5311
|
+
__l[0] = __x }
|
|
5312
|
+
return __el
|
|
5313
|
+
},
|
|
5314
|
+
applyItem: (__e) => {
|
|
5315
|
+
const item = () => __e.item
|
|
5316
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
5317
|
+
const __l = __e.last ?? (__e.last = [])
|
|
5318
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
5319
|
+
{ const __x = item().name
|
|
5320
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
5321
|
+
__l[0] = __x }
|
|
5322
|
+
},
|
|
5485
5323
|
}, 'l0')
|
|
5486
5324
|
|
|
5487
5325
|
}
|
|
@@ -5491,18 +5329,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
5491
5329
|
`;
|
|
5492
5330
|
|
|
5493
5331
|
exports[`docs/core/advanced/performance.md doc-examples L70 — ❌ Index key — DOM nodes recreated on reorder 1`] = `
|
|
5494
|
-
"import { $,
|
|
5332
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArrayLazy, textOrNode } from '@barefootjs/client/runtime'
|
|
5495
5333
|
|
|
5496
5334
|
export function initTodoItem(__scope, _p = {}) {
|
|
5497
5335
|
if (!__scope) return
|
|
5498
5336
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5499
5337
|
|
|
5500
|
-
const
|
|
5501
|
-
|
|
5502
|
-
let __anchor_s0 = _s0
|
|
5338
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5503
5339
|
createEffect(() => {
|
|
5504
5340
|
const __val = String(_p.todo)
|
|
5505
|
-
|
|
5341
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5506
5342
|
})
|
|
5507
5343
|
|
|
5508
5344
|
}
|
|
@@ -5513,12 +5349,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5513
5349
|
if (!__scope) return
|
|
5514
5350
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5515
5351
|
|
|
5516
|
-
const
|
|
5517
|
-
|
|
5518
|
-
let __anchor_s0 = _s0
|
|
5352
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5519
5353
|
createEffect(() => {
|
|
5520
5354
|
const __val = String(_p.item)
|
|
5521
|
-
|
|
5355
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5522
5356
|
})
|
|
5523
5357
|
|
|
5524
5358
|
}
|
|
@@ -5546,12 +5380,32 @@ export function initExample(__scope, _p = {}) {
|
|
|
5546
5380
|
|
|
5547
5381
|
const __tpl_l0 = document.createElement('template')
|
|
5548
5382
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5383
|
+
const __lzp_l0 = [[0]]
|
|
5384
|
+
const __lzs_l0 = [{ id: 's0', kind: 'text', path: [] }]
|
|
5385
|
+
const __lzsc_l0 = [{ id: 's0', kind: 'text', path: __lzp_l0[0] }]
|
|
5386
|
+
const __lzc_l0 = (__e) => {
|
|
5387
|
+
return [null]
|
|
5388
|
+
}
|
|
5389
|
+
mapArrayLazy(() => items(), _s1, (item, i) => String(i), {
|
|
5390
|
+
createRow: (__e, i) => {
|
|
5391
|
+
const item = () => __e.item
|
|
5392
|
+
const __el = __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5393
|
+
const __r = __e.refs = [lazySlots(__el, __lzsc_l0)]
|
|
5394
|
+
const __l = __e.last = []
|
|
5395
|
+
{ const __x = item().name
|
|
5396
|
+
__r[0]('s0', textOrNode(__x))
|
|
5397
|
+
__l[0] = __x }
|
|
5398
|
+
return __el
|
|
5399
|
+
},
|
|
5400
|
+
applyItem: (__e) => {
|
|
5401
|
+
const item = () => __e.item
|
|
5402
|
+
const __r = __e.refs ?? (__e.refs = __lzc_l0(__e))
|
|
5403
|
+
const __l = __e.last ?? (__e.last = [])
|
|
5404
|
+
const __d = __r[0] ?? (__r[0] = lazySlots(__e.primaryEl, __lzs_l0))
|
|
5405
|
+
{ const __x = item().name
|
|
5406
|
+
if (!(0 in __l) || !Object.is(__l[0], __x)) __d('s0', textOrNode(__x))
|
|
5407
|
+
__l[0] = __x }
|
|
5408
|
+
},
|
|
5555
5409
|
}, 'l0')
|
|
5556
5410
|
|
|
5557
5411
|
}
|
|
@@ -5768,7 +5622,7 @@ export function TimelineBar(_p, __bfKey) { return createComponent('TimelineBar',
|
|
|
5768
5622
|
`;
|
|
5769
5623
|
|
|
5770
5624
|
exports[`docs/core/introduction.mdx doc-examples L15 — (no label) 1`] = `
|
|
5771
|
-
"import { $,
|
|
5625
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5772
5626
|
|
|
5773
5627
|
|
|
5774
5628
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -5778,12 +5632,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
5778
5632
|
const [count, setCount] = createSignal(0)
|
|
5779
5633
|
|
|
5780
5634
|
const [_s1] = $(__scope, 's1')
|
|
5781
|
-
const [_s0] = $t(__scope, 's0')
|
|
5782
5635
|
|
|
5783
|
-
|
|
5636
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5784
5637
|
createEffect(() => {
|
|
5785
5638
|
const __val = count()
|
|
5786
|
-
|
|
5639
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5787
5640
|
})
|
|
5788
5641
|
|
|
5789
5642
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|