@solidjs/web 2.0.0-rc.5 → 2.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/server.cjs +122 -38
  2. package/dist/server.dev.cjs +3794 -0
  3. package/dist/server.dev.js +3627 -0
  4. package/dist/server.js +123 -39
  5. package/dist/web.cjs +102 -366
  6. package/dist/{dev.cjs → web.dev.cjs} +153 -376
  7. package/dist/{dev.js → web.dev.js} +155 -374
  8. package/dist/web.js +104 -364
  9. package/frames/dist/client.cjs +11 -3
  10. package/frames/dist/client.dev.cjs +11 -3
  11. package/frames/dist/client.dev.js +11 -3
  12. package/frames/dist/client.js +11 -3
  13. package/frames/dist/server.cjs +320 -53
  14. package/frames/dist/server.dev.cjs +4584 -0
  15. package/frames/dist/server.dev.js +4571 -0
  16. package/frames/dist/server.js +320 -53
  17. package/frames/package.json +10 -0
  18. package/package.json +78 -8
  19. package/serialization/dist/decode.cjs +18 -4
  20. package/serialization/dist/decode.js +18 -4
  21. package/serialization/dist/serialization.cjs +18 -4
  22. package/serialization/dist/serialization.js +18 -4
  23. package/server-functions/dist/client.cjs +27 -16
  24. package/server-functions/dist/client.js +27 -16
  25. package/server-functions/dist/server.cjs +529 -131
  26. package/server-functions/dist/server.dev.cjs +536 -130
  27. package/server-functions/dist/server.dev.js +536 -130
  28. package/server-functions/dist/server.js +529 -131
  29. package/types/client.d.ts +1 -3
  30. package/types/constants.d.ts +3 -1
  31. package/types/frames/frame-client.d.ts +1 -1
  32. package/types/head.d.ts +3 -0
  33. package/types/index.d.ts +18 -7
  34. package/types/index.server.d.ts +31 -9
  35. package/types/render.d.ts +3 -1
  36. package/types/server-functions/flash.d.ts +12 -3
  37. package/types/server-functions/server.d.ts +100 -5
  38. package/types/server-mock.d.ts +43 -7
  39. package/types/server.d.ts +47 -5
  40. package/types-cjs/client.d.cts +1 -3
  41. package/types-cjs/constants.d.cts +3 -1
  42. package/types-cjs/frames/frame-client.d.cts +1 -1
  43. package/types-cjs/head.d.cts +3 -0
  44. package/types-cjs/index.d.cts +18 -7
  45. package/types-cjs/index.server.d.cts +31 -9
  46. package/types-cjs/render.d.cts +3 -1
  47. package/types-cjs/server-functions/flash.d.cts +12 -3
  48. package/types-cjs/server-functions/server.d.cts +100 -5
  49. package/types-cjs/server-mock.d.cts +43 -7
  50. package/types-cjs/server.d.cts +47 -5
  51. package/types/patch-driver.d.ts +0 -3
  52. package/types-cjs/patch-driver.d.cts +0 -3
@@ -49,6 +49,7 @@ const Namespaces = {
49
49
  const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
50
50
  const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
51
51
  const DOMElements = /*#__PURE__*/new Set(/*#__PURE__*/"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,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,math,menu,menuitem,meta,meter,multicol,nav,nextid,nobr,noembed,noframes,noindex,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,portal,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,search,section,select,shadow,slot,small,source,spacer,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,webview,xmp".split(","));
52
+ const COMPOSED_BODY_FRAMING = /*#__PURE__*/new Set(["content-length", "content-encoding", "transfer-encoding"]);
52
53
 
53
54
  const transparentOptions = {
54
55
  transparent: true,
@@ -57,12 +58,32 @@ const transparentOptions = {
57
58
  const syncOptions = {
58
59
  sync: true
59
60
  };
61
+ let bindingEffect = null;
62
+ function tagElement(node) {
63
+ if (bindingEffect !== null && bindingEffect._devElement === undefined) bindingEffect._devElement = node;
64
+ }
60
65
  function effect(fn, effectFn, options) {
61
- solidJs.createRenderEffect(fn, effectFn, options ? {
66
+ const nodeOptions = options ? {
62
67
  sync: true,
63
68
  ...options,
64
69
  transparent: !options.scope
65
- } : transparentOptions);
70
+ } : transparentOptions;
71
+ {
72
+ let node = null;
73
+ solidJs.createRenderEffect(prev => {
74
+ node = solidJs.getOwner();
75
+ return fn(prev);
76
+ }, (value, prev) => {
77
+ const outer = bindingEffect;
78
+ bindingEffect = node;
79
+ try {
80
+ return effectFn(value, prev);
81
+ } finally {
82
+ bindingEffect = outer;
83
+ }
84
+ }, nodeOptions);
85
+ return;
86
+ }
66
87
  }
67
88
  function memo(fn) {
68
89
  return solidJs.createMemo(() => fn(), syncOptions);
@@ -211,12 +232,24 @@ function classifyHeadTag(desc) {
211
232
  resource: false
212
233
  };
213
234
  }
235
+ function qualifierValue(name, value) {
236
+ if (value == null || value === false) return null;
237
+ if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
238
+ const v = value === true ? "" : String(value);
239
+ if (name === "as") return asciiLowerCase(v);
240
+ if (name !== "crossorigin") return v;
241
+ return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
242
+ }
243
+ function asciiLowerCase(value) {
244
+ return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
245
+ }
214
246
  function resourceIdentity(tag, props) {
215
- let id = "res:" + tag + ":" + (props.rel || "") + ":" + (props.href || props.src || "");
247
+ const url = String(props.href || props.src || "");
248
+ let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
216
249
  for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
217
250
  const q = RESOURCE_QUALIFIERS[i];
218
- const value = props[q];
219
- if (value != null) id += ":" + q + "=" + (value === true ? "" : value);
251
+ const value = qualifierValue(q, props[q]);
252
+ if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
220
253
  }
221
254
  return id;
222
255
  }
@@ -356,11 +389,9 @@ const waitAsset = promise => {
356
389
  }
357
390
  gate();
358
391
  };
359
- exports.listDriver = void 0;
360
- function installListDriver(driver) {
361
- exports.listDriver = driver;
362
- }
363
392
  const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
393
+ const $$EVENT_TUPLE = Symbol();
394
+ const hasOwn = Object.prototype.hasOwnProperty;
364
395
  const INNER_OWNED = {};
365
396
  const delegatedEvents = new Set();
366
397
  const delegatedContainers = new Map();
@@ -412,6 +443,7 @@ function render(code, element, init, options = {}) {
412
443
  }
413
444
  function create(html, bypassGuard, flag) {
414
445
  if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
446
+ if (/^<(html|head|body)[\s>]/i.test(html)) throw new Error("Document shell templates (<html>, <head>, <body>) cannot be client-created: " + "a <template> parse strips those tags. Render this component through hydrate(), " + "where the document shell already exists.");
415
447
  const t = document.createElement("template");
416
448
  t.innerHTML = html;
417
449
  return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
@@ -462,10 +494,27 @@ function unregisterDelegatedContainer(container, owner = container) {
462
494
  }
463
495
  function attachDelegatedEvent(name, container, state) {
464
496
  if (state.handlers.has(name)) return;
465
- const handler = e => eventHandler(e, container, state);
497
+ const handler = e => dispatchAsInteraction(e, () => eventHandler(e, container, state)) ;
466
498
  state.handlers.set(name, handler);
467
499
  container.addEventListener(name, handler);
468
500
  }
501
+ function describeEventTarget(target) {
502
+ if (!target || typeof target.tagName !== "string") return undefined;
503
+ const tag = target.tagName.toLowerCase();
504
+ let out = tag;
505
+ if (target.id) out += `#${target.id}`;else if (typeof target.name === "string" && target.name) out += `[name=${target.name}]`;
506
+ if (tag !== "input" && tag !== "textarea" && tag !== "select") {
507
+ const text = (target.textContent || "").trim().replace(/\s+/g, " ");
508
+ if (text) out += ` "${text.length > 30 ? text.slice(0, 29) + "…" : text}"`;
509
+ }
510
+ return out;
511
+ }
512
+ function dispatchAsInteraction(e, fn) {
513
+ return solidJs.DEV.attribution.withInteraction({
514
+ type: e.type,
515
+ target: describeEventTarget(e.target)
516
+ }, fn);
517
+ }
469
518
  function getDelegatedRoot(node) {
470
519
  while (node) {
471
520
  if (delegatedContainers.get(node)?.roots) return node;
@@ -485,8 +534,10 @@ function findOwner(target, state) {
485
534
  }
486
535
  }
487
536
  function setProperty(node, name, value) {
537
+ tagElement(node);
488
538
  if (isHydrating(node)) return;
489
- node[name] = value;
539
+ const nodeName = node.nodeName;
540
+ if (name === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else if ((name === "value" || name === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA")) node[name] = value ?? "";else node[name] = value;
490
541
  }
491
542
  let claimHandlers = null;
492
543
  const CLAIM_SEAM = Symbol.for("solid.element-claims");
@@ -519,31 +570,54 @@ function claimElement(node) {
519
570
  return node;
520
571
  }
521
572
  function setAttribute(node, name, value) {
573
+ tagElement(node);
522
574
  if (isHydrating(node)) return;
523
- if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
575
+ const selectMultiple = name === "multiple" && node.localName === "select";
576
+ if (value == null || value === false) node.removeAttribute(name);else {
577
+ node.setAttribute(name, value === true ? "" : value);
578
+ if (selectMultiple && !node._$multiple) {
579
+ const options = node.options;
580
+ for (let i = 0; i < options.length; i++) {
581
+ if (options[i].defaultSelected) options[i].selected = true;
582
+ }
583
+ }
584
+ }
585
+ if (selectMultiple) node._$multiple = true;
524
586
  if (claimHandlers !== null && (name === "href" || name === "action")) claimElement(node);
525
587
  }
526
588
  function setAttributeNS(node, namespace, name, value) {
589
+ tagElement(node);
527
590
  if (isHydrating(node)) return;
528
591
  if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
529
592
  }
530
593
  function className(node, value, prev) {
531
- if (isHydrating(node)) return;
594
+ tagElement(node);
595
+ if (typeof value === "number") value = "" + value;
596
+ if (typeof prev === "number") prev = "" + prev;
597
+ if (isHydrating(node)) {
598
+ node._$classes = value && typeof value === "object" ? classListToObject(value) : undefined;
599
+ return;
600
+ }
532
601
  if (value == null || value === false) {
533
- prev && node.removeAttribute("class");
602
+ if (prev || node._$classes) {
603
+ node.removeAttribute("class");
604
+ node._$classes = undefined;
605
+ }
534
606
  return;
535
607
  }
536
608
  if (typeof value === "string") {
609
+ node._$classes = undefined;
537
610
  value !== prev && node.setAttribute("class", value);
538
611
  return;
539
612
  }
613
+ let applied;
540
614
  if (typeof prev === "string") {
541
- prev = {};
615
+ applied = {};
542
616
  node.removeAttribute("class");
543
- } else prev = classListToObject(prev || {});
617
+ } else applied = node._$classes || classListToObject(prev || {});
544
618
  value = classListToObject(value);
545
- const classKeys = Object.keys(value || {});
546
- const prevKeys = Object.keys(prev);
619
+ const classKeys = Object.keys(value);
620
+ const prevKeys = Object.keys(applied);
547
621
  let i, len;
548
622
  for (i = 0, len = prevKeys.length; i < len; i++) {
549
623
  const key = prevKeys[i];
@@ -553,22 +627,40 @@ function className(node, value, prev) {
553
627
  for (i = 0, len = classKeys.length; i < len; i++) {
554
628
  const key = classKeys[i],
555
629
  classValue = !!value[key];
556
- if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
630
+ if (!key || key === "undefined" || applied[key] === classValue || !classValue) continue;
557
631
  node.classList.add(key);
558
632
  }
633
+ node._$classes = value;
559
634
  }
560
635
  function addEvent(node, name, handler, delegate) {
561
636
  if (delegate) {
637
+ const key = `$$${name}`;
638
+ let data;
562
639
  if (Array.isArray(handler)) {
563
- node[`$$${name}`] = handler[0];
564
- node[`$$${name}Data`] = handler[1];
565
- } else node[`$$${name}`] = handler;
566
- } else if (Array.isArray(handler)) {
640
+ data = handler[1];
641
+ node[key] = handler[0];
642
+ } else node[key] = handler;
643
+ node[`${key}Data`] = data;
644
+ return;
645
+ }
646
+ if (Array.isArray(handler)) {
567
647
  const handlerFn = handler[0];
568
- node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
569
- } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
648
+ const listener = e => dispatchAsInteraction(e, () => handlerFn.call(node, handler[1], e)) ;
649
+ listener[$$EVENT_TUPLE] = handler;
650
+ node.addEventListener(name, listener);
651
+ return listener;
652
+ }
653
+ if (typeof handler === "function") {
654
+ const listener = e => dispatchAsInteraction(e, () => handler.call(node, e));
655
+ node.addEventListener(name, listener);
656
+ return listener;
657
+ }
658
+ node.addEventListener(name, handler, typeof handler !== "function" && handler);
659
+ return handler;
570
660
  }
571
661
  function style(node, value, prev) {
662
+ tagElement(node);
663
+ if (isHydrating(node)) return;
572
664
  if (!value) {
573
665
  if (prev || node._$styles) {
574
666
  setAttribute(node, "style");
@@ -593,12 +685,13 @@ function style(node, value, prev) {
593
685
  }
594
686
  let v, s;
595
687
  for (s in applied) {
596
- if (value[s] == null) {
688
+ if (!hasOwn.call(value, s) || value[s] == null) {
597
689
  nodeStyle.removeProperty(s);
598
690
  delete applied[s];
599
691
  }
600
692
  }
601
693
  for (s in value) {
694
+ if (!hasOwn.call(value, s)) continue;
602
695
  v = value[s];
603
696
  if (v != null && v !== applied[s]) {
604
697
  nodeStyle.setProperty(s, v);
@@ -607,20 +700,27 @@ function style(node, value, prev) {
607
700
  }
608
701
  }
609
702
  function setStyleProperty(node, name, value) {
703
+ tagElement(node);
704
+ if (isHydrating(node)) return;
610
705
  value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
611
706
  }
612
- function spread(node, props = {}, skipChildren) {
707
+ function spread(node, props, skipChildren) {
613
708
  const prevProps = {};
614
- const get = typeof props === "function" ? props : () => props;
615
- if (!skipChildren) insert(node, () => get().children);
709
+ const get = () => (typeof props === "function" ? props() : props) ?? {};
710
+ if (!skipChildren) insert(node, () => {
711
+ const source = get();
712
+ return hasOwn.call(source, "children") ? source.children : undefined;
713
+ });
616
714
  effect(() => {
617
- const r = get().ref;
715
+ const source = get();
716
+ const r = hasOwn.call(source, "ref") && source.ref;
618
717
  (typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
619
718
  }, () => {});
620
719
  effect(() => {
621
720
  const source = get();
622
721
  const newProps = {};
623
722
  for (const prop in source) {
723
+ if (!hasOwn.call(source, prop)) continue;
624
724
  if (prop === "children" || prop === "ref") continue;
625
725
  newProps[prop] = source[prop];
626
726
  }
@@ -713,11 +813,6 @@ function insert(parent, accessor, marker, initial, options) {
713
813
  const host = options && options.host;
714
814
  if (multi && !initial) initial = [];
715
815
  if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
716
- if (exports.listDriver !== undefined && typeof accessor === "function" && accessor.$ll !== undefined) {
717
- const listAccessor = accessor;
718
- const owner = solidJs.getOwner();
719
- if (exports.listDriver(parent, accessor, marker, () => solidJs.runWithOwner(owner, () => insert(parent, () => listAccessor(), marker, marker !== undefined ? [] : undefined, options)))) return;
720
- }
721
816
  if (typeof accessor !== "function") {
722
817
  accessor = normalize(accessor, initial, multi, true);
723
818
  if (typeof accessor !== "function") {
@@ -755,6 +850,7 @@ function insert(parent, accessor, marker, initial, options) {
755
850
  } : SCOPE_OPTIONS : options);
756
851
  }
757
852
  function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
853
+ tagElement(node);
758
854
  const nodeName = node.nodeName;
759
855
  props || (props = {});
760
856
  for (const prop in prevProps) {
@@ -777,10 +873,16 @@ function assetEntryKey(descriptor) {
777
873
  if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
778
874
  return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
779
875
  }
780
- function findAssetElement(selector, attr, value) {
876
+ function findAssetElement(selector, attr, value, qualifiers) {
781
877
  const nodes = document.querySelectorAll(selector);
782
- for (let i = 0; i < nodes.length; i++) {
783
- if (nodes[i].getAttribute(attr) === value) return nodes[i];
878
+ outer: for (let i = 0; i < nodes.length; i++) {
879
+ if (nodes[i].getAttribute(attr) !== value) continue;
880
+ if (!qualifiers) return nodes[i];
881
+ for (let q = 0; q < RESOURCE_QUALIFIERS.length; q++) {
882
+ const name = RESOURCE_QUALIFIERS[q];
883
+ if (qualifierValue(name, qualifiers[name]) !== qualifierValue(name, nodes[i].getAttribute(name))) continue outer;
884
+ }
885
+ return nodes[i];
784
886
  }
785
887
  return null;
786
888
  }
@@ -1086,8 +1188,8 @@ function mountHeadResource(tag, props) {
1086
1188
  headMountedResources.add(identity);
1087
1189
  const url = props.href || props.src;
1088
1190
  let el = null;
1089
- if (url != null) {
1090
- if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
1191
+ if (tag === "link" && url == null && typeof props.imagesrcset === "string") el = findAssetElement(`link[rel="${props.rel}"]`, "href", null, props);else if (url != null) {
1192
+ if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url, props);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
1091
1193
  }
1092
1194
  if (!el) document.head.appendChild(createHeadElement(tag, props));
1093
1195
  }
@@ -1454,7 +1556,8 @@ function classListToObject(classList) {
1454
1556
  function flattenClassList(list, result) {
1455
1557
  for (let i = 0, len = list.length; i < len; i++) {
1456
1558
  const item = list[i];
1457
- if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);else if (item || item === 0) result[item] = true;
1559
+ if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);
1560
+ else if (typeof item !== "boolean" && (item || item === 0)) result[item] = true;
1458
1561
  }
1459
1562
  }
1460
1563
  function assignProp(node, prop, value, prev, skipRef, nodeName) {
@@ -1470,12 +1573,13 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
1470
1573
  const name = prop.slice(2).toLowerCase();
1471
1574
  const delegate = DelegatedEvents.has(name);
1472
1575
  if (!delegate && prev) {
1473
- const h = Array.isArray(prev) ? prev[0] : prev;
1474
- node.removeEventListener(name, h);
1576
+ if (Array.isArray(value) && typeof prev === "function" && prev[$$EVENT_TUPLE] === value) return prev;
1577
+ node.removeEventListener(name, prev, typeof prev !== "function" && prev);
1475
1578
  }
1476
1579
  if (delegate || value) {
1477
- addEvent(node, name, value, delegate);
1580
+ const attached = addEvent(node, name, value, delegate);
1478
1581
  delegate && delegateEvents([name]);
1582
+ if (!delegate) return attached;
1479
1583
  }
1480
1584
  } else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
1481
1585
  if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
@@ -1515,7 +1619,7 @@ function eventHandler(e, container, state) {
1515
1619
  }
1516
1620
  if (handler && !node.disabled) {
1517
1621
  const data = node[`${key}Data`];
1518
- data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
1622
+ data !== undefined ? handler.call(node, data, e) : typeof handler === "function" ? handler.call(node, e) : handler.handleEvent(e);
1519
1623
  if (e.cancelBubble) return;
1520
1624
  }
1521
1625
  node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
@@ -1558,6 +1662,7 @@ function eventHandler(e, container, state) {
1558
1662
  retarget(oriTarget);
1559
1663
  }
1560
1664
  function insertExpression(parent, value, current, marker) {
1665
+ tagElement(parent);
1561
1666
  if (hydrationRt !== null && isHydrating(parent)) {
1562
1667
  if (value && value !== current) {
1563
1668
  const arr = Array.isArray(value);
@@ -1635,7 +1740,7 @@ function normalize(value, current, multi, doNotUnwrap) {
1635
1740
  const item = value[i],
1636
1741
  prev = current && current[i],
1637
1742
  t = typeof item;
1638
- if ((t === "string" || t === "number") && prev && prev.nodeType === 3) value[i] = prev;
1743
+ if ((t === "string" || t === "number") && prev && prev.nodeType === 3 && isHydrating(prev)) value[i] = prev;
1639
1744
  }
1640
1745
  }
1641
1746
  return value;
@@ -1718,331 +1823,6 @@ function getHydrationKey() {
1718
1823
  }
1719
1824
  const RequestContext = Symbol();
1720
1825
 
1721
- const PURE_ROW = Symbol.for("solid.pure-row");
1722
- const arm = () => {
1723
- installListDriver(driveList);
1724
- };
1725
- function rowProof(fn) {
1726
- arm();
1727
- fn[PURE_ROW] = true;
1728
- return fn;
1729
- }
1730
- let rowCollector = null;
1731
- const lisPositions = sources => {
1732
- const n = sources.length;
1733
- const tails = [];
1734
- const tailsIdx = [];
1735
- const prev = new Array(n).fill(-1);
1736
- for (let j = 0; j < n; j++) {
1737
- const v = sources[j];
1738
- if (v === -1) continue;
1739
- let lo = 0,
1740
- hi = tails.length;
1741
- while (lo < hi) {
1742
- const mid = lo + hi >> 1;
1743
- if (tails[mid] < v) lo = mid + 1;else hi = mid;
1744
- }
1745
- if (lo > 0) prev[j] = tailsIdx[lo - 1];
1746
- tails[lo] = v;
1747
- tailsIdx[lo] = j;
1748
- }
1749
- const stable = new Set();
1750
- let k = tailsIdx.length ? tailsIdx[tails.length - 1] : -1;
1751
- while (k >= 0) {
1752
- stable.add(k);
1753
- k = prev[k];
1754
- }
1755
- return stable;
1756
- };
1757
- const driveList = (parent, listFn, marker, lateClassic) => {
1758
- const meta = listFn.$ll;
1759
- if (meta.row?.[PURE_ROW] !== true) return false;
1760
- if (typeof meta.keyed === "function") return false;
1761
- const evalOwner = solidJs.createOwner({
1762
- id: "&each"
1763
- });
1764
- let subject = solidJs.runWithOwner(evalOwner, () => solidJs.untrack(meta.each));
1765
- evalOwner.dispose();
1766
- let raw = subject != null ? solidJs.patchableRaw(subject) : undefined;
1767
- if (raw === undefined || !Array.isArray(raw)) return false;
1768
- const optimistic = solidJs.storeHasOptimisticFamily(subject);
1769
- if (optimistic) raw = solidJs.untrack(() => Array.from(subject));
1770
- const hydrating = !!solidJs.sharedConfig.hydrating;
1771
- if (hydrating && raw.length === 0) return false;
1772
- let domRows;
1773
- let rowIds;
1774
- if (hydrating) {
1775
- if (marker !== undefined) return false;
1776
- domRows = Array.from(parent.children);
1777
- if (domRows.length !== raw.length) return false;
1778
- rowIds = new Array(raw.length);
1779
- for (let i = 0; i < domRows.length; i++) {
1780
- const key = domRows[i].getAttribute("_hk");
1781
- if (key === null || !key.endsWith("0") || key.length < 2) return false;
1782
- rowIds[i] = key.slice(0, -1);
1783
- }
1784
- }
1785
- const rowFn = meta.row;
1786
- const endAnchor = marker ?? null;
1787
- const shallow = solidJs.storeIsShallow(subject);
1788
- let lastBodies = null;
1789
- let lastUnbinds = null;
1790
- const collectBind = (abs, build) => {
1791
- const prevC = rowCollector;
1792
- rowCollector = {
1793
- row: shallow ? subject[abs] : undefined,
1794
- bodies: [],
1795
- unbinds: []
1796
- };
1797
- try {
1798
- return build();
1799
- } finally {
1800
- lastBodies = rowCollector.bodies;
1801
- lastUnbinds = rowCollector.unbinds;
1802
- rowCollector = prevC;
1803
- }
1804
- };
1805
- const listOwner = solidJs.createOwner();
1806
- let declined = false;
1807
- const bindRow = (abs, claimId) => {
1808
- {
1809
- const o = listOwner;
1810
- const prevChild = o._firstChild;
1811
- const prevDisposal = o._disposal;
1812
- const node = collectBind(abs, () => solidJs.runWithOwner(listOwner, () => claimId !== undefined ? solidJs.runWithOwner(solidJs.createOwner({
1813
- id: claimId
1814
- }), () => solidJs.untrack(() => rowFn(subject[abs]))) : solidJs.untrack(() => rowFn(subject[abs]))));
1815
- if (o._firstChild !== prevChild || o._disposal !== prevDisposal) {
1816
- console.warn("A patch-mode list row created reactive computations or cleanups " + "during build (likely a handler/attribute value expression calling " + "createEffect/onCleanup). This work attaches to the LIST, not the " + "row, and will not dispose when the row is removed. Move owned " + "work into effects/refs (which opt the row out of patch mode).");
1817
- }
1818
- return node;
1819
- }
1820
- };
1821
- let entries = new Array(raw.length);
1822
- let rowBodies = shallow ? new Array(raw.length) : null;
1823
- let rowUnbinds = new Array(raw.length);
1824
- const runUnbinds = list => {
1825
- if (list !== undefined) for (let u = 0; u < list.length; u++) list[u]();
1826
- };
1827
- const unbindAllRows = () => {
1828
- for (let j = 0; j < rowUnbinds.length; j++) runUnbinds(rowUnbinds[j]);
1829
- rowUnbinds = [];
1830
- };
1831
- let prevRaws = raw.slice();
1832
- try {
1833
- if (hydrating) {
1834
- for (let i = 0; i < raw.length; i++) {
1835
- entries[i] = bindRow(i, rowIds[i]);
1836
- if (rowBodies !== null) rowBodies[i] = lastBodies;
1837
- rowUnbinds[i] = lastUnbinds;
1838
- }
1839
- } else {
1840
- for (let i = 0; i < raw.length; i++) {
1841
- const node = bindRow(i);
1842
- entries[i] = node;
1843
- if (rowBodies !== null) rowBodies[i] = lastBodies;
1844
- rowUnbinds[i] = lastUnbinds;
1845
- parent.insertBefore(node, endAnchor);
1846
- }
1847
- }
1848
- } catch (err) {
1849
- unbindAllRows();
1850
- runUnbinds(lastUnbinds ?? undefined);
1851
- for (let j = 0; j < entries.length; j++) {
1852
- const n = entries[j];
1853
- if (n !== undefined && n.parentNode === parent) n.remove();
1854
- }
1855
- listOwner.dispose();
1856
- throw err;
1857
- }
1858
- const identityOps = nextArr => {
1859
- const keyOf = r => {
1860
- const w = r != null ? solidJs.patchableRaw(r) : undefined;
1861
- return w !== undefined ? w : r;
1862
- };
1863
- const oldIndex = new Map();
1864
- for (let j = 0; j < prevRaws.length; j++) {
1865
- const k = keyOf(prevRaws[j]);
1866
- const existing = oldIndex.get(k);
1867
- if (existing === undefined) oldIndex.set(k, j);else if (Array.isArray(existing)) existing.push(j);else oldIndex.set(k, [existing, j]);
1868
- }
1869
- const sources = new Array(nextArr.length);
1870
- for (let k = 0; k < nextArr.length; k++) {
1871
- const m = oldIndex.get(keyOf(nextArr[k]));
1872
- if (m === undefined) sources[k] = -1;else if (Array.isArray(m)) {
1873
- sources[k] = m.shift();
1874
- if (m.length === 1) oldIndex.set(keyOf(nextArr[k]), m[0]);
1875
- } else {
1876
- sources[k] = m;
1877
- oldIndex.delete(keyOf(nextArr[k]));
1878
- }
1879
- }
1880
- return {
1881
- prefix: 0,
1882
- sources
1883
- };
1884
- };
1885
- let resyncNeeded = false;
1886
- const applyOps = (next, ops) => {
1887
- if (declined) return;
1888
- if (resyncNeeded) ops = null;
1889
- if (ops === null) ops = identityOps(next);
1890
- const {
1891
- prefix,
1892
- sources
1893
- } = ops;
1894
- const built = new Array(sources.length);
1895
- const builtBodies = rowBodies !== null ? new Array(sources.length) : null;
1896
- const builtUnbinds = new Array(sources.length);
1897
- let j = 0;
1898
- try {
1899
- for (; j < sources.length; j++) {
1900
- const abs = prefix + j;
1901
- const src = sources[j];
1902
- if (src === -1 || refRebuild && src >= 0 && next[abs] !== prevRaws[src]) {
1903
- built[j] = bindRow(abs);
1904
- if (builtBodies !== null) builtBodies[j] = lastBodies;
1905
- builtUnbinds[j] = lastUnbinds;
1906
- }
1907
- }
1908
- } catch (err) {
1909
- for (let k = 0; k < j; k++) runUnbinds(builtUnbinds[k]);
1910
- runUnbinds(lastUnbinds ?? undefined);
1911
- resyncNeeded = true;
1912
- throw err;
1913
- }
1914
- const retained = new Set();
1915
- for (let k = 0; k < sources.length; k++) {
1916
- if (sources[k] >= 0 && built[k] === undefined) retained.add(sources[k]);
1917
- }
1918
- for (let k = prefix; k < entries.length; k++) {
1919
- if (!retained.has(k)) {
1920
- entries[k].remove();
1921
- runUnbinds(rowUnbinds[k]);
1922
- }
1923
- }
1924
- const newEntries = new Array(prefix + sources.length);
1925
- const newBodies = rowBodies !== null ? new Array(prefix + sources.length) : null;
1926
- const newUnbinds = new Array(prefix + sources.length);
1927
- for (let i = 0; i < prefix; i++) {
1928
- newEntries[i] = entries[i];
1929
- if (newBodies !== null) newBodies[i] = rowBodies[i];
1930
- newUnbinds[i] = rowUnbinds[i];
1931
- }
1932
- const stable = lisPositions(sources);
1933
- let anchor = endAnchor;
1934
- for (let k = sources.length - 1; k >= 0; k--) {
1935
- const abs = prefix + k;
1936
- const src = sources[k];
1937
- let node;
1938
- if (built[k] !== undefined) {
1939
- node = built[k];
1940
- if (newBodies !== null) newBodies[abs] = builtBodies[k];
1941
- newUnbinds[abs] = builtUnbinds[k];
1942
- parent.insertBefore(node, anchor);
1943
- } else {
1944
- node = entries[src];
1945
- if (newBodies !== null) newBodies[abs] = rowBodies[src];
1946
- newUnbinds[abs] = rowUnbinds[src];
1947
- if (!stable.has(k)) parent.insertBefore(node, anchor);
1948
- }
1949
- newEntries[abs] = node;
1950
- anchor = node;
1951
- }
1952
- entries = newEntries;
1953
- if (newBodies !== null) rowBodies = newBodies;
1954
- rowUnbinds = newUnbinds;
1955
- prevRaws = next.slice();
1956
- resyncNeeded = false;
1957
- };
1958
- let unbindOps = solidJs.runWithOwner(listOwner, () => solidJs.registerRowOps(subject, applyOps));
1959
- const refRebuild = shallow && typeof meta.keyed !== "function";
1960
- const rebuildSlot = i => {
1961
- runUnbinds(rowUnbinds[i]);
1962
- const old = entries[i];
1963
- const node = bindRow(i);
1964
- rowBodies[i] = lastBodies;
1965
- rowUnbinds[i] = lastUnbinds;
1966
- parent.insertBefore(node, old);
1967
- old.remove();
1968
- entries[i] = node;
1969
- };
1970
- const applySlot = (i, next, prev) => {
1971
- if (declined) return;
1972
- if (resyncNeeded) {
1973
- const live = subject != null ? solidJs.patchableRaw(subject) : undefined;
1974
- if (live !== undefined && Array.isArray(live)) applyOps(live, null);
1975
- return;
1976
- }
1977
- if (refRebuild) {
1978
- rebuildSlot(i);
1979
- prevRaws[i] = next;
1980
- return;
1981
- }
1982
- const bodies = rowBodies[i];
1983
- if (bodies !== undefined) {
1984
- for (let b = 0; b < bodies.length; b++) bodies[b](next, prev, false);
1985
- }
1986
- prevRaws[i] = next;
1987
- };
1988
- let unbindSlots = shallow ? solidJs.runWithOwner(listOwner, () => solidJs.registerSlotPatch(subject, applySlot)) : null;
1989
- solidJs.runWithOwner(listOwner, () => effect(() => meta.each(), value => {
1990
- if (declined || value === subject) return;
1991
- const nextRaw = value != null ? solidJs.patchableRaw(value) : undefined;
1992
- unbindOps();
1993
- unbindSlots?.();
1994
- if (nextRaw !== undefined && Array.isArray(nextRaw) && solidJs.storeIsShallow(value) !== shallow) {
1995
- for (let j = 0; j < entries.length; j++) entries[j].remove();
1996
- entries = [];
1997
- prevRaws = [];
1998
- unbindAllRows();
1999
- subject = value;
2000
- declined = true;
2001
- listOwner.dispose();
2002
- lateClassic?.();
2003
- return;
2004
- }
2005
- if (nextRaw === undefined || !Array.isArray(nextRaw)) {
2006
- for (let j = 0; j < entries.length; j++) entries[j].remove();
2007
- entries = [];
2008
- prevRaws = [];
2009
- unbindAllRows();
2010
- subject = value;
2011
- declined = true;
2012
- listOwner.dispose();
2013
- lateClassic?.();
2014
- return;
2015
- }
2016
- const swapOps = identityOps(nextRaw);
2017
- subject = value;
2018
- unbindOps = solidJs.runWithOwner(listOwner, () => solidJs.registerRowOps(subject, applyOps));
2019
- if (shallow) unbindSlots = solidJs.runWithOwner(listOwner, () => solidJs.registerSlotPatch(subject, applySlot));
2020
- applyOps(nextRaw, swapOps);
2021
- }));
2022
- solidJs.onCleanup(() => {
2023
- unbindOps();
2024
- unbindSlots?.();
2025
- unbindAllRows();
2026
- listOwner.dispose();
2027
- });
2028
- return true;
2029
- };
2030
- const patchDriver = (subject, body) => {
2031
- const raw = solidJs.patchableRaw(subject);
2032
- if (raw !== undefined) {
2033
- if (!solidJs.sharedConfig.hydrating) body(raw, undefined, true);
2034
- const unbind = solidJs.registerPatch(subject, body);
2035
- if (rowCollector !== null) rowCollector.unbinds.push(unbind);
2036
- else solidJs.onCleanup(unbind);
2037
- } else if (rowCollector !== null && subject === rowCollector.row) {
2038
- rowCollector.bodies.push(body);
2039
- if (!solidJs.sharedConfig.hydrating) body(subject, undefined, true);
2040
- } else {
2041
- effect(() => body(subject, subject, false),
2042
- () => solidJs.untrack(() => body(subject, undefined, true)));
2043
- }
2044
- };
2045
-
2046
1826
  function throwInBrowser(func) {
2047
1827
  const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
2048
1828
  console.error(err);
@@ -2188,6 +1968,7 @@ function respond(value, init = {}) {
2188
1968
  responseInit,
2189
1969
  headers
2190
1970
  } = initWithRevalidate(init);
1971
+ for (const header of COMPOSED_BODY_FRAMING) headers.delete(header);
2191
1972
  if (NULL_BODY_STATUSES.has(responseInit.status)) {
2192
1973
  return new ResponseEnvelope(new Response(null, {
2193
1974
  ...responseInit,
@@ -2259,7 +2040,7 @@ const COMPONENT_BINDING = Symbol.for("solid.component-binding");
2259
2040
  function bindingOf(value) {
2260
2041
  return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
2261
2042
  }
2262
- function dynamic(source) {
2043
+ function dynamic(source, _options) {
2263
2044
  let latest = 0;
2264
2045
  const sites = new Set();
2265
2046
  let deliveredAddress;
@@ -2437,7 +2218,6 @@ exports.createRequestEvent = createRequestEvent;
2437
2218
  exports.createResponseStub = createResponseStub;
2438
2219
  exports.createSSRResponse = createSSRResponse;
2439
2220
  exports.delegateEvents = delegateEvents;
2440
- exports.driveList = driveList;
2441
2221
  exports.dynamic = dynamic;
2442
2222
  exports.dynamicProperty = dynamicProperty;
2443
2223
  exports.effect = effect;
@@ -2460,7 +2240,6 @@ exports.httpStatus = httpStatus;
2460
2240
  exports.hydrate = hydrate;
2461
2241
  exports.insert = insert;
2462
2242
  exports.installHydrationRuntime = installHydrationRuntime;
2463
- exports.installListDriver = installListDriver;
2464
2243
  exports.isDev = isDev;
2465
2244
  exports.isHref = isHref;
2466
2245
  exports.isResponseEnvelope = isResponseEnvelope;
@@ -2470,7 +2249,6 @@ exports.isServerFunction = isServerFunction;
2470
2249
  exports.markSafeError = markSafeError;
2471
2250
  exports.memo = memo;
2472
2251
  exports.parseCookieHeader = parseCookieHeader;
2473
- exports.patchDriver = patchDriver;
2474
2252
  exports.redirect = redirect;
2475
2253
  exports.ref = ref;
2476
2254
  exports.registerDelegatedContainer = registerDelegatedContainer;
@@ -2482,7 +2260,6 @@ exports.renderToStream = renderToStream;
2482
2260
  exports.renderToString = renderToString;
2483
2261
  exports.resolveSSRNode = resolveSSRNode;
2484
2262
  exports.respond = respond;
2485
- exports.rowProof = rowProof;
2486
2263
  exports.runHydrationEvents = runHydrationEvents;
2487
2264
  exports.scope = scope;
2488
2265
  exports.serializeCookie = serializeCookie;