solid-js 1.9.1 → 1.9.2

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 (50) hide show
  1. package/README.md +1 -1
  2. package/dist/dev.cjs +1 -1
  3. package/dist/dev.js +318 -559
  4. package/dist/server.js +74 -168
  5. package/dist/solid.cjs +1 -1
  6. package/dist/solid.js +276 -486
  7. package/h/dist/h.js +9 -40
  8. package/h/jsx-runtime/dist/jsx.js +1 -1
  9. package/h/jsx-runtime/types/index.d.ts +8 -11
  10. package/h/jsx-runtime/types/jsx.d.ts +196 -59
  11. package/h/types/hyperscript.d.ts +11 -11
  12. package/html/dist/html.cjs +1 -1
  13. package/html/dist/html.js +94 -219
  14. package/html/types/lit.d.ts +33 -52
  15. package/package.json +1 -1
  16. package/store/dist/dev.js +43 -123
  17. package/store/dist/server.js +8 -20
  18. package/store/dist/store.js +40 -114
  19. package/store/types/index.d.ts +7 -21
  20. package/store/types/modifiers.d.ts +3 -6
  21. package/store/types/mutable.d.ts +2 -5
  22. package/store/types/server.d.ts +5 -25
  23. package/store/types/store.d.ts +61 -218
  24. package/types/index.d.ts +10 -75
  25. package/types/jsx.d.ts +195 -47
  26. package/types/reactive/array.d.ts +4 -12
  27. package/types/reactive/observable.d.ts +17 -25
  28. package/types/reactive/scheduler.d.ts +6 -9
  29. package/types/reactive/signal.d.ts +142 -233
  30. package/types/render/Suspense.d.ts +5 -5
  31. package/types/render/component.d.ts +35 -71
  32. package/types/render/flow.d.ts +31 -43
  33. package/types/render/hydration.d.ts +15 -15
  34. package/types/server/index.d.ts +2 -57
  35. package/types/server/reactive.d.ts +42 -73
  36. package/types/server/rendering.d.ts +98 -169
  37. package/universal/dist/dev.js +12 -28
  38. package/universal/dist/universal.js +12 -28
  39. package/universal/types/index.d.ts +1 -3
  40. package/universal/types/universal.d.ts +1 -0
  41. package/web/dist/dev.cjs +14 -14
  42. package/web/dist/dev.js +89 -639
  43. package/web/dist/server.cjs +14 -14
  44. package/web/dist/server.js +108 -635
  45. package/web/dist/web.cjs +14 -14
  46. package/web/dist/web.js +87 -627
  47. package/web/storage/dist/storage.js +3 -3
  48. package/web/types/core.d.ts +1 -10
  49. package/web/types/index.d.ts +10 -27
  50. package/web/types/server-mock.d.ts +32 -47
@@ -1,83 +1,17 @@
1
- import { 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
- createMemo as memo,
15
- mergeProps,
16
- untrack
17
- } from "solid-js";
18
- import { Feature, Serializer, getCrossReferenceHeader } from "seroval";
19
- import {
20
- CustomEventPlugin,
21
- DOMExceptionPlugin,
22
- EventPlugin,
23
- FormDataPlugin,
24
- HeadersPlugin,
25
- ReadableStreamPlugin,
26
- RequestPlugin,
27
- ResponsePlugin,
28
- URLSearchParamsPlugin,
29
- URLPlugin
30
- } from "seroval-plugins/web";
1
+ import { sharedConfig, createRoot, splitProps } from 'solid-js';
2
+ export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js';
3
+ import { Feature, Serializer, getCrossReferenceHeader } from 'seroval';
4
+ import { CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
31
5
 
32
- const booleans = [
33
- "allowfullscreen",
34
- "async",
35
- "autofocus",
36
- "autoplay",
37
- "checked",
38
- "controls",
39
- "default",
40
- "disabled",
41
- "formnovalidate",
42
- "hidden",
43
- "indeterminate",
44
- "inert",
45
- "ismap",
46
- "loop",
47
- "multiple",
48
- "muted",
49
- "nomodule",
50
- "novalidate",
51
- "open",
52
- "playsinline",
53
- "readonly",
54
- "required",
55
- "reversed",
56
- "seamless",
57
- "selected"
58
- ];
59
- const BooleanAttributes = /*#__PURE__*/ new Set(booleans);
60
- const Properties = /*#__PURE__*/ new Set([
61
- "className",
62
- "value",
63
- "readOnly",
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", "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
  formnovalidate: {
83
17
  $: "formNoValidate",
@@ -104,414 +38,34 @@ const PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {
104
38
  });
105
39
  function getPropAlias(prop, tagName) {
106
40
  const a = PropAliases[prop];
107
- return typeof a === "object" ? (a[tagName] ? a["$"] : undefined) : a;
108
- }
109
- const DelegatedEvents = /*#__PURE__*/ new Set([
110
- "beforeinput",
111
- "click",
112
- "dblclick",
113
- "contextmenu",
114
- "focusin",
115
- "focusout",
116
- "input",
117
- "keydown",
118
- "keyup",
119
- "mousedown",
120
- "mousemove",
121
- "mouseout",
122
- "mouseover",
123
- "mouseup",
124
- "pointerdown",
125
- "pointermove",
126
- "pointerout",
127
- "pointerover",
128
- "pointerup",
129
- "touchend",
130
- "touchmove",
131
- "touchstart"
132
- ]);
133
- const SVGElements = /*#__PURE__*/ new Set([
134
- "altGlyph",
135
- "altGlyphDef",
136
- "altGlyphItem",
137
- "animate",
138
- "animateColor",
139
- "animateMotion",
140
- "animateTransform",
141
- "circle",
142
- "clipPath",
143
- "color-profile",
144
- "cursor",
145
- "defs",
146
- "desc",
147
- "ellipse",
148
- "feBlend",
149
- "feColorMatrix",
150
- "feComponentTransfer",
151
- "feComposite",
152
- "feConvolveMatrix",
153
- "feDiffuseLighting",
154
- "feDisplacementMap",
155
- "feDistantLight",
156
- "feDropShadow",
157
- "feFlood",
158
- "feFuncA",
159
- "feFuncB",
160
- "feFuncG",
161
- "feFuncR",
162
- "feGaussianBlur",
163
- "feImage",
164
- "feMerge",
165
- "feMergeNode",
166
- "feMorphology",
167
- "feOffset",
168
- "fePointLight",
169
- "feSpecularLighting",
170
- "feSpotLight",
171
- "feTile",
172
- "feTurbulence",
173
- "filter",
174
- "font",
175
- "font-face",
176
- "font-face-format",
177
- "font-face-name",
178
- "font-face-src",
179
- "font-face-uri",
180
- "foreignObject",
181
- "g",
182
- "glyph",
183
- "glyphRef",
184
- "hkern",
185
- "image",
186
- "line",
187
- "linearGradient",
188
- "marker",
189
- "mask",
190
- "metadata",
191
- "missing-glyph",
192
- "mpath",
193
- "path",
194
- "pattern",
195
- "polygon",
196
- "polyline",
197
- "radialGradient",
198
- "rect",
199
- "set",
200
- "stop",
201
- "svg",
202
- "switch",
203
- "symbol",
204
- "text",
205
- "textPath",
206
- "tref",
207
- "tspan",
208
- "use",
209
- "view",
210
- "vkern"
211
- ]);
41
+ return typeof a === "object" ? a[tagName] ? a["$"] : undefined : a;
42
+ }
43
+ 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"]);
44
+ const SVGElements = /*#__PURE__*/new Set([
45
+ "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",
46
+ "set", "stop",
47
+ "svg", "switch", "symbol", "text", "textPath",
48
+ "tref", "tspan", "use", "view", "vkern"]);
212
49
  const SVGNamespace = {
213
50
  xlink: "http://www.w3.org/1999/xlink",
214
51
  xml: "http://www.w3.org/XML/1998/namespace"
215
52
  };
216
- const DOMElements = /*#__PURE__*/ new Set([
217
- "html",
218
- "base",
219
- "head",
220
- "link",
221
- "meta",
222
- "style",
223
- "title",
224
- "body",
225
- "address",
226
- "article",
227
- "aside",
228
- "footer",
229
- "header",
230
- "main",
231
- "nav",
232
- "section",
233
- "body",
234
- "blockquote",
235
- "dd",
236
- "div",
237
- "dl",
238
- "dt",
239
- "figcaption",
240
- "figure",
241
- "hr",
242
- "li",
243
- "ol",
244
- "p",
245
- "pre",
246
- "ul",
247
- "a",
248
- "abbr",
249
- "b",
250
- "bdi",
251
- "bdo",
252
- "br",
253
- "cite",
254
- "code",
255
- "data",
256
- "dfn",
257
- "em",
258
- "i",
259
- "kbd",
260
- "mark",
261
- "q",
262
- "rp",
263
- "rt",
264
- "ruby",
265
- "s",
266
- "samp",
267
- "small",
268
- "span",
269
- "strong",
270
- "sub",
271
- "sup",
272
- "time",
273
- "u",
274
- "var",
275
- "wbr",
276
- "area",
277
- "audio",
278
- "img",
279
- "map",
280
- "track",
281
- "video",
282
- "embed",
283
- "iframe",
284
- "object",
285
- "param",
286
- "picture",
287
- "portal",
288
- "source",
289
- "svg",
290
- "math",
291
- "canvas",
292
- "noscript",
293
- "script",
294
- "del",
295
- "ins",
296
- "caption",
297
- "col",
298
- "colgroup",
299
- "table",
300
- "tbody",
301
- "td",
302
- "tfoot",
303
- "th",
304
- "thead",
305
- "tr",
306
- "button",
307
- "datalist",
308
- "fieldset",
309
- "form",
310
- "input",
311
- "label",
312
- "legend",
313
- "meter",
314
- "optgroup",
315
- "option",
316
- "output",
317
- "progress",
318
- "select",
319
- "textarea",
320
- "details",
321
- "dialog",
322
- "menu",
323
- "summary",
324
- "details",
325
- "slot",
326
- "template",
327
- "acronym",
328
- "applet",
329
- "basefont",
330
- "bgsound",
331
- "big",
332
- "blink",
333
- "center",
334
- "content",
335
- "dir",
336
- "font",
337
- "frame",
338
- "frameset",
339
- "hgroup",
340
- "image",
341
- "keygen",
342
- "marquee",
343
- "menuitem",
344
- "nobr",
345
- "noembed",
346
- "noframes",
347
- "plaintext",
348
- "rb",
349
- "rtc",
350
- "shadow",
351
- "spacer",
352
- "strike",
353
- "tt",
354
- "xmp",
355
- "a",
356
- "abbr",
357
- "acronym",
358
- "address",
359
- "applet",
360
- "area",
361
- "article",
362
- "aside",
363
- "audio",
364
- "b",
365
- "base",
366
- "basefont",
367
- "bdi",
368
- "bdo",
369
- "bgsound",
370
- "big",
371
- "blink",
372
- "blockquote",
373
- "body",
374
- "br",
375
- "button",
376
- "canvas",
377
- "caption",
378
- "center",
379
- "cite",
380
- "code",
381
- "col",
382
- "colgroup",
383
- "content",
384
- "data",
385
- "datalist",
386
- "dd",
387
- "del",
388
- "details",
389
- "dfn",
390
- "dialog",
391
- "dir",
392
- "div",
393
- "dl",
394
- "dt",
395
- "em",
396
- "embed",
397
- "fieldset",
398
- "figcaption",
399
- "figure",
400
- "font",
401
- "footer",
402
- "form",
403
- "frame",
404
- "frameset",
405
- "head",
406
- "header",
407
- "hgroup",
408
- "hr",
409
- "html",
410
- "i",
411
- "iframe",
412
- "image",
413
- "img",
414
- "input",
415
- "ins",
416
- "kbd",
417
- "keygen",
418
- "label",
419
- "legend",
420
- "li",
421
- "link",
422
- "main",
423
- "map",
424
- "mark",
425
- "marquee",
426
- "menu",
427
- "menuitem",
428
- "meta",
429
- "meter",
430
- "nav",
431
- "nobr",
432
- "noembed",
433
- "noframes",
434
- "noscript",
435
- "object",
436
- "ol",
437
- "optgroup",
438
- "option",
439
- "output",
440
- "p",
441
- "param",
442
- "picture",
443
- "plaintext",
444
- "portal",
445
- "pre",
446
- "progress",
447
- "q",
448
- "rb",
449
- "rp",
450
- "rt",
451
- "rtc",
452
- "ruby",
453
- "s",
454
- "samp",
455
- "script",
456
- "section",
457
- "select",
458
- "shadow",
459
- "slot",
460
- "small",
461
- "source",
462
- "spacer",
463
- "span",
464
- "strike",
465
- "strong",
466
- "style",
467
- "sub",
468
- "summary",
469
- "sup",
470
- "table",
471
- "tbody",
472
- "td",
473
- "template",
474
- "textarea",
475
- "tfoot",
476
- "th",
477
- "thead",
478
- "time",
479
- "title",
480
- "tr",
481
- "track",
482
- "tt",
483
- "u",
484
- "ul",
485
- "var",
486
- "video",
487
- "wbr",
488
- "xmp",
489
- "input",
490
- "h1",
491
- "h2",
492
- "h3",
493
- "h4",
494
- "h5",
495
- "h6"
496
- ]);
53
+ 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"]);
497
54
 
498
- const ES2017FLAG = Feature.AggregateError | Feature.BigIntTypedArray;
499
- const GLOBAL_IDENTIFIER = "_$HY.r";
500
- function createSerializer({ onData, onDone, scopeId, onError }) {
55
+ const ES2017FLAG = Feature.AggregateError
56
+ | Feature.BigIntTypedArray;
57
+ const GLOBAL_IDENTIFIER = '_$HY.r';
58
+ function createSerializer({
59
+ onData,
60
+ onDone,
61
+ scopeId,
62
+ onError
63
+ }) {
501
64
  return new Serializer({
502
65
  scopeId,
503
66
  plugins: [
504
- CustomEventPlugin,
505
- DOMExceptionPlugin,
506
- EventPlugin,
507
- FormDataPlugin,
508
- HeadersPlugin,
509
- ReadableStreamPlugin,
510
- RequestPlugin,
511
- ResponsePlugin,
512
- URLSearchParamsPlugin,
513
- URLPlugin
514
- ],
67
+ CustomEventPlugin, DOMExceptionPlugin, EventPlugin,
68
+ FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin],
515
69
  globalIdentifier: GLOBAL_IDENTIFIER,
516
70
  disabledFeatures: ES2017FLAG,
517
71
  onData,
@@ -520,14 +74,15 @@ function createSerializer({ onData, onDone, scopeId, onError }) {
520
74
  });
521
75
  }
522
76
  function getLocalHeaderScript(id) {
523
- return getCrossReferenceHeader(id) + ";";
77
+ return getCrossReferenceHeader(id) + ';';
524
78
  }
525
79
 
526
- const VOID_ELEMENTS =
527
- /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
80
+ const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
528
81
  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)}`;
529
82
  function renderToString(code, options = {}) {
530
- const { renderId } = options;
83
+ const {
84
+ renderId
85
+ } = options;
531
86
  let scripts = "";
532
87
  const serializer = createSerializer({
533
88
  scopeId: renderId,
@@ -565,7 +120,9 @@ function renderToString(code, options = {}) {
565
120
  return html;
566
121
  }
567
122
  function renderToStringAsync(code, options = {}) {
568
- const { timeoutMs = 30000 } = options;
123
+ const {
124
+ timeoutMs = 30000
125
+ } = options;
569
126
  let timeoutHandle;
570
127
  const timeout = new Promise((_, reject) => {
571
128
  timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
@@ -576,7 +133,13 @@ function renderToStringAsync(code, options = {}) {
576
133
  });
577
134
  }
578
135
  function renderToStream(code, options = {}) {
579
- let { nonce, onCompleteShell, onCompleteAll, renderId, noScripts } = options;
136
+ let {
137
+ nonce,
138
+ onCompleteShell,
139
+ onCompleteAll,
140
+ renderId,
141
+ noScripts
142
+ } = options;
580
143
  let dispose;
581
144
  const blockingPromises = [];
582
145
  const pushTask = task => {
@@ -592,12 +155,11 @@ function renderToStream(code, options = {}) {
592
155
  const onDone = () => {
593
156
  writeTasks();
594
157
  doShell();
595
- onCompleteAll &&
596
- onCompleteAll({
597
- write(v) {
598
- !completed && buffer.write(v);
599
- }
600
- });
158
+ onCompleteAll && onCompleteAll({
159
+ write(v) {
160
+ !completed && buffer.write(v);
161
+ }
162
+ });
601
163
  writable && writable.end();
602
164
  completed = true;
603
165
  if (firstFlushed) dispose();
@@ -654,23 +216,17 @@ function renderToStream(code, options = {}) {
654
216
  const first = html.indexOf(placeholder);
655
217
  if (first === -1) return;
656
218
  const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
657
- html = html.replace(
658
- html.slice(first, last + placeholder.length + 1),
659
- resolveSSRNode(payloadFn())
660
- );
219
+ html = html.replace(html.slice(first, last + placeholder.length + 1), resolveSSRNode(payloadFn()));
661
220
  },
662
221
  serialize(id, p, wait) {
663
222
  const serverOnly = sharedConfig.context.noHydrate;
664
223
  if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
665
224
  blockingPromises.push(p);
666
- !serverOnly &&
667
- p
668
- .then(d => {
669
- serializer.write(id, d);
670
- })
671
- .catch(e => {
672
- serializer.write(id, e);
673
- });
225
+ !serverOnly && p.then(d => {
226
+ serializer.write(id, d);
227
+ }).catch(e => {
228
+ serializer.write(id, e);
229
+ });
674
230
  } else if (!serverOnly) serializer.write(id, p);
675
231
  },
676
232
  roots: 0,
@@ -680,15 +236,11 @@ function renderToStream(code, options = {}) {
680
236
  registerFragment(key) {
681
237
  if (!registry.has(key)) {
682
238
  let resolve, reject;
683
- const p = new Promise((r, rej) => ((resolve = r), (reject = rej)));
684
- registry.set(key, err =>
685
- queue(() =>
686
- queue(() => {
687
- err ? reject(err) : resolve(true);
688
- queue(flushEnd);
689
- })
690
- )
691
- );
239
+ const p = new Promise((r, rej) => (resolve = r, reject = rej));
240
+ registry.set(key, err => queue(() => queue(() => {
241
+ err ? reject(err) : resolve(true);
242
+ queue(flushEnd);
243
+ })));
692
244
  serializer.write(key, p);
693
245
  }
694
246
  return (value, error) => {
@@ -701,7 +253,7 @@ function renderToStream(code, options = {}) {
701
253
  }
702
254
  if (!completed) {
703
255
  if (!firstFlushed) {
704
- queue(() => (html = replacePlaceholder(html, key, value !== undefined ? value : "")));
256
+ queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
705
257
  resolve(error);
706
258
  } else {
707
259
  buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
@@ -727,12 +279,11 @@ function renderToStream(code, options = {}) {
727
279
  if (tasks.length) html = injectScripts(html, tasks, nonce);
728
280
  buffer.write(html);
729
281
  tasks = "";
730
- onCompleteShell &&
731
- onCompleteShell({
732
- write(v) {
733
- !completed && buffer.write(v);
734
- }
735
- });
282
+ onCompleteShell && onCompleteShell({
283
+ write(v) {
284
+ !completed && buffer.write(v);
285
+ }
286
+ });
736
287
  shellCompleted = true;
737
288
  }
738
289
  return {
@@ -767,7 +318,7 @@ function renderToStream(code, options = {}) {
767
318
  pipeTo(w) {
768
319
  return allSettled(blockingPromises).then(() => {
769
320
  let resolve;
770
- const p = new Promise(r => (resolve = r));
321
+ const p = new Promise(r => resolve = r);
771
322
  setTimeout(() => {
772
323
  doShell();
773
324
  const encoder = new TextEncoder();
@@ -797,13 +348,13 @@ function renderToStream(code, options = {}) {
797
348
  };
798
349
  }
799
350
  function HydrationScript(props) {
800
- const { nonce } = sharedConfig.context;
801
- return ssr(
802
- generateHydrationScript({
803
- nonce,
804
- ...props
805
- })
806
- );
351
+ const {
352
+ nonce
353
+ } = sharedConfig.context;
354
+ return ssr(generateHydrationScript({
355
+ nonce,
356
+ ...props
357
+ }));
807
358
  }
808
359
  function ssr(t, ...nodes) {
809
360
  if (nodes.length) {
@@ -848,8 +399,7 @@ function ssrStyle(value) {
848
399
  return result;
849
400
  }
850
401
  function ssrElement(tag, props, children, needsId) {
851
- if (props == null) props = {};
852
- else if (typeof props === "function") props = props();
402
+ if (props == null) props = {};else if (typeof props === "function") props = props();
853
403
  const skipChildren = VOID_ELEMENTS.test(tag);
854
404
  const keys = Object.keys(props);
855
405
  let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
@@ -857,8 +407,7 @@ function ssrElement(tag, props, children, needsId) {
857
407
  for (let i = 0; i < keys.length; i++) {
858
408
  const prop = keys[i];
859
409
  if (ChildProperties.has(prop)) {
860
- if (children === undefined && !skipChildren)
861
- children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
410
+ if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
862
411
  continue;
863
412
  }
864
413
  const value = props[prop];
@@ -867,14 +416,10 @@ function ssrElement(tag, props, children, needsId) {
867
416
  } else if (prop === "class" || prop === "className" || prop === "classList") {
868
417
  if (classResolved) continue;
869
418
  let n;
870
- result += `class="${
871
- escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) +
872
- ssrClassList(props.classList)
873
- }"`;
419
+ result += `class="${escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) + ssrClassList(props.classList)}"`;
874
420
  classResolved = true;
875
421
  } else if (BooleanAttributes.has(prop)) {
876
- if (value) result += prop;
877
- else continue;
422
+ if (value) result += prop;else continue;
878
423
  } else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on") {
879
424
  continue;
880
425
  } else {
@@ -882,17 +427,16 @@ function ssrElement(tag, props, children, needsId) {
882
427
  }
883
428
  if (i !== keys.length - 1) result += " ";
884
429
  }
885
- if (skipChildren)
886
- return {
887
- t: result + "/>"
888
- };
430
+ if (skipChildren) return {
431
+ t: result + "/>"
432
+ };
889
433
  if (typeof children === "function") children = children();
890
434
  return {
891
435
  t: result + `>${resolveSSRNode(children, true)}</${tag}>`
892
436
  };
893
437
  }
894
438
  function ssrAttribute(key, value, isBoolean) {
895
- return isBoolean ? (value ? " " + key : "") : value != null ? ` ${key}="${value}"` : "";
439
+ return isBoolean ? value ? " " + key : "" : value != null ? ` ${key}="${value}"` : "";
896
440
  }
897
441
  function ssrHydrationKey() {
898
442
  const hk = getHydrationKey();
@@ -936,13 +480,12 @@ function escape(s, attr) {
936
480
  left = iDelim + 1;
937
481
  iDelim = s.indexOf(delim, left);
938
482
  } while (iDelim >= 0);
939
- } else
940
- while (iAmp >= 0) {
941
- if (left < iAmp) out += s.substring(left, iAmp);
942
- out += "&amp;";
943
- left = iAmp + 1;
944
- iAmp = s.indexOf("&", left);
945
- }
483
+ } else while (iAmp >= 0) {
484
+ if (left < iAmp) out += s.substring(left, iAmp);
485
+ out += "&amp;";
486
+ left = iAmp + 1;
487
+ iAmp = s.indexOf("&", left);
488
+ }
946
489
  return left < s.length ? out + s.substring(left) : out;
947
490
  }
948
491
  function resolveSSRNode(node, top) {
@@ -954,7 +497,7 @@ function resolveSSRNode(node, top) {
954
497
  let mapped = "";
955
498
  for (let i = 0, len = node.length; i < len; i++) {
956
499
  if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
957
- mapped += resolveSSRNode((prev = node[i]));
500
+ mapped += resolveSSRNode(prev = node[i]);
958
501
  }
959
502
  return mapped;
960
503
  }
@@ -975,12 +518,11 @@ function getAssets() {
975
518
  for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
976
519
  return out;
977
520
  }
978
- function generateHydrationScript({ eventNames = ["click", "input"], nonce } = {}) {
979
- return `<script${
980
- nonce ? ` nonce="${nonce}"` : ""
981
- }>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(
982
- '", "'
983
- )}"].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-->`;
521
+ function generateHydrationScript({
522
+ eventNames = ["click", "input"],
523
+ nonce
524
+ } = {}) {
525
+ 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-->`;
984
526
  }
985
527
  function Hydration(props) {
986
528
  if (!sharedConfig.context.noHydrate) return props.children;
@@ -1039,20 +581,16 @@ function replacePlaceholder(html, key, value) {
1039
581
  }
1040
582
  const RequestContext = Symbol();
1041
583
  function getRequestEvent() {
1042
- return globalThis[RequestContext]
1043
- ? globalThis[RequestContext].getStore() ||
1044
- (sharedConfig.context && sharedConfig.context.event) ||
1045
- console.log(
1046
- "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."
1047
- )
1048
- : undefined;
584
+ 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;
1049
585
  }
1050
586
  function Assets(props) {
1051
587
  useAssets(() => props.children);
1052
588
  }
1053
589
  function pipeToNodeWritable(code, writable, options = {}) {
1054
590
  if (options.onReady) {
1055
- options.onCompleteShell = ({ write }) => {
591
+ options.onCompleteShell = ({
592
+ write
593
+ }) => {
1056
594
  options.onReady({
1057
595
  write,
1058
596
  startWriting() {
@@ -1066,7 +604,9 @@ function pipeToNodeWritable(code, writable, options = {}) {
1066
604
  }
1067
605
  function pipeToWritable(code, writable, options = {}) {
1068
606
  if (options.onReady) {
1069
- options.onCompleteShell = ({ write }) => {
607
+ options.onCompleteShell = ({
608
+ write
609
+ }) => {
1070
610
  options.onReady({
1071
611
  write,
1072
612
  startWriting() {
@@ -1096,19 +636,11 @@ function ssrSpread(props, isSVG, skipChildren) {
1096
636
  } else if (prop === "class" || prop === "className" || prop === "classList") {
1097
637
  if (classResolved) continue;
1098
638
  let n;
1099
- result += `class="${(n = props.class) ? n + " " : ""}${
1100
- (n = props.className) ? n + " " : ""
1101
- }${ssrClassList(props.classList)}"`;
639
+ result += `class="${(n = props.class) ? n + " " : ""}${(n = props.className) ? n + " " : ""}${ssrClassList(props.classList)}"`;
1102
640
  classResolved = true;
1103
641
  } else if (prop !== "value" && Properties.has(prop)) {
1104
- if (value) result += prop;
1105
- else continue;
1106
- } else if (
1107
- value == undefined ||
1108
- prop === "ref" ||
1109
- prop.slice(0, 2) === "on" ||
1110
- prop.slice(0, 5) === "prop:"
1111
- ) {
642
+ if (value) result += prop;else continue;
643
+ } else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
1112
644
  continue;
1113
645
  } else {
1114
646
  if (prop.slice(0, 5) === "bool:") {
@@ -1125,9 +657,7 @@ function ssrSpread(props, isSVG, skipChildren) {
1125
657
  return result;
1126
658
  }
1127
659
  function notSup() {
1128
- throw new Error(
1129
- "Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>."
1130
- );
660
+ 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>.");
1131
661
  }
1132
662
 
1133
663
  const isServer = true;
@@ -1137,8 +667,7 @@ function Dynamic(props) {
1137
667
  const comp = p.component,
1138
668
  t = typeof comp;
1139
669
  if (comp) {
1140
- if (t === "function") return comp(others);
1141
- else if (t === "string") {
670
+ if (t === "function") return comp(others);else if (t === "string") {
1142
671
  return ssrElement(comp, others, undefined, true);
1143
672
  }
1144
673
  }
@@ -1147,60 +676,4 @@ function Portal(props) {
1147
676
  return "";
1148
677
  }
1149
678
 
1150
- export {
1151
- Aliases,
1152
- Assets,
1153
- ChildProperties,
1154
- DOMElements,
1155
- DelegatedEvents,
1156
- Dynamic,
1157
- Hydration,
1158
- HydrationScript,
1159
- NoHydration,
1160
- Portal,
1161
- Properties,
1162
- RequestContext,
1163
- SVGElements,
1164
- SVGNamespace,
1165
- notSup as addEventListener,
1166
- notSup as assign,
1167
- notSup as classList,
1168
- notSup as className,
1169
- notSup as delegateEvents,
1170
- notSup as dynamicProperty,
1171
- escape,
1172
- generateHydrationScript,
1173
- getAssets,
1174
- getHydrationKey,
1175
- notSup as getNextElement,
1176
- notSup as getNextMarker,
1177
- notSup as getNextMatch,
1178
- getPropAlias,
1179
- getRequestEvent,
1180
- notSup as hydrate,
1181
- notSup as insert,
1182
- isDev,
1183
- isServer,
1184
- pipeToNodeWritable,
1185
- pipeToWritable,
1186
- notSup as render,
1187
- renderToStream,
1188
- renderToString,
1189
- renderToStringAsync,
1190
- resolveSSRNode,
1191
- notSup as runHydrationEvents,
1192
- notSup as setAttribute,
1193
- notSup as setAttributeNS,
1194
- notSup as setProperty,
1195
- notSup as spread,
1196
- ssr,
1197
- ssrAttribute,
1198
- ssrClassList,
1199
- ssrElement,
1200
- ssrHydrationKey,
1201
- ssrSpread,
1202
- ssrStyle,
1203
- notSup as style,
1204
- notSup as template,
1205
- useAssets
1206
- };
679
+ 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, 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, 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 };