@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
@@ -1,4 +1,4 @@
1
- import { createRenderEffect, createMemo, sharedConfig, enableHydration, untrack, runWithOwner, resetErrorHalt, enforceLoadingBoundary, createRoot, flatten, flush, getOwner, createOwner, patchableRaw, storeHasOptimisticFamily, storeIsShallow, registerRowOps, registerSlotPatch, onCleanup, registerPatch, createComponent, omit, createSignal, $DEVCOMP, createEffect } from 'solid-js';
1
+ import { createRenderEffect, getOwner, createMemo, sharedConfig, enableHydration, untrack, runWithOwner, resetErrorHalt, enforceLoadingBoundary, createRoot, flatten, flush, DEV, createComponent, omit, createOwner, createSignal, $DEVCOMP, onCleanup, createEffect } from 'solid-js';
2
2
  export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
3
3
 
4
4
  const DOMWithState = {
@@ -48,6 +48,7 @@ const Namespaces = {
48
48
  const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
49
49
  const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
50
50
  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(","));
51
+ const COMPOSED_BODY_FRAMING = /*#__PURE__*/new Set(["content-length", "content-encoding", "transfer-encoding"]);
51
52
 
52
53
  const transparentOptions = {
53
54
  transparent: true,
@@ -56,12 +57,32 @@ const transparentOptions = {
56
57
  const syncOptions = {
57
58
  sync: true
58
59
  };
60
+ let bindingEffect = null;
61
+ function tagElement(node) {
62
+ if (bindingEffect !== null && bindingEffect._devElement === undefined) bindingEffect._devElement = node;
63
+ }
59
64
  function effect(fn, effectFn, options) {
60
- createRenderEffect(fn, effectFn, options ? {
65
+ const nodeOptions = options ? {
61
66
  sync: true,
62
67
  ...options,
63
68
  transparent: !options.scope
64
- } : transparentOptions);
69
+ } : transparentOptions;
70
+ {
71
+ let node = null;
72
+ createRenderEffect(prev => {
73
+ node = getOwner();
74
+ return fn(prev);
75
+ }, (value, prev) => {
76
+ const outer = bindingEffect;
77
+ bindingEffect = node;
78
+ try {
79
+ return effectFn(value, prev);
80
+ } finally {
81
+ bindingEffect = outer;
82
+ }
83
+ }, nodeOptions);
84
+ return;
85
+ }
65
86
  }
66
87
  function memo(fn) {
67
88
  return createMemo(() => fn(), syncOptions);
@@ -210,12 +231,24 @@ function classifyHeadTag(desc) {
210
231
  resource: false
211
232
  };
212
233
  }
234
+ function qualifierValue(name, value) {
235
+ if (value == null || value === false) return null;
236
+ if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
237
+ const v = value === true ? "" : String(value);
238
+ if (name === "as") return asciiLowerCase(v);
239
+ if (name !== "crossorigin") return v;
240
+ return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
241
+ }
242
+ function asciiLowerCase(value) {
243
+ return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
244
+ }
213
245
  function resourceIdentity(tag, props) {
214
- let id = "res:" + tag + ":" + (props.rel || "") + ":" + (props.href || props.src || "");
246
+ const url = String(props.href || props.src || "");
247
+ let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
215
248
  for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
216
249
  const q = RESOURCE_QUALIFIERS[i];
217
- const value = props[q];
218
- if (value != null) id += ":" + q + "=" + (value === true ? "" : value);
250
+ const value = qualifierValue(q, props[q]);
251
+ if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
219
252
  }
220
253
  return id;
221
254
  }
@@ -355,11 +388,9 @@ const waitAsset = promise => {
355
388
  }
356
389
  gate();
357
390
  };
358
- let listDriver;
359
- function installListDriver(driver) {
360
- listDriver = driver;
361
- }
362
391
  const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
392
+ const $$EVENT_TUPLE = Symbol();
393
+ const hasOwn = Object.prototype.hasOwnProperty;
363
394
  const INNER_OWNED = {};
364
395
  const delegatedEvents = new Set();
365
396
  const delegatedContainers = new Map();
@@ -411,6 +442,7 @@ function render(code, element, init, options = {}) {
411
442
  }
412
443
  function create(html, bypassGuard, flag) {
413
444
  if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
445
+ 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.");
414
446
  const t = document.createElement("template");
415
447
  t.innerHTML = html;
416
448
  return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
@@ -461,10 +493,27 @@ function unregisterDelegatedContainer(container, owner = container) {
461
493
  }
462
494
  function attachDelegatedEvent(name, container, state) {
463
495
  if (state.handlers.has(name)) return;
464
- const handler = e => eventHandler(e, container, state);
496
+ const handler = e => dispatchAsInteraction(e, () => eventHandler(e, container, state)) ;
465
497
  state.handlers.set(name, handler);
466
498
  container.addEventListener(name, handler);
467
499
  }
500
+ function describeEventTarget(target) {
501
+ if (!target || typeof target.tagName !== "string") return undefined;
502
+ const tag = target.tagName.toLowerCase();
503
+ let out = tag;
504
+ if (target.id) out += `#${target.id}`;else if (typeof target.name === "string" && target.name) out += `[name=${target.name}]`;
505
+ if (tag !== "input" && tag !== "textarea" && tag !== "select") {
506
+ const text = (target.textContent || "").trim().replace(/\s+/g, " ");
507
+ if (text) out += ` "${text.length > 30 ? text.slice(0, 29) + "…" : text}"`;
508
+ }
509
+ return out;
510
+ }
511
+ function dispatchAsInteraction(e, fn) {
512
+ return DEV.attribution.withInteraction({
513
+ type: e.type,
514
+ target: describeEventTarget(e.target)
515
+ }, fn);
516
+ }
468
517
  function getDelegatedRoot(node) {
469
518
  while (node) {
470
519
  if (delegatedContainers.get(node)?.roots) return node;
@@ -484,8 +533,10 @@ function findOwner(target, state) {
484
533
  }
485
534
  }
486
535
  function setProperty(node, name, value) {
536
+ tagElement(node);
487
537
  if (isHydrating(node)) return;
488
- node[name] = value;
538
+ const nodeName = node.nodeName;
539
+ 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;
489
540
  }
490
541
  let claimHandlers = null;
491
542
  const CLAIM_SEAM = Symbol.for("solid.element-claims");
@@ -518,31 +569,54 @@ function claimElement(node) {
518
569
  return node;
519
570
  }
520
571
  function setAttribute(node, name, value) {
572
+ tagElement(node);
521
573
  if (isHydrating(node)) return;
522
- if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
574
+ const selectMultiple = name === "multiple" && node.localName === "select";
575
+ if (value == null || value === false) node.removeAttribute(name);else {
576
+ node.setAttribute(name, value === true ? "" : value);
577
+ if (selectMultiple && !node._$multiple) {
578
+ const options = node.options;
579
+ for (let i = 0; i < options.length; i++) {
580
+ if (options[i].defaultSelected) options[i].selected = true;
581
+ }
582
+ }
583
+ }
584
+ if (selectMultiple) node._$multiple = true;
523
585
  if (claimHandlers !== null && (name === "href" || name === "action")) claimElement(node);
524
586
  }
525
587
  function setAttributeNS(node, namespace, name, value) {
588
+ tagElement(node);
526
589
  if (isHydrating(node)) return;
527
590
  if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
528
591
  }
529
592
  function className(node, value, prev) {
530
- if (isHydrating(node)) return;
593
+ tagElement(node);
594
+ if (typeof value === "number") value = "" + value;
595
+ if (typeof prev === "number") prev = "" + prev;
596
+ if (isHydrating(node)) {
597
+ node._$classes = value && typeof value === "object" ? classListToObject(value) : undefined;
598
+ return;
599
+ }
531
600
  if (value == null || value === false) {
532
- prev && node.removeAttribute("class");
601
+ if (prev || node._$classes) {
602
+ node.removeAttribute("class");
603
+ node._$classes = undefined;
604
+ }
533
605
  return;
534
606
  }
535
607
  if (typeof value === "string") {
608
+ node._$classes = undefined;
536
609
  value !== prev && node.setAttribute("class", value);
537
610
  return;
538
611
  }
612
+ let applied;
539
613
  if (typeof prev === "string") {
540
- prev = {};
614
+ applied = {};
541
615
  node.removeAttribute("class");
542
- } else prev = classListToObject(prev || {});
616
+ } else applied = node._$classes || classListToObject(prev || {});
543
617
  value = classListToObject(value);
544
- const classKeys = Object.keys(value || {});
545
- const prevKeys = Object.keys(prev);
618
+ const classKeys = Object.keys(value);
619
+ const prevKeys = Object.keys(applied);
546
620
  let i, len;
547
621
  for (i = 0, len = prevKeys.length; i < len; i++) {
548
622
  const key = prevKeys[i];
@@ -552,22 +626,40 @@ function className(node, value, prev) {
552
626
  for (i = 0, len = classKeys.length; i < len; i++) {
553
627
  const key = classKeys[i],
554
628
  classValue = !!value[key];
555
- if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
629
+ if (!key || key === "undefined" || applied[key] === classValue || !classValue) continue;
556
630
  node.classList.add(key);
557
631
  }
632
+ node._$classes = value;
558
633
  }
559
634
  function addEvent(node, name, handler, delegate) {
560
635
  if (delegate) {
636
+ const key = `$$${name}`;
637
+ let data;
561
638
  if (Array.isArray(handler)) {
562
- node[`$$${name}`] = handler[0];
563
- node[`$$${name}Data`] = handler[1];
564
- } else node[`$$${name}`] = handler;
565
- } else if (Array.isArray(handler)) {
639
+ data = handler[1];
640
+ node[key] = handler[0];
641
+ } else node[key] = handler;
642
+ node[`${key}Data`] = data;
643
+ return;
644
+ }
645
+ if (Array.isArray(handler)) {
566
646
  const handlerFn = handler[0];
567
- node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
568
- } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
647
+ const listener = e => dispatchAsInteraction(e, () => handlerFn.call(node, handler[1], e)) ;
648
+ listener[$$EVENT_TUPLE] = handler;
649
+ node.addEventListener(name, listener);
650
+ return listener;
651
+ }
652
+ if (typeof handler === "function") {
653
+ const listener = e => dispatchAsInteraction(e, () => handler.call(node, e));
654
+ node.addEventListener(name, listener);
655
+ return listener;
656
+ }
657
+ node.addEventListener(name, handler, typeof handler !== "function" && handler);
658
+ return handler;
569
659
  }
570
660
  function style(node, value, prev) {
661
+ tagElement(node);
662
+ if (isHydrating(node)) return;
571
663
  if (!value) {
572
664
  if (prev || node._$styles) {
573
665
  setAttribute(node, "style");
@@ -592,12 +684,13 @@ function style(node, value, prev) {
592
684
  }
593
685
  let v, s;
594
686
  for (s in applied) {
595
- if (value[s] == null) {
687
+ if (!hasOwn.call(value, s) || value[s] == null) {
596
688
  nodeStyle.removeProperty(s);
597
689
  delete applied[s];
598
690
  }
599
691
  }
600
692
  for (s in value) {
693
+ if (!hasOwn.call(value, s)) continue;
601
694
  v = value[s];
602
695
  if (v != null && v !== applied[s]) {
603
696
  nodeStyle.setProperty(s, v);
@@ -606,20 +699,27 @@ function style(node, value, prev) {
606
699
  }
607
700
  }
608
701
  function setStyleProperty(node, name, value) {
702
+ tagElement(node);
703
+ if (isHydrating(node)) return;
609
704
  value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
610
705
  }
611
- function spread(node, props = {}, skipChildren) {
706
+ function spread(node, props, skipChildren) {
612
707
  const prevProps = {};
613
- const get = typeof props === "function" ? props : () => props;
614
- if (!skipChildren) insert(node, () => get().children);
708
+ const get = () => (typeof props === "function" ? props() : props) ?? {};
709
+ if (!skipChildren) insert(node, () => {
710
+ const source = get();
711
+ return hasOwn.call(source, "children") ? source.children : undefined;
712
+ });
615
713
  effect(() => {
616
- const r = get().ref;
714
+ const source = get();
715
+ const r = hasOwn.call(source, "ref") && source.ref;
617
716
  (typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
618
717
  }, () => {});
619
718
  effect(() => {
620
719
  const source = get();
621
720
  const newProps = {};
622
721
  for (const prop in source) {
722
+ if (!hasOwn.call(source, prop)) continue;
623
723
  if (prop === "children" || prop === "ref") continue;
624
724
  newProps[prop] = source[prop];
625
725
  }
@@ -712,11 +812,6 @@ function insert(parent, accessor, marker, initial, options) {
712
812
  const host = options && options.host;
713
813
  if (multi && !initial) initial = [];
714
814
  if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
715
- if (listDriver !== undefined && typeof accessor === "function" && accessor.$ll !== undefined) {
716
- const listAccessor = accessor;
717
- const owner = getOwner();
718
- if (listDriver(parent, accessor, marker, () => runWithOwner(owner, () => insert(parent, () => listAccessor(), marker, marker !== undefined ? [] : undefined, options)))) return;
719
- }
720
815
  if (typeof accessor !== "function") {
721
816
  accessor = normalize(accessor, initial, multi, true);
722
817
  if (typeof accessor !== "function") {
@@ -754,6 +849,7 @@ function insert(parent, accessor, marker, initial, options) {
754
849
  } : SCOPE_OPTIONS : options);
755
850
  }
756
851
  function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
852
+ tagElement(node);
757
853
  const nodeName = node.nodeName;
758
854
  props || (props = {});
759
855
  for (const prop in prevProps) {
@@ -776,10 +872,16 @@ function assetEntryKey(descriptor) {
776
872
  if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
777
873
  return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
778
874
  }
779
- function findAssetElement(selector, attr, value) {
875
+ function findAssetElement(selector, attr, value, qualifiers) {
780
876
  const nodes = document.querySelectorAll(selector);
781
- for (let i = 0; i < nodes.length; i++) {
782
- if (nodes[i].getAttribute(attr) === value) return nodes[i];
877
+ outer: for (let i = 0; i < nodes.length; i++) {
878
+ if (nodes[i].getAttribute(attr) !== value) continue;
879
+ if (!qualifiers) return nodes[i];
880
+ for (let q = 0; q < RESOURCE_QUALIFIERS.length; q++) {
881
+ const name = RESOURCE_QUALIFIERS[q];
882
+ if (qualifierValue(name, qualifiers[name]) !== qualifierValue(name, nodes[i].getAttribute(name))) continue outer;
883
+ }
884
+ return nodes[i];
783
885
  }
784
886
  return null;
785
887
  }
@@ -1085,8 +1187,8 @@ function mountHeadResource(tag, props) {
1085
1187
  headMountedResources.add(identity);
1086
1188
  const url = props.href || props.src;
1087
1189
  let el = null;
1088
- if (url != null) {
1089
- 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);
1190
+ if (tag === "link" && url == null && typeof props.imagesrcset === "string") el = findAssetElement(`link[rel="${props.rel}"]`, "href", null, props);else if (url != null) {
1191
+ 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);
1090
1192
  }
1091
1193
  if (!el) document.head.appendChild(createHeadElement(tag, props));
1092
1194
  }
@@ -1453,7 +1555,8 @@ function classListToObject(classList) {
1453
1555
  function flattenClassList(list, result) {
1454
1556
  for (let i = 0, len = list.length; i < len; i++) {
1455
1557
  const item = list[i];
1456
- 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;
1558
+ if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);
1559
+ else if (typeof item !== "boolean" && (item || item === 0)) result[item] = true;
1457
1560
  }
1458
1561
  }
1459
1562
  function assignProp(node, prop, value, prev, skipRef, nodeName) {
@@ -1469,12 +1572,13 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
1469
1572
  const name = prop.slice(2).toLowerCase();
1470
1573
  const delegate = DelegatedEvents.has(name);
1471
1574
  if (!delegate && prev) {
1472
- const h = Array.isArray(prev) ? prev[0] : prev;
1473
- node.removeEventListener(name, h);
1575
+ if (Array.isArray(value) && typeof prev === "function" && prev[$$EVENT_TUPLE] === value) return prev;
1576
+ node.removeEventListener(name, prev, typeof prev !== "function" && prev);
1474
1577
  }
1475
1578
  if (delegate || value) {
1476
- addEvent(node, name, value, delegate);
1579
+ const attached = addEvent(node, name, value, delegate);
1477
1580
  delegate && delegateEvents([name]);
1581
+ if (!delegate) return attached;
1478
1582
  }
1479
1583
  } else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
1480
1584
  if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
@@ -1514,7 +1618,7 @@ function eventHandler(e, container, state) {
1514
1618
  }
1515
1619
  if (handler && !node.disabled) {
1516
1620
  const data = node[`${key}Data`];
1517
- data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
1621
+ data !== undefined ? handler.call(node, data, e) : typeof handler === "function" ? handler.call(node, e) : handler.handleEvent(e);
1518
1622
  if (e.cancelBubble) return;
1519
1623
  }
1520
1624
  node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
@@ -1557,6 +1661,7 @@ function eventHandler(e, container, state) {
1557
1661
  retarget(oriTarget);
1558
1662
  }
1559
1663
  function insertExpression(parent, value, current, marker) {
1664
+ tagElement(parent);
1560
1665
  if (hydrationRt !== null && isHydrating(parent)) {
1561
1666
  if (value && value !== current) {
1562
1667
  const arr = Array.isArray(value);
@@ -1634,7 +1739,7 @@ function normalize(value, current, multi, doNotUnwrap) {
1634
1739
  const item = value[i],
1635
1740
  prev = current && current[i],
1636
1741
  t = typeof item;
1637
- if ((t === "string" || t === "number") && prev && prev.nodeType === 3) value[i] = prev;
1742
+ if ((t === "string" || t === "number") && prev && prev.nodeType === 3 && isHydrating(prev)) value[i] = prev;
1638
1743
  }
1639
1744
  }
1640
1745
  return value;
@@ -1717,331 +1822,6 @@ function getHydrationKey() {
1717
1822
  }
1718
1823
  const RequestContext = Symbol();
1719
1824
 
1720
- const PURE_ROW = Symbol.for("solid.pure-row");
1721
- const arm = () => {
1722
- installListDriver(driveList);
1723
- };
1724
- function rowProof(fn) {
1725
- arm();
1726
- fn[PURE_ROW] = true;
1727
- return fn;
1728
- }
1729
- let rowCollector = null;
1730
- const lisPositions = sources => {
1731
- const n = sources.length;
1732
- const tails = [];
1733
- const tailsIdx = [];
1734
- const prev = new Array(n).fill(-1);
1735
- for (let j = 0; j < n; j++) {
1736
- const v = sources[j];
1737
- if (v === -1) continue;
1738
- let lo = 0,
1739
- hi = tails.length;
1740
- while (lo < hi) {
1741
- const mid = lo + hi >> 1;
1742
- if (tails[mid] < v) lo = mid + 1;else hi = mid;
1743
- }
1744
- if (lo > 0) prev[j] = tailsIdx[lo - 1];
1745
- tails[lo] = v;
1746
- tailsIdx[lo] = j;
1747
- }
1748
- const stable = new Set();
1749
- let k = tailsIdx.length ? tailsIdx[tails.length - 1] : -1;
1750
- while (k >= 0) {
1751
- stable.add(k);
1752
- k = prev[k];
1753
- }
1754
- return stable;
1755
- };
1756
- const driveList = (parent, listFn, marker, lateClassic) => {
1757
- const meta = listFn.$ll;
1758
- if (meta.row?.[PURE_ROW] !== true) return false;
1759
- if (typeof meta.keyed === "function") return false;
1760
- const evalOwner = createOwner({
1761
- id: "&each"
1762
- });
1763
- let subject = runWithOwner(evalOwner, () => untrack(meta.each));
1764
- evalOwner.dispose();
1765
- let raw = subject != null ? patchableRaw(subject) : undefined;
1766
- if (raw === undefined || !Array.isArray(raw)) return false;
1767
- const optimistic = storeHasOptimisticFamily(subject);
1768
- if (optimistic) raw = untrack(() => Array.from(subject));
1769
- const hydrating = !!sharedConfig.hydrating;
1770
- if (hydrating && raw.length === 0) return false;
1771
- let domRows;
1772
- let rowIds;
1773
- if (hydrating) {
1774
- if (marker !== undefined) return false;
1775
- domRows = Array.from(parent.children);
1776
- if (domRows.length !== raw.length) return false;
1777
- rowIds = new Array(raw.length);
1778
- for (let i = 0; i < domRows.length; i++) {
1779
- const key = domRows[i].getAttribute("_hk");
1780
- if (key === null || !key.endsWith("0") || key.length < 2) return false;
1781
- rowIds[i] = key.slice(0, -1);
1782
- }
1783
- }
1784
- const rowFn = meta.row;
1785
- const endAnchor = marker ?? null;
1786
- const shallow = storeIsShallow(subject);
1787
- let lastBodies = null;
1788
- let lastUnbinds = null;
1789
- const collectBind = (abs, build) => {
1790
- const prevC = rowCollector;
1791
- rowCollector = {
1792
- row: shallow ? subject[abs] : undefined,
1793
- bodies: [],
1794
- unbinds: []
1795
- };
1796
- try {
1797
- return build();
1798
- } finally {
1799
- lastBodies = rowCollector.bodies;
1800
- lastUnbinds = rowCollector.unbinds;
1801
- rowCollector = prevC;
1802
- }
1803
- };
1804
- const listOwner = createOwner();
1805
- let declined = false;
1806
- const bindRow = (abs, claimId) => {
1807
- {
1808
- const o = listOwner;
1809
- const prevChild = o._firstChild;
1810
- const prevDisposal = o._disposal;
1811
- const node = collectBind(abs, () => runWithOwner(listOwner, () => claimId !== undefined ? runWithOwner(createOwner({
1812
- id: claimId
1813
- }), () => untrack(() => rowFn(subject[abs]))) : untrack(() => rowFn(subject[abs]))));
1814
- if (o._firstChild !== prevChild || o._disposal !== prevDisposal) {
1815
- 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).");
1816
- }
1817
- return node;
1818
- }
1819
- };
1820
- let entries = new Array(raw.length);
1821
- let rowBodies = shallow ? new Array(raw.length) : null;
1822
- let rowUnbinds = new Array(raw.length);
1823
- const runUnbinds = list => {
1824
- if (list !== undefined) for (let u = 0; u < list.length; u++) list[u]();
1825
- };
1826
- const unbindAllRows = () => {
1827
- for (let j = 0; j < rowUnbinds.length; j++) runUnbinds(rowUnbinds[j]);
1828
- rowUnbinds = [];
1829
- };
1830
- let prevRaws = raw.slice();
1831
- try {
1832
- if (hydrating) {
1833
- for (let i = 0; i < raw.length; i++) {
1834
- entries[i] = bindRow(i, rowIds[i]);
1835
- if (rowBodies !== null) rowBodies[i] = lastBodies;
1836
- rowUnbinds[i] = lastUnbinds;
1837
- }
1838
- } else {
1839
- for (let i = 0; i < raw.length; i++) {
1840
- const node = bindRow(i);
1841
- entries[i] = node;
1842
- if (rowBodies !== null) rowBodies[i] = lastBodies;
1843
- rowUnbinds[i] = lastUnbinds;
1844
- parent.insertBefore(node, endAnchor);
1845
- }
1846
- }
1847
- } catch (err) {
1848
- unbindAllRows();
1849
- runUnbinds(lastUnbinds ?? undefined);
1850
- for (let j = 0; j < entries.length; j++) {
1851
- const n = entries[j];
1852
- if (n !== undefined && n.parentNode === parent) n.remove();
1853
- }
1854
- listOwner.dispose();
1855
- throw err;
1856
- }
1857
- const identityOps = nextArr => {
1858
- const keyOf = r => {
1859
- const w = r != null ? patchableRaw(r) : undefined;
1860
- return w !== undefined ? w : r;
1861
- };
1862
- const oldIndex = new Map();
1863
- for (let j = 0; j < prevRaws.length; j++) {
1864
- const k = keyOf(prevRaws[j]);
1865
- const existing = oldIndex.get(k);
1866
- if (existing === undefined) oldIndex.set(k, j);else if (Array.isArray(existing)) existing.push(j);else oldIndex.set(k, [existing, j]);
1867
- }
1868
- const sources = new Array(nextArr.length);
1869
- for (let k = 0; k < nextArr.length; k++) {
1870
- const m = oldIndex.get(keyOf(nextArr[k]));
1871
- if (m === undefined) sources[k] = -1;else if (Array.isArray(m)) {
1872
- sources[k] = m.shift();
1873
- if (m.length === 1) oldIndex.set(keyOf(nextArr[k]), m[0]);
1874
- } else {
1875
- sources[k] = m;
1876
- oldIndex.delete(keyOf(nextArr[k]));
1877
- }
1878
- }
1879
- return {
1880
- prefix: 0,
1881
- sources
1882
- };
1883
- };
1884
- let resyncNeeded = false;
1885
- const applyOps = (next, ops) => {
1886
- if (declined) return;
1887
- if (resyncNeeded) ops = null;
1888
- if (ops === null) ops = identityOps(next);
1889
- const {
1890
- prefix,
1891
- sources
1892
- } = ops;
1893
- const built = new Array(sources.length);
1894
- const builtBodies = rowBodies !== null ? new Array(sources.length) : null;
1895
- const builtUnbinds = new Array(sources.length);
1896
- let j = 0;
1897
- try {
1898
- for (; j < sources.length; j++) {
1899
- const abs = prefix + j;
1900
- const src = sources[j];
1901
- if (src === -1 || refRebuild && src >= 0 && next[abs] !== prevRaws[src]) {
1902
- built[j] = bindRow(abs);
1903
- if (builtBodies !== null) builtBodies[j] = lastBodies;
1904
- builtUnbinds[j] = lastUnbinds;
1905
- }
1906
- }
1907
- } catch (err) {
1908
- for (let k = 0; k < j; k++) runUnbinds(builtUnbinds[k]);
1909
- runUnbinds(lastUnbinds ?? undefined);
1910
- resyncNeeded = true;
1911
- throw err;
1912
- }
1913
- const retained = new Set();
1914
- for (let k = 0; k < sources.length; k++) {
1915
- if (sources[k] >= 0 && built[k] === undefined) retained.add(sources[k]);
1916
- }
1917
- for (let k = prefix; k < entries.length; k++) {
1918
- if (!retained.has(k)) {
1919
- entries[k].remove();
1920
- runUnbinds(rowUnbinds[k]);
1921
- }
1922
- }
1923
- const newEntries = new Array(prefix + sources.length);
1924
- const newBodies = rowBodies !== null ? new Array(prefix + sources.length) : null;
1925
- const newUnbinds = new Array(prefix + sources.length);
1926
- for (let i = 0; i < prefix; i++) {
1927
- newEntries[i] = entries[i];
1928
- if (newBodies !== null) newBodies[i] = rowBodies[i];
1929
- newUnbinds[i] = rowUnbinds[i];
1930
- }
1931
- const stable = lisPositions(sources);
1932
- let anchor = endAnchor;
1933
- for (let k = sources.length - 1; k >= 0; k--) {
1934
- const abs = prefix + k;
1935
- const src = sources[k];
1936
- let node;
1937
- if (built[k] !== undefined) {
1938
- node = built[k];
1939
- if (newBodies !== null) newBodies[abs] = builtBodies[k];
1940
- newUnbinds[abs] = builtUnbinds[k];
1941
- parent.insertBefore(node, anchor);
1942
- } else {
1943
- node = entries[src];
1944
- if (newBodies !== null) newBodies[abs] = rowBodies[src];
1945
- newUnbinds[abs] = rowUnbinds[src];
1946
- if (!stable.has(k)) parent.insertBefore(node, anchor);
1947
- }
1948
- newEntries[abs] = node;
1949
- anchor = node;
1950
- }
1951
- entries = newEntries;
1952
- if (newBodies !== null) rowBodies = newBodies;
1953
- rowUnbinds = newUnbinds;
1954
- prevRaws = next.slice();
1955
- resyncNeeded = false;
1956
- };
1957
- let unbindOps = runWithOwner(listOwner, () => registerRowOps(subject, applyOps));
1958
- const refRebuild = shallow && typeof meta.keyed !== "function";
1959
- const rebuildSlot = i => {
1960
- runUnbinds(rowUnbinds[i]);
1961
- const old = entries[i];
1962
- const node = bindRow(i);
1963
- rowBodies[i] = lastBodies;
1964
- rowUnbinds[i] = lastUnbinds;
1965
- parent.insertBefore(node, old);
1966
- old.remove();
1967
- entries[i] = node;
1968
- };
1969
- const applySlot = (i, next, prev) => {
1970
- if (declined) return;
1971
- if (resyncNeeded) {
1972
- const live = subject != null ? patchableRaw(subject) : undefined;
1973
- if (live !== undefined && Array.isArray(live)) applyOps(live, null);
1974
- return;
1975
- }
1976
- if (refRebuild) {
1977
- rebuildSlot(i);
1978
- prevRaws[i] = next;
1979
- return;
1980
- }
1981
- const bodies = rowBodies[i];
1982
- if (bodies !== undefined) {
1983
- for (let b = 0; b < bodies.length; b++) bodies[b](next, prev, false);
1984
- }
1985
- prevRaws[i] = next;
1986
- };
1987
- let unbindSlots = shallow ? runWithOwner(listOwner, () => registerSlotPatch(subject, applySlot)) : null;
1988
- runWithOwner(listOwner, () => effect(() => meta.each(), value => {
1989
- if (declined || value === subject) return;
1990
- const nextRaw = value != null ? patchableRaw(value) : undefined;
1991
- unbindOps();
1992
- unbindSlots?.();
1993
- if (nextRaw !== undefined && Array.isArray(nextRaw) && storeIsShallow(value) !== shallow) {
1994
- for (let j = 0; j < entries.length; j++) entries[j].remove();
1995
- entries = [];
1996
- prevRaws = [];
1997
- unbindAllRows();
1998
- subject = value;
1999
- declined = true;
2000
- listOwner.dispose();
2001
- lateClassic?.();
2002
- return;
2003
- }
2004
- if (nextRaw === undefined || !Array.isArray(nextRaw)) {
2005
- for (let j = 0; j < entries.length; j++) entries[j].remove();
2006
- entries = [];
2007
- prevRaws = [];
2008
- unbindAllRows();
2009
- subject = value;
2010
- declined = true;
2011
- listOwner.dispose();
2012
- lateClassic?.();
2013
- return;
2014
- }
2015
- const swapOps = identityOps(nextRaw);
2016
- subject = value;
2017
- unbindOps = runWithOwner(listOwner, () => registerRowOps(subject, applyOps));
2018
- if (shallow) unbindSlots = runWithOwner(listOwner, () => registerSlotPatch(subject, applySlot));
2019
- applyOps(nextRaw, swapOps);
2020
- }));
2021
- onCleanup(() => {
2022
- unbindOps();
2023
- unbindSlots?.();
2024
- unbindAllRows();
2025
- listOwner.dispose();
2026
- });
2027
- return true;
2028
- };
2029
- const patchDriver = (subject, body) => {
2030
- const raw = patchableRaw(subject);
2031
- if (raw !== undefined) {
2032
- if (!sharedConfig.hydrating) body(raw, undefined, true);
2033
- const unbind = registerPatch(subject, body);
2034
- if (rowCollector !== null) rowCollector.unbinds.push(unbind);
2035
- else onCleanup(unbind);
2036
- } else if (rowCollector !== null && subject === rowCollector.row) {
2037
- rowCollector.bodies.push(body);
2038
- if (!sharedConfig.hydrating) body(subject, undefined, true);
2039
- } else {
2040
- effect(() => body(subject, subject, false),
2041
- () => untrack(() => body(subject, undefined, true)));
2042
- }
2043
- };
2044
-
2045
1825
  function throwInBrowser(func) {
2046
1826
  const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
2047
1827
  console.error(err);
@@ -2187,6 +1967,7 @@ function respond(value, init = {}) {
2187
1967
  responseInit,
2188
1968
  headers
2189
1969
  } = initWithRevalidate(init);
1970
+ for (const header of COMPOSED_BODY_FRAMING) headers.delete(header);
2190
1971
  if (NULL_BODY_STATUSES.has(responseInit.status)) {
2191
1972
  return new ResponseEnvelope(new Response(null, {
2192
1973
  ...responseInit,
@@ -2258,7 +2039,7 @@ const COMPONENT_BINDING = Symbol.for("solid.component-binding");
2258
2039
  function bindingOf(value) {
2259
2040
  return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
2260
2041
  }
2261
- function dynamic(source) {
2042
+ function dynamic(source, _options) {
2262
2043
  let latest = 0;
2263
2044
  const sites = new Set();
2264
2045
  let deliveredAddress;
@@ -2346,4 +2127,4 @@ _moduleUrl) {
2346
2127
  function httpStatus(_code, _text) {}
2347
2128
  function httpHeader(_name, _value, _options) {}
2348
2129
 
2349
- export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, driveList, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installListDriver, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, listDriver, markSafeError, memo, 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, waitAsset, warmAsset };
2130
+ export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, 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, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, 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, waitAsset, warmAsset };