@solidjs/web 2.0.0-rc.1 → 2.0.0-rc.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.
package/dist/dev.cjs CHANGED
@@ -87,13 +87,18 @@ function reconcileArrays(parentNode, a, b, marker) {
87
87
  map = null,
88
88
  anchor,
89
89
  anchorTag;
90
+ const isLive = n => {
91
+ if (!n) return false;
92
+ const tag = n[$$SLOT];
93
+ return n.parentNode === parentNode && (!tag || tag === marker);
94
+ };
90
95
  while (aStart < aEnd || bStart < bEnd) {
91
- if (a[aStart] === b[bStart]) {
96
+ if (a[aStart] === b[bStart] && isLive(a[aStart])) {
92
97
  aStart++;
93
98
  bStart++;
94
99
  continue;
95
100
  }
96
- while (a[aEnd - 1] === b[bEnd - 1]) {
101
+ while (a[aEnd - 1] === b[bEnd - 1] && isLive(a[aEnd - 1])) {
97
102
  aEnd--;
98
103
  bEnd--;
99
104
  }
@@ -592,6 +597,11 @@ function ref(fn, element) {
592
597
  const resolved = solidJs.untrack(fn);
593
598
  solidJs.runWithOwner(null, () => applyRef(resolved, element));
594
599
  }
600
+ const PURE_ROW = Symbol.for("solid.pure-row");
601
+ function rowProof(fn) {
602
+ fn[PURE_ROW] = true;
603
+ return fn;
604
+ }
595
605
  function scope(fn) {
596
606
  fn.$s = true;
597
607
  return fn;
@@ -655,6 +665,11 @@ function stripTextSeparators(nodes) {
655
665
  nodes.length = j;
656
666
  return nodes;
657
667
  }
668
+ function patchDriver(subject, body) {
669
+ {
670
+ effect(() => body(subject, subject, false), () => body(subject, undefined, true));
671
+ }
672
+ }
658
673
  function insert(parent, accessor, marker, initial, options) {
659
674
  const multi = marker !== undefined;
660
675
  const host = options && options.host;
@@ -895,7 +910,7 @@ function initHeadRegistry() {
895
910
  headOwned = new Map();
896
911
  headApplied = new Map();
897
912
  const t = document.querySelector("title");
898
- headFallbackTitle = t && !t.hasAttribute("data-dh") ? t.textContent : null;
913
+ headFallbackTitle = t ? t.hasAttribute("data-dh") ? t.getAttribute("data-dhf") : t.textContent : null;
899
914
  if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
900
915
  }
901
916
  function applyServerHeadOps(ops) {
@@ -950,7 +965,11 @@ function flushHeadRegistry() {
950
965
  headOwned.delete(identity);
951
966
  headApplied.delete(identity);
952
967
  if (identity === "title") {
953
- if (headFallbackTitle != null) setHeadTitle(headFallbackTitle).removeAttribute("data-dh");
968
+ if (headFallbackTitle != null) {
969
+ const el = setHeadTitle(headFallbackTitle);
970
+ el.removeAttribute("data-dh");
971
+ el.removeAttribute("data-dhf");
972
+ }
954
973
  } else {
955
974
  for (let i = 0; i < els.length; i++) els[i].remove();
956
975
  }
@@ -1117,7 +1136,7 @@ function loadModuleAssets(mapping) {
1117
1136
  const pending = [];
1118
1137
  for (const key in mapping) {
1119
1138
  if (hy.modules[key]) continue;
1120
- const entryUrl = mapping[key];
1139
+ const entryUrl = new URL(mapping[key], document.baseURI).href;
1121
1140
  if (!hy.loading[key]) {
1122
1141
  hy.loading[key] = import(entryUrl).then(mod => {
1123
1142
  hy.modules[key] = mod;
@@ -1436,7 +1455,11 @@ function eventHandler(e, container, state) {
1436
1455
  value
1437
1456
  });
1438
1457
  const handleNode = () => {
1439
- const handler = node[key];
1458
+ let handler = node[key];
1459
+ if (handler === undefined && node.hasAttribute && node.hasAttribute("_bnd")) {
1460
+ const seam = globalThis[Symbol.for("dx.bnd")];
1461
+ if (seam) handler = seam.resolve(node, e.type);
1462
+ }
1440
1463
  if (handler && !node.disabled) {
1441
1464
  const data = node[`${key}Data`];
1442
1465
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
@@ -2042,6 +2065,7 @@ exports.markSafeError = markSafeError;
2042
2065
  exports.memo = memo;
2043
2066
  exports.mergeProps = mergeProps;
2044
2067
  exports.parseCookieHeader = parseCookieHeader;
2068
+ exports.patchDriver = patchDriver;
2045
2069
  exports.redirect = redirect;
2046
2070
  exports.ref = ref;
2047
2071
  exports.registerDelegatedContainer = registerDelegatedContainer;
@@ -2053,6 +2077,7 @@ exports.renderToStream = renderToStream;
2053
2077
  exports.renderToString = renderToString;
2054
2078
  exports.resolveSSRNode = resolveSSRNode;
2055
2079
  exports.respond = respond;
2080
+ exports.rowProof = rowProof;
2056
2081
  exports.runHydrationEvents = runHydrationEvents;
2057
2082
  exports.scope = scope;
2058
2083
  exports.serializeCookie = serializeCookie;
package/dist/dev.js CHANGED
@@ -86,13 +86,18 @@ function reconcileArrays(parentNode, a, b, marker) {
86
86
  map = null,
87
87
  anchor,
88
88
  anchorTag;
89
+ const isLive = n => {
90
+ if (!n) return false;
91
+ const tag = n[$$SLOT];
92
+ return n.parentNode === parentNode && (!tag || tag === marker);
93
+ };
89
94
  while (aStart < aEnd || bStart < bEnd) {
90
- if (a[aStart] === b[bStart]) {
95
+ if (a[aStart] === b[bStart] && isLive(a[aStart])) {
91
96
  aStart++;
92
97
  bStart++;
93
98
  continue;
94
99
  }
95
- while (a[aEnd - 1] === b[bEnd - 1]) {
100
+ while (a[aEnd - 1] === b[bEnd - 1] && isLive(a[aEnd - 1])) {
96
101
  aEnd--;
97
102
  bEnd--;
98
103
  }
@@ -591,6 +596,11 @@ function ref(fn, element) {
591
596
  const resolved = untrack(fn);
592
597
  runWithOwner(null, () => applyRef(resolved, element));
593
598
  }
599
+ const PURE_ROW = Symbol.for("solid.pure-row");
600
+ function rowProof(fn) {
601
+ fn[PURE_ROW] = true;
602
+ return fn;
603
+ }
594
604
  function scope(fn) {
595
605
  fn.$s = true;
596
606
  return fn;
@@ -654,6 +664,11 @@ function stripTextSeparators(nodes) {
654
664
  nodes.length = j;
655
665
  return nodes;
656
666
  }
667
+ function patchDriver(subject, body) {
668
+ {
669
+ effect(() => body(subject, subject, false), () => body(subject, undefined, true));
670
+ }
671
+ }
657
672
  function insert(parent, accessor, marker, initial, options) {
658
673
  const multi = marker !== undefined;
659
674
  const host = options && options.host;
@@ -894,7 +909,7 @@ function initHeadRegistry() {
894
909
  headOwned = new Map();
895
910
  headApplied = new Map();
896
911
  const t = document.querySelector("title");
897
- headFallbackTitle = t && !t.hasAttribute("data-dh") ? t.textContent : null;
912
+ headFallbackTitle = t ? t.hasAttribute("data-dh") ? t.getAttribute("data-dhf") : t.textContent : null;
898
913
  if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
899
914
  }
900
915
  function applyServerHeadOps(ops) {
@@ -949,7 +964,11 @@ function flushHeadRegistry() {
949
964
  headOwned.delete(identity);
950
965
  headApplied.delete(identity);
951
966
  if (identity === "title") {
952
- if (headFallbackTitle != null) setHeadTitle(headFallbackTitle).removeAttribute("data-dh");
967
+ if (headFallbackTitle != null) {
968
+ const el = setHeadTitle(headFallbackTitle);
969
+ el.removeAttribute("data-dh");
970
+ el.removeAttribute("data-dhf");
971
+ }
953
972
  } else {
954
973
  for (let i = 0; i < els.length; i++) els[i].remove();
955
974
  }
@@ -1116,7 +1135,7 @@ function loadModuleAssets(mapping) {
1116
1135
  const pending = [];
1117
1136
  for (const key in mapping) {
1118
1137
  if (hy.modules[key]) continue;
1119
- const entryUrl = mapping[key];
1138
+ const entryUrl = new URL(mapping[key], document.baseURI).href;
1120
1139
  if (!hy.loading[key]) {
1121
1140
  hy.loading[key] = import(entryUrl).then(mod => {
1122
1141
  hy.modules[key] = mod;
@@ -1435,7 +1454,11 @@ function eventHandler(e, container, state) {
1435
1454
  value
1436
1455
  });
1437
1456
  const handleNode = () => {
1438
- const handler = node[key];
1457
+ let handler = node[key];
1458
+ if (handler === undefined && node.hasAttribute && node.hasAttribute("_bnd")) {
1459
+ const seam = globalThis[Symbol.for("dx.bnd")];
1460
+ if (seam) handler = seam.resolve(node, e.type);
1461
+ }
1439
1462
  if (handler && !node.disabled) {
1440
1463
  const data = node[`${key}Data`];
1441
1464
  data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
@@ -1925,4 +1948,4 @@ _moduleUrl) {
1925
1948
  function httpStatus(_code, _text) {}
1926
1949
  function httpHeader(_name, _value, _options) {}
1927
1950
 
1928
- export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, voidFn as HydrationScript, MathMLElements, Namespaces, Portal, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dynamic, dynamicProperty, effect, escape, voidFn as generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, voidFn as getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, mergeProps, parseCookieHeader, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle, ssrStyleProperty, style, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, warmAsset };
1951
+ export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, voidFn as HydrationScript, MathMLElements, Namespaces, Portal, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dynamic, dynamicProperty, effect, escape, voidFn as generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, voidFn as getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, mergeProps, parseCookieHeader, patchDriver, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, resolveSSRNode, respond, rowProof, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle, ssrStyleProperty, style, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, warmAsset };