@barefootjs/jsx 0.26.3 → 0.27.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 +735 -140
- package/dist/ir-to-client-js/build-references.d.ts.map +1 -1
- 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 +12 -1
- 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.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/build-event-delegation.d.ts.map +1 -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/event-delegation.d.ts +16 -1
- package/dist/ir-to-client-js/control-flow/plan/event-delegation.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/plan/loop.d.ts +27 -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 +13 -2
- package/dist/ir-to-client-js/control-flow/shared.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/event-delegation.d.ts.map +1 -1
- 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/loop-child-arm.d.ts.map +1 -1
- package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts +19 -3
- 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/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 +73 -1
- 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 +35 -2
- 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/jsx-to-ir.d.ts.map +1 -1
- package/dist/types.d.ts +70 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +555 -678
- package/src/__tests__/child-components-in-map.test.ts +4 -4
- package/src/__tests__/client-js-generation.test.ts +26 -12
- package/src/__tests__/compiler-runtime-contract.test.ts +4 -4
- package/src/__tests__/composite-branch-loop.test.ts +2 -2
- package/src/__tests__/cross-file-client-signal.test.ts +5 -1
- package/src/__tests__/delegated-handler-preamble.test.ts +153 -0
- package/src/__tests__/early-return-scope-var-ref.test.ts +10 -11
- package/src/__tests__/flatmap-segments.test.ts +182 -0
- package/src/__tests__/inline-jsx-callback.test.ts +6 -4
- package/src/__tests__/ir-jsx-props.test.ts +6 -5
- package/src/__tests__/loop-fallback-wrap.test.ts +3 -4
- package/src/__tests__/map-body-no-silent-divergence.test.ts +45 -0
- 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 +156 -0
- 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 +3 -2
- 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/build-references.ts +16 -0
- package/src/ir-to-client-js/client-only-elision.ts +273 -0
- package/src/ir-to-client-js/collect-elements.ts +74 -14
- package/src/ir-to-client-js/control-flow/plan/branch-loop.ts +12 -1
- package/src/ir-to-client-js/control-flow/plan/build-branch-loop.ts +11 -3
- package/src/ir-to-client-js/control-flow/plan/build-event-delegation.ts +19 -3
- package/src/ir-to-client-js/control-flow/plan/build-loop.ts +36 -0
- package/src/ir-to-client-js/control-flow/plan/event-delegation.ts +16 -1
- package/src/ir-to-client-js/control-flow/plan/loop.ts +28 -0
- package/src/ir-to-client-js/control-flow/shared.ts +27 -2
- 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/event-delegation.ts +67 -19
- 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/loop-child-arm.ts +35 -16
- package/src/ir-to-client-js/control-flow/stringify/loop.ts +80 -14
- package/src/ir-to-client-js/control-flow/stringify/reactive-effects.ts +241 -31
- package/src/ir-to-client-js/control-flow.ts +1 -1
- 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 +144 -15
- package/src/ir-to-client-js/imports.ts +7 -4
- package/src/ir-to-client-js/reactivity.ts +7 -0
- package/src/ir-to-client-js/types.ts +34 -2
- package/src/ir-to-client-js/utils.ts +1 -1
- package/src/jsx-to-ir.ts +382 -15
- package/src/types.ts +72 -0
|
@@ -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
|
}
|
|
@@ -358,19 +335,85 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
358
335
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
359
336
|
`;
|
|
360
337
|
|
|
361
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L59 — ✅
|
|
362
|
-
"import { $,
|
|
338
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L59 — ✅ Projection — works on every adapter 1`] = `
|
|
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
|
|
345
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
346
|
+
createEffect(() => {
|
|
347
|
+
const __val = String(_p.todo)
|
|
348
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
hydrate('TodoItem__b3c36eee', { init: initTodoItem, template: (_p) => \`<li bf="s1"><!--bf:s0-->\${escapeText(String(_p.todo))}<!--/--></li>\` })
|
|
354
|
+
export function TodoItem(_p, __bfKey) { return createComponent('TodoItem__b3c36eee', _p, __bfKey) }
|
|
355
|
+
export function initItem(__scope, _p = {}) {
|
|
356
|
+
if (!__scope) return
|
|
357
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
358
|
+
|
|
359
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
360
|
+
createEffect(() => {
|
|
361
|
+
const __val = String(_p.item)
|
|
362
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
hydrate('Item__b3c36eee', { init: initItem, template: (_p) => \`<li bf="s1"><!--bf:s0-->\${escapeText(String(_p.item))}<!--/--></li>\` })
|
|
368
|
+
export function Item(_p, __bfKey) { return createComponent('Item__b3c36eee', _p, __bfKey) }
|
|
369
|
+
function initDashboard() {}
|
|
370
|
+
|
|
371
|
+
hydrate('Dashboard__b3c36eee', { init: initDashboard, template: (_p) => \`<div>D</div>\` })
|
|
372
|
+
export function Dashboard(_p, __bfKey) { return createComponent('Dashboard__b3c36eee', _p, __bfKey) }
|
|
373
|
+
export function initExample(__scope, _p = {}) {
|
|
374
|
+
if (!__scope) return
|
|
375
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
376
|
+
|
|
377
|
+
const children = _p.children
|
|
378
|
+
const [count, setCount] = createSignal(0)
|
|
379
|
+
const [isLoggedIn] = createSignal(false)
|
|
380
|
+
const [todos] = createSignal([])
|
|
381
|
+
const [items] = createSignal([])
|
|
382
|
+
const [filter] = createSignal('all')
|
|
383
|
+
const [accepted] = createSignal(false)
|
|
384
|
+
const [text, setText] = createSignal('')
|
|
385
|
+
|
|
386
|
+
const [_s1] = $(__scope, 's1')
|
|
387
|
+
|
|
388
|
+
mapArray(() => (todos()).flatMap((todo) => todo.tags.map((tag) => ({ k: (\`\${todo.id}:\${tag}\`), h: \`<li data-key-1="\${escapeAttr(\`\${todo.id}:\${tag}\`)}"><!--bf:s0-->\${escapeText(tag)}<!--/--></li>\` }))), _s1, (__bfD, __bfI) => String(__bfD.k ?? __bfI), (__bfD, __idx, __existing) => {
|
|
389
|
+
let __el = __existing
|
|
390
|
+
if (!__el) { const __tpl = document.createElement('template'); __tpl.innerHTML = __bfD().h; __el = __tpl.content.firstElementChild }
|
|
391
|
+
let __last = __existing ? undefined : __bfD().h
|
|
392
|
+
createEffect(() => {
|
|
393
|
+
const __html = __bfD().h
|
|
394
|
+
if (__last === undefined) { __last = __html; return }
|
|
395
|
+
if (__html !== __last) { __last = __html; patchLeaf(__el, __html) }
|
|
396
|
+
})
|
|
397
|
+
return __el
|
|
398
|
+
}, 'l1')
|
|
399
|
+
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l1-->\${([]).flatMap((todo) => \`<!--bf-loop:l0-->\${todo.tags.map((tag) => \`<li data-key-1="\${escapeAttr(\`\${todo.id}:\${tag}\`)}"><!--bf:s0-->\${escapeText(tag)}<!--/--></li>\`).join('')}<!--bf-/loop:l0-->\`).join('')}<!--bf-/loop:l1--></div>\` })
|
|
403
|
+
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
404
|
+
`;
|
|
405
|
+
|
|
406
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L64 — ✅ Statement body — JS-runtime adapters; /* @client */ on Go/Mojo etc. 1`] = `
|
|
407
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray, patchLeaf } from '@barefootjs/client/runtime'
|
|
369
408
|
|
|
370
|
-
|
|
409
|
+
export function initTodoItem(__scope, _p = {}) {
|
|
410
|
+
if (!__scope) return
|
|
411
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
412
|
+
|
|
413
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
371
414
|
createEffect(() => {
|
|
372
415
|
const __val = String(_p.todo)
|
|
373
|
-
|
|
416
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
374
417
|
})
|
|
375
418
|
|
|
376
419
|
}
|
|
@@ -381,12 +424,84 @@ export function initItem(__scope, _p = {}) {
|
|
|
381
424
|
if (!__scope) return
|
|
382
425
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
383
426
|
|
|
384
|
-
const
|
|
427
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
428
|
+
createEffect(() => {
|
|
429
|
+
const __val = String(_p.item)
|
|
430
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
hydrate('Item__b3c36eee', { init: initItem, template: (_p) => \`<li bf="s1"><!--bf:s0-->\${escapeText(String(_p.item))}<!--/--></li>\` })
|
|
436
|
+
export function Item(_p, __bfKey) { return createComponent('Item__b3c36eee', _p, __bfKey) }
|
|
437
|
+
function initDashboard() {}
|
|
438
|
+
|
|
439
|
+
hydrate('Dashboard__b3c36eee', { init: initDashboard, template: (_p) => \`<div>D</div>\` })
|
|
440
|
+
export function Dashboard(_p, __bfKey) { return createComponent('Dashboard__b3c36eee', _p, __bfKey) }
|
|
441
|
+
export function initExample(__scope, _p = {}) {
|
|
442
|
+
if (!__scope) return
|
|
443
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
444
|
+
|
|
445
|
+
const children = _p.children
|
|
446
|
+
const [count, setCount] = createSignal(0)
|
|
447
|
+
const [isLoggedIn] = createSignal(false)
|
|
448
|
+
const [todos] = createSignal([])
|
|
449
|
+
const [items] = createSignal([])
|
|
450
|
+
const [filter] = createSignal('all')
|
|
451
|
+
const [accepted] = createSignal(false)
|
|
452
|
+
const [text, setText] = createSignal('')
|
|
453
|
+
|
|
454
|
+
const [_s0] = $(__scope, 's0')
|
|
385
455
|
|
|
386
|
-
|
|
456
|
+
mapArray(() => (todos()).flatMap((todo) => {
|
|
457
|
+
if (todo.hidden) return []
|
|
458
|
+
return todo.tags.map(tag => ({ k: (\`\${todo.id}:\${tag}\`), h: \`<li>\${escapeText((tag))}</li>\` }))
|
|
459
|
+
}), _s0, (__bfD, __bfI) => String(__bfD.k ?? __bfI), (__bfD, __idx, __existing) => {
|
|
460
|
+
let __el = __existing
|
|
461
|
+
if (!__el) { const __tpl = document.createElement('template'); __tpl.innerHTML = __bfD().h; __el = __tpl.content.firstElementChild }
|
|
462
|
+
let __last = __existing ? undefined : __bfD().h
|
|
463
|
+
createEffect(() => {
|
|
464
|
+
const __html = __bfD().h
|
|
465
|
+
if (__last === undefined) { __last = __html; return }
|
|
466
|
+
if (__html !== __last) { __last = __html; patchLeaf(__el, __html) }
|
|
467
|
+
})
|
|
468
|
+
return __el
|
|
469
|
+
}, 'l0')
|
|
470
|
+
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s0"><!--bf-loop:l0-->\${([]).flatMap((todo) => {
|
|
474
|
+
if (todo.hidden) return []
|
|
475
|
+
return todo.tags.map(tag => \`<li>\${escapeText((tag))}</li>\`)
|
|
476
|
+
}).join('')}<!--bf-/loop:l0--></div>\` })
|
|
477
|
+
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
478
|
+
`;
|
|
479
|
+
|
|
480
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L74 — ✅ Sort then render 1`] = `
|
|
481
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
482
|
+
|
|
483
|
+
export function initTodoItem(__scope, _p = {}) {
|
|
484
|
+
if (!__scope) return
|
|
485
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
486
|
+
|
|
487
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
488
|
+
createEffect(() => {
|
|
489
|
+
const __val = String(_p.todo)
|
|
490
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
491
|
+
})
|
|
492
|
+
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
hydrate('TodoItem__b3c36eee', { init: initTodoItem, template: (_p) => \`<li bf="s1"><!--bf:s0-->\${escapeText(String(_p.todo))}<!--/--></li>\` })
|
|
496
|
+
export function TodoItem(_p, __bfKey) { return createComponent('TodoItem__b3c36eee', _p, __bfKey) }
|
|
497
|
+
export function initItem(__scope, _p = {}) {
|
|
498
|
+
if (!__scope) return
|
|
499
|
+
const __scopeId = __scope.getAttribute('bf-s')
|
|
500
|
+
|
|
501
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
387
502
|
createEffect(() => {
|
|
388
503
|
const __val = String(_p.item)
|
|
389
|
-
|
|
504
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
390
505
|
})
|
|
391
506
|
|
|
392
507
|
}
|
|
@@ -423,19 +538,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
423
538
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
424
539
|
`;
|
|
425
540
|
|
|
426
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
427
|
-
"import { $,
|
|
541
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L79 — ✅ Filter, sort, then render 1`] = `
|
|
542
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
428
543
|
|
|
429
544
|
export function initTodoItem(__scope, _p = {}) {
|
|
430
545
|
if (!__scope) return
|
|
431
546
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
432
547
|
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
let __anchor_s0 = _s0
|
|
548
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
436
549
|
createEffect(() => {
|
|
437
550
|
const __val = String(_p.todo)
|
|
438
|
-
|
|
551
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
439
552
|
})
|
|
440
553
|
|
|
441
554
|
}
|
|
@@ -446,12 +559,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
446
559
|
if (!__scope) return
|
|
447
560
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
448
561
|
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
let __anchor_s0 = _s0
|
|
562
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
452
563
|
createEffect(() => {
|
|
453
564
|
const __val = String(_p.item)
|
|
454
|
-
|
|
565
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
455
566
|
})
|
|
456
567
|
|
|
457
568
|
}
|
|
@@ -488,19 +599,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
488
599
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
489
600
|
`;
|
|
490
601
|
|
|
491
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
492
|
-
"import { $,
|
|
602
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L84 — ✅ Multi-key: sort by price, break ties by name 1`] = `
|
|
603
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
493
604
|
|
|
494
605
|
export function initTodoItem(__scope, _p = {}) {
|
|
495
606
|
if (!__scope) return
|
|
496
607
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
497
608
|
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
let __anchor_s0 = _s0
|
|
609
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
501
610
|
createEffect(() => {
|
|
502
611
|
const __val = String(_p.todo)
|
|
503
|
-
|
|
612
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
504
613
|
})
|
|
505
614
|
|
|
506
615
|
}
|
|
@@ -511,12 +620,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
511
620
|
if (!__scope) return
|
|
512
621
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
513
622
|
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
let __anchor_s0 = _s0
|
|
623
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
517
624
|
createEffect(() => {
|
|
518
625
|
const __val = String(_p.item)
|
|
519
|
-
|
|
626
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
520
627
|
})
|
|
521
628
|
|
|
522
629
|
}
|
|
@@ -553,19 +660,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
553
660
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
554
661
|
`;
|
|
555
662
|
|
|
556
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
557
|
-
"import { $,
|
|
663
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L89 — ✅ Relational ternary 1`] = `
|
|
664
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
558
665
|
|
|
559
666
|
export function initTodoItem(__scope, _p = {}) {
|
|
560
667
|
if (!__scope) return
|
|
561
668
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
562
669
|
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
let __anchor_s0 = _s0
|
|
670
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
566
671
|
createEffect(() => {
|
|
567
672
|
const __val = String(_p.todo)
|
|
568
|
-
|
|
673
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
569
674
|
})
|
|
570
675
|
|
|
571
676
|
}
|
|
@@ -576,12 +681,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
576
681
|
if (!__scope) return
|
|
577
682
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
578
683
|
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
let __anchor_s0 = _s0
|
|
684
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
582
685
|
createEffect(() => {
|
|
583
686
|
const __val = String(_p.item)
|
|
584
|
-
|
|
687
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
585
688
|
})
|
|
586
689
|
|
|
587
690
|
}
|
|
@@ -618,19 +721,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
618
721
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
619
722
|
`;
|
|
620
723
|
|
|
621
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
622
|
-
"import { $,
|
|
724
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L100 — (no label) 1`] = `
|
|
725
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
623
726
|
|
|
624
727
|
export function initTodoItem(__scope, _p = {}) {
|
|
625
728
|
if (!__scope) return
|
|
626
729
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
627
730
|
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
let __anchor_s0 = _s0
|
|
731
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
631
732
|
createEffect(() => {
|
|
632
733
|
const __val = String(_p.todo)
|
|
633
|
-
|
|
734
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
634
735
|
})
|
|
635
736
|
|
|
636
737
|
}
|
|
@@ -641,12 +742,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
641
742
|
if (!__scope) return
|
|
642
743
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
643
744
|
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
let __anchor_s0 = _s0
|
|
745
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
647
746
|
createEffect(() => {
|
|
648
747
|
const __val = String(_p.item)
|
|
649
|
-
|
|
748
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
650
749
|
})
|
|
651
750
|
|
|
652
751
|
}
|
|
@@ -682,19 +781,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div><button bf="s0"
|
|
|
682
781
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
683
782
|
`;
|
|
684
783
|
|
|
685
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
686
|
-
"import {
|
|
784
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L142 — ✅ Nested \`.filter()\` / \`.map()\` now compiles everywhere 1`] = `
|
|
785
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
687
786
|
|
|
688
787
|
export function initTodoItem(__scope, _p = {}) {
|
|
689
788
|
if (!__scope) return
|
|
690
789
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
691
790
|
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
let __anchor_s0 = _s0
|
|
791
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
695
792
|
createEffect(() => {
|
|
696
793
|
const __val = String(_p.todo)
|
|
697
|
-
|
|
794
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
698
795
|
})
|
|
699
796
|
|
|
700
797
|
}
|
|
@@ -705,12 +802,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
705
802
|
if (!__scope) return
|
|
706
803
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
707
804
|
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
let __anchor_s0 = _s0
|
|
805
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
711
806
|
createEffect(() => {
|
|
712
807
|
const __val = String(_p.item)
|
|
713
|
-
|
|
808
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
714
809
|
})
|
|
715
810
|
|
|
716
811
|
}
|
|
@@ -734,12 +829,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
734
829
|
const [accepted] = createSignal(false)
|
|
735
830
|
const [text, setText] = createSignal('')
|
|
736
831
|
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
let __anchor_s0 = _s0
|
|
832
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
740
833
|
createEffect(() => {
|
|
741
834
|
const __val = items().filter(x => x.tags.filter(t => t.active).length > 0).map(t => t.name)
|
|
742
|
-
|
|
835
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
743
836
|
})
|
|
744
837
|
|
|
745
838
|
}
|
|
@@ -748,19 +841,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:
|
|
|
748
841
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
749
842
|
`;
|
|
750
843
|
|
|
751
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
752
|
-
"import {
|
|
844
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L149 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
845
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
753
846
|
|
|
754
847
|
export function initTodoItem(__scope, _p = {}) {
|
|
755
848
|
if (!__scope) return
|
|
756
849
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
757
850
|
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
let __anchor_s0 = _s0
|
|
851
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
761
852
|
createEffect(() => {
|
|
762
853
|
const __val = String(_p.todo)
|
|
763
|
-
|
|
854
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
764
855
|
})
|
|
765
856
|
|
|
766
857
|
}
|
|
@@ -771,12 +862,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
771
862
|
if (!__scope) return
|
|
772
863
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
773
864
|
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
let __anchor_s0 = _s0
|
|
865
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
777
866
|
createEffect(() => {
|
|
778
867
|
const __val = String(_p.item)
|
|
779
|
-
|
|
868
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
780
869
|
})
|
|
781
870
|
|
|
782
871
|
}
|
|
@@ -800,12 +889,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
800
889
|
const [accepted] = createSignal(false)
|
|
801
890
|
const [text, setText] = createSignal('')
|
|
802
891
|
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
let __anchor_s0 = _s0
|
|
892
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
806
893
|
createEffect(() => {
|
|
807
894
|
const __val = items().filter(x => x.tags.some(t => t.active)).map(t => t.name)
|
|
808
|
-
|
|
895
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
809
896
|
})
|
|
810
897
|
|
|
811
898
|
}
|
|
@@ -814,19 +901,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:
|
|
|
814
901
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
815
902
|
`;
|
|
816
903
|
|
|
817
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
818
|
-
"import {
|
|
904
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L152 — ✅ Add /* @client */ to evaluate on the client 1`] = `
|
|
905
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
819
906
|
|
|
820
907
|
export function initTodoItem(__scope, _p = {}) {
|
|
821
908
|
if (!__scope) return
|
|
822
909
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
823
910
|
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
let __anchor_s0 = _s0
|
|
911
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
827
912
|
createEffect(() => {
|
|
828
913
|
const __val = String(_p.todo)
|
|
829
|
-
|
|
914
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
830
915
|
})
|
|
831
916
|
|
|
832
917
|
}
|
|
@@ -837,12 +922,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
837
922
|
if (!__scope) return
|
|
838
923
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
839
924
|
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
let __anchor_s0 = _s0
|
|
925
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
843
926
|
createEffect(() => {
|
|
844
927
|
const __val = String(_p.item)
|
|
845
|
-
|
|
928
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
846
929
|
})
|
|
847
930
|
|
|
848
931
|
}
|
|
@@ -867,29 +950,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
867
950
|
const [text, setText] = createSignal('')
|
|
868
951
|
|
|
869
952
|
// @client: s0
|
|
953
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
870
954
|
createEffect(() => {
|
|
871
|
-
|
|
872
|
-
})
|
|
955
|
+
__bfw_s0('s0', items().filter(x => x.tags.some(t => t.active)).map(t => t.name))
|
|
956
|
+
}) }
|
|
873
957
|
|
|
874
958
|
}
|
|
875
959
|
|
|
876
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
960
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
877
961
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
878
962
|
`;
|
|
879
963
|
|
|
880
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
881
|
-
"import {
|
|
964
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L159 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
965
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
882
966
|
|
|
883
967
|
export function initTodoItem(__scope, _p = {}) {
|
|
884
968
|
if (!__scope) return
|
|
885
969
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
886
970
|
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
let __anchor_s0 = _s0
|
|
971
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
890
972
|
createEffect(() => {
|
|
891
973
|
const __val = String(_p.todo)
|
|
892
|
-
|
|
974
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
893
975
|
})
|
|
894
976
|
|
|
895
977
|
}
|
|
@@ -900,12 +982,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
900
982
|
if (!__scope) return
|
|
901
983
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
902
984
|
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
let __anchor_s0 = _s0
|
|
985
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
906
986
|
createEffect(() => {
|
|
907
987
|
const __val = String(_p.item)
|
|
908
|
-
|
|
988
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
909
989
|
})
|
|
910
990
|
|
|
911
991
|
}
|
|
@@ -929,12 +1009,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
929
1009
|
const [accepted] = createSignal(false)
|
|
930
1010
|
const [text, setText] = createSignal('')
|
|
931
1011
|
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
let __anchor_s0 = _s0
|
|
1012
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
935
1013
|
createEffect(() => {
|
|
936
1014
|
const __val = items().reduce((sum, x) => sum + x.price, 0)
|
|
937
|
-
|
|
1015
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
938
1016
|
})
|
|
939
1017
|
|
|
940
1018
|
}
|
|
@@ -943,19 +1021,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:
|
|
|
943
1021
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
944
1022
|
`;
|
|
945
1023
|
|
|
946
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
947
|
-
"import {
|
|
1024
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L162 — ✅ Use /* @client */ 1`] = `
|
|
1025
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
948
1026
|
|
|
949
1027
|
export function initTodoItem(__scope, _p = {}) {
|
|
950
1028
|
if (!__scope) return
|
|
951
1029
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
952
1030
|
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
let __anchor_s0 = _s0
|
|
1031
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
956
1032
|
createEffect(() => {
|
|
957
1033
|
const __val = String(_p.todo)
|
|
958
|
-
|
|
1034
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
959
1035
|
})
|
|
960
1036
|
|
|
961
1037
|
}
|
|
@@ -966,12 +1042,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
966
1042
|
if (!__scope) return
|
|
967
1043
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
968
1044
|
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
let __anchor_s0 = _s0
|
|
1045
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
972
1046
|
createEffect(() => {
|
|
973
1047
|
const __val = String(_p.item)
|
|
974
|
-
|
|
1048
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
975
1049
|
})
|
|
976
1050
|
|
|
977
1051
|
}
|
|
@@ -996,29 +1070,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
996
1070
|
const [text, setText] = createSignal('')
|
|
997
1071
|
|
|
998
1072
|
// @client: s0
|
|
1073
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
999
1074
|
createEffect(() => {
|
|
1000
|
-
|
|
1001
|
-
})
|
|
1075
|
+
__bfw_s0('s0', items().reduce((sum, x) => sum + x.price, 0))
|
|
1076
|
+
}) }
|
|
1002
1077
|
|
|
1003
1078
|
}
|
|
1004
1079
|
|
|
1005
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1080
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1006
1081
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1007
1082
|
`;
|
|
1008
1083
|
|
|
1009
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1010
|
-
"import {
|
|
1084
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L179 — ❌ BF101 on Go/Mojo; works on Hono 1`] = `
|
|
1085
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1011
1086
|
|
|
1012
1087
|
export function initTodoItem(__scope, _p = {}) {
|
|
1013
1088
|
if (!__scope) return
|
|
1014
1089
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1015
1090
|
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
let __anchor_s0 = _s0
|
|
1091
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1019
1092
|
createEffect(() => {
|
|
1020
1093
|
const __val = String(_p.todo)
|
|
1021
|
-
|
|
1094
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1022
1095
|
})
|
|
1023
1096
|
|
|
1024
1097
|
}
|
|
@@ -1029,12 +1102,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1029
1102
|
if (!__scope) return
|
|
1030
1103
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1031
1104
|
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
let __anchor_s0 = _s0
|
|
1105
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1035
1106
|
createEffect(() => {
|
|
1036
1107
|
const __val = String(_p.item)
|
|
1037
|
-
|
|
1108
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1038
1109
|
})
|
|
1039
1110
|
|
|
1040
1111
|
}
|
|
@@ -1058,12 +1129,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
1058
1129
|
const [accepted] = createSignal(false)
|
|
1059
1130
|
const [text, setText] = createSignal('')
|
|
1060
1131
|
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
let __anchor_s0 = _s0
|
|
1132
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1064
1133
|
createEffect(() => {
|
|
1065
1134
|
const __val = items().filter(function(x) { return x.done })
|
|
1066
|
-
|
|
1135
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1067
1136
|
})
|
|
1068
1137
|
|
|
1069
1138
|
}
|
|
@@ -1072,19 +1141,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:
|
|
|
1072
1141
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1073
1142
|
`;
|
|
1074
1143
|
|
|
1075
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1076
|
-
"import {
|
|
1144
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L182 — ✅ Use arrow functions for adapter portability 1`] = `
|
|
1145
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1077
1146
|
|
|
1078
1147
|
export function initTodoItem(__scope, _p = {}) {
|
|
1079
1148
|
if (!__scope) return
|
|
1080
1149
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1081
1150
|
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
let __anchor_s0 = _s0
|
|
1151
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1085
1152
|
createEffect(() => {
|
|
1086
1153
|
const __val = String(_p.todo)
|
|
1087
|
-
|
|
1154
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1088
1155
|
})
|
|
1089
1156
|
|
|
1090
1157
|
}
|
|
@@ -1095,12 +1162,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1095
1162
|
if (!__scope) return
|
|
1096
1163
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1097
1164
|
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
let __anchor_s0 = _s0
|
|
1165
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1101
1166
|
createEffect(() => {
|
|
1102
1167
|
const __val = String(_p.item)
|
|
1103
|
-
|
|
1168
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1104
1169
|
})
|
|
1105
1170
|
|
|
1106
1171
|
}
|
|
@@ -1124,12 +1189,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
1124
1189
|
const [accepted] = createSignal(false)
|
|
1125
1190
|
const [text, setText] = createSignal('')
|
|
1126
1191
|
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
let __anchor_s0 = _s0
|
|
1192
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1130
1193
|
createEffect(() => {
|
|
1131
1194
|
const __val = items().filter(x => x.done)
|
|
1132
|
-
|
|
1195
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1133
1196
|
})
|
|
1134
1197
|
|
|
1135
1198
|
}
|
|
@@ -1138,19 +1201,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:
|
|
|
1138
1201
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1139
1202
|
`;
|
|
1140
1203
|
|
|
1141
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1142
|
-
"import { $,
|
|
1204
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L195 — ✅ Value-producing block bodies normalize (let-inline) and lower everywhere 1`] = `
|
|
1205
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1143
1206
|
|
|
1144
1207
|
export function initTodoItem(__scope, _p = {}) {
|
|
1145
1208
|
if (!__scope) return
|
|
1146
1209
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1147
1210
|
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
let __anchor_s0 = _s0
|
|
1211
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1151
1212
|
createEffect(() => {
|
|
1152
1213
|
const __val = String(_p.todo)
|
|
1153
|
-
|
|
1214
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1154
1215
|
})
|
|
1155
1216
|
|
|
1156
1217
|
}
|
|
@@ -1161,12 +1222,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1161
1222
|
if (!__scope) return
|
|
1162
1223
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1163
1224
|
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1166
|
-
let __anchor_s0 = _s0
|
|
1225
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1167
1226
|
createEffect(() => {
|
|
1168
1227
|
const __val = String(_p.item)
|
|
1169
|
-
|
|
1228
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1170
1229
|
})
|
|
1171
1230
|
|
|
1172
1231
|
}
|
|
@@ -1203,19 +1262,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
1203
1262
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1204
1263
|
`;
|
|
1205
1264
|
|
|
1206
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1207
|
-
"import { $,
|
|
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`] = `
|
|
1266
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1208
1267
|
|
|
1209
1268
|
export function initTodoItem(__scope, _p = {}) {
|
|
1210
1269
|
if (!__scope) return
|
|
1211
1270
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1212
1271
|
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
let __anchor_s0 = _s0
|
|
1272
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1216
1273
|
createEffect(() => {
|
|
1217
1274
|
const __val = String(_p.todo)
|
|
1218
|
-
|
|
1275
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1219
1276
|
})
|
|
1220
1277
|
|
|
1221
1278
|
}
|
|
@@ -1226,12 +1283,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1226
1283
|
if (!__scope) return
|
|
1227
1284
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1228
1285
|
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
let __anchor_s0 = _s0
|
|
1286
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1232
1287
|
createEffect(() => {
|
|
1233
1288
|
const __val = String(_p.item)
|
|
1234
|
-
|
|
1289
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1235
1290
|
})
|
|
1236
1291
|
|
|
1237
1292
|
}
|
|
@@ -1268,19 +1323,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
1268
1323
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1269
1324
|
`;
|
|
1270
1325
|
|
|
1271
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1272
|
-
"import { $,
|
|
1326
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L210 — ✅ Use /* @client */ 1`] = `
|
|
1327
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1273
1328
|
|
|
1274
1329
|
export function initTodoItem(__scope, _p = {}) {
|
|
1275
1330
|
if (!__scope) return
|
|
1276
1331
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1277
1332
|
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
let __anchor_s0 = _s0
|
|
1333
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1281
1334
|
createEffect(() => {
|
|
1282
1335
|
const __val = String(_p.todo)
|
|
1283
|
-
|
|
1336
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1284
1337
|
})
|
|
1285
1338
|
|
|
1286
1339
|
}
|
|
@@ -1291,12 +1344,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1291
1344
|
if (!__scope) return
|
|
1292
1345
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1293
1346
|
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
let __anchor_s0 = _s0
|
|
1347
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1297
1348
|
createEffect(() => {
|
|
1298
1349
|
const __val = String(_p.item)
|
|
1299
|
-
|
|
1350
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1300
1351
|
})
|
|
1301
1352
|
|
|
1302
1353
|
}
|
|
@@ -1333,8 +1384,8 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
1333
1384
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1334
1385
|
`;
|
|
1335
1386
|
|
|
1336
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1337
|
-
"import { $,
|
|
1387
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L222 — ❌ BF021 on Go/Mojo — \`byPrice\` is imported, not declared in this file 1`] = `
|
|
1388
|
+
"import { $, createComponent, createEffect, escapeAttr, escapeText, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
1338
1389
|
import { byPrice } from './comparators'
|
|
1339
1390
|
|
|
1340
1391
|
|
|
@@ -1350,31 +1401,28 @@ export function initSortedList(__scope, _p = {}) {
|
|
|
1350
1401
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
1351
1402
|
mapArray(() => items.sort(byPrice), _s1, (item) => String(item.id), (item, __idx, __existing) => {
|
|
1352
1403
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1355
|
-
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)) })
|
|
1356
1406
|
return __el
|
|
1357
1407
|
}, 'l0')
|
|
1358
1408
|
|
|
1359
1409
|
}
|
|
1360
1410
|
|
|
1361
|
-
hydrate('SortedList__b3c36eee', { init: initSortedList, template: (_p) => \`<ul bf="s1"><!--bf-loop:l0-->\${_p.items.sort(byPrice).map((item) => \`<li data-key="\${item.id}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></ul>\` })
|
|
1411
|
+
hydrate('SortedList__b3c36eee', { init: initSortedList, template: (_p) => \`<ul bf="s1"><!--bf-loop:l0-->\${_p.items.sort(byPrice).map((item) => \`<li data-key="\${escapeAttr(item.id)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></ul>\` })
|
|
1362
1412
|
export function SortedList(_p, __bfKey) { return createComponent('SortedList__b3c36eee', _p, __bfKey) }"
|
|
1363
1413
|
`;
|
|
1364
1414
|
|
|
1365
|
-
exports[`docs/core/rendering/jsx-compatibility.md doc-examples
|
|
1366
|
-
"import { $,
|
|
1415
|
+
exports[`docs/core/rendering/jsx-compatibility.md doc-examples L228 — ✅ Use /* @client */, or inline / re-declare the comparator locally 1`] = `
|
|
1416
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
1367
1417
|
|
|
1368
1418
|
export function initTodoItem(__scope, _p = {}) {
|
|
1369
1419
|
if (!__scope) return
|
|
1370
1420
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1371
1421
|
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1374
|
-
let __anchor_s0 = _s0
|
|
1422
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1375
1423
|
createEffect(() => {
|
|
1376
1424
|
const __val = String(_p.todo)
|
|
1377
|
-
|
|
1425
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1378
1426
|
})
|
|
1379
1427
|
|
|
1380
1428
|
}
|
|
@@ -1385,12 +1433,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1385
1433
|
if (!__scope) return
|
|
1386
1434
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1387
1435
|
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
let __anchor_s0 = _s0
|
|
1436
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1391
1437
|
createEffect(() => {
|
|
1392
1438
|
const __val = String(_p.item)
|
|
1393
|
-
|
|
1439
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1394
1440
|
})
|
|
1395
1441
|
|
|
1396
1442
|
}
|
|
@@ -1427,19 +1473,17 @@ hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-
|
|
|
1427
1473
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1428
1474
|
`;
|
|
1429
1475
|
|
|
1430
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1431
|
-
"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'
|
|
1432
1478
|
|
|
1433
1479
|
export function initTodoItem(__scope, _p = {}) {
|
|
1434
1480
|
if (!__scope) return
|
|
1435
1481
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1436
1482
|
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1439
|
-
let __anchor_s0 = _s0
|
|
1483
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1440
1484
|
createEffect(() => {
|
|
1441
1485
|
const __val = String(_p.todo)
|
|
1442
|
-
|
|
1486
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1443
1487
|
})
|
|
1444
1488
|
|
|
1445
1489
|
}
|
|
@@ -1450,12 +1494,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1450
1494
|
if (!__scope) return
|
|
1451
1495
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1452
1496
|
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
let __anchor_s0 = _s0
|
|
1497
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1456
1498
|
createEffect(() => {
|
|
1457
1499
|
const __val = String(_p.item)
|
|
1458
|
-
|
|
1500
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1459
1501
|
})
|
|
1460
1502
|
|
|
1461
1503
|
}
|
|
@@ -1480,29 +1522,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1480
1522
|
const [text, setText] = createSignal('')
|
|
1481
1523
|
|
|
1482
1524
|
// @client: s0
|
|
1525
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1483
1526
|
createEffect(() => {
|
|
1484
|
-
|
|
1485
|
-
})
|
|
1527
|
+
__bfw_s0('s0', items().filter(x => x.tags().filter(t => t.active).length > 0))
|
|
1528
|
+
}) }
|
|
1486
1529
|
|
|
1487
1530
|
}
|
|
1488
1531
|
|
|
1489
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1532
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1490
1533
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1491
1534
|
`;
|
|
1492
1535
|
|
|
1493
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1494
|
-
"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'
|
|
1495
1538
|
|
|
1496
1539
|
export function initTodoItem(__scope, _p = {}) {
|
|
1497
1540
|
if (!__scope) return
|
|
1498
1541
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1499
1542
|
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1502
|
-
let __anchor_s0 = _s0
|
|
1543
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1503
1544
|
createEffect(() => {
|
|
1504
1545
|
const __val = String(_p.todo)
|
|
1505
|
-
|
|
1546
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1506
1547
|
})
|
|
1507
1548
|
|
|
1508
1549
|
}
|
|
@@ -1513,12 +1554,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1513
1554
|
if (!__scope) return
|
|
1514
1555
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1515
1556
|
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
let __anchor_s0 = _s0
|
|
1557
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1519
1558
|
createEffect(() => {
|
|
1520
1559
|
const __val = String(_p.item)
|
|
1521
|
-
|
|
1560
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1522
1561
|
})
|
|
1523
1562
|
|
|
1524
1563
|
}
|
|
@@ -1543,29 +1582,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1543
1582
|
const [text, setText] = createSignal('')
|
|
1544
1583
|
|
|
1545
1584
|
// @client: s0
|
|
1585
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0], markerless: true }])
|
|
1546
1586
|
createEffect(() => {
|
|
1547
|
-
|
|
1548
|
-
})
|
|
1587
|
+
__bfw_s0('s0', items().reduce((sum, x) => sum + x.price, 0))
|
|
1588
|
+
}) }
|
|
1549
1589
|
|
|
1550
1590
|
}
|
|
1551
1591
|
|
|
1552
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf
|
|
1592
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf:s0--><!--/--></div>\` })
|
|
1553
1593
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1554
1594
|
`;
|
|
1555
1595
|
|
|
1556
|
-
exports[`docs/core/rendering/client-directive.md doc-examples
|
|
1557
|
-
"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'
|
|
1558
1598
|
|
|
1559
1599
|
export function initTodoItem(__scope, _p = {}) {
|
|
1560
1600
|
if (!__scope) return
|
|
1561
1601
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1562
1602
|
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1565
|
-
let __anchor_s0 = _s0
|
|
1603
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1566
1604
|
createEffect(() => {
|
|
1567
1605
|
const __val = String(_p.todo)
|
|
1568
|
-
|
|
1606
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1569
1607
|
})
|
|
1570
1608
|
|
|
1571
1609
|
}
|
|
@@ -1576,12 +1614,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1576
1614
|
if (!__scope) return
|
|
1577
1615
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1578
1616
|
|
|
1579
|
-
const
|
|
1580
|
-
|
|
1581
|
-
let __anchor_s0 = _s0
|
|
1617
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1582
1618
|
createEffect(() => {
|
|
1583
1619
|
const __val = String(_p.item)
|
|
1584
|
-
|
|
1620
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1585
1621
|
})
|
|
1586
1622
|
|
|
1587
1623
|
}
|
|
@@ -1606,29 +1642,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
1606
1642
|
const [text, setText] = createSignal('')
|
|
1607
1643
|
|
|
1608
1644
|
// @client: s0
|
|
1645
|
+
{ const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'text', path: [0, 0], markerless: true }])
|
|
1609
1646
|
createEffect(() => {
|
|
1610
|
-
|
|
1611
|
-
})
|
|
1647
|
+
__bfw_s0('s0', todos().filter(t => !t.done).length)
|
|
1648
|
+
}) }
|
|
1612
1649
|
|
|
1613
1650
|
}
|
|
1614
1651
|
|
|
1615
|
-
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>\` })
|
|
1616
1653
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
1617
1654
|
`;
|
|
1618
1655
|
|
|
1619
1656
|
exports[`docs/core/rendering/fragment.md doc-examples L11 — (no label) 1`] = `
|
|
1620
|
-
"import {
|
|
1657
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1621
1658
|
|
|
1622
1659
|
export function initTodoItem(__scope, _p = {}) {
|
|
1623
1660
|
if (!__scope) return
|
|
1624
1661
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1625
1662
|
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
let __anchor_s0 = _s0
|
|
1663
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1629
1664
|
createEffect(() => {
|
|
1630
1665
|
const __val = String(_p.todo)
|
|
1631
|
-
|
|
1666
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1632
1667
|
})
|
|
1633
1668
|
|
|
1634
1669
|
}
|
|
@@ -1639,12 +1674,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1639
1674
|
if (!__scope) return
|
|
1640
1675
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1641
1676
|
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
let __anchor_s0 = _s0
|
|
1677
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1645
1678
|
createEffect(() => {
|
|
1646
1679
|
const __val = String(_p.item)
|
|
1647
|
-
|
|
1680
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1648
1681
|
})
|
|
1649
1682
|
|
|
1650
1683
|
}
|
|
@@ -1675,18 +1708,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
1675
1708
|
`;
|
|
1676
1709
|
|
|
1677
1710
|
exports[`docs/core/rendering/fragment.md doc-examples L23 — (no label) 1`] = `
|
|
1678
|
-
"import {
|
|
1711
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1679
1712
|
|
|
1680
1713
|
export function initTodoItem(__scope, _p = {}) {
|
|
1681
1714
|
if (!__scope) return
|
|
1682
1715
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1683
1716
|
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
let __anchor_s0 = _s0
|
|
1717
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1687
1718
|
createEffect(() => {
|
|
1688
1719
|
const __val = String(_p.todo)
|
|
1689
|
-
|
|
1720
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1690
1721
|
})
|
|
1691
1722
|
|
|
1692
1723
|
}
|
|
@@ -1697,12 +1728,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
1697
1728
|
if (!__scope) return
|
|
1698
1729
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
1699
1730
|
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1702
|
-
let __anchor_s0 = _s0
|
|
1731
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1703
1732
|
createEffect(() => {
|
|
1704
1733
|
const __val = String(_p.item)
|
|
1705
|
-
|
|
1734
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1706
1735
|
})
|
|
1707
1736
|
|
|
1708
1737
|
}
|
|
@@ -1890,7 +1919,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
1890
1919
|
`;
|
|
1891
1920
|
|
|
1892
1921
|
exports[`docs/core/reactivity/create-signal.md doc-examples L95 — (no label) 1`] = `
|
|
1893
|
-
"import { $,
|
|
1922
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
1894
1923
|
|
|
1895
1924
|
|
|
1896
1925
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -1900,12 +1929,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
1900
1929
|
const [count, setCount] = createSignal(0)
|
|
1901
1930
|
|
|
1902
1931
|
const [_s2] = $(__scope, 's2')
|
|
1903
|
-
const [_s0] = $t(__scope, 's0')
|
|
1904
1932
|
|
|
1905
|
-
|
|
1933
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
1906
1934
|
createEffect(() => {
|
|
1907
1935
|
const __val = count()
|
|
1908
|
-
|
|
1936
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
1909
1937
|
})
|
|
1910
1938
|
|
|
1911
1939
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -2079,18 +2107,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2079
2107
|
`;
|
|
2080
2108
|
|
|
2081
2109
|
exports[`docs/core/reactivity/create-effect.md doc-examples L115 — (no label) 1`] = `
|
|
2082
|
-
"import {
|
|
2110
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2083
2111
|
|
|
2084
2112
|
export function initTodoItem(__scope, _p = {}) {
|
|
2085
2113
|
if (!__scope) return
|
|
2086
2114
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2087
2115
|
|
|
2088
|
-
const
|
|
2089
|
-
|
|
2090
|
-
let __anchor_s0 = _s0
|
|
2116
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2091
2117
|
createEffect(() => {
|
|
2092
2118
|
const __val = String(_p.todo)
|
|
2093
|
-
|
|
2119
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2094
2120
|
})
|
|
2095
2121
|
|
|
2096
2122
|
}
|
|
@@ -2101,12 +2127,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2101
2127
|
if (!__scope) return
|
|
2102
2128
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2103
2129
|
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2106
|
-
let __anchor_s0 = _s0
|
|
2130
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2107
2131
|
createEffect(() => {
|
|
2108
2132
|
const __val = String(_p.item)
|
|
2109
|
-
|
|
2133
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2110
2134
|
})
|
|
2111
2135
|
|
|
2112
2136
|
}
|
|
@@ -2213,18 +2237,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2213
2237
|
`;
|
|
2214
2238
|
|
|
2215
2239
|
exports[`docs/core/reactivity/create-memo.md doc-examples L60 — No memo needed 1`] = `
|
|
2216
|
-
"import {
|
|
2240
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2217
2241
|
|
|
2218
2242
|
export function initTodoItem(__scope, _p = {}) {
|
|
2219
2243
|
if (!__scope) return
|
|
2220
2244
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2221
2245
|
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2224
|
-
let __anchor_s0 = _s0
|
|
2246
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2225
2247
|
createEffect(() => {
|
|
2226
2248
|
const __val = String(_p.todo)
|
|
2227
|
-
|
|
2249
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2228
2250
|
})
|
|
2229
2251
|
|
|
2230
2252
|
}
|
|
@@ -2235,12 +2257,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2235
2257
|
if (!__scope) return
|
|
2236
2258
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2237
2259
|
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2240
|
-
let __anchor_s0 = _s0
|
|
2260
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2241
2261
|
createEffect(() => {
|
|
2242
2262
|
const __val = String(_p.item)
|
|
2243
|
-
|
|
2263
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2244
2264
|
})
|
|
2245
2265
|
|
|
2246
2266
|
}
|
|
@@ -2264,12 +2284,10 @@ export function initExample(__scope, _p = {}) {
|
|
|
2264
2284
|
const [accepted] = createSignal(false)
|
|
2265
2285
|
const [text, setText] = createSignal('')
|
|
2266
2286
|
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2269
|
-
let __anchor_s0 = _s0
|
|
2287
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2270
2288
|
createEffect(() => {
|
|
2271
2289
|
const __val = count() * 2
|
|
2272
|
-
|
|
2290
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2273
2291
|
})
|
|
2274
2292
|
|
|
2275
2293
|
}
|
|
@@ -2520,19 +2538,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2520
2538
|
`;
|
|
2521
2539
|
|
|
2522
2540
|
exports[`docs/core/reactivity/props-reactivity.md doc-examples L82 — Parent 1`] = `
|
|
2523
|
-
"import { $c,
|
|
2541
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
2524
2542
|
import '/* @bf-child:Child */'
|
|
2525
2543
|
|
|
2526
2544
|
export function initTodoItem(__scope, _p = {}) {
|
|
2527
2545
|
if (!__scope) return
|
|
2528
2546
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2529
2547
|
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2532
|
-
let __anchor_s0 = _s0
|
|
2548
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2533
2549
|
createEffect(() => {
|
|
2534
2550
|
const __val = String(_p.todo)
|
|
2535
|
-
|
|
2551
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2536
2552
|
})
|
|
2537
2553
|
|
|
2538
2554
|
}
|
|
@@ -2543,12 +2559,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2543
2559
|
if (!__scope) return
|
|
2544
2560
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2545
2561
|
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2548
|
-
let __anchor_s0 = _s0
|
|
2562
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2549
2563
|
createEffect(() => {
|
|
2550
2564
|
const __val = String(_p.item)
|
|
2551
|
-
|
|
2565
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2552
2566
|
})
|
|
2553
2567
|
|
|
2554
2568
|
}
|
|
@@ -2601,18 +2615,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2601
2615
|
`;
|
|
2602
2616
|
|
|
2603
2617
|
exports[`docs/core/reactivity/props-reactivity.md doc-examples L85 — Compiled props object 1`] = `
|
|
2604
|
-
"import {
|
|
2618
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2605
2619
|
|
|
2606
2620
|
export function initTodoItem(__scope, _p = {}) {
|
|
2607
2621
|
if (!__scope) return
|
|
2608
2622
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2609
2623
|
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2612
|
-
let __anchor_s0 = _s0
|
|
2624
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2613
2625
|
createEffect(() => {
|
|
2614
2626
|
const __val = String(_p.todo)
|
|
2615
|
-
|
|
2627
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2616
2628
|
})
|
|
2617
2629
|
|
|
2618
2630
|
}
|
|
@@ -2623,12 +2635,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2623
2635
|
if (!__scope) return
|
|
2624
2636
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2625
2637
|
|
|
2626
|
-
const
|
|
2627
|
-
|
|
2628
|
-
let __anchor_s0 = _s0
|
|
2638
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2629
2639
|
createEffect(() => {
|
|
2630
2640
|
const __val = String(_p.item)
|
|
2631
|
-
|
|
2641
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2632
2642
|
})
|
|
2633
2643
|
|
|
2634
2644
|
}
|
|
@@ -2659,7 +2669,7 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2659
2669
|
`;
|
|
2660
2670
|
|
|
2661
2671
|
exports[`docs/core/components/component-authoring.mdx doc-examples L16 — (no label) 1`] = `
|
|
2662
|
-
"import {
|
|
2672
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2663
2673
|
|
|
2664
2674
|
|
|
2665
2675
|
export function initGreeting(__scope, _p = {}) {
|
|
@@ -2668,12 +2678,10 @@ export function initGreeting(__scope, _p = {}) {
|
|
|
2668
2678
|
|
|
2669
2679
|
const name = _p.name
|
|
2670
2680
|
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2673
|
-
let __anchor_s0 = _s0
|
|
2681
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2674
2682
|
createEffect(() => {
|
|
2675
2683
|
const __val = name
|
|
2676
|
-
|
|
2684
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2677
2685
|
})
|
|
2678
2686
|
|
|
2679
2687
|
}
|
|
@@ -2683,7 +2691,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
2683
2691
|
`;
|
|
2684
2692
|
|
|
2685
2693
|
exports[`docs/core/components/component-authoring.mdx doc-examples L29 — (no label) 1`] = `
|
|
2686
|
-
"import { $,
|
|
2694
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2687
2695
|
|
|
2688
2696
|
|
|
2689
2697
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -2693,12 +2701,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
2693
2701
|
const [count, setCount] = createSignal(0)
|
|
2694
2702
|
|
|
2695
2703
|
const [_s1] = $(__scope, 's1')
|
|
2696
|
-
const [_s0] = $t(__scope, 's0')
|
|
2697
2704
|
|
|
2698
|
-
|
|
2705
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2699
2706
|
createEffect(() => {
|
|
2700
2707
|
const __val = count()
|
|
2701
|
-
|
|
2708
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2702
2709
|
})
|
|
2703
2710
|
|
|
2704
2711
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -2790,19 +2797,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2790
2797
|
`;
|
|
2791
2798
|
|
|
2792
2799
|
exports[`docs/core/components/children-slots.md doc-examples L14 — (no label) 1`] = `
|
|
2793
|
-
"import { $c,
|
|
2800
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
2794
2801
|
import '/* @bf-child:Card */'
|
|
2795
2802
|
|
|
2796
2803
|
export function initTodoItem(__scope, _p = {}) {
|
|
2797
2804
|
if (!__scope) return
|
|
2798
2805
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2799
2806
|
|
|
2800
|
-
const
|
|
2801
|
-
|
|
2802
|
-
let __anchor_s0 = _s0
|
|
2807
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2803
2808
|
createEffect(() => {
|
|
2804
2809
|
const __val = String(_p.todo)
|
|
2805
|
-
|
|
2810
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2806
2811
|
})
|
|
2807
2812
|
|
|
2808
2813
|
}
|
|
@@ -2813,12 +2818,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2813
2818
|
if (!__scope) return
|
|
2814
2819
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2815
2820
|
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2818
|
-
let __anchor_s0 = _s0
|
|
2821
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2819
2822
|
createEffect(() => {
|
|
2820
2823
|
const __val = String(_p.item)
|
|
2821
|
-
|
|
2824
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2822
2825
|
})
|
|
2823
2826
|
|
|
2824
2827
|
}
|
|
@@ -2872,19 +2875,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
2872
2875
|
`;
|
|
2873
2876
|
|
|
2874
2877
|
exports[`docs/core/components/children-slots.md doc-examples L68 — Input 1`] = `
|
|
2875
|
-
"import { $c,
|
|
2878
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
2876
2879
|
import '/* @bf-child:Slot */'
|
|
2877
2880
|
|
|
2878
2881
|
export function initTodoItem(__scope, _p = {}) {
|
|
2879
2882
|
if (!__scope) return
|
|
2880
2883
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2881
2884
|
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2884
|
-
let __anchor_s0 = _s0
|
|
2885
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2885
2886
|
createEffect(() => {
|
|
2886
2887
|
const __val = String(_p.todo)
|
|
2887
|
-
|
|
2888
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2888
2889
|
})
|
|
2889
2890
|
|
|
2890
2891
|
}
|
|
@@ -2895,12 +2896,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2895
2896
|
if (!__scope) return
|
|
2896
2897
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2897
2898
|
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2900
|
-
let __anchor_s0 = _s0
|
|
2899
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2901
2900
|
createEffect(() => {
|
|
2902
2901
|
const __val = String(_p.item)
|
|
2903
|
-
|
|
2902
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2904
2903
|
})
|
|
2905
2904
|
|
|
2906
2905
|
}
|
|
@@ -2936,18 +2935,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2936
2935
|
`;
|
|
2937
2936
|
|
|
2938
2937
|
exports[`docs/core/components/children-slots.md doc-examples L73 — Output 1`] = `
|
|
2939
|
-
"import { $,
|
|
2938
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
2940
2939
|
|
|
2941
2940
|
export function initTodoItem(__scope, _p = {}) {
|
|
2942
2941
|
if (!__scope) return
|
|
2943
2942
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2944
2943
|
|
|
2945
|
-
const
|
|
2946
|
-
|
|
2947
|
-
let __anchor_s0 = _s0
|
|
2944
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2948
2945
|
createEffect(() => {
|
|
2949
2946
|
const __val = String(_p.todo)
|
|
2950
|
-
|
|
2947
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2951
2948
|
})
|
|
2952
2949
|
|
|
2953
2950
|
}
|
|
@@ -2958,12 +2955,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
2958
2955
|
if (!__scope) return
|
|
2959
2956
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
2960
2957
|
|
|
2961
|
-
const
|
|
2962
|
-
|
|
2963
|
-
let __anchor_s0 = _s0
|
|
2958
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
2964
2959
|
createEffect(() => {
|
|
2965
2960
|
const __val = String(_p.item)
|
|
2966
|
-
|
|
2961
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
2967
2962
|
})
|
|
2968
2963
|
|
|
2969
2964
|
}
|
|
@@ -2997,19 +2992,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
2997
2992
|
`;
|
|
2998
2993
|
|
|
2999
2994
|
exports[`docs/core/components/children-slots.md doc-examples L86 — (no label) 1`] = `
|
|
3000
|
-
"import { $c,
|
|
2995
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3001
2996
|
import '/* @bf-child:Button */'
|
|
3002
2997
|
|
|
3003
2998
|
export function initTodoItem(__scope, _p = {}) {
|
|
3004
2999
|
if (!__scope) return
|
|
3005
3000
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3006
3001
|
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3009
|
-
let __anchor_s0 = _s0
|
|
3002
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3010
3003
|
createEffect(() => {
|
|
3011
3004
|
const __val = String(_p.todo)
|
|
3012
|
-
|
|
3005
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3013
3006
|
})
|
|
3014
3007
|
|
|
3015
3008
|
}
|
|
@@ -3020,12 +3013,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3020
3013
|
if (!__scope) return
|
|
3021
3014
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3022
3015
|
|
|
3023
|
-
const
|
|
3024
|
-
|
|
3025
|
-
let __anchor_s0 = _s0
|
|
3016
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3026
3017
|
createEffect(() => {
|
|
3027
3018
|
const __val = String(_p.item)
|
|
3028
|
-
|
|
3019
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3029
3020
|
})
|
|
3030
3021
|
|
|
3031
3022
|
}
|
|
@@ -3061,19 +3052,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3061
3052
|
`;
|
|
3062
3053
|
|
|
3063
3054
|
exports[`docs/core/components/children-slots.md doc-examples L93 — (no label) 1`] = `
|
|
3064
|
-
"import { $c,
|
|
3055
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3065
3056
|
import '/* @bf-child:Button */'
|
|
3066
3057
|
|
|
3067
3058
|
export function initTodoItem(__scope, _p = {}) {
|
|
3068
3059
|
if (!__scope) return
|
|
3069
3060
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3070
3061
|
|
|
3071
|
-
const
|
|
3072
|
-
|
|
3073
|
-
let __anchor_s0 = _s0
|
|
3062
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3074
3063
|
createEffect(() => {
|
|
3075
3064
|
const __val = String(_p.todo)
|
|
3076
|
-
|
|
3065
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3077
3066
|
})
|
|
3078
3067
|
|
|
3079
3068
|
}
|
|
@@ -3084,12 +3073,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3084
3073
|
if (!__scope) return
|
|
3085
3074
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3086
3075
|
|
|
3087
|
-
const
|
|
3088
|
-
|
|
3089
|
-
let __anchor_s0 = _s0
|
|
3076
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3090
3077
|
createEffect(() => {
|
|
3091
3078
|
const __val = String(_p.item)
|
|
3092
|
-
|
|
3079
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3093
3080
|
})
|
|
3094
3081
|
|
|
3095
3082
|
}
|
|
@@ -3125,19 +3112,17 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3125
3112
|
`;
|
|
3126
3113
|
|
|
3127
3114
|
exports[`docs/core/components/children-slots.md doc-examples L109 — Dialog trigger as a custom element 1`] = `
|
|
3128
|
-
"import { $c,
|
|
3115
|
+
"import { $c, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3129
3116
|
import '/* @bf-child:DialogTrigger */'
|
|
3130
3117
|
|
|
3131
3118
|
export function initTodoItem(__scope, _p = {}) {
|
|
3132
3119
|
if (!__scope) return
|
|
3133
3120
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3134
3121
|
|
|
3135
|
-
const
|
|
3136
|
-
|
|
3137
|
-
let __anchor_s0 = _s0
|
|
3122
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3138
3123
|
createEffect(() => {
|
|
3139
3124
|
const __val = String(_p.todo)
|
|
3140
|
-
|
|
3125
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3141
3126
|
})
|
|
3142
3127
|
|
|
3143
3128
|
}
|
|
@@ -3148,12 +3133,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3148
3133
|
if (!__scope) return
|
|
3149
3134
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3150
3135
|
|
|
3151
|
-
const
|
|
3152
|
-
|
|
3153
|
-
let __anchor_s0 = _s0
|
|
3136
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3154
3137
|
createEffect(() => {
|
|
3155
3138
|
const __val = String(_p.item)
|
|
3156
|
-
|
|
3139
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3157
3140
|
})
|
|
3158
3141
|
|
|
3159
3142
|
}
|
|
@@ -3189,7 +3172,7 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3189
3172
|
`;
|
|
3190
3173
|
|
|
3191
3174
|
exports[`docs/core/components/children-slots.md doc-examples L118 — (no label) 1`] = `
|
|
3192
|
-
"import { $c,
|
|
3175
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3193
3176
|
import '/* @bf-child:Dialog */'
|
|
3194
3177
|
import '/* @bf-child:DialogTrigger */'
|
|
3195
3178
|
import '/* @bf-child:DialogOverlay */'
|
|
@@ -3205,12 +3188,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3205
3188
|
if (!__scope) return
|
|
3206
3189
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3207
3190
|
|
|
3208
|
-
const
|
|
3209
|
-
|
|
3210
|
-
let __anchor_s0 = _s0
|
|
3191
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3211
3192
|
createEffect(() => {
|
|
3212
3193
|
const __val = String(_p.todo)
|
|
3213
|
-
|
|
3194
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3214
3195
|
})
|
|
3215
3196
|
|
|
3216
3197
|
}
|
|
@@ -3221,12 +3202,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3221
3202
|
if (!__scope) return
|
|
3222
3203
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3223
3204
|
|
|
3224
|
-
const
|
|
3225
|
-
|
|
3226
|
-
let __anchor_s0 = _s0
|
|
3205
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3227
3206
|
createEffect(() => {
|
|
3228
3207
|
const __val = String(_p.item)
|
|
3229
|
-
|
|
3208
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3230
3209
|
})
|
|
3231
3210
|
|
|
3232
3211
|
}
|
|
@@ -3279,18 +3258,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3279
3258
|
`;
|
|
3280
3259
|
|
|
3281
3260
|
exports[`docs/core/components/children-slots.md doc-examples L140 — (no label) 1`] = `
|
|
3282
|
-
"import { $,
|
|
3261
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, mapArray, renderChild } from '@barefootjs/client/runtime'
|
|
3283
3262
|
|
|
3284
3263
|
export function initTodoItem(__scope, _p = {}) {
|
|
3285
3264
|
if (!__scope) return
|
|
3286
3265
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3287
3266
|
|
|
3288
|
-
const
|
|
3289
|
-
|
|
3290
|
-
let __anchor_s0 = _s0
|
|
3267
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3291
3268
|
createEffect(() => {
|
|
3292
3269
|
const __val = String(_p.todo)
|
|
3293
|
-
|
|
3270
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3294
3271
|
})
|
|
3295
3272
|
|
|
3296
3273
|
}
|
|
@@ -3301,12 +3278,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3301
3278
|
if (!__scope) return
|
|
3302
3279
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3303
3280
|
|
|
3304
|
-
const
|
|
3305
|
-
|
|
3306
|
-
let __anchor_s0 = _s0
|
|
3281
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3307
3282
|
createEffect(() => {
|
|
3308
3283
|
const __val = String(_p.item)
|
|
3309
|
-
|
|
3284
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3310
3285
|
})
|
|
3311
3286
|
|
|
3312
3287
|
}
|
|
@@ -3353,18 +3328,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3353
3328
|
`;
|
|
3354
3329
|
|
|
3355
3330
|
exports[`docs/core/components/context-api.md doc-examples L40 — (no label) 1`] = `
|
|
3356
|
-
"import {
|
|
3331
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, provideContext } from '@barefootjs/client/runtime'
|
|
3357
3332
|
|
|
3358
3333
|
export function initTodoItem(__scope, _p = {}) {
|
|
3359
3334
|
if (!__scope) return
|
|
3360
3335
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3361
3336
|
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3364
|
-
let __anchor_s0 = _s0
|
|
3337
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3365
3338
|
createEffect(() => {
|
|
3366
3339
|
const __val = String(_p.todo)
|
|
3367
|
-
|
|
3340
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3368
3341
|
})
|
|
3369
3342
|
|
|
3370
3343
|
}
|
|
@@ -3375,12 +3348,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3375
3348
|
if (!__scope) return
|
|
3376
3349
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3377
3350
|
|
|
3378
|
-
const
|
|
3379
|
-
|
|
3380
|
-
let __anchor_s0 = _s0
|
|
3351
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3381
3352
|
createEffect(() => {
|
|
3382
3353
|
const __val = String(_p.item)
|
|
3383
|
-
|
|
3354
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3384
3355
|
})
|
|
3385
3356
|
|
|
3386
3357
|
}
|
|
@@ -3466,7 +3437,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3466
3437
|
`;
|
|
3467
3438
|
|
|
3468
3439
|
exports[`docs/core/components/context-api.md doc-examples L94 — Usage 1`] = `
|
|
3469
|
-
"import { $c,
|
|
3440
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3470
3441
|
import '/* @bf-child:ThemeProvider */'
|
|
3471
3442
|
import '/* @bf-child:ThemedButton */'
|
|
3472
3443
|
|
|
@@ -3474,12 +3445,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3474
3445
|
if (!__scope) return
|
|
3475
3446
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3476
3447
|
|
|
3477
|
-
const
|
|
3478
|
-
|
|
3479
|
-
let __anchor_s0 = _s0
|
|
3448
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3480
3449
|
createEffect(() => {
|
|
3481
3450
|
const __val = String(_p.todo)
|
|
3482
|
-
|
|
3451
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3483
3452
|
})
|
|
3484
3453
|
|
|
3485
3454
|
}
|
|
@@ -3490,12 +3459,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3490
3459
|
if (!__scope) return
|
|
3491
3460
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3492
3461
|
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3495
|
-
let __anchor_s0 = _s0
|
|
3462
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3496
3463
|
createEffect(() => {
|
|
3497
3464
|
const __val = String(_p.item)
|
|
3498
|
-
|
|
3465
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3499
3466
|
})
|
|
3500
3467
|
|
|
3501
3468
|
}
|
|
@@ -3619,7 +3586,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3619
3586
|
`;
|
|
3620
3587
|
|
|
3621
3588
|
exports[`docs/core/components/context-api.md doc-examples L170 — (no label) 1`] = `
|
|
3622
|
-
"import { $c,
|
|
3589
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3623
3590
|
import '/* @bf-child:Accordion */'
|
|
3624
3591
|
import '/* @bf-child:AccordionTrigger */'
|
|
3625
3592
|
import '/* @bf-child:AccordionContent */'
|
|
@@ -3628,12 +3595,10 @@ export function initTodoItem(__scope, _p = {}) {
|
|
|
3628
3595
|
if (!__scope) return
|
|
3629
3596
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3630
3597
|
|
|
3631
|
-
const
|
|
3632
|
-
|
|
3633
|
-
let __anchor_s0 = _s0
|
|
3598
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3634
3599
|
createEffect(() => {
|
|
3635
3600
|
const __val = String(_p.todo)
|
|
3636
|
-
|
|
3601
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3637
3602
|
})
|
|
3638
3603
|
|
|
3639
3604
|
}
|
|
@@ -3644,12 +3609,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3644
3609
|
if (!__scope) return
|
|
3645
3610
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3646
3611
|
|
|
3647
|
-
const
|
|
3648
|
-
|
|
3649
|
-
let __anchor_s0 = _s0
|
|
3612
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3650
3613
|
createEffect(() => {
|
|
3651
3614
|
const __val = String(_p.item)
|
|
3652
|
-
|
|
3615
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3653
3616
|
})
|
|
3654
3617
|
|
|
3655
3618
|
}
|
|
@@ -3689,18 +3652,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
3689
3652
|
`;
|
|
3690
3653
|
|
|
3691
3654
|
exports[`docs/core/components/context-api.md doc-examples L190 — Provider passes signal getter 1`] = `
|
|
3692
|
-
"import {
|
|
3655
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots, provideContext } from '@barefootjs/client/runtime'
|
|
3693
3656
|
|
|
3694
3657
|
export function initTodoItem(__scope, _p = {}) {
|
|
3695
3658
|
if (!__scope) return
|
|
3696
3659
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3697
3660
|
|
|
3698
|
-
const
|
|
3699
|
-
|
|
3700
|
-
let __anchor_s0 = _s0
|
|
3661
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3701
3662
|
createEffect(() => {
|
|
3702
3663
|
const __val = String(_p.todo)
|
|
3703
|
-
|
|
3664
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3704
3665
|
})
|
|
3705
3666
|
|
|
3706
3667
|
}
|
|
@@ -3711,12 +3672,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3711
3672
|
if (!__scope) return
|
|
3712
3673
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3713
3674
|
|
|
3714
|
-
const
|
|
3715
|
-
|
|
3716
|
-
let __anchor_s0 = _s0
|
|
3675
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3717
3676
|
createEffect(() => {
|
|
3718
3677
|
const __val = String(_p.item)
|
|
3719
|
-
|
|
3678
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3720
3679
|
})
|
|
3721
3680
|
|
|
3722
3681
|
}
|
|
@@ -3806,7 +3765,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3806
3765
|
`;
|
|
3807
3766
|
|
|
3808
3767
|
exports[`docs/core/components/portals.md doc-examples L53 — (no label) 1`] = `
|
|
3809
|
-
"import { $,
|
|
3768
|
+
"import { $, createComponent, createEffect, createPortal, createSignal, escapeText, escapeTextOrNode, hydrate, isSSRPortal, lazySlots } from '@barefootjs/client/runtime'
|
|
3810
3769
|
|
|
3811
3770
|
|
|
3812
3771
|
export function initTooltip(__scope, _p = {}) {
|
|
@@ -3827,12 +3786,11 @@ export function initTooltip(__scope, _p = {}) {
|
|
|
3827
3786
|
}
|
|
3828
3787
|
|
|
3829
3788
|
const [_s0, _s2] = $(__scope, 's0', 's2')
|
|
3830
|
-
const [_s1] = $t(__scope, 's1')
|
|
3831
3789
|
|
|
3832
|
-
|
|
3790
|
+
const __bfw_s1 = lazySlots(__scope, [{ id: 's1', kind: 'markup', path: [] }])
|
|
3833
3791
|
createEffect(() => {
|
|
3834
3792
|
const __val = _p.text
|
|
3835
|
-
|
|
3793
|
+
__bfw_s1('s1', escapeTextOrNode(__val))
|
|
3836
3794
|
})
|
|
3837
3795
|
|
|
3838
3796
|
if (_s0) _s0.addEventListener('mouseenter', () => { setVisible(true) })
|
|
@@ -3911,25 +3869,23 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3911
3869
|
`;
|
|
3912
3870
|
|
|
3913
3871
|
exports[`docs/core/components/props-type-safety.md doc-examples L16 — (no label) 1`] = `
|
|
3914
|
-
"import {
|
|
3872
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
3915
3873
|
|
|
3916
3874
|
|
|
3917
3875
|
export function initGreeting(__scope, _p = {}) {
|
|
3918
3876
|
if (!__scope) return
|
|
3919
3877
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3920
3878
|
|
|
3921
|
-
const
|
|
3922
|
-
|
|
3923
|
-
let __anchor_s0 = _s0
|
|
3879
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3924
3880
|
createEffect(() => {
|
|
3925
3881
|
const __val = _p.greeting ?? 'Hello'
|
|
3926
|
-
|
|
3882
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3927
3883
|
})
|
|
3928
3884
|
|
|
3929
|
-
|
|
3885
|
+
const __bfw_s1 = lazySlots(__scope, [{ id: 's1', kind: 'markup', path: [] }])
|
|
3930
3886
|
createEffect(() => {
|
|
3931
3887
|
const __val = _p.name
|
|
3932
|
-
|
|
3888
|
+
__bfw_s1('s1', escapeTextOrNode(__val))
|
|
3933
3889
|
})
|
|
3934
3890
|
|
|
3935
3891
|
}
|
|
@@ -3975,19 +3931,17 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
3975
3931
|
`;
|
|
3976
3932
|
|
|
3977
3933
|
exports[`docs/core/components/props-type-safety.md doc-examples L89 — (no label) 1`] = `
|
|
3978
|
-
"import { $c,
|
|
3934
|
+
"import { $c, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
3979
3935
|
import '/* @bf-child:Card */'
|
|
3980
3936
|
|
|
3981
3937
|
export function initTodoItem(__scope, _p = {}) {
|
|
3982
3938
|
if (!__scope) return
|
|
3983
3939
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
3984
3940
|
|
|
3985
|
-
const
|
|
3986
|
-
|
|
3987
|
-
let __anchor_s0 = _s0
|
|
3941
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
3988
3942
|
createEffect(() => {
|
|
3989
3943
|
const __val = String(_p.todo)
|
|
3990
|
-
|
|
3944
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
3991
3945
|
})
|
|
3992
3946
|
|
|
3993
3947
|
}
|
|
@@ -3998,12 +3952,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
3998
3952
|
if (!__scope) return
|
|
3999
3953
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4000
3954
|
|
|
4001
|
-
const
|
|
4002
|
-
|
|
4003
|
-
let __anchor_s0 = _s0
|
|
3955
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4004
3956
|
createEffect(() => {
|
|
4005
3957
|
const __val = String(_p.item)
|
|
4006
|
-
|
|
3958
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4007
3959
|
})
|
|
4008
3960
|
|
|
4009
3961
|
}
|
|
@@ -4057,7 +4009,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4057
4009
|
`;
|
|
4058
4010
|
|
|
4059
4011
|
exports[`docs/core/core-concepts/how-it-works.mdx doc-examples L33 — (no label) 1`] = `
|
|
4060
|
-
"import { $,
|
|
4012
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4061
4013
|
|
|
4062
4014
|
|
|
4063
4015
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4067,12 +4019,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4067
4019
|
const [count, setCount] = createSignal(0)
|
|
4068
4020
|
|
|
4069
4021
|
const [_s1] = $(__scope, 's1')
|
|
4070
|
-
const [_s0] = $t(__scope, 's0')
|
|
4071
4022
|
|
|
4072
|
-
|
|
4023
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4073
4024
|
createEffect(() => {
|
|
4074
4025
|
const __val = count()
|
|
4075
|
-
|
|
4026
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4076
4027
|
})
|
|
4077
4028
|
|
|
4078
4029
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4105,7 +4056,7 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
4105
4056
|
`;
|
|
4106
4057
|
|
|
4107
4058
|
exports[`docs/core/core-concepts/mpa-style.md doc-examples L23 — (no label) 1`] = `
|
|
4108
|
-
"import { $, $c,
|
|
4059
|
+
"import { $, $c, createComponent, createEffect, escapeAttr, escapeText, escapeTextOrNode, hydrate, initChild, lazySlots, renderChild } from '@barefootjs/client/runtime'
|
|
4109
4060
|
import '/* @bf-child:ReviewStars */'
|
|
4110
4061
|
import '/* @bf-child:AddToCart */'
|
|
4111
4062
|
|
|
@@ -4117,19 +4068,18 @@ export function initProductPage(__scope, _p = {}) {
|
|
|
4117
4068
|
const product = _p.product ?? {}
|
|
4118
4069
|
|
|
4119
4070
|
const [_s4] = $(__scope, 's4')
|
|
4120
|
-
const [_s0, _s2] = $t(__scope, 's0', 's2')
|
|
4121
4071
|
const [_s5, _s6] = $c(__scope, 's5', 's6')
|
|
4122
4072
|
|
|
4123
|
-
|
|
4073
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4124
4074
|
createEffect(() => {
|
|
4125
4075
|
const __val = product.name
|
|
4126
|
-
|
|
4076
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4127
4077
|
})
|
|
4128
4078
|
|
|
4129
|
-
|
|
4079
|
+
const __bfw_s2 = lazySlots(__scope, [{ id: 's2', kind: 'markup', path: [] }])
|
|
4130
4080
|
createEffect(() => {
|
|
4131
4081
|
const __val = product.description
|
|
4132
|
-
|
|
4082
|
+
__bfw_s2('s2', escapeTextOrNode(__val))
|
|
4133
4083
|
})
|
|
4134
4084
|
|
|
4135
4085
|
createEffect(() => {
|
|
@@ -4161,19 +4111,17 @@ export function ProductPage(_p, __bfKey) { return createComponent('ProductPage',
|
|
|
4161
4111
|
`;
|
|
4162
4112
|
|
|
4163
4113
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L55 — (no label) 1`] = `
|
|
4164
|
-
"import {
|
|
4114
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4165
4115
|
|
|
4166
4116
|
|
|
4167
4117
|
export function initGreeting(__scope, _p = {}) {
|
|
4168
4118
|
if (!__scope) return
|
|
4169
4119
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4170
4120
|
|
|
4171
|
-
const
|
|
4172
|
-
|
|
4173
|
-
let __anchor_s0 = _s0
|
|
4121
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4174
4122
|
createEffect(() => {
|
|
4175
4123
|
const __val = _p.name
|
|
4176
|
-
|
|
4124
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4177
4125
|
})
|
|
4178
4126
|
|
|
4179
4127
|
}
|
|
@@ -4183,7 +4131,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
4183
4131
|
`;
|
|
4184
4132
|
|
|
4185
4133
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L82 — (no label) 1`] = `
|
|
4186
|
-
"import { $,
|
|
4134
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4187
4135
|
|
|
4188
4136
|
|
|
4189
4137
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4197,12 +4145,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4197
4145
|
})
|
|
4198
4146
|
|
|
4199
4147
|
const [_s2] = $(__scope, 's2')
|
|
4200
|
-
const [_s0] = $t(__scope, 's0')
|
|
4201
4148
|
|
|
4202
|
-
|
|
4149
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4203
4150
|
createEffect(() => {
|
|
4204
4151
|
const __val = count()
|
|
4205
|
-
|
|
4152
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4206
4153
|
})
|
|
4207
4154
|
|
|
4208
4155
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4235,18 +4182,16 @@ export function Layout(_p, __bfKey) { return createComponent('Layout', _p, __bfK
|
|
|
4235
4182
|
`;
|
|
4236
4183
|
|
|
4237
4184
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L167 — (no label) 1`] = `
|
|
4238
|
-
"import { $,
|
|
4185
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4239
4186
|
|
|
4240
4187
|
export function initTodoItem(__scope, _p = {}) {
|
|
4241
4188
|
if (!__scope) return
|
|
4242
4189
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4243
4190
|
|
|
4244
|
-
const
|
|
4245
|
-
|
|
4246
|
-
let __anchor_s0 = _s0
|
|
4191
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4247
4192
|
createEffect(() => {
|
|
4248
4193
|
const __val = String(_p.todo)
|
|
4249
|
-
|
|
4194
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4250
4195
|
})
|
|
4251
4196
|
|
|
4252
4197
|
}
|
|
@@ -4257,12 +4202,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4257
4202
|
if (!__scope) return
|
|
4258
4203
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4259
4204
|
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4262
|
-
let __anchor_s0 = _s0
|
|
4205
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4263
4206
|
createEffect(() => {
|
|
4264
4207
|
const __val = String(_p.item)
|
|
4265
|
-
|
|
4208
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4266
4209
|
})
|
|
4267
4210
|
|
|
4268
4211
|
}
|
|
@@ -4305,18 +4248,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4305
4248
|
`;
|
|
4306
4249
|
|
|
4307
4250
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L171 — (no label) 1`] = `
|
|
4308
|
-
"import { $,
|
|
4251
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4309
4252
|
|
|
4310
4253
|
export function initTodoItem(__scope, _p = {}) {
|
|
4311
4254
|
if (!__scope) return
|
|
4312
4255
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4313
4256
|
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4316
|
-
let __anchor_s0 = _s0
|
|
4257
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4317
4258
|
createEffect(() => {
|
|
4318
4259
|
const __val = String(_p.todo)
|
|
4319
|
-
|
|
4260
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4320
4261
|
})
|
|
4321
4262
|
|
|
4322
4263
|
}
|
|
@@ -4327,12 +4268,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4327
4268
|
if (!__scope) return
|
|
4328
4269
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4329
4270
|
|
|
4330
|
-
const
|
|
4331
|
-
|
|
4332
|
-
let __anchor_s0 = _s0
|
|
4271
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4333
4272
|
createEffect(() => {
|
|
4334
4273
|
const __val = String(_p.item)
|
|
4335
|
-
|
|
4274
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4336
4275
|
})
|
|
4337
4276
|
|
|
4338
4277
|
}
|
|
@@ -4375,18 +4314,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4375
4314
|
`;
|
|
4376
4315
|
|
|
4377
4316
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L177 — (no label) 1`] = `
|
|
4378
|
-
"import { $,
|
|
4317
|
+
"import { $, __bfSlot, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4379
4318
|
|
|
4380
4319
|
export function initTodoItem(__scope, _p = {}) {
|
|
4381
4320
|
if (!__scope) return
|
|
4382
4321
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4383
4322
|
|
|
4384
|
-
const
|
|
4385
|
-
|
|
4386
|
-
let __anchor_s0 = _s0
|
|
4323
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4387
4324
|
createEffect(() => {
|
|
4388
4325
|
const __val = String(_p.todo)
|
|
4389
|
-
|
|
4326
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4390
4327
|
})
|
|
4391
4328
|
|
|
4392
4329
|
}
|
|
@@ -4397,12 +4334,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4397
4334
|
if (!__scope) return
|
|
4398
4335
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4399
4336
|
|
|
4400
|
-
const
|
|
4401
|
-
|
|
4402
|
-
let __anchor_s0 = _s0
|
|
4337
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4403
4338
|
createEffect(() => {
|
|
4404
4339
|
const __val = String(_p.item)
|
|
4405
|
-
|
|
4340
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4406
4341
|
})
|
|
4407
4342
|
|
|
4408
4343
|
}
|
|
@@ -4445,18 +4380,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4445
4380
|
`;
|
|
4446
4381
|
|
|
4447
4382
|
exports[`docs/core/adapters/hono-adapter.md doc-examples L190 — (no label) 1`] = `
|
|
4448
|
-
"import { $,
|
|
4383
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
4449
4384
|
|
|
4450
4385
|
export function initTodoItem(__scope, _p = {}) {
|
|
4451
4386
|
if (!__scope) return
|
|
4452
4387
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4453
4388
|
|
|
4454
|
-
const
|
|
4455
|
-
|
|
4456
|
-
let __anchor_s0 = _s0
|
|
4389
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4457
4390
|
createEffect(() => {
|
|
4458
4391
|
const __val = String(_p.todo)
|
|
4459
|
-
|
|
4392
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4460
4393
|
})
|
|
4461
4394
|
|
|
4462
4395
|
}
|
|
@@ -4467,12 +4400,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4467
4400
|
if (!__scope) return
|
|
4468
4401
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4469
4402
|
|
|
4470
|
-
const
|
|
4471
|
-
|
|
4472
|
-
let __anchor_s0 = _s0
|
|
4403
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4473
4404
|
createEffect(() => {
|
|
4474
4405
|
const __val = String(_p.item)
|
|
4475
|
-
|
|
4406
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4476
4407
|
})
|
|
4477
4408
|
|
|
4478
4409
|
}
|
|
@@ -4502,32 +4433,29 @@ export function initExample(__scope, _p = {}) {
|
|
|
4502
4433
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4503
4434
|
mapArray(() => items(), _s1, (item) => String(item), (item, __idx, __existing) => {
|
|
4504
4435
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4505
|
-
const
|
|
4506
|
-
|
|
4507
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item()) }) }
|
|
4436
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
4437
|
+
createEffect(() => { __bfw_s0('s0', String(item())) })
|
|
4508
4438
|
return __el
|
|
4509
4439
|
}, 'l0')
|
|
4510
4440
|
|
|
4511
4441
|
}
|
|
4512
4442
|
|
|
4513
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${item}"><!--bf:s0-->\${escapeText(item)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4443
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${escapeAttr(item)}"><!--bf:s0-->\${escapeText(item)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4514
4444
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
4515
4445
|
`;
|
|
4516
4446
|
|
|
4517
4447
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L71 — (no label) 1`] = `
|
|
4518
|
-
"import {
|
|
4448
|
+
"import { createComponent, createEffect, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4519
4449
|
|
|
4520
4450
|
|
|
4521
4451
|
export function initGreeting(__scope, _p = {}) {
|
|
4522
4452
|
if (!__scope) return
|
|
4523
4453
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4524
4454
|
|
|
4525
|
-
const
|
|
4526
|
-
|
|
4527
|
-
let __anchor_s0 = _s0
|
|
4455
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4528
4456
|
createEffect(() => {
|
|
4529
4457
|
const __val = _p.name
|
|
4530
|
-
|
|
4458
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4531
4459
|
})
|
|
4532
4460
|
|
|
4533
4461
|
}
|
|
@@ -4537,7 +4465,7 @@ export function Greeting(_p, __bfKey) { return createComponent('Greeting', _p, _
|
|
|
4537
4465
|
`;
|
|
4538
4466
|
|
|
4539
4467
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L95 — (no label) 1`] = `
|
|
4540
|
-
"import { $,
|
|
4468
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4541
4469
|
|
|
4542
4470
|
|
|
4543
4471
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -4551,12 +4479,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
4551
4479
|
})
|
|
4552
4480
|
|
|
4553
4481
|
const [_s2] = $(__scope, 's2')
|
|
4554
|
-
const [_s0] = $t(__scope, 's0')
|
|
4555
4482
|
|
|
4556
|
-
|
|
4483
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4557
4484
|
createEffect(() => {
|
|
4558
4485
|
const __val = count()
|
|
4559
|
-
|
|
4486
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4560
4487
|
})
|
|
4561
4488
|
|
|
4562
4489
|
if (_s2) _s2.addEventListener('click', () => { setCount(n => n + 1) })
|
|
@@ -4567,18 +4494,16 @@ export function Counter(_p, __bfKey) { return createComponent('Counter', _p, __b
|
|
|
4567
4494
|
`;
|
|
4568
4495
|
|
|
4569
4496
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L168 — (no label) 1`] = `
|
|
4570
|
-
"import { $,
|
|
4497
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
4571
4498
|
|
|
4572
4499
|
export function initTodoItem(__scope, _p = {}) {
|
|
4573
4500
|
if (!__scope) return
|
|
4574
4501
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4575
4502
|
|
|
4576
|
-
const
|
|
4577
|
-
|
|
4578
|
-
let __anchor_s0 = _s0
|
|
4503
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4579
4504
|
createEffect(() => {
|
|
4580
4505
|
const __val = String(_p.todo)
|
|
4581
|
-
|
|
4506
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4582
4507
|
})
|
|
4583
4508
|
|
|
4584
4509
|
}
|
|
@@ -4589,12 +4514,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4589
4514
|
if (!__scope) return
|
|
4590
4515
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4591
4516
|
|
|
4592
|
-
const
|
|
4593
|
-
|
|
4594
|
-
let __anchor_s0 = _s0
|
|
4517
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4595
4518
|
createEffect(() => {
|
|
4596
4519
|
const __val = String(_p.item)
|
|
4597
|
-
|
|
4520
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4598
4521
|
})
|
|
4599
4522
|
|
|
4600
4523
|
}
|
|
@@ -4624,31 +4547,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
4624
4547
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4625
4548
|
mapArray(() => items(), _s1, (item) => String(item), (item, __idx, __existing) => {
|
|
4626
4549
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4627
|
-
const
|
|
4628
|
-
|
|
4629
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item()) }) }
|
|
4550
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
4551
|
+
createEffect(() => { __bfw_s0('s0', String(item())) })
|
|
4630
4552
|
return __el
|
|
4631
4553
|
}, 'l0')
|
|
4632
4554
|
|
|
4633
4555
|
}
|
|
4634
4556
|
|
|
4635
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${item}"><!--bf:s0-->\${escapeText(item)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4557
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${escapeAttr(item)}"><!--bf:s0-->\${escapeText(item)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4636
4558
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
4637
4559
|
`;
|
|
4638
4560
|
|
|
4639
4561
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L180 — (no label) 1`] = `
|
|
4640
|
-
"import { $,
|
|
4562
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
4641
4563
|
|
|
4642
4564
|
export function initTodoItem(__scope, _p = {}) {
|
|
4643
4565
|
if (!__scope) return
|
|
4644
4566
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4645
4567
|
|
|
4646
|
-
const
|
|
4647
|
-
|
|
4648
|
-
let __anchor_s0 = _s0
|
|
4568
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4649
4569
|
createEffect(() => {
|
|
4650
4570
|
const __val = String(_p.todo)
|
|
4651
|
-
|
|
4571
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4652
4572
|
})
|
|
4653
4573
|
|
|
4654
4574
|
}
|
|
@@ -4659,12 +4579,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4659
4579
|
if (!__scope) return
|
|
4660
4580
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4661
4581
|
|
|
4662
|
-
const
|
|
4663
|
-
|
|
4664
|
-
let __anchor_s0 = _s0
|
|
4582
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4665
4583
|
createEffect(() => {
|
|
4666
4584
|
const __val = String(_p.item)
|
|
4667
|
-
|
|
4585
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4668
4586
|
})
|
|
4669
4587
|
|
|
4670
4588
|
}
|
|
@@ -4694,31 +4612,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
4694
4612
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
4695
4613
|
mapArray(() => items().filter(item => item.active), _s1, (item) => String(item.id), (item, __idx, __existing) => {
|
|
4696
4614
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
4697
|
-
const
|
|
4698
|
-
|
|
4699
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item().name) }) }
|
|
4615
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
4616
|
+
createEffect(() => { __bfw_s0('s0', String(item().name)) })
|
|
4700
4617
|
return __el
|
|
4701
4618
|
}, 'l0')
|
|
4702
4619
|
|
|
4703
4620
|
}
|
|
4704
4621
|
|
|
4705
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).filter(item => item.active).map((item) => \`<li data-key="\${item.id}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4622
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).filter(item => item.active).map((item) => \`<li data-key="\${escapeAttr(item.id)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4706
4623
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
4707
4624
|
`;
|
|
4708
4625
|
|
|
4709
4626
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L194 — (no label) 1`] = `
|
|
4710
|
-
"import { $,
|
|
4627
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4711
4628
|
|
|
4712
4629
|
export function initTodoItem(__scope, _p = {}) {
|
|
4713
4630
|
if (!__scope) return
|
|
4714
4631
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4715
4632
|
|
|
4716
|
-
const
|
|
4717
|
-
|
|
4718
|
-
let __anchor_s0 = _s0
|
|
4633
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4719
4634
|
createEffect(() => {
|
|
4720
4635
|
const __val = String(_p.todo)
|
|
4721
|
-
|
|
4636
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4722
4637
|
})
|
|
4723
4638
|
|
|
4724
4639
|
}
|
|
@@ -4729,12 +4644,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4729
4644
|
if (!__scope) return
|
|
4730
4645
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4731
4646
|
|
|
4732
|
-
const
|
|
4733
|
-
|
|
4734
|
-
let __anchor_s0 = _s0
|
|
4647
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4735
4648
|
createEffect(() => {
|
|
4736
4649
|
const __val = String(_p.item)
|
|
4737
|
-
|
|
4650
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4738
4651
|
})
|
|
4739
4652
|
|
|
4740
4653
|
}
|
|
@@ -4765,15 +4678,15 @@ export function initExample(__scope, _p = {}) {
|
|
|
4765
4678
|
items.forEach((t, __idx) => {
|
|
4766
4679
|
let __iterEl = _s1.children[__idx]
|
|
4767
4680
|
if (__iterEl) {
|
|
4768
|
-
|
|
4769
|
-
|
|
4681
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
4682
|
+
createEffect(() => { __bfw_s0('s0', String(t.name)) })
|
|
4770
4683
|
}
|
|
4771
4684
|
})
|
|
4772
4685
|
}
|
|
4773
4686
|
|
|
4774
4687
|
}
|
|
4775
4688
|
|
|
4776
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.toSorted((a, b) => a.priority - b.priority).map((t) => \`<li data-key="\${t.id}"><!--bf:s0-->\${escapeText(t.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4689
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.toSorted((a, b) => a.priority - b.priority).map((t) => \`<li data-key="\${escapeAttr(t.id)}"><!--bf:s0-->\${escapeText(t.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4777
4690
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
4778
4691
|
`;
|
|
4779
4692
|
|
|
@@ -4802,18 +4715,16 @@ export function TodoList(_p, __bfKey) { return createComponent('TodoList', _p, _
|
|
|
4802
4715
|
`;
|
|
4803
4716
|
|
|
4804
4717
|
exports[`docs/core/adapters/go-template-adapter.md doc-examples L260 — (no label) 1`] = `
|
|
4805
|
-
"import { $,
|
|
4718
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, insert, lazySlots } from '@barefootjs/client/runtime'
|
|
4806
4719
|
|
|
4807
4720
|
export function initTodoItem(__scope, _p = {}) {
|
|
4808
4721
|
if (!__scope) return
|
|
4809
4722
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4810
4723
|
|
|
4811
|
-
const
|
|
4812
|
-
|
|
4813
|
-
let __anchor_s0 = _s0
|
|
4724
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4814
4725
|
createEffect(() => {
|
|
4815
4726
|
const __val = String(_p.todo)
|
|
4816
|
-
|
|
4727
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4817
4728
|
})
|
|
4818
4729
|
|
|
4819
4730
|
}
|
|
@@ -4824,12 +4735,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4824
4735
|
if (!__scope) return
|
|
4825
4736
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4826
4737
|
|
|
4827
|
-
const
|
|
4828
|
-
|
|
4829
|
-
let __anchor_s0 = _s0
|
|
4738
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4830
4739
|
createEffect(() => {
|
|
4831
4740
|
const __val = String(_p.item)
|
|
4832
|
-
|
|
4741
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4833
4742
|
})
|
|
4834
4743
|
|
|
4835
4744
|
}
|
|
@@ -4872,18 +4781,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4872
4781
|
`;
|
|
4873
4782
|
|
|
4874
4783
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L169 — (no label) 1`] = `
|
|
4875
|
-
"import {
|
|
4784
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4876
4785
|
|
|
4877
4786
|
export function initTodoItem(__scope, _p = {}) {
|
|
4878
4787
|
if (!__scope) return
|
|
4879
4788
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4880
4789
|
|
|
4881
|
-
const
|
|
4882
|
-
|
|
4883
|
-
let __anchor_s0 = _s0
|
|
4790
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4884
4791
|
createEffect(() => {
|
|
4885
4792
|
const __val = String(_p.todo)
|
|
4886
|
-
|
|
4793
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4887
4794
|
})
|
|
4888
4795
|
|
|
4889
4796
|
}
|
|
@@ -4894,12 +4801,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4894
4801
|
if (!__scope) return
|
|
4895
4802
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4896
4803
|
|
|
4897
|
-
const
|
|
4898
|
-
|
|
4899
|
-
let __anchor_s0 = _s0
|
|
4804
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4900
4805
|
createEffect(() => {
|
|
4901
4806
|
const __val = String(_p.item)
|
|
4902
|
-
|
|
4807
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4903
4808
|
})
|
|
4904
4809
|
|
|
4905
4810
|
}
|
|
@@ -4930,18 +4835,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4930
4835
|
`;
|
|
4931
4836
|
|
|
4932
4837
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L174 — (no label) 1`] = `
|
|
4933
|
-
"import {
|
|
4838
|
+
"import { createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4934
4839
|
|
|
4935
4840
|
export function initTodoItem(__scope, _p = {}) {
|
|
4936
4841
|
if (!__scope) return
|
|
4937
4842
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4938
4843
|
|
|
4939
|
-
const
|
|
4940
|
-
|
|
4941
|
-
let __anchor_s0 = _s0
|
|
4844
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4942
4845
|
createEffect(() => {
|
|
4943
4846
|
const __val = String(_p.todo)
|
|
4944
|
-
|
|
4847
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4945
4848
|
})
|
|
4946
4849
|
|
|
4947
4850
|
}
|
|
@@ -4952,12 +4855,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
4952
4855
|
if (!__scope) return
|
|
4953
4856
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4954
4857
|
|
|
4955
|
-
const
|
|
4956
|
-
|
|
4957
|
-
let __anchor_s0 = _s0
|
|
4858
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
4958
4859
|
createEffect(() => {
|
|
4959
4860
|
const __val = String(_p.item)
|
|
4960
|
-
|
|
4861
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
4961
4862
|
})
|
|
4962
4863
|
|
|
4963
4864
|
}
|
|
@@ -4988,18 +4889,16 @@ export function Example(_p, __bfKey) { return createComponent('Example', _p, __b
|
|
|
4988
4889
|
`;
|
|
4989
4890
|
|
|
4990
4891
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L195 — (no label) 1`] = `
|
|
4991
|
-
"import { $,
|
|
4892
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
4992
4893
|
|
|
4993
4894
|
export function initTodoItem(__scope, _p = {}) {
|
|
4994
4895
|
if (!__scope) return
|
|
4995
4896
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
4996
4897
|
|
|
4997
|
-
const
|
|
4998
|
-
|
|
4999
|
-
let __anchor_s0 = _s0
|
|
4898
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5000
4899
|
createEffect(() => {
|
|
5001
4900
|
const __val = String(_p.todo)
|
|
5002
|
-
|
|
4901
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5003
4902
|
})
|
|
5004
4903
|
|
|
5005
4904
|
}
|
|
@@ -5010,12 +4909,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5010
4909
|
if (!__scope) return
|
|
5011
4910
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5012
4911
|
|
|
5013
|
-
const
|
|
5014
|
-
|
|
5015
|
-
let __anchor_s0 = _s0
|
|
4912
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5016
4913
|
createEffect(() => {
|
|
5017
4914
|
const __val = String(_p.item)
|
|
5018
|
-
|
|
4915
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5019
4916
|
})
|
|
5020
4917
|
|
|
5021
4918
|
}
|
|
@@ -5046,31 +4943,29 @@ export function initExample(__scope, _p = {}) {
|
|
|
5046
4943
|
items.forEach((item, __idx) => {
|
|
5047
4944
|
let __iterEl = _s1.children[__idx]
|
|
5048
4945
|
if (__iterEl) {
|
|
5049
|
-
|
|
5050
|
-
|
|
4946
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
4947
|
+
createEffect(() => { __bfw_s0('s0', String(item.name)) })
|
|
5051
4948
|
}
|
|
5052
4949
|
})
|
|
5053
4950
|
}
|
|
5054
4951
|
|
|
5055
4952
|
}
|
|
5056
4953
|
|
|
5057
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.map((item) => \`<li data-key="\${item.id}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
4954
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.map((item) => \`<li data-key="\${escapeAttr(item.id)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5058
4955
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
5059
4956
|
`;
|
|
5060
4957
|
|
|
5061
4958
|
exports[`docs/core/adapters/custom-adapter.md doc-examples L200 — (no label) 1`] = `
|
|
5062
|
-
"import { $,
|
|
4959
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5063
4960
|
|
|
5064
4961
|
export function initTodoItem(__scope, _p = {}) {
|
|
5065
4962
|
if (!__scope) return
|
|
5066
4963
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5067
4964
|
|
|
5068
|
-
const
|
|
5069
|
-
|
|
5070
|
-
let __anchor_s0 = _s0
|
|
4965
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5071
4966
|
createEffect(() => {
|
|
5072
4967
|
const __val = String(_p.todo)
|
|
5073
|
-
|
|
4968
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5074
4969
|
})
|
|
5075
4970
|
|
|
5076
4971
|
}
|
|
@@ -5081,12 +4976,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5081
4976
|
if (!__scope) return
|
|
5082
4977
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5083
4978
|
|
|
5084
|
-
const
|
|
5085
|
-
|
|
5086
|
-
let __anchor_s0 = _s0
|
|
4979
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5087
4980
|
createEffect(() => {
|
|
5088
4981
|
const __val = String(_p.item)
|
|
5089
|
-
|
|
4982
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5090
4983
|
})
|
|
5091
4984
|
|
|
5092
4985
|
}
|
|
@@ -5117,15 +5010,15 @@ export function initExample(__scope, _p = {}) {
|
|
|
5117
5010
|
items.forEach((item, __idx) => {
|
|
5118
5011
|
let __iterEl = _s1.children[__idx]
|
|
5119
5012
|
if (__iterEl) {
|
|
5120
|
-
|
|
5121
|
-
|
|
5013
|
+
const __bfw_s0 = lazySlots(__iterEl, [{ id: 's0', kind: 'text', path: [] }])
|
|
5014
|
+
createEffect(() => { __bfw_s0('s0', String(item.name)) })
|
|
5122
5015
|
}
|
|
5123
5016
|
})
|
|
5124
5017
|
}
|
|
5125
5018
|
|
|
5126
5019
|
}
|
|
5127
5020
|
|
|
5128
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.map((item) => \`<li data-key="\${item.id}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5021
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${items.map((item) => \`<li data-key="\${escapeAttr(item.id)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5129
5022
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
5130
5023
|
`;
|
|
5131
5024
|
|
|
@@ -5139,18 +5032,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
5139
5032
|
`;
|
|
5140
5033
|
|
|
5141
5034
|
exports[`docs/core/advanced/compiler-internals.md doc-examples L126 — (no label) 1`] = `
|
|
5142
|
-
"import { $,
|
|
5035
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
5143
5036
|
|
|
5144
5037
|
export function initTodoItem(__scope, _p = {}) {
|
|
5145
5038
|
if (!__scope) return
|
|
5146
5039
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5147
5040
|
|
|
5148
|
-
const
|
|
5149
|
-
|
|
5150
|
-
let __anchor_s0 = _s0
|
|
5041
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5151
5042
|
createEffect(() => {
|
|
5152
5043
|
const __val = String(_p.todo)
|
|
5153
|
-
|
|
5044
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5154
5045
|
})
|
|
5155
5046
|
|
|
5156
5047
|
}
|
|
@@ -5161,12 +5052,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5161
5052
|
if (!__scope) return
|
|
5162
5053
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5163
5054
|
|
|
5164
|
-
const
|
|
5165
|
-
|
|
5166
|
-
let __anchor_s0 = _s0
|
|
5055
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5167
5056
|
createEffect(() => {
|
|
5168
5057
|
const __val = String(_p.item)
|
|
5169
|
-
|
|
5058
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5170
5059
|
})
|
|
5171
5060
|
|
|
5172
5061
|
}
|
|
@@ -5196,15 +5085,14 @@ export function initExample(__scope, _p = {}) {
|
|
|
5196
5085
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5197
5086
|
mapArray(() => todos().filter(t => !t.done).toSorted((a, b) => a.date - b.date), _s1, (t) => String(t.id), (t, __idx, __existing) => {
|
|
5198
5087
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5199
|
-
const
|
|
5200
|
-
|
|
5201
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(t().name) }) }
|
|
5088
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
5089
|
+
createEffect(() => { __bfw_s0('s0', String(t().name)) })
|
|
5202
5090
|
return __el
|
|
5203
5091
|
}, 'l0')
|
|
5204
5092
|
|
|
5205
5093
|
}
|
|
5206
5094
|
|
|
5207
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).filter(t => !t.done).toSorted((a, b) => a.date - b.date).map((t) => \`<li data-key="\${t.id}"><!--bf:s0-->\${escapeText(t.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5095
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).filter(t => !t.done).toSorted((a, b) => a.date - b.date).map((t) => \`<li data-key="\${escapeAttr(t.id)}"><!--bf:s0-->\${escapeText(t.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5208
5096
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
5209
5097
|
`;
|
|
5210
5098
|
|
|
@@ -5271,18 +5159,16 @@ export function StatementExample(_p, __bfKey) { return createComponent('Statemen
|
|
|
5271
5159
|
`;
|
|
5272
5160
|
|
|
5273
5161
|
exports[`docs/core/advanced/performance.md doc-examples L67 — ✅ Stable key — DOM nodes reused when list changes 1`] = `
|
|
5274
|
-
"import { $,
|
|
5162
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
5275
5163
|
|
|
5276
5164
|
export function initTodoItem(__scope, _p = {}) {
|
|
5277
5165
|
if (!__scope) return
|
|
5278
5166
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5279
5167
|
|
|
5280
|
-
const
|
|
5281
|
-
|
|
5282
|
-
let __anchor_s0 = _s0
|
|
5168
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5283
5169
|
createEffect(() => {
|
|
5284
5170
|
const __val = String(_p.todo)
|
|
5285
|
-
|
|
5171
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5286
5172
|
})
|
|
5287
5173
|
|
|
5288
5174
|
}
|
|
@@ -5293,12 +5179,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5293
5179
|
if (!__scope) return
|
|
5294
5180
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5295
5181
|
|
|
5296
|
-
const
|
|
5297
|
-
|
|
5298
|
-
let __anchor_s0 = _s0
|
|
5182
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5299
5183
|
createEffect(() => {
|
|
5300
5184
|
const __val = String(_p.item)
|
|
5301
|
-
|
|
5185
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5302
5186
|
})
|
|
5303
5187
|
|
|
5304
5188
|
}
|
|
@@ -5328,31 +5212,28 @@ export function initExample(__scope, _p = {}) {
|
|
|
5328
5212
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5329
5213
|
mapArray(() => items(), _s1, (item) => String(item.id), (item, __idx, __existing) => {
|
|
5330
5214
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5331
|
-
const
|
|
5332
|
-
|
|
5333
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item().name) }) }
|
|
5215
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
5216
|
+
createEffect(() => { __bfw_s0('s0', String(item().name)) })
|
|
5334
5217
|
return __el
|
|
5335
5218
|
}, 'l0')
|
|
5336
5219
|
|
|
5337
5220
|
}
|
|
5338
5221
|
|
|
5339
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${item.id}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5222
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item) => \`<li data-key="\${escapeAttr(item.id)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5340
5223
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
5341
5224
|
`;
|
|
5342
5225
|
|
|
5343
5226
|
exports[`docs/core/advanced/performance.md doc-examples L70 — ❌ Index key — DOM nodes recreated on reorder 1`] = `
|
|
5344
|
-
"import { $,
|
|
5227
|
+
"import { $, createComponent, createEffect, createSignal, escapeAttr, escapeText, escapeTextOrNode, hydrate, lazySlots, mapArray } from '@barefootjs/client/runtime'
|
|
5345
5228
|
|
|
5346
5229
|
export function initTodoItem(__scope, _p = {}) {
|
|
5347
5230
|
if (!__scope) return
|
|
5348
5231
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5349
5232
|
|
|
5350
|
-
const
|
|
5351
|
-
|
|
5352
|
-
let __anchor_s0 = _s0
|
|
5233
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5353
5234
|
createEffect(() => {
|
|
5354
5235
|
const __val = String(_p.todo)
|
|
5355
|
-
|
|
5236
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5356
5237
|
})
|
|
5357
5238
|
|
|
5358
5239
|
}
|
|
@@ -5363,12 +5244,10 @@ export function initItem(__scope, _p = {}) {
|
|
|
5363
5244
|
if (!__scope) return
|
|
5364
5245
|
const __scopeId = __scope.getAttribute('bf-s')
|
|
5365
5246
|
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5368
|
-
let __anchor_s0 = _s0
|
|
5247
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5369
5248
|
createEffect(() => {
|
|
5370
5249
|
const __val = String(_p.item)
|
|
5371
|
-
|
|
5250
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5372
5251
|
})
|
|
5373
5252
|
|
|
5374
5253
|
}
|
|
@@ -5398,15 +5277,14 @@ export function initExample(__scope, _p = {}) {
|
|
|
5398
5277
|
__tpl_l0.innerHTML = \`<li data-key=""><!--bf:s0--><!--/--></li>\`
|
|
5399
5278
|
mapArray(() => items(), _s1, (item, i) => String(i), (item, i, __existing) => {
|
|
5400
5279
|
const __el = __existing ?? __tpl_l0.content.firstElementChild.cloneNode(true)
|
|
5401
|
-
const
|
|
5402
|
-
|
|
5403
|
-
if (__rt_s0) createEffect(() => { __rt_s0.textContent = String(item().name) }) }
|
|
5280
|
+
const __bfw_s0 = lazySlots(__el, [{ id: 's0', kind: 'text', path: __existing ? [] : [0] }])
|
|
5281
|
+
createEffect(() => { __bfw_s0('s0', String(item().name)) })
|
|
5404
5282
|
return __el
|
|
5405
5283
|
}, 'l0')
|
|
5406
5284
|
|
|
5407
5285
|
}
|
|
5408
5286
|
|
|
5409
|
-
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item, i) => \`<li data-key="\${i}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5287
|
+
hydrate('Example', { init: initExample, template: (_p) => \`<div bf="s1"><!--bf-loop:l0-->\${([]).map((item, i) => \`<li data-key="\${escapeAttr(i)}"><!--bf:s0-->\${escapeText(item.name)}<!--/--></li>\`).join('')}<!--bf-/loop:l0--></div>\` })
|
|
5410
5288
|
export function Example(_p, __bfKey) { return createComponent('Example', _p, __bfKey) }"
|
|
5411
5289
|
`;
|
|
5412
5290
|
|
|
@@ -5618,7 +5496,7 @@ export function TimelineBar(_p, __bfKey) { return createComponent('TimelineBar',
|
|
|
5618
5496
|
`;
|
|
5619
5497
|
|
|
5620
5498
|
exports[`docs/core/introduction.mdx doc-examples L15 — (no label) 1`] = `
|
|
5621
|
-
"import { $,
|
|
5499
|
+
"import { $, createComponent, createEffect, createSignal, escapeText, escapeTextOrNode, hydrate, lazySlots } from '@barefootjs/client/runtime'
|
|
5622
5500
|
|
|
5623
5501
|
|
|
5624
5502
|
export function initCounter(__scope, _p = {}) {
|
|
@@ -5628,12 +5506,11 @@ export function initCounter(__scope, _p = {}) {
|
|
|
5628
5506
|
const [count, setCount] = createSignal(0)
|
|
5629
5507
|
|
|
5630
5508
|
const [_s1] = $(__scope, 's1')
|
|
5631
|
-
const [_s0] = $t(__scope, 's0')
|
|
5632
5509
|
|
|
5633
|
-
|
|
5510
|
+
const __bfw_s0 = lazySlots(__scope, [{ id: 's0', kind: 'markup', path: [] }])
|
|
5634
5511
|
createEffect(() => {
|
|
5635
5512
|
const __val = count()
|
|
5636
|
-
|
|
5513
|
+
__bfw_s0('s0', escapeTextOrNode(__val))
|
|
5637
5514
|
})
|
|
5638
5515
|
|
|
5639
5516
|
if (_s1) _s1.addEventListener('click', () => { setCount(n => n + 1) })
|