@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.4

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 (86) hide show
  1. package/dist/dev.cjs +433 -72
  2. package/dist/dev.js +426 -71
  3. package/dist/server.cjs +39 -21
  4. package/dist/server.js +40 -23
  5. package/dist/web.cjs +421 -70
  6. package/dist/web.js +414 -69
  7. package/frames/dist/client.cjs +8 -8
  8. package/frames/dist/client.dev.cjs +8 -8
  9. package/frames/dist/client.dev.js +8 -8
  10. package/frames/dist/client.js +8 -8
  11. package/frames/dist/server.cjs +28 -18
  12. package/frames/dist/server.js +29 -19
  13. package/package.json +20 -22
  14. package/serialization/dist/decode.cjs +3 -3
  15. package/serialization/dist/decode.js +3 -3
  16. package/serialization/dist/serialization.cjs +7 -11
  17. package/serialization/dist/serialization.js +7 -6
  18. package/serialization/types/index.d.ts +69 -157
  19. package/serialization/types/serializer-decode.d.ts +89 -112
  20. package/serialization/types/serializer.d.ts +94 -0
  21. package/serialization/types-cjs/index.d.cts +69 -157
  22. package/serialization/types-cjs/serializer-decode.d.cts +89 -112
  23. package/serialization/types-cjs/serializer.d.cts +94 -0
  24. package/server-functions/dist/client.cjs +126 -19
  25. package/server-functions/dist/client.js +123 -19
  26. package/server-functions/dist/server.cjs +156 -28
  27. package/server-functions/dist/server.dev.cjs +156 -28
  28. package/server-functions/dist/server.dev.js +153 -28
  29. package/server-functions/dist/server.js +153 -28
  30. package/types/client.d.ts +152 -290
  31. package/types/constants.d.ts +18 -0
  32. package/types/cookies.d.ts +31 -75
  33. package/types/frames/frame-client.d.ts +287 -277
  34. package/types/frames/frame-container-plugin.d.ts +71 -0
  35. package/types/frames/frame-sink.d.ts +58 -160
  36. package/types/frames/frame-transport.d.ts +161 -194
  37. package/types/frames/serializer-decode.d.ts +159 -0
  38. package/types/frames/serializer.d.ts +69 -157
  39. package/types/head.d.ts +16 -0
  40. package/types/index.d.ts +1 -65
  41. package/types/index.server.d.ts +125 -0
  42. package/types/jsx.d.ts +5 -13
  43. package/types/patch-driver.d.ts +3 -0
  44. package/types/reconcile.d.ts +1 -0
  45. package/types/render.d.ts +4 -0
  46. package/types/response.d.ts +48 -152
  47. package/types/serializer-decode.d.ts +89 -112
  48. package/types/serializer.d.ts +69 -157
  49. package/types/server-functions/client.d.ts +124 -222
  50. package/types/server-functions/flash.d.ts +10 -30
  51. package/types/server-functions/registry.d.ts +100 -0
  52. package/types/server-functions/rich-args.d.ts +1 -10
  53. package/types/server-functions/server.d.ts +295 -574
  54. package/types/server-functions/shared.d.ts +155 -458
  55. package/types/server-mock.d.ts +2 -2
  56. package/types/server.d.ts +242 -434
  57. package/types-cjs/client.d.cts +152 -290
  58. package/types-cjs/constants.d.cts +18 -0
  59. package/types-cjs/cookies.d.cts +31 -75
  60. package/types-cjs/frames/frame-client.d.cts +287 -277
  61. package/types-cjs/frames/frame-container-plugin.d.cts +71 -0
  62. package/types-cjs/frames/frame-sink.d.cts +58 -160
  63. package/types-cjs/frames/frame-transport.d.cts +161 -194
  64. package/types-cjs/frames/serializer-decode.d.cts +159 -0
  65. package/types-cjs/frames/serializer.d.cts +69 -157
  66. package/types-cjs/head.d.cts +16 -0
  67. package/types-cjs/index.d.cts +1 -65
  68. package/types-cjs/index.server.d.cts +125 -0
  69. package/types-cjs/jsx.d.cts +5 -13
  70. package/types-cjs/patch-driver.d.cts +3 -0
  71. package/types-cjs/reconcile.d.cts +1 -0
  72. package/types-cjs/render.d.cts +4 -0
  73. package/types-cjs/response.d.cts +48 -152
  74. package/types-cjs/serializer-decode.d.cts +89 -112
  75. package/types-cjs/serializer.d.cts +69 -157
  76. package/types-cjs/server-functions/client.d.cts +124 -222
  77. package/types-cjs/server-functions/flash.d.cts +10 -30
  78. package/types-cjs/server-functions/registry.d.cts +100 -0
  79. package/types-cjs/server-functions/rich-args.d.cts +1 -10
  80. package/types-cjs/server-functions/server.d.cts +295 -574
  81. package/types-cjs/server-functions/shared.d.cts +155 -458
  82. package/types-cjs/server-mock.d.cts +2 -2
  83. package/types-cjs/server.d.cts +242 -434
  84. package/LICENSE +0 -21
  85. package/types/core.d.ts +0 -9
  86. package/types-cjs/core.d.cts +0 -9
@@ -7,7 +7,7 @@ var client = require('@solidjs/web/server-functions/client');
7
7
  const ELEMENT_NODE = 1;
8
8
  const TEXT_NODE = 3;
9
9
  const COMMENT_NODE = 8;
10
- const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
10
+ const CLAIM_SEAM = Symbol.for("solid.element-claims");
11
11
  const CLAIMED_ELEMENTS = "a[href], form[action]";
12
12
  function claimHandlers() {
13
13
  const handlers = globalThis[CLAIM_SEAM];
@@ -17,7 +17,7 @@ function claimNode(handlers, el) {
17
17
  for (let i = 0; i < handlers.length; i++) handlers[i](el);
18
18
  }
19
19
  const claimedAttr = name => name === "href" || name === "action";
20
- const BOUND_SEAM = Symbol.for("dx.bnd");
20
+ const BOUND_SEAM = Symbol.for("solid.bnd");
21
21
  const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
22
22
  const BND_ATTR = "_bnd";
23
23
  const BND_SELECTOR = "[_bnd]";
@@ -845,7 +845,7 @@ class FrameImpl {
845
845
  function createFrame(boundary, options) {
846
846
  return new FrameImpl(boundary, null, null, options);
847
847
  }
848
- const FRAME_TAG = "dx-frame";
848
+ const FRAME_TAG = "solid-frame";
849
849
  const FRAME_ID_ATTR = "data-fid";
850
850
  function createFrameElement(options) {
851
851
  const el = makeFrameElement(options.id);
@@ -1300,9 +1300,9 @@ async function applyFrameResponse(response, host, options = {}) {
1300
1300
  }
1301
1301
  return as !== undefined ? as : rootId;
1302
1302
  }
1303
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
1304
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
1305
- const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("dom-expressions.component-binding");
1303
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
1304
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
1305
+ const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
1306
1306
  let resolveServerComponent;
1307
1307
  function parseServerComponent(value, ctx) {
1308
1308
  return {
@@ -1311,7 +1311,7 @@ function parseServerComponent(value, ctx) {
1311
1311
  };
1312
1312
  }
1313
1313
  const ServerComponentPlugin = {
1314
- tag: "dom-expressions/server-component",
1314
+ tag: "solid/server-component",
1315
1315
  test(value) {
1316
1316
  return typeof value === "function" && SERVER_COMPONENT in value;
1317
1317
  },
@@ -1457,7 +1457,7 @@ function createServerComponentHandler({
1457
1457
  }
1458
1458
  }
1459
1459
 
1460
- const STATE = Symbol.for("dom-expressions.container-trace-state");
1460
+ const STATE = Symbol.for("solid.container-trace-state");
1461
1461
  const state = globalThis[STATE] || (globalThis[STATE] = {
1462
1462
  materialized: new WeakMap(),
1463
1463
  materializedValues: new WeakSet()
@@ -7,7 +7,7 @@ var client = require('@solidjs/web/server-functions/client');
7
7
  const ELEMENT_NODE = 1;
8
8
  const TEXT_NODE = 3;
9
9
  const COMMENT_NODE = 8;
10
- const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
10
+ const CLAIM_SEAM = Symbol.for("solid.element-claims");
11
11
  const CLAIMED_ELEMENTS = "a[href], form[action]";
12
12
  function claimHandlers() {
13
13
  const handlers = globalThis[CLAIM_SEAM];
@@ -17,7 +17,7 @@ function claimNode(handlers, el) {
17
17
  for (let i = 0; i < handlers.length; i++) handlers[i](el);
18
18
  }
19
19
  const claimedAttr = name => name === "href" || name === "action";
20
- const BOUND_SEAM = Symbol.for("dx.bnd");
20
+ const BOUND_SEAM = Symbol.for("solid.bnd");
21
21
  const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
22
22
  const BND_ATTR = "_bnd";
23
23
  const BND_SELECTOR = "[_bnd]";
@@ -855,7 +855,7 @@ class FrameImpl {
855
855
  function createFrame(boundary, options) {
856
856
  return new FrameImpl(boundary, null, null, options);
857
857
  }
858
- const FRAME_TAG = "dx-frame";
858
+ const FRAME_TAG = "solid-frame";
859
859
  const FRAME_ID_ATTR = "data-fid";
860
860
  function createFrameElement(options) {
861
861
  const el = makeFrameElement(options.id);
@@ -1320,9 +1320,9 @@ async function applyFrameResponse(response, host, options = {}) {
1320
1320
  }
1321
1321
  return as !== undefined ? as : rootId;
1322
1322
  }
1323
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
1324
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
1325
- const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("dom-expressions.component-binding");
1323
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
1324
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
1325
+ const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
1326
1326
  let resolveServerComponent;
1327
1327
  function parseServerComponent(value, ctx) {
1328
1328
  return {
@@ -1331,7 +1331,7 @@ function parseServerComponent(value, ctx) {
1331
1331
  };
1332
1332
  }
1333
1333
  const ServerComponentPlugin = {
1334
- tag: "dom-expressions/server-component",
1334
+ tag: "solid/server-component",
1335
1335
  test(value) {
1336
1336
  return typeof value === "function" && SERVER_COMPONENT in value;
1337
1337
  },
@@ -1477,7 +1477,7 @@ function createServerComponentHandler({
1477
1477
  }
1478
1478
  }
1479
1479
 
1480
- const STATE = Symbol.for("dom-expressions.container-trace-state");
1480
+ const STATE = Symbol.for("solid.container-trace-state");
1481
1481
  const state = globalThis[STATE] || (globalThis[STATE] = {
1482
1482
  materialized: new WeakMap(),
1483
1483
  materializedValues: new WeakSet()
@@ -5,7 +5,7 @@ import { ChunkReader, frameAddress, SINGLE_FLIGHT_HEADER, deserializeStream, get
5
5
  const ELEMENT_NODE = 1;
6
6
  const TEXT_NODE = 3;
7
7
  const COMMENT_NODE = 8;
8
- const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
8
+ const CLAIM_SEAM = Symbol.for("solid.element-claims");
9
9
  const CLAIMED_ELEMENTS = "a[href], form[action]";
10
10
  function claimHandlers() {
11
11
  const handlers = globalThis[CLAIM_SEAM];
@@ -15,7 +15,7 @@ function claimNode(handlers, el) {
15
15
  for (let i = 0; i < handlers.length; i++) handlers[i](el);
16
16
  }
17
17
  const claimedAttr = name => name === "href" || name === "action";
18
- const BOUND_SEAM = Symbol.for("dx.bnd");
18
+ const BOUND_SEAM = Symbol.for("solid.bnd");
19
19
  const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
20
20
  const BND_ATTR = "_bnd";
21
21
  const BND_SELECTOR = "[_bnd]";
@@ -853,7 +853,7 @@ class FrameImpl {
853
853
  function createFrame(boundary, options) {
854
854
  return new FrameImpl(boundary, null, null, options);
855
855
  }
856
- const FRAME_TAG = "dx-frame";
856
+ const FRAME_TAG = "solid-frame";
857
857
  const FRAME_ID_ATTR = "data-fid";
858
858
  function createFrameElement(options) {
859
859
  const el = makeFrameElement(options.id);
@@ -1318,9 +1318,9 @@ async function applyFrameResponse(response, host, options = {}) {
1318
1318
  }
1319
1319
  return as !== undefined ? as : rootId;
1320
1320
  }
1321
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
1322
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
1323
- const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("dom-expressions.component-binding");
1321
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
1322
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
1323
+ const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
1324
1324
  let resolveServerComponent;
1325
1325
  function parseServerComponent(value, ctx) {
1326
1326
  return {
@@ -1329,7 +1329,7 @@ function parseServerComponent(value, ctx) {
1329
1329
  };
1330
1330
  }
1331
1331
  const ServerComponentPlugin = {
1332
- tag: "dom-expressions/server-component",
1332
+ tag: "solid/server-component",
1333
1333
  test(value) {
1334
1334
  return typeof value === "function" && SERVER_COMPONENT in value;
1335
1335
  },
@@ -1475,7 +1475,7 @@ function createServerComponentHandler({
1475
1475
  }
1476
1476
  }
1477
1477
 
1478
- const STATE = Symbol.for("dom-expressions.container-trace-state");
1478
+ const STATE = Symbol.for("solid.container-trace-state");
1479
1479
  const state = globalThis[STATE] || (globalThis[STATE] = {
1480
1480
  materialized: new WeakMap(),
1481
1481
  materializedValues: new WeakSet()
@@ -5,7 +5,7 @@ import { ChunkReader, frameAddress, SINGLE_FLIGHT_HEADER, deserializeStream, get
5
5
  const ELEMENT_NODE = 1;
6
6
  const TEXT_NODE = 3;
7
7
  const COMMENT_NODE = 8;
8
- const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
8
+ const CLAIM_SEAM = Symbol.for("solid.element-claims");
9
9
  const CLAIMED_ELEMENTS = "a[href], form[action]";
10
10
  function claimHandlers() {
11
11
  const handlers = globalThis[CLAIM_SEAM];
@@ -15,7 +15,7 @@ function claimNode(handlers, el) {
15
15
  for (let i = 0; i < handlers.length; i++) handlers[i](el);
16
16
  }
17
17
  const claimedAttr = name => name === "href" || name === "action";
18
- const BOUND_SEAM = Symbol.for("dx.bnd");
18
+ const BOUND_SEAM = Symbol.for("solid.bnd");
19
19
  const boundSeam = globalThis[BOUND_SEAM] || (globalThis[BOUND_SEAM] = {});
20
20
  const BND_ATTR = "_bnd";
21
21
  const BND_SELECTOR = "[_bnd]";
@@ -843,7 +843,7 @@ class FrameImpl {
843
843
  function createFrame(boundary, options) {
844
844
  return new FrameImpl(boundary, null, null, options);
845
845
  }
846
- const FRAME_TAG = "dx-frame";
846
+ const FRAME_TAG = "solid-frame";
847
847
  const FRAME_ID_ATTR = "data-fid";
848
848
  function createFrameElement(options) {
849
849
  const el = makeFrameElement(options.id);
@@ -1298,9 +1298,9 @@ async function applyFrameResponse(response, host, options = {}) {
1298
1298
  }
1299
1299
  return as !== undefined ? as : rootId;
1300
1300
  }
1301
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
1302
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
1303
- const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("dom-expressions.component-binding");
1301
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
1302
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
1303
+ const COMPONENT_BINDING = /*#__PURE__*/Symbol.for("solid.component-binding");
1304
1304
  let resolveServerComponent;
1305
1305
  function parseServerComponent(value, ctx) {
1306
1306
  return {
@@ -1309,7 +1309,7 @@ function parseServerComponent(value, ctx) {
1309
1309
  };
1310
1310
  }
1311
1311
  const ServerComponentPlugin = {
1312
- tag: "dom-expressions/server-component",
1312
+ tag: "solid/server-component",
1313
1313
  test(value) {
1314
1314
  return typeof value === "function" && SERVER_COMPONENT in value;
1315
1315
  },
@@ -1455,7 +1455,7 @@ function createServerComponentHandler({
1455
1455
  }
1456
1456
  }
1457
1457
 
1458
- const STATE = Symbol.for("dom-expressions.container-trace-state");
1458
+ const STATE = Symbol.for("solid.container-trace-state");
1459
1459
  const state = globalThis[STATE] || (globalThis[STATE] = {
1460
1460
  materialized: new WeakMap(),
1461
1461
  materializedValues: new WeakSet()
@@ -4,7 +4,7 @@ var solidJs = require('solid-js');
4
4
  var seroval = require('seroval');
5
5
  var web = require('seroval-plugins/web');
6
6
 
7
- const STATE = Symbol.for("dom-expressions.container-trace-state");
7
+ const STATE = Symbol.for("solid.container-trace-state");
8
8
  const state = globalThis[STATE] || (globalThis[STATE] = {
9
9
  materialized: new WeakMap(),
10
10
  materializedValues: new WeakSet()
@@ -19,7 +19,7 @@ function isContainerTraced(value) {
19
19
  const resolve = state.resolveTrace;
20
20
  return !!(resolve && value && typeof value === "object" && resolve(value));
21
21
  }
22
- const TRACE = Symbol.for("dom-expressions.container-trace");
22
+ const TRACE = Symbol.for("solid.container-trace");
23
23
  function envelopeContainerTraces(value) {
24
24
  if (!state.resolveTrace || value == null || typeof value !== "object") return value;
25
25
  const trace = state.resolveTrace(value);
@@ -70,7 +70,7 @@ function parseTrace(value, ctx) {
70
70
  };
71
71
  }
72
72
  const ContainerTracePlugin = {
73
- tag: "dom-expressions/container-trace",
73
+ tag: "solid/container-trace",
74
74
  test(value) {
75
75
  return value != null && typeof value === "object" && TRACE in value;
76
76
  },
@@ -101,13 +101,6 @@ const ContainerTracePlugin = {
101
101
  }
102
102
  };
103
103
 
104
- const runWithHydrationScope = (id, fn) => solidJs.runWithOwner(solidJs.createOwner({
105
- id
106
- }), fn);
107
- const ssrAsyncValue = value => solidJs.createMemo(() => value, {
108
- serialize: false
109
- });
110
-
111
104
  setContainerTraceStreamMint(iterable => {
112
105
  const stream = seroval.createStream();
113
106
  (async () => {
@@ -1818,6 +1811,15 @@ function createLiveHoles(sink, scoped) {
1818
1811
  const stamp = typeof solidJs.creationStamp === "function" ? solidJs.creationStamp : () => 0;
1819
1812
  const inScope = scoped && typeof solidJs.inServerComponentScope === "function" ? solidJs.inServerComponentScope : null;
1820
1813
  const stripMarkers = html => html.replace(/<!--lh:\/?\d+-->/g, "");
1814
+ const swept = (owner, ctx, fn) => {
1815
+ const prev = solidJs.sharedConfig.context;
1816
+ solidJs.sharedConfig.context = ctx;
1817
+ try {
1818
+ return owner ? solidJs.runWithOwner(owner, fn) : fn();
1819
+ } finally {
1820
+ solidJs.sharedConfig.context = prev;
1821
+ }
1822
+ };
1821
1823
  function resolveHoleValue(hole) {
1822
1824
  const result = {
1823
1825
  t: [""],
@@ -1883,6 +1885,7 @@ function createLiveHoles(sink, scoped) {
1883
1885
  const recordsBefore = engine.recordStamp;
1884
1886
  const ownersBefore = stamp();
1885
1887
  const owner = solidJs.getOwner();
1888
+ const holeCtx = solidJs.sharedConfig.context;
1886
1889
  const b = {
1887
1890
  key: null,
1888
1891
  children: [],
@@ -1896,7 +1899,7 @@ function createLiveHoles(sink, scoped) {
1896
1899
  const sweepOwnersBefore = stamp();
1897
1900
  let res;
1898
1901
  try {
1899
- res = owner ? solidJs.runWithOwner(owner, () => resolveHoleValue(hole)) : resolveHoleValue(hole);
1902
+ res = swept(owner, holeCtx, () => resolveHoleValue(hole));
1900
1903
  } catch (err) {
1901
1904
  b.closed = true;
1902
1905
  sink.closeBinding(b.key);
@@ -2004,6 +2007,7 @@ function createLiveHoles(sink, scoped) {
2004
2007
  },
2005
2008
  attr(cap) {
2006
2009
  const owner = solidJs.getOwner();
2010
+ const holeCtx = solidJs.sharedConfig.context;
2007
2011
  const b = {
2008
2012
  key: "lha:" + cap.id,
2009
2013
  children: [],
@@ -2039,7 +2043,7 @@ function createLiveHoles(sink, scoped) {
2039
2043
  if (vt === "string" || vt === "number") html += v;
2040
2044
  }
2041
2045
  };
2042
- owner ? solidJs.runWithOwner(owner, run) : run();
2046
+ swept(owner, holeCtx, run);
2043
2047
  } catch (err) {
2044
2048
  if (solidJs.ssrHandleError(err, true)) return;
2045
2049
  b.closed = true;
@@ -2299,7 +2303,7 @@ function ssr(t) {
2299
2303
  };
2300
2304
  return result;
2301
2305
  }
2302
- const CLAIM_PROP = /*#__PURE__*/Symbol.for("dom-expressions.claim-prop");
2306
+ const CLAIM_PROP = /*#__PURE__*/Symbol.for("solid.claim-prop");
2303
2307
  const CLAIMS_STREAM = 1;
2304
2308
  const CLAIMS_DOCUMENT = 2;
2305
2309
  function resolveSSRSelectValues(html) {
@@ -2670,9 +2674,9 @@ const FRAME_STREAM_HEADER = "X-Frame-Stream";
2670
2674
  function isFrameStreamResponse(response) {
2671
2675
  return response.headers.has(FRAME_STREAM_HEADER);
2672
2676
  }
2673
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
2674
- const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("dom-expressions.server-component-source");
2675
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
2677
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
2678
+ const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("solid.server-component-source");
2679
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
2676
2680
  let serverComponentRegistryExpr;
2677
2681
  function setServerComponentBootstrap(resolve) {
2678
2682
  serverComponentRegistryExpr = resolve;
@@ -2684,7 +2688,7 @@ function parseServerComponent(value, ctx) {
2684
2688
  };
2685
2689
  }
2686
2690
  const ServerComponentPlugin = {
2687
- tag: "dom-expressions/server-component",
2691
+ tag: "solid/server-component",
2688
2692
  test(value) {
2689
2693
  return typeof value === "function" && SERVER_COMPONENT in value;
2690
2694
  },
@@ -2717,6 +2721,12 @@ function flightCodec(codec) {
2717
2721
  };
2718
2722
  }
2719
2723
 
2724
+ const runWithHydrationScope = (id, fn) => solidJs.runWithOwner(solidJs.createOwner({
2725
+ id
2726
+ }), fn);
2727
+ const ssrAsyncValue = value => solidJs.createMemo(() => value, {
2728
+ serialize: false
2729
+ });
2720
2730
  const scopeStamp = typeof solidJs.creationStamp === "function" ? solidJs.creationStamp : () => 0;
2721
2731
  function serverOwned(render) {
2722
2732
  return solidJs.NoHydration ? solidJs.NoHydration({
@@ -3295,7 +3305,7 @@ function createDocumentSlotProps(clientProps, frameId) {
3295
3305
  }
3296
3306
  });
3297
3307
  }
3298
- const FRAME_TAG = "dx-frame";
3308
+ const FRAME_TAG = "solid-frame";
3299
3309
  const FRAME_ID_ATTR = "data-fid";
3300
3310
  function frameElementOpen(id) {
3301
3311
  const escaped = solidJs.sharedConfig.context ? solidJs.sharedConfig.context.escape(String(id), true) : String(id);
@@ -1,8 +1,8 @@
1
- import { createMemo, runWithOwner, createOwner, sharedConfig, createRoot, ssrHandleError, getOwner, inServerComponentScope, creationStamp, NoHydration, runInServerComponentScope, Hydration, getProjectionTrace } from 'solid-js';
1
+ import { sharedConfig, createRoot, ssrHandleError, getOwner, runWithOwner, inServerComponentScope, creationStamp, NoHydration, runInServerComponentScope, createMemo, Hydration, createOwner, getProjectionTrace } from 'solid-js';
2
2
  import { Feature, createStream, toCrossJSONStream, Serializer, getCrossReferenceHeader } from 'seroval';
3
3
  import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
4
4
 
5
- const STATE = Symbol.for("dom-expressions.container-trace-state");
5
+ const STATE = Symbol.for("solid.container-trace-state");
6
6
  const state = globalThis[STATE] || (globalThis[STATE] = {
7
7
  materialized: new WeakMap(),
8
8
  materializedValues: new WeakSet()
@@ -17,7 +17,7 @@ function isContainerTraced(value) {
17
17
  const resolve = state.resolveTrace;
18
18
  return !!(resolve && value && typeof value === "object" && resolve(value));
19
19
  }
20
- const TRACE = Symbol.for("dom-expressions.container-trace");
20
+ const TRACE = Symbol.for("solid.container-trace");
21
21
  function envelopeContainerTraces(value) {
22
22
  if (!state.resolveTrace || value == null || typeof value !== "object") return value;
23
23
  const trace = state.resolveTrace(value);
@@ -68,7 +68,7 @@ function parseTrace(value, ctx) {
68
68
  };
69
69
  }
70
70
  const ContainerTracePlugin = {
71
- tag: "dom-expressions/container-trace",
71
+ tag: "solid/container-trace",
72
72
  test(value) {
73
73
  return value != null && typeof value === "object" && TRACE in value;
74
74
  },
@@ -99,13 +99,6 @@ const ContainerTracePlugin = {
99
99
  }
100
100
  };
101
101
 
102
- const runWithHydrationScope = (id, fn) => runWithOwner(createOwner({
103
- id
104
- }), fn);
105
- const ssrAsyncValue = value => createMemo(() => value, {
106
- serialize: false
107
- });
108
-
109
102
  setContainerTraceStreamMint(iterable => {
110
103
  const stream = createStream();
111
104
  (async () => {
@@ -1816,6 +1809,15 @@ function createLiveHoles(sink, scoped) {
1816
1809
  const stamp = typeof creationStamp === "function" ? creationStamp : () => 0;
1817
1810
  const inScope = scoped && typeof inServerComponentScope === "function" ? inServerComponentScope : null;
1818
1811
  const stripMarkers = html => html.replace(/<!--lh:\/?\d+-->/g, "");
1812
+ const swept = (owner, ctx, fn) => {
1813
+ const prev = sharedConfig.context;
1814
+ sharedConfig.context = ctx;
1815
+ try {
1816
+ return owner ? runWithOwner(owner, fn) : fn();
1817
+ } finally {
1818
+ sharedConfig.context = prev;
1819
+ }
1820
+ };
1819
1821
  function resolveHoleValue(hole) {
1820
1822
  const result = {
1821
1823
  t: [""],
@@ -1881,6 +1883,7 @@ function createLiveHoles(sink, scoped) {
1881
1883
  const recordsBefore = engine.recordStamp;
1882
1884
  const ownersBefore = stamp();
1883
1885
  const owner = getOwner();
1886
+ const holeCtx = sharedConfig.context;
1884
1887
  const b = {
1885
1888
  key: null,
1886
1889
  children: [],
@@ -1894,7 +1897,7 @@ function createLiveHoles(sink, scoped) {
1894
1897
  const sweepOwnersBefore = stamp();
1895
1898
  let res;
1896
1899
  try {
1897
- res = owner ? runWithOwner(owner, () => resolveHoleValue(hole)) : resolveHoleValue(hole);
1900
+ res = swept(owner, holeCtx, () => resolveHoleValue(hole));
1898
1901
  } catch (err) {
1899
1902
  b.closed = true;
1900
1903
  sink.closeBinding(b.key);
@@ -2002,6 +2005,7 @@ function createLiveHoles(sink, scoped) {
2002
2005
  },
2003
2006
  attr(cap) {
2004
2007
  const owner = getOwner();
2008
+ const holeCtx = sharedConfig.context;
2005
2009
  const b = {
2006
2010
  key: "lha:" + cap.id,
2007
2011
  children: [],
@@ -2037,7 +2041,7 @@ function createLiveHoles(sink, scoped) {
2037
2041
  if (vt === "string" || vt === "number") html += v;
2038
2042
  }
2039
2043
  };
2040
- owner ? runWithOwner(owner, run) : run();
2044
+ swept(owner, holeCtx, run);
2041
2045
  } catch (err) {
2042
2046
  if (ssrHandleError(err, true)) return;
2043
2047
  b.closed = true;
@@ -2297,7 +2301,7 @@ function ssr(t) {
2297
2301
  };
2298
2302
  return result;
2299
2303
  }
2300
- const CLAIM_PROP = /*#__PURE__*/Symbol.for("dom-expressions.claim-prop");
2304
+ const CLAIM_PROP = /*#__PURE__*/Symbol.for("solid.claim-prop");
2301
2305
  const CLAIMS_STREAM = 1;
2302
2306
  const CLAIMS_DOCUMENT = 2;
2303
2307
  function resolveSSRSelectValues(html) {
@@ -2668,9 +2672,9 @@ const FRAME_STREAM_HEADER = "X-Frame-Stream";
2668
2672
  function isFrameStreamResponse(response) {
2669
2673
  return response.headers.has(FRAME_STREAM_HEADER);
2670
2674
  }
2671
- const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("dom-expressions.server-component");
2672
- const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("dom-expressions.server-component-source");
2673
- const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("dom-expressions.server-component-address");
2675
+ const SERVER_COMPONENT = /*#__PURE__*/Symbol.for("solid.server-component");
2676
+ const SERVER_COMPONENT_SOURCE = /*#__PURE__*/Symbol.for("solid.server-component-source");
2677
+ const SERVER_COMPONENT_ADDRESS = /*#__PURE__*/Symbol.for("solid.server-component-address");
2674
2678
  let serverComponentRegistryExpr;
2675
2679
  function setServerComponentBootstrap(resolve) {
2676
2680
  serverComponentRegistryExpr = resolve;
@@ -2682,7 +2686,7 @@ function parseServerComponent(value, ctx) {
2682
2686
  };
2683
2687
  }
2684
2688
  const ServerComponentPlugin = {
2685
- tag: "dom-expressions/server-component",
2689
+ tag: "solid/server-component",
2686
2690
  test(value) {
2687
2691
  return typeof value === "function" && SERVER_COMPONENT in value;
2688
2692
  },
@@ -2715,6 +2719,12 @@ function flightCodec(codec) {
2715
2719
  };
2716
2720
  }
2717
2721
 
2722
+ const runWithHydrationScope = (id, fn) => runWithOwner(createOwner({
2723
+ id
2724
+ }), fn);
2725
+ const ssrAsyncValue = value => createMemo(() => value, {
2726
+ serialize: false
2727
+ });
2718
2728
  const scopeStamp = typeof creationStamp === "function" ? creationStamp : () => 0;
2719
2729
  function serverOwned(render) {
2720
2730
  return NoHydration ? NoHydration({
@@ -3293,7 +3303,7 @@ function createDocumentSlotProps(clientProps, frameId) {
3293
3303
  }
3294
3304
  });
3295
3305
  }
3296
- const FRAME_TAG = "dx-frame";
3306
+ const FRAME_TAG = "solid-frame";
3297
3307
  const FRAME_ID_ATTR = "data-fid";
3298
3308
  function frameElementOpen(id) {
3299
3309
  const escaped = sharedConfig.context ? sharedConfig.context.escape(String(id), true) : String(id);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@solidjs/web",
3
3
  "description": "Solid's web runtime: client rendering, hydration, SSR, and DOM-specific control flow (Portal, Dynamic).",
4
- "version": "2.0.0-rc.2",
4
+ "version": "2.0.0-rc.4",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/solidjs/solid.git",
11
- "directory": "packages/solid-web"
11
+ "directory": "packages/web"
12
12
  },
13
13
  "publishConfig": {
14
14
  "access": "public"
@@ -373,32 +373,18 @@
373
373
  },
374
374
  "./types/*": "./types/*"
375
375
  },
376
- "dependencies": {
377
- "seroval": "~1.5.4",
378
- "seroval-plugins": "~1.5.4"
379
- },
380
- "peerDependencies": {
381
- "solid-js": "^2.0.0-rc.2"
382
- },
383
- "devDependencies": {
384
- "@codspeed/vitest-plugin": "^5.4.0",
385
- "solid-js": "2.0.0-rc.2"
386
- },
387
376
  "scripts": {
388
377
  "build": "npm-run-all -nl build:clean types:copy-jsx build:js",
389
378
  "build:clean": "rimraf dist/",
390
379
  "build:js": "rollup -c",
391
380
  "link": "symlink-dir . node_modules/@solidjs/web",
392
- "types": "npm-run-all -nl types:clean types:copy-jsx types:web types:copy-web types:web-storage types:copy-server-functions types:copy-serialization types:web-frames types:copy-frames types:cjs",
393
- "types:clean": "rimraf types/ types-cjs/ storage/types/ storage/types-cjs/ serialization/types/ serialization/types-cjs/ frames/types/",
394
- "types:copy-jsx": "ncp ../../node_modules/@dom-expressions/runtime/src/jsx.d.ts ./src/jsx.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/jsx-properties.d.ts ./src/jsx-properties.d.ts && dom-expressions-jsx-types --input ./src/jsx.d.ts --element \"SolidElement | Node | ArrayElement\" --import 'import type { Element as SolidElement } from \"solid-js\";'",
381
+ "types": "npm-run-all -nl types:clean types:copy-jsx types:web types:copy-web types:web-storage types:cjs",
382
+ "types:clean": "rimraf types/ types-cjs/ storage/types/ storage/types-cjs/ serialization/types/ serialization/types-cjs/ frames/types/ .types-build/",
383
+ "jsx-sync": "node ./scripts/jsx-sync.mjs --compile --element \"SolidElement | Node | ArrayElement\" --import \"import type { Element as SolidElement } from \\\"solid-js\\\";\"",
384
+ "types:copy-jsx": "pnpm run jsx-sync",
395
385
  "types:web": "tsc --project ./tsconfig.build.json",
396
- "types:copy-web": "node -e \"const src = fs.readFileSync('../../node_modules/@dom-expressions/runtime/src/client.d.ts', 'utf8'); const marker = 'export type { RequestEventLocals } from'; if (!src.includes(marker)) throw new Error('client.d.ts drift: the type-only RequestEventLocals re-export was not found — revisit the augmentation-identity rewrite'); fs.writeFileSync('./types/client.d.ts', src.replace(marker, 'export { RequestEventLocals } from'));\" && ncp ../../node_modules/@dom-expressions/runtime/src/server.d.ts ./types/server.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/serializer.d.ts ./types/serializer.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/serializer-decode.d.ts ./types/serializer-decode.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/response.d.ts ./types/response.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/cookies.d.ts ./types/cookies.d.ts && ncp ./src/jsx.d.ts ./types/jsx.d.ts && ncp ./src/jsx-properties.d.ts ./types/jsx-properties.d.ts",
386
+ "types:copy-web": "node ./scripts/copy-types.mjs",
397
387
  "types:web-storage": "tsc --project ./storage/tsconfig.build.json",
398
- "types:web-frames": "tsc --project ./frames/tsconfig.build.json",
399
- "types:copy-serialization": "node -e \"fs.mkdirSync('./serialization/types', { recursive: true }); fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/serializer.d.ts', './serialization/types/index.d.ts'); fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/serializer-decode.d.ts', './serialization/types/serializer-decode.d.ts');\"",
400
- "types:copy-server-functions": "node -e \"fs.mkdirSync('./types/server-functions', { recursive: true }); for (const f of ['shared', 'flash', 'client', 'server', 'rich-args']) fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/server-functions/' + f + '.d.ts', './types/server-functions/' + f + '.d.ts');\"",
401
- "types:copy-frames": "node -e \"fs.mkdirSync('./types/frames', { recursive: true }); for (const f of ['frame-client', 'frame-transport', 'frame-sink', 'serializer']) fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/' + f + '.d.ts', './types/frames/' + f + '.d.ts'); for (const f of ['client', 'server']) fs.writeFileSync('./types/frames/' + f + '.d.ts', fs.readFileSync('./frames/types/' + f + '.d.ts', 'utf8').replaceAll('@dom-expressions/runtime/src/', './'));\"",
402
388
  "types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./storage/types ./storage/types-cjs ./serialization/types ./serialization/types-cjs",
403
389
  "test": "vitest run && vitest run --config vite.config.server.mjs && vitest run --config vite.config.hydrate.mjs",
404
390
  "test:server": "vitest run --config vite.config.server.mjs",
@@ -406,5 +392,17 @@
406
392
  "bench": "vitest bench --run",
407
393
  "bench:server": "vitest bench --run --config vite.config.server-bench.mjs",
408
394
  "test-types": "tsc --project tsconfig.test.json"
395
+ },
396
+ "dependencies": {
397
+ "seroval": "~1.5.4",
398
+ "seroval-plugins": "~1.5.4"
399
+ },
400
+ "peerDependencies": {
401
+ "solid-js": "^2.0.0-rc.4"
402
+ },
403
+ "devDependencies": {
404
+ "@codspeed/vitest-plugin": "^5.4.0",
405
+ "@solidjs/signals": "workspace:*",
406
+ "solid-js": "workspace:*"
409
407
  }
410
- }
408
+ }
@@ -3,7 +3,7 @@
3
3
  var seroval = require('seroval');
4
4
  var web = require('seroval-plugins/web');
5
5
 
6
- const STATE = Symbol.for("dom-expressions.container-trace-state");
6
+ const STATE = Symbol.for("solid.container-trace-state");
7
7
  const state = globalThis[STATE] || (globalThis[STATE] = {
8
8
  materialized: new WeakMap(),
9
9
  materializedValues: new WeakSet()
@@ -11,7 +11,7 @@ const state = globalThis[STATE] || (globalThis[STATE] = {
11
11
  function setContainerTraceStreamMint(fn) {
12
12
  state.streamOf = fn;
13
13
  }
14
- const TRACE = Symbol.for("dom-expressions.container-trace");
14
+ const TRACE = Symbol.for("solid.container-trace");
15
15
  function materialize(marker) {
16
16
  let value = state.materialized.get(marker.$tr);
17
17
  if (value === undefined) {
@@ -30,7 +30,7 @@ function parseTrace(value, ctx) {
30
30
  };
31
31
  }
32
32
  const ContainerTracePlugin = {
33
- tag: "dom-expressions/container-trace",
33
+ tag: "solid/container-trace",
34
34
  test(value) {
35
35
  return value != null && typeof value === "object" && TRACE in value;
36
36
  },
@@ -1,7 +1,7 @@
1
1
  import { Feature, fromCrossJSON, createStream } from 'seroval';
2
2
  import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
3
3
 
4
- const STATE = Symbol.for("dom-expressions.container-trace-state");
4
+ const STATE = Symbol.for("solid.container-trace-state");
5
5
  const state = globalThis[STATE] || (globalThis[STATE] = {
6
6
  materialized: new WeakMap(),
7
7
  materializedValues: new WeakSet()
@@ -9,7 +9,7 @@ const state = globalThis[STATE] || (globalThis[STATE] = {
9
9
  function setContainerTraceStreamMint(fn) {
10
10
  state.streamOf = fn;
11
11
  }
12
- const TRACE = Symbol.for("dom-expressions.container-trace");
12
+ const TRACE = Symbol.for("solid.container-trace");
13
13
  function materialize(marker) {
14
14
  let value = state.materialized.get(marker.$tr);
15
15
  if (value === undefined) {
@@ -28,7 +28,7 @@ function parseTrace(value, ctx) {
28
28
  };
29
29
  }
30
30
  const ContainerTracePlugin = {
31
- tag: "dom-expressions/container-trace",
31
+ tag: "solid/container-trace",
32
32
  test(value) {
33
33
  return value != null && typeof value === "object" && TRACE in value;
34
34
  },