aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/solid-dom-fixtures/conditionalExpressions/output.js
blob: 1511f42223e1444018007645c519932ba56ab063 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
import { template as _$template } from "r-dom";
import { effect as _$effect } from "r-dom";
import { createComponent as _$createComponent } from "r-dom";
import { memo as _$memo } from "r-dom";
import { insert as _$insert } from "r-dom";

const _tmpl$ = /*#__PURE__*/ _$template(`<div></div>`, 2);

const template1 = (() => {
  const _el$ = _tmpl$.cloneNode(true);

  _$insert(_el$, simple);

  return _el$;
})();

const template2 = (() => {
  const _el$2 = _tmpl$.cloneNode(true);

  _$insert(_el$2, () => state.dynamic);

  return _el$2;
})();

const template3 = (() => {
  const _el$3 = _tmpl$.cloneNode(true);

  _$insert(_el$3, simple ? good : bad);

  return _el$3;
})();

const template4 = (() => {
  const _el$4 = _tmpl$.cloneNode(true);

  _$insert(_el$4, () => (simple ? good() : bad));

  return _el$4;
})();

const template5 = (() => {
  const _el$5 = _tmpl$.cloneNode(true);

  _$insert(
    _el$5,
    (() => {
      const _c$ = _$memo(() => !!state.dynamic, true);

      return () => (_c$() ? good() : bad);
    })()
  );

  return _el$5;
})();

const template6 = (() => {
  const _el$6 = _tmpl$.cloneNode(true);

  _$insert(
    _el$6,
    (() => {
      const _c$2 = _$memo(() => !!state.dynamic, true);

      return () => _c$2() && good();
    })()
  );

  return _el$6;
})();

const template7 = (() => {
  const _el$7 = _tmpl$.cloneNode(true);

  _$insert(
    _el$7,
    (() => {
      const _c$3 = _$memo(() => state.count > 5, true);

      return () =>
        _c$3()
          ? (() => {
              const _c$4 = _$memo(() => !!state.dynamic, true);

              return () => (_c$4() ? best : good());
            })()
          : bad;
    })()
  );

  return _el$7;
})();

const template8 = (() => {
  const _el$8 = _tmpl$.cloneNode(true);

  _$insert(
    _el$8,
    (() => {
      const _c$5 = _$memo(() => !!(state.dynamic && state.something), true);

      return () => _c$5() && good();
    })()
  );

  return _el$8;
})();

const template9 = (() => {
  const _el$9 = _tmpl$.cloneNode(true);

  _$insert(
    _el$9,
    (() => {
      const _c$6 = _$memo(() => !!state.dynamic, true);

      return () => (_c$6() && good()) || bad;
    })()
  );

  return _el$9;
})();

const template10 = (() => {
  const _el$10 = _tmpl$.cloneNode(true);

  _$insert(_el$10, () =>
    state.a ? "a" : state.b ? "b" : state.c ? "c" : "fallback"
  );

  return _el$10;
})();

const template11 = (() => {
  const _el$11 = _tmpl$.cloneNode(true);

  _$insert(
    _el$11,
    (() => {
      const _c$7 = _$memo(() => !!state.a, true);

      return () =>
        _c$7()
          ? a()
          : (() => {
              const _c$8 = _$memo(() => !!state.b, true);

              return () => (_c$8() ? b() : state.c ? "c" : "fallback");
            })();
    })()
  );

  return _el$11;
})();

const template12 = _$createComponent(Comp, {
  get render() {
    return _$memo(() => !!state.dynamic, true)() ? good() : bad;
  },
}); // no dynamic predicate

const template13 = _$createComponent(Comp, {
  get render() {
    return state.dynamic ? good : bad;
  },
});

const template14 = _$createComponent(Comp, {
  get render() {
    return _$memo(() => !!state.dynamic, true)() && good();
  },
}); // no dynamic predicate

const template15 = _$createComponent(Comp, {
  get render() {
    return state.dynamic && good;
  },
});

const template16 = _$createComponent(Comp, {
  get render() {
    return state.dynamic || good();
  },
});

const template17 = _$createComponent(Comp, {
  get render() {
    return _$memo(() => !!state.dynamic, true)()
      ? _$createComponent(Comp, {})
      : _$createComponent(Comp, {});
  },
});

const template18 = _$createComponent(Comp, {
  get children() {
    return _$memo(() => !!state.dynamic, true)()
      ? _$createComponent(Comp, {})
      : _$createComponent(Comp, {});
  },
});

const template19 = (() => {
  const _el$12 = _tmpl$.cloneNode(true);

  _$effect(
    () =>
      (_el$12.innerHTML = state.dynamic
        ? _$createComponent(Comp, {})
        : _$createComponent(Comp, {}))
  );

  return _el$12;
})();

const template20 = (() => {
  const _el$13 = _tmpl$.cloneNode(true);

  _$insert(
    _el$13,
    (() => {
      const _c$9 = _$memo(() => !!state.dynamic, true);

      return () =>
        _c$9() ? _$createComponent(Comp, {}) : _$createComponent(Comp, {});
    })()
  );

  return _el$13;
})();

const template21 = _$createComponent(Comp, {
  get render() {
    return state?.dynamic ? "a" : "b";
  },
});

const template22 = _$createComponent(Comp, {
  get children() {
    return state?.dynamic ? "a" : "b";
  },
});

const template23 = (() => {
  const _el$14 = _tmpl$.cloneNode(true);

  _$effect(() => (_el$14.innerHTML = state?.dynamic ? "a" : "b"));

  return _el$14;
})();

const template24 = (() => {
  const _el$15 = _tmpl$.cloneNode(true);

  _$insert(_el$15, () => (state?.dynamic ? "a" : "b"));

  return _el$15;
})();

const template25 = _$createComponent(Comp, {
  get render() {
    return state.dynamic ?? _$createComponent(Comp, {});
  },
});

const template26 = _$createComponent(Comp, {
  get children() {
    return state.dynamic ?? _$createComponent(Comp, {});
  },
});

const template27 = (() => {
  const _el$16 = _tmpl$.cloneNode(true);

  _$effect(
    () => (_el$16.innerHTML = state.dynamic ?? _$createComponent(Comp, {}))
  );

  return _el$16;
})();

const template28 = (() => {
  const _el$17 = _tmpl$.cloneNode(true);

  _$insert(_el$17, () => state.dynamic ?? _$createComponent(Comp, {}));

  return _el$17;
})();

const template29 = (() => {
  const _el$18 = _tmpl$.cloneNode(true);

  _$insert(
    _el$18,
    (() => {
      const _c$10 = _$memo(() => !!thing(), true);

      return () => (_c$10() && thing1()) ?? thing2() ?? thing3();
    })()
  );

  return _el$18;
})();

const template30 = (() => {
  const _el$19 = _tmpl$.cloneNode(true);

  _$insert(_el$19, () => thing() || thing1() || thing2());

  return _el$19;
})();

const template31 = _$createComponent(Comp, {
  get value() {
    return _$memo(() => !!count(), true)()
      ? _$memo(() => !!count(), true)()
        ? count()
        : count()
      : count();
  },
});