solid-js 1.9.6 → 1.9.7

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.
Files changed (44) hide show
  1. package/dist/dev.cjs +18 -8
  2. package/dist/dev.js +326 -557
  3. package/dist/server.js +81 -178
  4. package/dist/solid.cjs +18 -8
  5. package/dist/solid.js +282 -486
  6. package/h/dist/h.js +9 -40
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +8 -11
  9. package/h/types/hyperscript.d.ts +11 -11
  10. package/html/dist/html.js +94 -219
  11. package/html/types/lit.d.ts +33 -52
  12. package/package.json +3 -3
  13. package/store/dist/dev.js +43 -123
  14. package/store/dist/server.js +8 -20
  15. package/store/dist/store.js +40 -114
  16. package/store/types/index.d.ts +7 -21
  17. package/store/types/modifiers.d.ts +3 -6
  18. package/store/types/mutable.d.ts +2 -5
  19. package/store/types/server.d.ts +5 -25
  20. package/store/types/store.d.ts +61 -218
  21. package/types/index.d.ts +11 -78
  22. package/types/reactive/array.d.ts +4 -12
  23. package/types/reactive/observable.d.ts +16 -22
  24. package/types/reactive/scheduler.d.ts +6 -9
  25. package/types/reactive/signal.d.ts +145 -236
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +37 -73
  28. package/types/render/flow.d.ts +31 -43
  29. package/types/render/hydration.d.ts +15 -15
  30. package/types/server/index.d.ts +2 -57
  31. package/types/server/reactive.d.ts +45 -76
  32. package/types/server/rendering.d.ts +98 -169
  33. package/universal/dist/dev.js +12 -28
  34. package/universal/dist/universal.js +12 -28
  35. package/universal/types/index.d.ts +1 -3
  36. package/universal/types/universal.d.ts +1 -0
  37. package/web/dist/dev.js +90 -644
  38. package/web/dist/server.cjs +1 -1
  39. package/web/dist/server.js +110 -647
  40. package/web/dist/web.js +88 -632
  41. package/web/storage/dist/storage.js +3 -3
  42. package/web/types/core.d.ts +1 -9
  43. package/web/types/index.d.ts +11 -31
  44. package/web/types/server-mock.d.ts +32 -47
@@ -1,83 +1,17 @@
1
- import { createMemo, sharedConfig, createRoot, splitProps } from "solid-js";
2
- export {
3
- ErrorBoundary,
4
- For,
5
- Index,
6
- Match,
7
- Show,
8
- Suspense,
9
- SuspenseList,
10
- Switch,
11
- createComponent,
12
- createRenderEffect as effect,
13
- getOwner,
14
- mergeProps,
15
- untrack
16
- } from "solid-js";
17
- import { Feature, Serializer, getCrossReferenceHeader } from "seroval";
18
- import {
19
- CustomEventPlugin,
20
- DOMExceptionPlugin,
21
- EventPlugin,
22
- FormDataPlugin,
23
- HeadersPlugin,
24
- ReadableStreamPlugin,
25
- RequestPlugin,
26
- ResponsePlugin,
27
- URLSearchParamsPlugin,
28
- URLPlugin
29
- } from "seroval-plugins/web";
1
+ import { createMemo, sharedConfig, createRoot, splitProps } from 'solid-js';
2
+ export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
3
+ import { Feature, Serializer, getCrossReferenceHeader } from 'seroval';
4
+ import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
30
5
 
31
- const booleans = [
32
- "allowfullscreen",
33
- "async",
34
- "autofocus",
35
- "autoplay",
36
- "checked",
37
- "controls",
38
- "default",
39
- "disabled",
40
- "formnovalidate",
41
- "hidden",
42
- "indeterminate",
43
- "inert",
44
- "ismap",
45
- "loop",
46
- "multiple",
47
- "muted",
48
- "nomodule",
49
- "novalidate",
50
- "open",
51
- "playsinline",
52
- "readonly",
53
- "required",
54
- "reversed",
55
- "seamless",
56
- "selected"
57
- ];
58
- const BooleanAttributes = /*#__PURE__*/ new Set(booleans);
59
- const Properties = /*#__PURE__*/ new Set([
60
- "className",
61
- "value",
62
- "readOnly",
63
- "noValidate",
64
- "formNoValidate",
65
- "isMap",
66
- "noModule",
67
- "playsInline",
68
- ...booleans
69
- ]);
70
- const ChildProperties = /*#__PURE__*/ new Set([
71
- "innerHTML",
72
- "textContent",
73
- "innerText",
74
- "children"
75
- ]);
76
- const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
6
+ const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
7
+ const BooleanAttributes = /*#__PURE__*/new Set(booleans);
8
+ const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
9
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
10
+ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
77
11
  className: "class",
78
12
  htmlFor: "for"
79
13
  });
80
- const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
14
+ const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
81
15
  class: "className",
82
16
  novalidate: {
83
17
  $: "noValidate",
@@ -108,416 +42,36 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
108
42
  });
109
43
  function getPropAlias(prop, tagName) {
110
44
  const a = PropAliases[prop];
111
- return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
112
- }
113
- const DelegatedEvents = /*#__PURE__*/ new Set([
114
- "beforeinput",
115
- "click",
116
- "dblclick",
117
- "contextmenu",
118
- "focusin",
119
- "focusout",
120
- "input",
121
- "keydown",
122
- "keyup",
123
- "mousedown",
124
- "mousemove",
125
- "mouseout",
126
- "mouseover",
127
- "mouseup",
128
- "pointerdown",
129
- "pointermove",
130
- "pointerout",
131
- "pointerover",
132
- "pointerup",
133
- "touchend",
134
- "touchmove",
135
- "touchstart"
136
- ]);
137
- const SVGElements = /*#__PURE__*/ new Set([
138
- "altGlyph",
139
- "altGlyphDef",
140
- "altGlyphItem",
141
- "animate",
142
- "animateColor",
143
- "animateMotion",
144
- "animateTransform",
145
- "circle",
146
- "clipPath",
147
- "color-profile",
148
- "cursor",
149
- "defs",
150
- "desc",
151
- "ellipse",
152
- "feBlend",
153
- "feColorMatrix",
154
- "feComponentTransfer",
155
- "feComposite",
156
- "feConvolveMatrix",
157
- "feDiffuseLighting",
158
- "feDisplacementMap",
159
- "feDistantLight",
160
- "feDropShadow",
161
- "feFlood",
162
- "feFuncA",
163
- "feFuncB",
164
- "feFuncG",
165
- "feFuncR",
166
- "feGaussianBlur",
167
- "feImage",
168
- "feMerge",
169
- "feMergeNode",
170
- "feMorphology",
171
- "feOffset",
172
- "fePointLight",
173
- "feSpecularLighting",
174
- "feSpotLight",
175
- "feTile",
176
- "feTurbulence",
177
- "filter",
178
- "font",
179
- "font-face",
180
- "font-face-format",
181
- "font-face-name",
182
- "font-face-src",
183
- "font-face-uri",
184
- "foreignObject",
185
- "g",
186
- "glyph",
187
- "glyphRef",
188
- "hkern",
189
- "image",
190
- "line",
191
- "linearGradient",
192
- "marker",
193
- "mask",
194
- "metadata",
195
- "missing-glyph",
196
- "mpath",
197
- "path",
198
- "pattern",
199
- "polygon",
200
- "polyline",
201
- "radialGradient",
202
- "rect",
203
- "set",
204
- "stop",
205
- "svg",
206
- "switch",
207
- "symbol",
208
- "text",
209
- "textPath",
210
- "tref",
211
- "tspan",
212
- "use",
213
- "view",
214
- "vkern"
215
- ]);
45
+ return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
46
+ }
47
+ const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
48
+ const SVGElements = /*#__PURE__*/new Set([
49
+ "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
50
+ "set", "stop",
51
+ "svg", "switch", "symbol", "text", "textPath",
52
+ "tref", "tspan", "use", "view", "vkern"]);
216
53
  const SVGNamespace = {
217
54
  xlink: "http://www.w3.org/1999/xlink",
218
55
  xml: "http://www.w3.org/XML/1998/namespace"
219
56
  };
220
- const DOMElements = /*#__PURE__*/ new Set([
221
- "html",
222
- "base",
223
- "head",
224
- "link",
225
- "meta",
226
- "style",
227
- "title",
228
- "body",
229
- "address",
230
- "article",
231
- "aside",
232
- "footer",
233
- "header",
234
- "main",
235
- "nav",
236
- "section",
237
- "body",
238
- "blockquote",
239
- "dd",
240
- "div",
241
- "dl",
242
- "dt",
243
- "figcaption",
244
- "figure",
245
- "hr",
246
- "li",
247
- "ol",
248
- "p",
249
- "pre",
250
- "ul",
251
- "a",
252
- "abbr",
253
- "b",
254
- "bdi",
255
- "bdo",
256
- "br",
257
- "cite",
258
- "code",
259
- "data",
260
- "dfn",
261
- "em",
262
- "i",
263
- "kbd",
264
- "mark",
265
- "q",
266
- "rp",
267
- "rt",
268
- "ruby",
269
- "s",
270
- "samp",
271
- "small",
272
- "span",
273
- "strong",
274
- "sub",
275
- "sup",
276
- "time",
277
- "u",
278
- "var",
279
- "wbr",
280
- "area",
281
- "audio",
282
- "img",
283
- "map",
284
- "track",
285
- "video",
286
- "embed",
287
- "iframe",
288
- "object",
289
- "param",
290
- "picture",
291
- "portal",
292
- "source",
293
- "svg",
294
- "math",
295
- "canvas",
296
- "noscript",
297
- "script",
298
- "del",
299
- "ins",
300
- "caption",
301
- "col",
302
- "colgroup",
303
- "table",
304
- "tbody",
305
- "td",
306
- "tfoot",
307
- "th",
308
- "thead",
309
- "tr",
310
- "button",
311
- "datalist",
312
- "fieldset",
313
- "form",
314
- "input",
315
- "label",
316
- "legend",
317
- "meter",
318
- "optgroup",
319
- "option",
320
- "output",
321
- "progress",
322
- "select",
323
- "textarea",
324
- "details",
325
- "dialog",
326
- "menu",
327
- "summary",
328
- "details",
329
- "slot",
330
- "template",
331
- "acronym",
332
- "applet",
333
- "basefont",
334
- "bgsound",
335
- "big",
336
- "blink",
337
- "center",
338
- "content",
339
- "dir",
340
- "font",
341
- "frame",
342
- "frameset",
343
- "hgroup",
344
- "image",
345
- "keygen",
346
- "marquee",
347
- "menuitem",
348
- "nobr",
349
- "noembed",
350
- "noframes",
351
- "plaintext",
352
- "rb",
353
- "rtc",
354
- "shadow",
355
- "spacer",
356
- "strike",
357
- "tt",
358
- "xmp",
359
- "a",
360
- "abbr",
361
- "acronym",
362
- "address",
363
- "applet",
364
- "area",
365
- "article",
366
- "aside",
367
- "audio",
368
- "b",
369
- "base",
370
- "basefont",
371
- "bdi",
372
- "bdo",
373
- "bgsound",
374
- "big",
375
- "blink",
376
- "blockquote",
377
- "body",
378
- "br",
379
- "button",
380
- "canvas",
381
- "caption",
382
- "center",
383
- "cite",
384
- "code",
385
- "col",
386
- "colgroup",
387
- "content",
388
- "data",
389
- "datalist",
390
- "dd",
391
- "del",
392
- "details",
393
- "dfn",
394
- "dialog",
395
- "dir",
396
- "div",
397
- "dl",
398
- "dt",
399
- "em",
400
- "embed",
401
- "fieldset",
402
- "figcaption",
403
- "figure",
404
- "font",
405
- "footer",
406
- "form",
407
- "frame",
408
- "frameset",
409
- "head",
410
- "header",
411
- "hgroup",
412
- "hr",
413
- "html",
414
- "i",
415
- "iframe",
416
- "image",
417
- "img",
418
- "input",
419
- "ins",
420
- "kbd",
421
- "keygen",
422
- "label",
423
- "legend",
424
- "li",
425
- "link",
426
- "main",
427
- "map",
428
- "mark",
429
- "marquee",
430
- "menu",
431
- "menuitem",
432
- "meta",
433
- "meter",
434
- "nav",
435
- "nobr",
436
- "noembed",
437
- "noframes",
438
- "noscript",
439
- "object",
440
- "ol",
441
- "optgroup",
442
- "option",
443
- "output",
444
- "p",
445
- "param",
446
- "picture",
447
- "plaintext",
448
- "portal",
449
- "pre",
450
- "progress",
451
- "q",
452
- "rb",
453
- "rp",
454
- "rt",
455
- "rtc",
456
- "ruby",
457
- "s",
458
- "samp",
459
- "script",
460
- "section",
461
- "select",
462
- "shadow",
463
- "slot",
464
- "small",
465
- "source",
466
- "spacer",
467
- "span",
468
- "strike",
469
- "strong",
470
- "style",
471
- "sub",
472
- "summary",
473
- "sup",
474
- "table",
475
- "tbody",
476
- "td",
477
- "template",
478
- "textarea",
479
- "tfoot",
480
- "th",
481
- "thead",
482
- "time",
483
- "title",
484
- "tr",
485
- "track",
486
- "tt",
487
- "u",
488
- "ul",
489
- "var",
490
- "video",
491
- "wbr",
492
- "xmp",
493
- "input",
494
- "h1",
495
- "h2",
496
- "h3",
497
- "h4",
498
- "h5",
499
- "h6"
500
- ]);
57
+ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input", "h1", "h2", "h3", "h4", "h5", "h6"]);
501
58
 
502
59
  const memo = fn => createMemo(() => fn());
503
60
 
504
- const ES2017FLAG = Feature.AggregateError | Feature.BigIntTypedArray;
505
- const GLOBAL_IDENTIFIER = "_$HY.r";
506
- function createSerializer({ onData, onDone, scopeId, onError }) {
61
+ const ES2017FLAG = Feature.AggregateError
62
+ | Feature.BigIntTypedArray;
63
+ const GLOBAL_IDENTIFIER = '_$HY.r';
64
+ function createSerializer({
65
+ onData,
66
+ onDone,
67
+ scopeId,
68
+ onError
69
+ }) {
507
70
  return new Serializer({
508
71
  scopeId,
509
- plugins: [
510
- CustomEventPlugin,
511
- DOMExceptionPlugin,
512
- EventPlugin,
513
- FormDataPlugin,
514
- HeadersPlugin,
515
- ReadableStreamPlugin,
516
- RequestPlugin,
517
- ResponsePlugin,
518
- URLSearchParamsPlugin,
519
- URLPlugin
520
- ],
72
+ plugins: [AbortSignalPlugin,
73
+ CustomEventPlugin, DOMExceptionPlugin, EventPlugin,
74
+ FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin],
521
75
  globalIdentifier: GLOBAL_IDENTIFIER,
522
76
  disabledFeatures: ES2017FLAG,
523
77
  onData,
@@ -526,14 +80,15 @@ function createSerializer({ onData, onDone, scopeId, onError }) {
526
80
  });
527
81
  }
528
82
  function getLocalHeaderScript(id) {
529
- return getCrossReferenceHeader(id) + ";";
83
+ return getCrossReferenceHeader(id) + ';';
530
84
  }
531
85
 
532
- const VOID_ELEMENTS =
533
- /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
86
+ const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
534
87
  const REPLACE_SCRIPT = `function $df(e,n,o,t){if(n=document.getElementById(e),o=document.getElementById("pl-"+e)){for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content)}n.remove(),_$HY.fe(e)}`;
535
88
  function renderToString(code, options = {}) {
536
- const { renderId } = options;
89
+ const {
90
+ renderId
91
+ } = options;
537
92
  let scripts = "";
538
93
  const serializer = createSerializer({
539
94
  scopeId: renderId,
@@ -571,7 +126,9 @@ function renderToString(code, options = {}) {
571
126
  return html;
572
127
  }
573
128
  function renderToStringAsync(code, options = {}) {
574
- const { timeoutMs = 30000 } = options;
129
+ const {
130
+ timeoutMs = 30000
131
+ } = options;
575
132
  let timeoutHandle;
576
133
  const timeout = new Promise((_, reject) => {
577
134
  timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
@@ -582,7 +139,13 @@ function renderToStringAsync(code, options = {}) {
582
139
  });
583
140
  }
584
141
  function renderToStream(code, options = {}) {
585
- let { nonce, onCompleteShell, onCompleteAll, renderId, noScripts } = options;
142
+ let {
143
+ nonce,
144
+ onCompleteShell,
145
+ onCompleteAll,
146
+ renderId,
147
+ noScripts
148
+ } = options;
586
149
  let dispose;
587
150
  const blockingPromises = [];
588
151
  const pushTask = task => {
@@ -598,12 +161,11 @@ function renderToStream(code, options = {}) {
598
161
  const onDone = () => {
599
162
  writeTasks();
600
163
  doShell();
601
- onCompleteAll &&
602
- onCompleteAll({
603
- write(v) {
604
- !completed && buffer.write(v);
605
- }
606
- });
164
+ onCompleteAll && onCompleteAll({
165
+ write(v) {
166
+ !completed && buffer.write(v);
167
+ }
168
+ });
607
169
  writable && writable.end();
608
170
  completed = true;
609
171
  if (firstFlushed) dispose();
@@ -660,23 +222,17 @@ function renderToStream(code, options = {}) {
660
222
  const first = html.indexOf(placeholder);
661
223
  if (first === -1) return;
662
224
  const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
663
- html =
664
- html.slice(0, first) +
665
- resolveSSRNode(escape(payloadFn())) +
666
- html.slice(last + placeholder.length + 1);
225
+ html = html.slice(0, first) + resolveSSRNode(escape(payloadFn())) + html.slice(last + placeholder.length + 1);
667
226
  },
668
227
  serialize(id, p, wait) {
669
228
  const serverOnly = sharedConfig.context.noHydrate;
670
229
  if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
671
230
  blockingPromises.push(p);
672
- !serverOnly &&
673
- p
674
- .then(d => {
675
- serializer.write(id, d);
676
- })
677
- .catch(e => {
678
- serializer.write(id, e);
679
- });
231
+ !serverOnly && p.then(d => {
232
+ serializer.write(id, d);
233
+ }).catch(e => {
234
+ serializer.write(id, e);
235
+ });
680
236
  } else if (!serverOnly) serializer.write(id, p);
681
237
  },
682
238
  roots: 0,
@@ -686,15 +242,11 @@ function renderToStream(code, options = {}) {
686
242
  registerFragment(key) {
687
243
  if (!registry.has(key)) {
688
244
  let resolve, reject;
689
- const p = new Promise((r, rej) => ((resolve = r), (reject = rej)));
690
- registry.set(key, err =>
691
- queue(() =>
692
- queue(() => {
693
- err ? reject(err) : resolve(true);
694
- queue(flushEnd);
695
- })
696
- )
697
- );
245
+ const p = new Promise((r, rej) => (resolve = r, reject = rej));
246
+ registry.set(key, err => queue(() => queue(() => {
247
+ err ? reject(err) : resolve(true);
248
+ queue(flushEnd);
249
+ })));
698
250
  serializer.write(key, p);
699
251
  }
700
252
  return (value, error) => {
@@ -707,7 +259,7 @@ function renderToStream(code, options = {}) {
707
259
  }
708
260
  if (!completed) {
709
261
  if (!firstFlushed) {
710
- queue(() => (html = replacePlaceholder(html, key, value !== undefined ? value : "")));
262
+ queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
711
263
  resolve(error);
712
264
  } else {
713
265
  buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
@@ -733,12 +285,11 @@ function renderToStream(code, options = {}) {
733
285
  if (tasks.length) html = injectScripts(html, tasks, nonce);
734
286
  buffer.write(html);
735
287
  tasks = "";
736
- onCompleteShell &&
737
- onCompleteShell({
738
- write(v) {
739
- !completed && buffer.write(v);
740
- }
741
- });
288
+ onCompleteShell && onCompleteShell({
289
+ write(v) {
290
+ !completed && buffer.write(v);
291
+ }
292
+ });
742
293
  shellCompleted = true;
743
294
  }
744
295
  return {
@@ -773,7 +324,7 @@ function renderToStream(code, options = {}) {
773
324
  pipeTo(w) {
774
325
  return allSettled(blockingPromises).then(() => {
775
326
  let resolve;
776
- const p = new Promise(r => (resolve = r));
327
+ const p = new Promise(r => resolve = r);
777
328
  setTimeout(() => {
778
329
  doShell();
779
330
  const encoder = new TextEncoder();
@@ -803,13 +354,13 @@ function renderToStream(code, options = {}) {
803
354
  };
804
355
  }
805
356
  function HydrationScript(props) {
806
- const { nonce } = sharedConfig.context;
807
- return ssr(
808
- generateHydrationScript({
809
- nonce,
810
- ...props
811
- })
812
- );
357
+ const {
358
+ nonce
359
+ } = sharedConfig.context;
360
+ return ssr(generateHydrationScript({
361
+ nonce,
362
+ ...props
363
+ }));
813
364
  }
814
365
  function ssr(t, ...nodes) {
815
366
  if (nodes.length) {
@@ -854,8 +405,7 @@ function ssrStyle(value) {
854
405
  return result;
855
406
  }
856
407
  function ssrElement(tag, props, children, needsId) {
857
- if (props == null) props = {};
858
- else if (typeof props === "function") props = props();
408
+ if (props == null) props = {};else if (typeof props === "function") props = props();
859
409
  const skipChildren = VOID_ELEMENTS.test(tag);
860
410
  const keys = Object.keys(props);
861
411
  let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
@@ -863,11 +413,7 @@ function ssrElement(tag, props, children, needsId) {
863
413
  for (let i = 0; i < keys.length; i++) {
864
414
  const prop = keys[i];
865
415
  if (ChildProperties.has(prop)) {
866
- if (children === undefined && !skipChildren)
867
- children =
868
- tag === "script" || tag === "style" || prop === "innerHTML"
869
- ? props[prop]
870
- : escape(props[prop]);
416
+ if (children === undefined && !skipChildren) children = tag === "script" || tag === "style" || prop === "innerHTML" ? props[prop] : escape(props[prop]);
871
417
  continue;
872
418
  }
873
419
  const value = props[prop];
@@ -876,20 +422,11 @@ function ssrElement(tag, props, children, needsId) {
876
422
  } else if (prop === "class" || prop === "className" || prop === "classList") {
877
423
  if (classResolved) continue;
878
424
  let n;
879
- result += `class="${
880
- escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) +
881
- ssrClassList(props.classList)
882
- }"`;
425
+ result += `class="${escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) + ssrClassList(props.classList)}"`;
883
426
  classResolved = true;
884
427
  } else if (BooleanAttributes.has(prop)) {
885
- if (value) result += prop;
886
- else continue;
887
- } else if (
888
- value == undefined ||
889
- prop === "ref" ||
890
- prop.slice(0, 2) === "on" ||
891
- prop.slice(0, 5) === "prop:"
892
- ) {
428
+ if (value) result += prop;else continue;
429
+ } else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
893
430
  continue;
894
431
  } else if (prop.slice(0, 5) === "bool:") {
895
432
  if (!value) continue;
@@ -901,17 +438,16 @@ function ssrElement(tag, props, children, needsId) {
901
438
  }
902
439
  if (i !== keys.length - 1) result += " ";
903
440
  }
904
- if (skipChildren)
905
- return {
906
- t: result + "/>"
907
- };
441
+ if (skipChildren) return {
442
+ t: result + "/>"
443
+ };
908
444
  if (typeof children === "function") children = children();
909
445
  return {
910
446
  t: result + `>${resolveSSRNode(children, true)}</${tag}>`
911
447
  };
912
448
  }
913
449
  function ssrAttribute(key, value, isBoolean) {
914
- return isBoolean ? (value ? " " + key : "") : value != null ? ` ${key}="${value}"` : "";
450
+ return isBoolean ? value ? " " + key : "" : value != null ? ` ${key}="${value}"` : "";
915
451
  }
916
452
  function ssrHydrationKey() {
917
453
  const hk = getHydrationKey();
@@ -955,13 +491,12 @@ function escape(s, attr) {
955
491
  left = iDelim + 1;
956
492
  iDelim = s.indexOf(delim, left);
957
493
  } while (iDelim >= 0);
958
- } else
959
- while (iAmp >= 0) {
960
- if (left < iAmp) out += s.substring(left, iAmp);
961
- out += "&amp;";
962
- left = iAmp + 1;
963
- iAmp = s.indexOf("&", left);
964
- }
494
+ } else while (iAmp >= 0) {
495
+ if (left < iAmp) out += s.substring(left, iAmp);
496
+ out += "&amp;";
497
+ left = iAmp + 1;
498
+ iAmp = s.indexOf("&", left);
499
+ }
965
500
  return left < s.length ? out + s.substring(left) : out;
966
501
  }
967
502
  function resolveSSRNode(node, top) {
@@ -973,7 +508,7 @@ function resolveSSRNode(node, top) {
973
508
  let mapped = "";
974
509
  for (let i = 0, len = node.length; i < len; i++) {
975
510
  if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
976
- mapped += resolveSSRNode((prev = node[i]));
511
+ mapped += resolveSSRNode(prev = node[i]);
977
512
  }
978
513
  return mapped;
979
514
  }
@@ -994,12 +529,11 @@ function getAssets() {
994
529
  for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
995
530
  return out;
996
531
  }
997
- function generateHydrationScript({ eventNames = ["click", "input"], nonce } = {}) {
998
- return `<script${
999
- nonce ? ` nonce="${nonce}"` : ""
1000
- }>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join(
1001
- '", "'
1002
- )}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
532
+ function generateHydrationScript({
533
+ eventNames = ["click", "input"],
534
+ nonce
535
+ } = {}) {
536
+ return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
1003
537
  }
1004
538
  function Hydration(props) {
1005
539
  if (!sharedConfig.context.noHydrate) return props.children;
@@ -1060,20 +594,16 @@ function replacePlaceholder(html, key, value) {
1060
594
  }
1061
595
  const RequestContext = Symbol();
1062
596
  function getRequestEvent() {
1063
- return globalThis[RequestContext]
1064
- ? globalThis[RequestContext].getStore() ||
1065
- (sharedConfig.context && sharedConfig.context.event) ||
1066
- console.log(
1067
- "RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls."
1068
- )
1069
- : undefined;
597
+ return globalThis[RequestContext] ? globalThis[RequestContext].getStore() || sharedConfig.context && sharedConfig.context.event || console.log("RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls.") : undefined;
1070
598
  }
1071
599
  function Assets(props) {
1072
600
  useAssets(() => props.children);
1073
601
  }
1074
602
  function pipeToNodeWritable(code, writable, options = {}) {
1075
603
  if (options.onReady) {
1076
- options.onCompleteShell = ({ write }) => {
604
+ options.onCompleteShell = ({
605
+ write
606
+ }) => {
1077
607
  options.onReady({
1078
608
  write,
1079
609
  startWriting() {
@@ -1087,7 +617,9 @@ function pipeToNodeWritable(code, writable, options = {}) {
1087
617
  }
1088
618
  function pipeToWritable(code, writable, options = {}) {
1089
619
  if (options.onReady) {
1090
- options.onCompleteShell = ({ write }) => {
620
+ options.onCompleteShell = ({
621
+ write
622
+ }) => {
1091
623
  options.onReady({
1092
624
  write,
1093
625
  startWriting() {
@@ -1117,19 +649,11 @@ function ssrSpread(props, isSVG, skipChildren) {
1117
649
  } else if (prop === "class" || prop === "className" || prop === "classList") {
1118
650
  if (classResolved) continue;
1119
651
  let n;
1120
- result += `class="${(n = props.class) ? n + " " : ""}${
1121
- (n = props.className) ? n + " " : ""
1122
- }${ssrClassList(props.classList)}"`;
652
+ result += `class="${(n = props.class) ? n + " " : ""}${(n = props.className) ? n + " " : ""}${ssrClassList(props.classList)}"`;
1123
653
  classResolved = true;
1124
654
  } else if (prop !== "value" && Properties.has(prop)) {
1125
- if (value) result += prop;
1126
- else continue;
1127
- } else if (
1128
- value == undefined ||
1129
- prop === "ref" ||
1130
- prop.slice(0, 2) === "on" ||
1131
- prop.slice(0, 5) === "prop:"
1132
- ) {
655
+ if (value) result += prop;else continue;
656
+ } else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
1133
657
  continue;
1134
658
  } else if (prop.slice(0, 5) === "bool:") {
1135
659
  if (!value) continue;
@@ -1144,9 +668,7 @@ function ssrSpread(props, isSVG, skipChildren) {
1144
668
  return result;
1145
669
  }
1146
670
  function notSup() {
1147
- throw new Error(
1148
- "Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>."
1149
- );
671
+ throw new Error("Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.");
1150
672
  }
1151
673
 
1152
674
  const isServer = true;
@@ -1155,8 +677,7 @@ function createDynamic(component, props) {
1155
677
  const comp = component(),
1156
678
  t = typeof comp;
1157
679
  if (comp) {
1158
- if (t === "function") return comp(props);
1159
- else if (t === "string") {
680
+ if (t === "function") return comp(props);else if (t === "string") {
1160
681
  return ssrElement(comp, props, undefined, true);
1161
682
  }
1162
683
  }
@@ -1169,62 +690,4 @@ function Portal(props) {
1169
690
  return "";
1170
691
  }
1171
692
 
1172
- export {
1173
- Aliases,
1174
- Assets,
1175
- ChildProperties,
1176
- DOMElements,
1177
- DelegatedEvents,
1178
- Dynamic,
1179
- Hydration,
1180
- HydrationScript,
1181
- NoHydration,
1182
- Portal,
1183
- Properties,
1184
- RequestContext,
1185
- SVGElements,
1186
- SVGNamespace,
1187
- notSup as addEventListener,
1188
- notSup as assign,
1189
- notSup as classList,
1190
- notSup as className,
1191
- createDynamic,
1192
- notSup as delegateEvents,
1193
- notSup as dynamicProperty,
1194
- escape,
1195
- generateHydrationScript,
1196
- getAssets,
1197
- getHydrationKey,
1198
- notSup as getNextElement,
1199
- notSup as getNextMarker,
1200
- notSup as getNextMatch,
1201
- getPropAlias,
1202
- getRequestEvent,
1203
- notSup as hydrate,
1204
- notSup as insert,
1205
- isDev,
1206
- isServer,
1207
- memo,
1208
- pipeToNodeWritable,
1209
- pipeToWritable,
1210
- notSup as render,
1211
- renderToStream,
1212
- renderToString,
1213
- renderToStringAsync,
1214
- resolveSSRNode,
1215
- notSup as runHydrationEvents,
1216
- notSup as setAttribute,
1217
- notSup as setAttributeNS,
1218
- notSup as setProperty,
1219
- notSup as spread,
1220
- ssr,
1221
- ssrAttribute,
1222
- ssrClassList,
1223
- ssrElement,
1224
- ssrHydrationKey,
1225
- ssrSpread,
1226
- ssrStyle,
1227
- notSup as style,
1228
- notSup as template,
1229
- useAssets
1230
- };
693
+ export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, HydrationScript, NoHydration, Portal, Properties, RequestContext, SVGElements, SVGNamespace, notSup as addEventListener, notSup as assign, notSup as classList, notSup as className, createDynamic, notSup as delegateEvents, notSup as dynamicProperty, escape, generateHydrationScript, getAssets, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getPropAlias, getRequestEvent, notSup as hydrate, notSup as insert, isDev, isServer, memo, pipeToNodeWritable, pipeToWritable, notSup as render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, notSup as runHydrationEvents, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, notSup as style, notSup as template, useAssets };