@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.8

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 (82) hide show
  1. package/dist/{server.cjs → server.dev.js} +274 -272
  2. package/dist/server.js +119 -36
  3. package/dist/{dev.js → web.dev.js} +131 -399
  4. package/dist/web.js +78 -388
  5. package/dist/{web.cjs → web.observe.js} +174 -622
  6. package/frames/dist/client.dev.js +11 -3
  7. package/frames/dist/client.js +11 -3
  8. package/frames/dist/{server.cjs → server.dev.js} +375 -125
  9. package/frames/dist/server.js +253 -32
  10. package/frames/package.json +7 -15
  11. package/package.json +88 -251
  12. package/serialization/decode/package.json +3 -9
  13. package/serialization/dist/decode.js +18 -4
  14. package/serialization/dist/serialization.js +18 -4
  15. package/serialization/package.json +3 -9
  16. package/serialization/types/serializer-decode.d.ts +49 -2
  17. package/server-functions/dist/client.js +13 -14
  18. package/server-functions/dist/server.dev.js +359 -85
  19. package/server-functions/dist/server.js +352 -86
  20. package/server-functions/package.json +6 -24
  21. package/server-functions/rich-args/package.json +3 -9
  22. package/storage/package.json +3 -9
  23. package/types/client.d.ts +17 -3
  24. package/types/frames/frame-client.d.ts +1 -1
  25. package/types/frames/serializer-decode.d.ts +49 -2
  26. package/types/head.d.ts +3 -0
  27. package/types/index.d.ts +18 -7
  28. package/types/index.server.d.ts +31 -9
  29. package/types/render.d.ts +3 -1
  30. package/types/serializer-decode.d.ts +49 -2
  31. package/types/server-functions/flash.d.ts +12 -3
  32. package/types/server-functions/server.d.ts +50 -3
  33. package/types/server-mock.d.ts +43 -7
  34. package/types/server.d.ts +48 -6
  35. package/dist/dev.cjs +0 -2590
  36. package/frames/dist/client.cjs +0 -2035
  37. package/frames/dist/client.dev.cjs +0 -2055
  38. package/serialization/dist/decode.cjs +0 -141
  39. package/serialization/dist/serialization.cjs +0 -261
  40. package/serialization/types-cjs/index.d.cts +0 -101
  41. package/serialization/types-cjs/package.json +0 -3
  42. package/serialization/types-cjs/serializer-decode.d.cts +0 -172
  43. package/serialization/types-cjs/serializer.d.cts +0 -101
  44. package/server-functions/dist/client.cjs +0 -1070
  45. package/server-functions/dist/rich-args.cjs +0 -11
  46. package/server-functions/dist/server.cjs +0 -2133
  47. package/server-functions/dist/server.dev.cjs +0 -2153
  48. package/storage/dist/storage.cjs +0 -12
  49. package/storage/types-cjs/index.d.cts +0 -28
  50. package/storage/types-cjs/package.json +0 -3
  51. package/types/patch-driver.d.ts +0 -3
  52. package/types-cjs/client.d.cts +0 -200
  53. package/types-cjs/constants.d.cts +0 -20
  54. package/types-cjs/cookies.d.cts +0 -41
  55. package/types-cjs/frames/client.d.cts +0 -36
  56. package/types-cjs/frames/frame-client.d.cts +0 -370
  57. package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
  58. package/types-cjs/frames/frame-sink.d.cts +0 -92
  59. package/types-cjs/frames/frame-transport.d.cts +0 -189
  60. package/types-cjs/frames/serializer-decode.d.cts +0 -172
  61. package/types-cjs/frames/serializer.d.cts +0 -101
  62. package/types-cjs/frames/server.d.cts +0 -52
  63. package/types-cjs/head.d.cts +0 -16
  64. package/types-cjs/index.d.cts +0 -180
  65. package/types-cjs/index.server.d.cts +0 -125
  66. package/types-cjs/jsx-properties.d.cts +0 -93
  67. package/types-cjs/jsx.d.cts +0 -4146
  68. package/types-cjs/package.json +0 -3
  69. package/types-cjs/patch-driver.d.cts +0 -3
  70. package/types-cjs/reconcile.d.cts +0 -1
  71. package/types-cjs/render.d.cts +0 -4
  72. package/types-cjs/response.d.cts +0 -81
  73. package/types-cjs/serializer-decode.d.cts +0 -172
  74. package/types-cjs/serializer.d.cts +0 -101
  75. package/types-cjs/server-functions/client.d.cts +0 -184
  76. package/types-cjs/server-functions/flash.d.cts +0 -27
  77. package/types-cjs/server-functions/registry.d.cts +0 -100
  78. package/types-cjs/server-functions/rich-args.d.cts +0 -1
  79. package/types-cjs/server-functions/server.d.cts +0 -522
  80. package/types-cjs/server-functions/shared.d.cts +0 -283
  81. package/types-cjs/server-mock.d.cts +0 -301
  82. package/types-cjs/server.d.cts +0 -366
@@ -291,6 +291,18 @@ const ERROR_HEADER = "X-Server-Function-Error";
291
291
  const BODY_FORMAT_HEADER = "X-Server-Function-Format";
292
292
  const REDIRECT_HEADER = "X-Server-Function-Redirect";
293
293
  const SINGLE_FLIGHT_HEADER = "X-Single-Flight";
294
+ const BodyFormat = {
295
+ Serialized: "0",
296
+ String: "1",
297
+ FormData: "2",
298
+ URLSearchParams: "3",
299
+ Blob: "4",
300
+ File: "5",
301
+ ArrayBuffer: "6",
302
+ Uint8Array: "7",
303
+ Json: "8",
304
+ Void: "9"
305
+ };
294
306
  function createChunk(data) {
295
307
  const encoder = new TextEncoder();
296
308
  const encodeData = encoder.encode(data);
@@ -426,12 +438,24 @@ function classifyHeadTag(desc) {
426
438
  resource: false
427
439
  };
428
440
  }
441
+ function qualifierValue(name, value) {
442
+ if (value == null || value === false) return null;
443
+ if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
444
+ const v = value === true ? "" : String(value);
445
+ if (name === "as") return asciiLowerCase(v);
446
+ if (name !== "crossorigin") return v;
447
+ return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
448
+ }
449
+ function asciiLowerCase(value) {
450
+ return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
451
+ }
429
452
  function resourceIdentity(tag, props) {
430
- let id = "res:" + tag + ":" + (props.rel || "") + ":" + (props.href || props.src || "");
453
+ const url = String(props.href || props.src || "");
454
+ let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
431
455
  for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
432
456
  const q = RESOURCE_QUALIFIERS[i];
433
- const value = props[q];
434
- if (value != null) id += ":" + q + "=" + (value === true ? "" : value);
457
+ const value = qualifierValue(q, props[q]);
458
+ if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
435
459
  }
436
460
  return id;
437
461
  }
@@ -505,12 +529,20 @@ function resolveAssets(moduleUrl, manifest) {
505
529
  if (e.preloads) {
506
530
  for (let i = 0; i < e.preloads.length; i++) {
507
531
  const link = e.preloads[i];
508
- if (!link || typeof link.href !== "string" || !link.href) continue;
532
+ const href = link && typeof link.href === "string" && link.href;
533
+ const srcset = link && typeof link.imagesrcset === "string" && link.imagesrcset;
534
+ if (!href && !srcset) continue;
509
535
  if (!preloads) preloads = [];
510
- preloads.push({
536
+ if (href) preloads.push({
511
537
  ...link,
512
- href: joinAssetPath(base, link.href)
513
- });
538
+ href: joinAssetPath(base, href)
539
+ });else {
540
+ const {
541
+ href: bad,
542
+ ...rest
543
+ } = link;
544
+ preloads.push(rest);
545
+ }
514
546
  }
515
547
  }
516
548
  if (e.imports) for (let i = 0; i < e.imports.length; i++) walk(e.imports[i]);
@@ -642,9 +674,13 @@ function isCssUrl(url) {
642
674
  const q = url.search(/[?#]/);
643
675
  return (q === -1 ? url : url.slice(0, q)).endsWith(".css");
644
676
  }
645
- const PRELOAD_LINK_ATTRIBUTES = ["type", "crossorigin", "integrity", "referrerpolicy", "fetchpriority", "media"];
677
+ const RESPONSIVE_ATTRIBUTES = ["imagesrcset", "imagesizes"];
678
+ function isSetAttr(value) {
679
+ return value != null && value !== false && value !== "";
680
+ }
681
+ const PRELOAD_LINK_ATTRIBUTES = ["type", "crossorigin", "integrity", "referrerpolicy", "fetchpriority", "media", "imagesrcset", "imagesizes"];
646
682
  function registerPreloadLink(tracking, headRegistry, link, nonce) {
647
- if (!link || typeof link !== "object" || typeof link.href !== "string" || !link.href) {
683
+ if (!link || typeof link !== "object") {
648
684
  return null;
649
685
  }
650
686
  if (typeof link.as !== "string") {
@@ -665,13 +701,35 @@ function registerPreloadLink(tracking, headRegistry, link, nonce) {
665
701
  default:
666
702
  return null;
667
703
  }
704
+ const responsive = as === "image";
705
+ let srcset = null;
706
+ let sizes = null;
707
+ if (responsive) {
708
+ for (const name of RESPONSIVE_ATTRIBUTES) {
709
+ const value = link[name];
710
+ if (!isSetAttr(value)) continue;
711
+ if (typeof value !== "string") {
712
+ continue;
713
+ }
714
+ if (name === "imagesrcset") srcset = value;else sizes = value;
715
+ }
716
+ }
717
+ const href = typeof link.href === "string" && link.href ? link.href : null;
718
+ if (!href && !srcset) {
719
+ return null;
720
+ }
668
721
  const props = {
669
- rel: "preload",
670
- href: link.href,
671
- as
722
+ rel: "preload"
672
723
  };
724
+ if (href) props.href = href;
725
+ props.as = as;
673
726
  for (let i = 0; i < PRELOAD_LINK_ATTRIBUTES.length; i++) {
674
727
  const name = PRELOAD_LINK_ATTRIBUTES[i];
728
+ if (RESPONSIVE_ATTRIBUTES.indexOf(name) !== -1) {
729
+ const value = name === "imagesrcset" ? srcset : sizes;
730
+ if (value !== null) props[name] = value;
731
+ continue;
732
+ }
675
733
  const value = link[name];
676
734
  if (value == null || value === false) continue;
677
735
  props[name] = value === true ? "" : String(value);
@@ -1036,9 +1094,6 @@ function normalizeNonce(nonce) {
1036
1094
  styleAttr: typeof style === "string" && style ? ` nonce="${escape(style, true)}"` : ""
1037
1095
  };
1038
1096
  }
1039
- function asciiLowerCase(value) {
1040
- return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
1041
- }
1042
1097
  function hasNonceProp(props) {
1043
1098
  for (const name in props) if (name.length === 5 && asciiLowerCase(name) === "nonce" && props[name] != null) return true;
1044
1099
  return false;
@@ -1119,6 +1174,7 @@ function renderToStream(code, options = {}) {
1119
1174
  onHead
1120
1175
  } = options;
1121
1176
  const nonce = normalizeNonce(options.nonce);
1177
+ const requestEvent = peekRequestEvent();
1122
1178
  let dispose;
1123
1179
  let dead = false;
1124
1180
  const abandon = () => {
@@ -1220,6 +1276,7 @@ function renderToStream(code, options = {}) {
1220
1276
  };
1221
1277
  const onDone = () => {
1222
1278
  writeTasks();
1279
+ lastBlockingSize = blockingPromises.size;
1223
1280
  doShell();
1224
1281
  onCompleteAll && onCompleteAll({
1225
1282
  write(v) {
@@ -1609,9 +1666,9 @@ function renderToStream(code, options = {}) {
1609
1666
  function doShell() {
1610
1667
  if (shellCompleted) return;
1611
1668
  sharedConfig.context = context;
1612
- const blockersBefore = blockingPromises.size;
1669
+ if (blockingPromises.size !== lastBlockingSize) return;
1613
1670
  if (!resolveRootHoles()) return;
1614
- if (blockingPromises.size !== blockersBefore) return;
1671
+ if (blockingPromises.size !== lastBlockingSize) return;
1615
1672
  if (!headShellReady(headRegistry, p => blockingPromises.add(p))) return;
1616
1673
  headStyles = new Set();
1617
1674
  for (const url of tracking.emittedAssets) {
@@ -1639,7 +1696,7 @@ function renderToStream(code, options = {}) {
1639
1696
  let lastBlockingSize = -1;
1640
1697
  let lastRegistrySize = -1;
1641
1698
  let drainTurn = 0;
1642
- const scheduleFlush = fn => {
1699
+ const scheduleFlush = (fn, awaited) => {
1643
1700
  const attempt = () => {
1644
1701
  flushStubBatch();
1645
1702
  if (registry.size !== lastRegistrySize || drainTurn++ < MIN_DRAIN_TURNS) {
@@ -1650,8 +1707,8 @@ function renderToStream(code, options = {}) {
1650
1707
  }
1651
1708
  fn();
1652
1709
  };
1653
- const progressed = blockingPromises.size !== lastBlockingSize;
1654
- lastBlockingSize = blockingPromises.size;
1710
+ const progressed = awaited !== lastBlockingSize;
1711
+ lastBlockingSize = awaited;
1655
1712
  lastRegistrySize = -1;
1656
1713
  drainTurn = 0;
1657
1714
  progressed ? queue(attempt) : setTimeout(attempt);
@@ -1668,7 +1725,7 @@ function renderToStream(code, options = {}) {
1668
1725
  let resolve;
1669
1726
  const p = new Promise(r => resolve = r);
1670
1727
  function flush() {
1671
- allSettled(blockingPromises).then(() => {
1728
+ allSettled(blockingPromises).then(awaited => {
1672
1729
  scheduleFlush(() => {
1673
1730
  if (dead) return resolve();
1674
1731
  try {
@@ -1706,7 +1763,7 @@ function renderToStream(code, options = {}) {
1706
1763
  dispose();
1707
1764
  writable.end();
1708
1765
  } else flushEnd();
1709
- });
1766
+ }, awaited);
1710
1767
  });
1711
1768
  }
1712
1769
  flush();
@@ -1714,8 +1771,12 @@ function renderToStream(code, options = {}) {
1714
1771
  };
1715
1772
  return {
1716
1773
  then(onFulfilled, onRejected) {
1774
+ const freezeHead = () => {
1775
+ if (requestEvent && requestEvent.response) commitResponseStub(requestEvent.response);
1776
+ };
1717
1777
  const p = new Promise(resolve => {
1718
1778
  function complete() {
1779
+ freezeHead();
1719
1780
  dispose();
1720
1781
  resolve(tmp);
1721
1782
  }
@@ -1727,17 +1788,16 @@ function renderToStream(code, options = {}) {
1727
1788
  };
1728
1789
  } else onCompleteAll = complete;
1729
1790
  function flush() {
1730
- allSettled(blockingPromises).then(() => {
1791
+ allSettled(blockingPromises).then(awaited => {
1731
1792
  scheduleFlush(() => {
1732
1793
  try {
1733
- const blockersBefore = blockingPromises.size;
1734
- if (!resolveRootHoles() || blockingPromises.size !== blockersBefore || !headShellReady(headRegistry, p => blockingPromises.add(p))) return flush();
1794
+ if (blockingPromises.size !== lastBlockingSize || !resolveRootHoles() || blockingPromises.size !== lastBlockingSize || !headShellReady(headRegistry, p => blockingPromises.add(p))) return flush();
1735
1795
  } catch (err) {
1736
1796
  failRender(err);
1737
1797
  return resolve(tmp);
1738
1798
  }
1739
1799
  queue(flushEnd);
1740
- });
1800
+ }, awaited);
1741
1801
  });
1742
1802
  }
1743
1803
  flush();
@@ -1747,7 +1807,7 @@ function renderToStream(code, options = {}) {
1747
1807
  pipe(w) {
1748
1808
  claimConsumer("pipe");
1749
1809
  function flush() {
1750
- allSettled(blockingPromises).then(() => {
1810
+ allSettled(blockingPromises).then(awaited => {
1751
1811
  scheduleFlush(() => {
1752
1812
  if (dead) return;
1753
1813
  try {
@@ -1769,7 +1829,7 @@ function renderToStream(code, options = {}) {
1769
1829
  dispose();
1770
1830
  writable.end();
1771
1831
  } else flushEnd();
1772
- });
1832
+ }, awaited);
1773
1833
  });
1774
1834
  }
1775
1835
  flush();
@@ -2440,10 +2500,13 @@ function escape(s, attr) {
2440
2500
  if (!attr && Array.isArray(s)) {
2441
2501
  const joined = tryJoinPlainSSRArray(s);
2442
2502
  if (joined !== undefined) return joined;
2503
+ const src = s;
2443
2504
  s = s.slice();
2444
2505
  for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
2506
+ if (src.$slot) s.$slot = true;
2445
2507
  return s;
2446
2508
  }
2509
+ if (!attr && t === "function") return escapeLate(s);
2447
2510
  if (attr) {
2448
2511
  if (s == null || t === "boolean" || t === "number") return s;
2449
2512
  return escape(String(s), attr);
@@ -2454,6 +2517,15 @@ function escape(s, attr) {
2454
2517
  if (i < 0) return s;
2455
2518
  return escapeSlow(s, attr, i);
2456
2519
  }
2520
+ function escapeLate(fn) {
2521
+ if (fn.$esc) return fn;
2522
+ const w = () => escape(fn());
2523
+ w.$esc = true;
2524
+ if (fn.$lhSkip) w.$lhSkip = true;
2525
+ if (fn.$lhSuppress) w.$lhSuppress = true;
2526
+ if (fn.$lhBinding) w.$lhBinding = fn.$lhBinding;
2527
+ return w;
2528
+ }
2457
2529
  const ESCAPE_CONTENT = /[&<]/;
2458
2530
  const ESCAPE_ATTR = /[&"<]/;
2459
2531
  function escapeSlow(s, attr, start) {
@@ -2541,7 +2613,7 @@ function allSettled(promises) {
2541
2613
  let size = promises.size;
2542
2614
  return Promise.allSettled(promises).then(() => {
2543
2615
  if (promises.size !== size) return allSettled(promises);
2544
- return;
2616
+ return size;
2545
2617
  });
2546
2618
  }
2547
2619
  function assembleDocument(html, emittedAssets, preloadLinks, inlineStyles, scripts, nonce, headTags, onHead) {
@@ -2791,10 +2863,145 @@ function resolveSSRSync(node) {
2791
2863
  if (!res.h.length) return res.t[0];
2792
2864
  throw new Error("This value cannot be rendered synchronously. Are you missing a boundary?");
2793
2865
  }
2866
+ const RequestContext = Symbol.for("solid.RequestContext");
2867
+ function peekRequestEvent() {
2868
+ const store = globalThis[RequestContext];
2869
+ return store ? store.getStore() : undefined;
2870
+ }
2871
+ function reportLostHeaderWrite(method, name) {
2872
+ const message = `Response header write dropped: headers.${method}(${JSON.stringify(String(name))}) ` + "ran after the response head was sent. Write headers before the shell flushes " + "(or before the handler returns).";
2873
+ console.error(message);
2874
+ }
2875
+ function commitResponseStub(stub, {
2876
+ allowLateLocation = false
2877
+ } = {}) {
2878
+ if (!stub || stub.committed) return stub;
2879
+ stub.committed = true;
2880
+ const headers = stub.headers;
2881
+ if (!headers || typeof headers.set !== "function") return stub;
2882
+ for (const method of ["set", "append", "delete"]) {
2883
+ const original = headers[method].bind(headers);
2884
+ headers[method] = function (name, ...rest) {
2885
+ if (allowLateLocation && method === "set" && String(name).toLowerCase() === "location") {
2886
+ return original(name, ...rest);
2887
+ }
2888
+ reportLostHeaderWrite(method, name);
2889
+ };
2890
+ }
2891
+ return stub;
2892
+ }
2794
2893
  /*#__PURE__*/new Set([ERROR_HEADER, BODY_FORMAT_HEADER, SINGLE_FLIGHT_HEADER, REVALIDATE_HEADER, REDIRECT_HEADER, "Location",
2795
2894
  ...COMPOSED_BODY_FRAMING].map(header => header.toLowerCase()));
2796
2895
 
2797
2896
  function scopeDeferredResult(value, scope) {
2897
+ const bound = bindDeferredBody(value, scope);
2898
+ if (bound !== value || value === null || typeof value !== "object") return bound;
2899
+ return scopeDeferredContents(value, scope);
2900
+ }
2901
+ class ScopeFrame {
2902
+ constructor(value, next, keys, descriptors) {
2903
+ this.value = value;
2904
+ this.next = next;
2905
+ this.keys = keys;
2906
+ this.descriptors = descriptors;
2907
+ this.i = 0;
2908
+ this.changed = false;
2909
+ }
2910
+ }
2911
+ function enterScopeCarrier(value, state) {
2912
+ if (value === null || typeof value !== "object" && typeof value !== "function") return value;
2913
+ if (state.seen.has(value)) {
2914
+ state.cyclic.add(value);
2915
+ return state.seen.get(value);
2916
+ }
2917
+ const bound = bindDeferredBody(value, state.scope);
2918
+ if (bound !== value) {
2919
+ state.seen.set(value, bound);
2920
+ return bound;
2921
+ }
2922
+ if (typeof value !== "object") return value;
2923
+ if (Array.isArray(value)) {
2924
+ if (Object.isFrozen(value)) {
2925
+ state.seen.set(value, value);
2926
+ return value;
2927
+ }
2928
+ const next = value.slice();
2929
+ state.seen.set(value, next);
2930
+ return new ScopeFrame(value, next, null, null);
2931
+ }
2932
+ const prototype = Object.getPrototypeOf(value);
2933
+ if (prototype !== Object.prototype && prototype !== null || Object.isFrozen(value)) {
2934
+ state.seen.set(value, value);
2935
+ return value;
2936
+ }
2937
+ const descriptors = Object.getOwnPropertyDescriptors(value);
2938
+ const next = Object.create(prototype, descriptors);
2939
+ state.seen.set(value, next);
2940
+ return new ScopeFrame(value, next, Object.keys(value), descriptors);
2941
+ }
2942
+ function scopeDeferredContents(root, scope) {
2943
+ const state = {
2944
+ seen: new Map(),
2945
+ cyclic: new Set(),
2946
+ scope
2947
+ };
2948
+ const entered = enterScopeCarrier(root, state);
2949
+ if (!(entered instanceof ScopeFrame)) return entered;
2950
+ const stack = [entered];
2951
+ let delivered = NOTHING;
2952
+ for (;;) {
2953
+ const top = stack[stack.length - 1];
2954
+ const length = top.keys ? top.keys.length : top.value.length;
2955
+ let pushed = null;
2956
+ while (top.i < length) {
2957
+ const i = top.i;
2958
+ let original;
2959
+ let writable = true;
2960
+ if (top.keys) {
2961
+ const descriptor = top.descriptors[top.keys[i]];
2962
+ writable = "value" in descriptor && descriptor.writable === true;
2963
+ original = writable ? descriptor.value : undefined;
2964
+ } else {
2965
+ original = top.value[i];
2966
+ }
2967
+ if (!writable) {
2968
+ top.i++;
2969
+ continue;
2970
+ }
2971
+ let bound;
2972
+ if (delivered !== NOTHING) {
2973
+ bound = delivered;
2974
+ delivered = NOTHING;
2975
+ } else {
2976
+ bound = enterScopeCarrier(original, state);
2977
+ if (bound instanceof ScopeFrame) {
2978
+ pushed = bound;
2979
+ break;
2980
+ }
2981
+ }
2982
+ if (bound !== original) {
2983
+ if (top.keys) top.next[top.keys[i]] = bound;else top.next[i] = bound;
2984
+ top.changed = true;
2985
+ }
2986
+ top.i++;
2987
+ }
2988
+ if (pushed !== null) {
2989
+ stack.push(pushed);
2990
+ continue;
2991
+ }
2992
+ stack.pop();
2993
+ let out;
2994
+ if (top.changed || state.cyclic.has(top.value)) {
2995
+ out = top.next;
2996
+ } else {
2997
+ state.seen.set(top.value, top.value);
2998
+ out = top.value;
2999
+ }
3000
+ if (stack.length === 0) return out;
3001
+ delivered = out;
3002
+ }
3003
+ }
3004
+ function bindDeferredBody(value, scope) {
2798
3005
  if (value === null || typeof value !== "object" && typeof value !== "function") return value;
2799
3006
  const promised = scope(() => nativePromise(value));
2800
3007
  if (promised) {
@@ -2840,10 +3047,18 @@ function scopeDeferredResult(value, scope) {
2840
3047
  }
2841
3048
  return value;
2842
3049
  }
3050
+ function processState(key, create) {
3051
+ const slot = Symbol.for(key);
3052
+ return globalThis[slot] || (globalThis[slot] = create());
3053
+ }
3054
+ processState("solid.ServerFunctionRegistrations", () => new Map());
3055
+ processState("solid.ServerFunctionMethods", () => new Map());
3056
+ processState("solid.ServerFunctionReferenceBindings", () => new WeakMap());
2843
3057
  const INVOCATIONS = new WeakMap();
2844
3058
  function getEventServerFunctionInvocation(event) {
2845
3059
  return event && INVOCATIONS.get(event);
2846
3060
  }
3061
+ new Set(Object.values(BodyFormat));
2847
3062
  function guardFailures(value, state) {
2848
3063
  if (!state) state = {
2849
3064
  seen: new WeakMap(),
@@ -3068,7 +3283,7 @@ function enterGuard(value, state) {
3068
3283
  return new Frame(SET, value, next, [...value], null);
3069
3284
  }
3070
3285
  const prototype = Object.getPrototypeOf(value);
3071
- if (prototype !== Object.prototype && prototype !== null) {
3286
+ if (prototype !== Object.prototype && prototype !== null && !(value instanceof Error)) {
3072
3287
  state.seen.set(value, value);
3073
3288
  return value;
3074
3289
  }
@@ -3079,7 +3294,11 @@ function enterGuard(value, state) {
3079
3294
  }
3080
3295
  const next = Object.create(prototype, descriptors);
3081
3296
  state.seen.set(value, next);
3082
- return new Frame(OBJECT, value, next, Object.keys(value), descriptors);
3297
+ const children = !(value instanceof Error) ? Object.keys(value) : Object.getOwnPropertyNames(value).filter(key => {
3298
+ const descriptor = descriptors[key];
3299
+ return descriptor.enumerable || "value" in descriptor;
3300
+ });
3301
+ return new Frame(OBJECT, value, next, children, descriptors);
3083
3302
  }
3084
3303
  function keepGuarded(value, next, changed, state) {
3085
3304
  if (changed || state.cyclic.has(value)) return next;
@@ -3167,9 +3386,11 @@ function serverComponentScope(render) {
3167
3386
  return runInServerComponentScope ? runInServerComponentScope(render) : render();
3168
3387
  }
3169
3388
  function wirePreload(entry) {
3170
- return {
3389
+ return entry.href ? {
3171
3390
  href: entry.href,
3172
3391
  attrs: entry.attrs
3392
+ } : {
3393
+ attrs: entry.attrs
3173
3394
  };
3174
3395
  }
3175
3396
  const SERVER_COMPONENT_BOOTSTRAP_EXPR = "(self._$SC||(self._$SC={c:{},a:{},r(i,a){a&&(this.a[a]=i,this.reg&&this.reg(a,i));return this.c[i]||(this.c[i]=(p,b)=>self._$SC.impl(i,p,b))}}))";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/web/frames",
3
- "main": "./dist/server.cjs",
3
+ "main": "./dist/server.js",
4
4
  "module": "./dist/server.js",
5
5
  "types": "../types/frames/server.d.ts",
6
6
  "type": "module",
@@ -8,23 +8,15 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "browser": {
11
- "import": {
12
- "types": "../types/frames/client.d.ts",
13
- "default": "./dist/client.js"
14
- },
15
- "require": {
16
- "types": "../types-cjs/frames/client.d.cts",
17
- "default": "./dist/client.cjs"
18
- }
11
+ "types": "../types/frames/client.d.ts",
12
+ "default": "./dist/client.js"
19
13
  },
20
- "import": {
14
+ "development": {
21
15
  "types": "../types/frames/server.d.ts",
22
- "default": "./dist/server.js"
16
+ "default": "./dist/server.dev.js"
23
17
  },
24
- "require": {
25
- "types": "../types-cjs/frames/server.d.cts",
26
- "default": "./dist/server.cjs"
27
- }
18
+ "types": "../types/frames/server.d.ts",
19
+ "default": "./dist/server.js"
28
20
  }
29
21
  }
30
22
  }