@qwik.dev/core 2.0.0-alpha.7 → 2.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core 2.0.0-alpha.7-dev+a26598a
3
+ * @qwik.dev/core 2.0.0-alpha.8-dev+66037b5
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -168,9 +168,7 @@ const ComponentStylesPrefixContent = "⚡️";
168
168
 
169
169
  const QSlot = "q:slot";
170
170
 
171
- const QSlotParent = ":";
172
-
173
- const QSlotRef = "q:sref";
171
+ const QSlotParent = "q:sparent";
174
172
 
175
173
  const QSlotS = "q:s";
176
174
 
@@ -716,7 +714,7 @@ const STORE_TARGET = Symbol("store.target");
716
714
 
717
715
  const STORE_HANDLER = Symbol("store.handler");
718
716
 
719
- const STORE_ARRAY_PROP = Symbol("store.array");
717
+ const STORE_ALL_PROPS = Symbol("store.all");
720
718
 
721
719
  var StoreFlags;
722
720
 
@@ -772,7 +770,7 @@ class StoreHandler {
772
770
  assertTrue(!ctx.$container$ || ctx.$container$ === this.$container$, "Do not use signals across containers");
773
771
  }
774
772
  const effectSubscriber = ctx.$effectSubscriber$;
775
- effectSubscriber && addEffect(target, Array.isArray(target) ? STORE_ARRAY_PROP : prop, this, effectSubscriber);
773
+ effectSubscriber && addStoreEffect(target, Array.isArray(target) ? STORE_ALL_PROPS : prop, this, effectSubscriber);
776
774
  }
777
775
  if ("toString" === prop && value === Object.prototype.toString) {
778
776
  return this.toString;
@@ -803,7 +801,7 @@ class StoreHandler {
803
801
  const ctx = tryGetInvokeContext();
804
802
  if (ctx) {
805
803
  const effectSubscriber = ctx.$effectSubscriber$;
806
- effectSubscriber && addEffect(target, Array.isArray(target) ? STORE_ARRAY_PROP : prop, this, effectSubscriber);
804
+ effectSubscriber && addStoreEffect(target, Array.isArray(target) ? STORE_ALL_PROPS : prop, this, effectSubscriber);
807
805
  }
808
806
  }
809
807
  return Object.prototype.hasOwnProperty.call(target, prop);
@@ -811,7 +809,7 @@ class StoreHandler {
811
809
  ownKeys(target) {
812
810
  const ctx = tryGetInvokeContext();
813
811
  const effectSubscriber = ctx?.$effectSubscriber$;
814
- return effectSubscriber && addEffect(target, STORE_ARRAY_PROP, this, effectSubscriber),
812
+ return effectSubscriber && addStoreEffect(target, STORE_ALL_PROPS, this, effectSubscriber),
815
813
  Reflect.ownKeys(target);
816
814
  }
817
815
  getOwnPropertyDescriptor(target, prop) {
@@ -823,7 +821,7 @@ class StoreHandler {
823
821
  }
824
822
  }
825
823
 
826
- function addEffect(target, prop, store, effectSubscription) {
824
+ function addStoreEffect(target, prop, store, effectSubscription) {
827
825
  const effectsMap = store.$effects$ ||= new Map;
828
826
  let effects = effectsMap.get(prop);
829
827
  effects || (effects = new Set, effectsMap.set(prop, effects)), ensureContainsSubscription(effects, effectSubscription),
@@ -848,7 +846,7 @@ function getEffects(target, prop, storeEffects) {
848
846
  effectsToTrigger = storeEffects.get(prop);
849
847
  }
850
848
  }
851
- const storeArrayValue = storeEffects?.get(STORE_ARRAY_PROP);
849
+ const storeArrayValue = storeEffects?.get(STORE_ALL_PROPS);
852
850
  if (storeArrayValue) {
853
851
  effectsToTrigger ||= new Set;
854
852
  for (const effect of storeArrayValue) {
@@ -995,6 +993,10 @@ const runTask = (task, container, host) => {
995
993
  if (isSignal(obj)) {
996
994
  return obj.value;
997
995
  }
996
+ if (isStore(obj)) {
997
+ return addStoreEffect(getStoreTarget(obj), STORE_ALL_PROPS, getStoreHandler(obj), ctx.$effectSubscriber$),
998
+ obj;
999
+ }
998
1000
  throw qError(QError.trackObjectWithoutProp);
999
1001
  }));
1000
1002
  },
@@ -1080,13 +1082,13 @@ var VirtualVNodeProps;
1080
1082
  VirtualVNodeProps[VirtualVNodeProps.PROPS_OFFSET = 6] = "PROPS_OFFSET";
1081
1083
  }(VirtualVNodeProps || (VirtualVNodeProps = {}));
1082
1084
 
1083
- const mapApp_findIndx = (elementVNode, key, start) => {
1085
+ const mapApp_findIndx = (array, key, start) => {
1084
1086
  assertTrue(start % 2 == 0, "Expecting even number.");
1085
1087
  let bottom = start >> 1;
1086
- let top = elementVNode.length - 2 >> 1;
1088
+ let top = array.length - 2 >> 1;
1087
1089
  for (;bottom <= top; ) {
1088
1090
  const mid = bottom + (top - bottom >> 1);
1089
- const midKey = elementVNode[mid << 1];
1091
+ const midKey = array[mid << 1];
1090
1092
  if (midKey === key) {
1091
1093
  return mid << 1;
1092
1094
  }
@@ -1095,14 +1097,14 @@ const mapApp_findIndx = (elementVNode, key, start) => {
1095
1097
  return ~(bottom << 1);
1096
1098
  };
1097
1099
 
1098
- const mapArray_set = (elementVNode, key, value, start) => {
1099
- const indx = mapApp_findIndx(elementVNode, key, start);
1100
- indx >= 0 ? null == value ? elementVNode.splice(indx, 2) : elementVNode[indx + 1] = value : null != value && elementVNode.splice(~indx, 0, key, value);
1100
+ const mapArray_set = (array, key, value, start) => {
1101
+ const indx = mapApp_findIndx(array, key, start);
1102
+ indx >= 0 ? null == value ? array.splice(indx, 2) : array[indx + 1] = value : null != value && array.splice(~indx, 0, key, value);
1101
1103
  };
1102
1104
 
1103
- const mapArray_get = (elementVNode, key, start) => {
1104
- const indx = mapApp_findIndx(elementVNode, key, start);
1105
- return indx >= 0 ? elementVNode[indx + 1] : null;
1105
+ const mapArray_get = (array, key, start) => {
1106
+ const indx = mapApp_findIndx(array, key, start);
1107
+ return indx >= 0 ? array[indx + 1] : null;
1106
1108
  };
1107
1109
 
1108
1110
  const isForeignObjectElement = elementName => isDev ? "foreignobject" === elementName.toLowerCase() : "foreignObject" === elementName;
@@ -1410,10 +1412,6 @@ function isSlotProp(prop) {
1410
1412
  return !prop.startsWith("q:") && !prop.startsWith(":");
1411
1413
  }
1412
1414
 
1413
- function isParentSlotProp(prop) {
1414
- return prop.startsWith(":");
1415
- }
1416
-
1417
1415
  const _restProps = (props, omit, target = {}) => {
1418
1416
  let constPropsTarget = null;
1419
1417
  const constProps = props[_CONST_PROPS];
@@ -1575,9 +1573,10 @@ const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
1575
1573
  function expectProjection() {
1576
1574
  const slotName = jsxValue.key;
1577
1575
  vCurrent = vnode_getProp(vParent, slotName, (id => vnode_locate(container.rootVNode, id))),
1576
+ vCurrent = vCurrent && vCurrent[VNodeProps.flags] & VNodeFlags.Deleted ? null : vCurrent,
1578
1577
  null == vCurrent && (vNewNode = vnode_newVirtual(), isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Projection),
1579
1578
  isDev && vnode_setProp(vNewNode, "q:code", "expectProjection"), vnode_setProp(vNewNode, QSlot, slotName),
1580
- vnode_setProp(vNewNode, ":", vParent), vnode_setProp(vParent, slotName, vNewNode));
1579
+ vnode_setProp(vNewNode, "q:sparent", vParent), vnode_setProp(vParent, slotName, vNewNode));
1581
1580
  }
1582
1581
  function expectSlot() {
1583
1582
  const vHost = vnode_getProjectionParentComponent(vParent, container.rootVNode);
@@ -1593,19 +1592,27 @@ const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
1593
1592
  return directGetPropsProxyProp(jsxNode, "name") || "";
1594
1593
  }(vHost);
1595
1594
  const vProjectedNode = vHost ? vnode_getProp(vHost, slotNameKey, null) : null;
1596
- return null == vProjectedNode ? (vnode_insertBefore(journal, vParent, vNewNode = vnode_newVirtual(), vCurrent && getInsertBefore()),
1597
- vnode_setProp(vNewNode, QSlot, slotNameKey), vHost && vnode_setProp(vHost, slotNameKey, vNewNode),
1598
- isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Projection), isDev && vnode_setProp(vNewNode, "q:code", "expectSlot" + count++),
1599
- !1) : (vProjectedNode === vCurrent || (vnode_insertBefore(journal, vParent, vNewNode = vProjectedNode, vCurrent && getInsertBefore()),
1600
- vnode_setProp(vNewNode, QSlot, slotNameKey), vHost && vnode_setProp(vHost, slotNameKey, vNewNode),
1601
- isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Projection), isDev && vnode_setProp(vNewNode, "q:code", "expectSlot" + count++)),
1602
- !0);
1595
+ if (null == vProjectedNode) {
1596
+ return vnode_insertBefore(journal, vParent, vNewNode = vnode_newVirtual(), vCurrent && getInsertBefore()),
1597
+ vnode_setProp(vNewNode, QSlot, slotNameKey), vHost && vnode_setProp(vHost, slotNameKey, vNewNode),
1598
+ isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Projection), isDev && vnode_setProp(vNewNode, "q:code", "expectSlot" + count++),
1599
+ !1;
1600
+ }
1601
+ if (vProjectedNode === vCurrent) {} else {
1602
+ const parent = vnode_getParent(vProjectedNode);
1603
+ !(!parent || vnode_isElementVNode(parent) && vnode_getElementName(parent) === QTemplate) && vParent !== parent && vnode_remove(journal, parent, vProjectedNode, !1),
1604
+ vnode_insertBefore(journal, vParent, vNewNode = vProjectedNode, vCurrent && getInsertBefore()),
1605
+ vnode_setProp(vNewNode, QSlot, slotNameKey), vHost && vnode_setProp(vHost, slotNameKey, vNewNode),
1606
+ isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Projection), isDev && vnode_setProp(vNewNode, "q:code", "expectSlot" + count++);
1607
+ }
1608
+ return !0;
1603
1609
  }
1604
1610
  function expectNoMore() {
1605
1611
  if (assertFalse(vParent === vCurrent, "Parent and current can't be the same"), null !== vCurrent) {
1606
1612
  for (;vCurrent; ) {
1607
1613
  const toRemove = vCurrent;
1608
- advanceToNextSibling(), cleanup(container, toRemove), vParent === vnode_getParent(toRemove) && vnode_remove(journal, vParent, toRemove, !0);
1614
+ advanceToNextSibling(), vParent === vnode_getParent(toRemove) && (cleanup(container, toRemove),
1615
+ vnode_remove(journal, vParent, toRemove, !0));
1609
1616
  }
1610
1617
  }
1611
1618
  }
@@ -1825,7 +1832,7 @@ const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
1825
1832
  const vNodeComponentHash = getComponentHash(host, container.$getObjectById$);
1826
1833
  const lookupKey = jsxNode.key || componentHash;
1827
1834
  if (lookupKey === (getKey(host) || vNodeComponentHash) ? componentHash === vNodeComponentHash || (insertNewComponent(host, componentQRL, jsxProps),
1828
- vNewNode && (host = vNewNode, shouldRender = !0)) : (vNewNode = retrieveChildWithKey(null, lookupKey),
1835
+ host = vNewNode, shouldRender = !0) : (vNewNode = retrieveChildWithKey(null, lookupKey),
1829
1836
  vNewNode ? vnode_insertBefore(journal, vParent, vNewNode, vCurrent) : insertNewComponent(host, componentQRL, jsxProps),
1830
1837
  host = vNewNode, shouldRender = !0), host) {
1831
1838
  const vNodeProps = vnode_getProp(host, "q:props", container.$getObjectById$);
@@ -1863,13 +1870,11 @@ const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
1863
1870
  }(jsxNode.children, host);
1864
1871
  } else {
1865
1872
  const lookupKey = jsxNode.key;
1866
- if (lookupKey === getKey(host) || (vNewNode = retrieveChildWithKey(null, lookupKey),
1867
- vNewNode ? vnode_insertBefore(journal, vParent, vNewNode, vCurrent) : function() {
1868
- vnode_insertBefore(journal, vParent, vNewNode = vnode_newVirtual(), vCurrent && getInsertBefore());
1869
- const jsxNode = jsxValue;
1870
- isDev && vnode_setProp(vNewNode, "q:type", VirtualType.InlineComponent), vnode_setProp(vNewNode, "q:props", jsxNode.props),
1871
- jsxNode.key && vnode_setProp(vNewNode, "q:key", jsxNode.key);
1872
- }(), host = vNewNode), host) {
1873
+ const lookupKeysAreEqual = lookupKey === getKey(host);
1874
+ const vNodeComponentHash = getComponentHash(host, container.$getObjectById$);
1875
+ if (lookupKeysAreEqual ? null != vNodeComponentHash && (insertNewInlineComponent(),
1876
+ host = vNewNode) : (vNewNode = retrieveChildWithKey(null, lookupKey), vNewNode ? vnode_insertBefore(journal, vParent, vNewNode, vCurrent) : insertNewInlineComponent(),
1877
+ host = vNewNode), host) {
1873
1878
  let componentHost = host;
1874
1879
  for (;componentHost && (!vnode_isVirtualVNode(componentHost) || null === vnode_getProp(componentHost, "q:renderFn", null)); ) {
1875
1880
  componentHost = vnode_getParent(componentHost);
@@ -1885,6 +1890,12 @@ const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
1885
1890
  isDev && vnode_setProp(vNewNode, "q:type", VirtualType.Component), container.setHostProp(vNewNode, "q:renderFn", componentQRL),
1886
1891
  container.setHostProp(vNewNode, "q:props", jsxProps), container.setHostProp(vNewNode, "q:key", jsxNode.key);
1887
1892
  }
1893
+ function insertNewInlineComponent() {
1894
+ vnode_insertBefore(journal, vParent, vNewNode = vnode_newVirtual(), vCurrent && getInsertBefore());
1895
+ const jsxNode = jsxValue;
1896
+ isDev && vnode_setProp(vNewNode, "q:type", VirtualType.InlineComponent), vnode_setProp(vNewNode, "q:props", jsxNode.props),
1897
+ jsxNode.key && vnode_setProp(vNewNode, "q:key", jsxNode.key);
1898
+ }
1888
1899
  function expectText(text) {
1889
1900
  if (null !== vCurrent) {
1890
1901
  if (3 === vnode_getType(vCurrent)) {
@@ -1940,7 +1951,7 @@ function removePropsKeys(keys, propKeys) {
1940
1951
  function cleanup(container, vNode) {
1941
1952
  let vCursor = vNode;
1942
1953
  if (vnode_isTextVNode(vNode)) {
1943
- return;
1954
+ return void markVNodeAsDeleted(vCursor);
1944
1955
  }
1945
1956
  let vParent = null;
1946
1957
  for (;;) {
@@ -1961,8 +1972,7 @@ function cleanup(container, vNode) {
1961
1972
  if (type & VNodeFlags.Virtual && null !== vnode_getProp(vCursor, "q:renderFn", null)) {
1962
1973
  const attrs = vnode_getProps(vCursor);
1963
1974
  for (let i = 0; i < attrs.length; i += 2) {
1964
- const key = attrs[i];
1965
- if (!isParentSlotProp(key) && isSlotProp(key)) {
1975
+ if (isSlotProp(attrs[i])) {
1966
1976
  const value = attrs[i + 1];
1967
1977
  if (value) {
1968
1978
  attrs[i + 1] = null;
@@ -1976,7 +1986,7 @@ function cleanup(container, vNode) {
1976
1986
  }
1977
1987
  }
1978
1988
  }
1979
- if (type & VNodeFlags.Virtual && null !== vnode_getProp(vCursor, QSlot, null)) {
1989
+ if (vnode_isProjection(vCursor)) {
1980
1990
  if (vCursor === vNode) {
1981
1991
  const vFirstChild = vnode_getFirstChild(vCursor);
1982
1992
  if (vFirstChild) {
@@ -1990,6 +2000,8 @@ function cleanup(container, vNode) {
1990
2000
  continue;
1991
2001
  }
1992
2002
  }
2003
+ } else {
2004
+ type & VNodeFlags.Text && markVNodeAsDeleted(vCursor);
1993
2005
  }
1994
2006
  if (vCursor === vNode) {
1995
2007
  return;
@@ -2172,10 +2184,10 @@ const vnode_documentPosition = (a, b, rootVNode) => {
2172
2184
  let aDepth = -1;
2173
2185
  let bDepth = -1;
2174
2186
  for (;a; ) {
2175
- a = (aVNodePath[++aDepth] = a)[VNodeProps.parent] || rootVNode && vnode_getProp(a, ":", (id => vnode_locate(rootVNode, id)));
2187
+ a = (aVNodePath[++aDepth] = a)[VNodeProps.parent] || rootVNode && vnode_getProp(a, "q:sparent", (id => vnode_locate(rootVNode, id)));
2176
2188
  }
2177
2189
  for (;b; ) {
2178
- b = (bVNodePath[++bDepth] = b)[VNodeProps.parent] || rootVNode && vnode_getProp(b, ":", (id => vnode_locate(rootVNode, id)));
2190
+ b = (bVNodePath[++bDepth] = b)[VNodeProps.parent] || rootVNode && vnode_getProp(b, "q:sparent", (id => vnode_locate(rootVNode, id)));
2179
2191
  }
2180
2192
  for (;aDepth >= 0 && bDepth >= 0; ) {
2181
2193
  if ((a = aVNodePath[aDepth]) !== (b = bVNodePath[bDepth])) {
@@ -2191,7 +2203,7 @@ const vnode_documentPosition = (a, b, rootVNode) => {
2191
2203
  return -1;
2192
2204
  }
2193
2205
  } while (cursor);
2194
- return rootVNode && vnode_getProp(b, ":", (id => vnode_locate(rootVNode, id))) ? -1 : 1;
2206
+ return rootVNode && vnode_getProp(b, "q:sparent", (id => vnode_locate(rootVNode, id))) ? -1 : 1;
2195
2207
  }
2196
2208
  aDepth--, bDepth--;
2197
2209
  }
@@ -2495,6 +2507,16 @@ const DEBUG = !1;
2495
2507
 
2496
2508
  const log = (...args) => console.log("SIGNAL", ...args.map(qwikDebugToString));
2497
2509
 
2510
+ var SignalFlags;
2511
+
2512
+ var WrappedSignalFlags;
2513
+
2514
+ !function(SignalFlags) {
2515
+ SignalFlags[SignalFlags.INVALID = 1] = "INVALID";
2516
+ }(SignalFlags || (SignalFlags = {})), function(WrappedSignalFlags) {
2517
+ WrappedSignalFlags[WrappedSignalFlags.UNWRAP = 2] = "UNWRAP";
2518
+ }(WrappedSignalFlags || (WrappedSignalFlags = {}));
2519
+
2498
2520
  const throwIfQRLNotResolved = qrl => {
2499
2521
  if (!qrl.resolved) {
2500
2522
  throw qrl.resolve();
@@ -2561,7 +2583,7 @@ class Signal {
2561
2583
  qDev;
2562
2584
  }
2563
2585
  toString() {
2564
- return `[${this.constructor.name}${this.$invalid$ ? " INVALID" : ""} ${String(this.$untrackedValue$)}]` + (Array.from(this.$effects$ || []).map((e => "\n -> " + pad(qwikDebugToString(e[0]), " "))).join("\n") || "");
2586
+ return `[${this.constructor.name}${this.$flags$ & SignalFlags.INVALID ? " INVALID" : ""} ${String(this.$untrackedValue$)}]` + (Array.from(this.$effects$ || []).map((e => "\n -> " + pad(qwikDebugToString(e[0]), " "))).join("\n") || "");
2565
2587
  }
2566
2588
  toJSON() {
2567
2589
  return {
@@ -2630,16 +2652,17 @@ const triggerEffects = (container, signal, effects) => {
2630
2652
 
2631
2653
  class ComputedSignal extends Signal {
2632
2654
  $computeQrl$;
2633
- $invalid$=!0;
2655
+ $flags$;
2634
2656
  $forceRunEffects$=!1;
2635
- constructor(container, fn) {
2636
- super(container, NEEDS_COMPUTATION), this.$computeQrl$ = fn;
2657
+ [_EFFECT_BACK_REF]=null;
2658
+ constructor(container, fn, flags = SignalFlags.INVALID) {
2659
+ super(container, NEEDS_COMPUTATION), this.$computeQrl$ = fn, this.$flags$ = flags;
2637
2660
  }
2638
2661
  $invalidate$() {
2639
- this.$invalid$ = !0, this.$forceRunEffects$ = !1, this.$container$?.$scheduler$(ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, null, this);
2662
+ this.$flags$ |= SignalFlags.INVALID, this.$forceRunEffects$ = !1, this.$container$?.$scheduler$(ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, null, this);
2640
2663
  }
2641
2664
  force() {
2642
- this.$invalid$ = !0, this.$forceRunEffects$ = !1, triggerEffects(this.$container$, this, this.$effects$);
2665
+ this.$flags$ |= SignalFlags.INVALID, this.$forceRunEffects$ = !1, triggerEffects(this.$container$, this, this.$effects$);
2643
2666
  }
2644
2667
  get untrackedValue() {
2645
2668
  const didChange = this.$computeIfNeeded$();
@@ -2647,7 +2670,7 @@ class ComputedSignal extends Signal {
2647
2670
  this.$untrackedValue$;
2648
2671
  }
2649
2672
  $computeIfNeeded$() {
2650
- if (!this.$invalid$) {
2673
+ if (!(this.$flags$ & SignalFlags.INVALID)) {
2651
2674
  return !1;
2652
2675
  }
2653
2676
  const computeQrl = this.$computeQrl$;
@@ -2660,7 +2683,7 @@ class ComputedSignal extends Signal {
2660
2683
  if (isPromise(untrackedValue)) {
2661
2684
  throw qError(QError.computedNotSync, [ computeQrl.dev ? computeQrl.dev.file : "", computeQrl.$hash$ ]);
2662
2685
  }
2663
- this.$invalid$ = !1;
2686
+ this.$flags$ &= ~SignalFlags.INVALID;
2664
2687
  const didChange = untrackedValue !== this.$untrackedValue$;
2665
2688
  return didChange && (this.$untrackedValue$ = untrackedValue), didChange;
2666
2689
  } finally {
@@ -2679,18 +2702,19 @@ class WrappedSignal extends Signal {
2679
2702
  $args$;
2680
2703
  $func$;
2681
2704
  $funcStr$;
2682
- $invalid$=!0;
2705
+ $flags$;
2683
2706
  $hostElement$=null;
2684
2707
  $forceRunEffects$=!1;
2685
2708
  [_EFFECT_BACK_REF]=null;
2686
- constructor(container, fn, args, fnStr) {
2687
- super(container, NEEDS_COMPUTATION), this.$args$ = args, this.$func$ = fn, this.$funcStr$ = fnStr;
2709
+ constructor(container, fn, args, fnStr, flags = SignalFlags.INVALID | WrappedSignalFlags.UNWRAP) {
2710
+ super(container, NEEDS_COMPUTATION), this.$args$ = args, this.$func$ = fn, this.$funcStr$ = fnStr,
2711
+ this.$flags$ = flags;
2688
2712
  }
2689
2713
  $invalidate$() {
2690
- this.$invalid$ = !0, this.$forceRunEffects$ = !1, this.$container$?.$scheduler$(ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, this.$hostElement$, this);
2714
+ this.$flags$ |= SignalFlags.INVALID, this.$forceRunEffects$ = !1, this.$container$?.$scheduler$(ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, this.$hostElement$, this);
2691
2715
  }
2692
2716
  force() {
2693
- this.$invalid$ = !0, this.$forceRunEffects$ = !1, triggerEffects(this.$container$, this, this.$effects$);
2717
+ this.$flags$ |= SignalFlags.INVALID, this.$forceRunEffects$ = !1, triggerEffects(this.$container$, this, this.$effects$);
2694
2718
  }
2695
2719
  get untrackedValue() {
2696
2720
  const didChange = this.$computeIfNeeded$();
@@ -2698,7 +2722,7 @@ class WrappedSignal extends Signal {
2698
2722
  this.$untrackedValue$;
2699
2723
  }
2700
2724
  $computeIfNeeded$() {
2701
- if (!this.$invalid$) {
2725
+ if (!(this.$flags$ & SignalFlags.INVALID)) {
2702
2726
  return !1;
2703
2727
  }
2704
2728
  const untrackedValue = trackSignal((() => this.$func$(...this.$args$)), this, EffectProperty.VNODE, this.$container$);
@@ -2813,7 +2837,7 @@ function processJSXNode(ssr, enqueue, value, options) {
2813
2837
  const componentFrame = options.parentComponentFrame || ssr.unclaimedProjectionComponentFrameQueue.shift();
2814
2838
  if (componentFrame) {
2815
2839
  const projectionAttrs = isDev ? [ "q:type", VirtualType.Projection ] : [];
2816
- projectionAttrs.push(":", componentFrame.componentNode.id || ""), ssr.openProjection(projectionAttrs);
2840
+ projectionAttrs.push("q:sparent", componentFrame.componentNode.id || ""), ssr.openProjection(projectionAttrs);
2817
2841
  const host = componentFrame.componentNode;
2818
2842
  const node = ssr.getLastNode();
2819
2843
  const slotName = getSlotName(host, jsx, ssr);
@@ -2970,7 +2994,7 @@ function appendClassIfScopedStyleExists(jsx, styleScoped) {
2970
2994
  jsx.constProps.class = "");
2971
2995
  }
2972
2996
 
2973
- const version = "2.0.0-alpha.7-dev+a26598a";
2997
+ const version = "2.0.0-alpha.8-dev+66037b5";
2974
2998
 
2975
2999
  class _SharedContainer {
2976
3000
  $version$;
@@ -3009,7 +3033,7 @@ const _wrapProp = (...args) => {
3009
3033
  }
3010
3034
  if (isSignal(obj)) {
3011
3035
  return assertEqual(prop, "value", "Left side is a signal, prop must be value"),
3012
- obj instanceof WrappedSignal ? obj : getWrapped(args);
3036
+ obj instanceof WrappedSignal && obj.flags & WrappedSignalFlags.UNWRAP ? obj : getWrapped(args);
3013
3037
  }
3014
3038
  if (isPropsProxy(obj)) {
3015
3039
  const constProps = obj[_CONST_PROPS];
@@ -3026,6 +3050,11 @@ const _wrapProp = (...args) => {
3026
3050
  return getWrapped(args);
3027
3051
  };
3028
3052
 
3053
+ const _wrapStore = (obj, prop) => {
3054
+ const value = getStoreTarget(obj)[prop];
3055
+ return isSignal(value) ? value : new WrappedSignal(null, getProp, [ obj, prop ], null, SignalFlags.INVALID);
3056
+ };
3057
+
3029
3058
  const _wrapSignal = (obj, prop) => {
3030
3059
  const r = _wrapProp(obj, prop);
3031
3060
  return r === _IMMUTABLE ? obj[prop] : r;
@@ -3154,7 +3183,7 @@ class PropsProxyHandler {
3154
3183
  return this.$children$;
3155
3184
  }
3156
3185
  const value = this.$constProps$ && prop in this.$constProps$ ? this.$constProps$[prop] : this.$varProps$[prop];
3157
- return value instanceof WrappedSignal ? value.value : value;
3186
+ return value instanceof WrappedSignal && value.$flags$ & WrappedSignalFlags.UNWRAP ? value.value : value;
3158
3187
  }
3159
3188
  set(_, prop, value) {
3160
3189
  return prop === _CONST_PROPS ? (this.$constProps$ = value, !0) : prop === _VAR_PROPS ? (this.$varProps$ = value,
@@ -3305,8 +3334,8 @@ const VNodeDataChar = {
3305
3334
  ID_CHAR: "=",
3306
3335
  PROPS: 62,
3307
3336
  PROPS_CHAR: ">",
3308
- SLOT_REF: 63,
3309
- SLOT_REF_CHAR: "?",
3337
+ SLOT_PARENT: 63,
3338
+ SLOT_PARENT_CHAR: "?",
3310
3339
  KEY: 64,
3311
3340
  KEY_CHAR: "@",
3312
3341
  SEQ: 91,
@@ -3405,6 +3434,11 @@ const vnode_isVirtualVNode = vNode => {
3405
3434
  return (vNode[VNodeProps.flags] & VNodeFlags.Virtual) === VNodeFlags.Virtual;
3406
3435
  };
3407
3436
 
3437
+ const vnode_isProjection = vNode => {
3438
+ assertDefined(vNode, "Missing vNode");
3439
+ return (vNode[VNodeProps.flags] & VNodeFlags.Virtual) === VNodeFlags.Virtual && null !== vnode_getProp(vNode, QSlot, null);
3440
+ };
3441
+
3408
3442
  const ensureTextVNode = vNode => (assertTrue(vnode_isTextVNode(vNode), "Expecting TextVNode was: " + vnode_getNodeTypeName(vNode)),
3409
3443
  vNode);
3410
3444
 
@@ -3685,7 +3719,7 @@ const vnode_applyJournal = journal => {
3685
3719
  let key = journal[idx++];
3686
3720
  "className" === key && (key = "class");
3687
3721
  const value = journal[idx++];
3688
- isBooleanAttr(element, key) ? element[key] = parseBoolean(value) : "value" === key && key in element ? element.value = escapeHTML(String(value)) : key === dangerouslySetInnerHTML ? element.innerHTML = value : null == value || !1 === value ? element.removeAttribute(key) : element.setAttribute(key, String(value));
3722
+ isBooleanAttr(element, key) ? element[key] = parseBoolean(value) : "value" === key && key in element ? element.value = String(value) : key === dangerouslySetInnerHTML ? element.innerHTML = value : null == value || !1 === value ? element.removeAttribute(key) : element.setAttribute(key, String(value));
3689
3723
  break;
3690
3724
 
3691
3725
  case VNodeJournalOpCode.HoistStyles:
@@ -4189,8 +4223,6 @@ function materializeFromVNodeData(vParent, vData, element, child) {
4189
4223
  container.$setRawState$(parseInt(id), vParent), isDev && vnode_setAttr(null, vParent, "q:id", id);
4190
4224
  } else if (peek() === VNodeDataChar.PROPS) {
4191
4225
  vnode_setAttr(null, vParent, "q:props", consumeValue());
4192
- } else if (peek() === VNodeDataChar.SLOT_REF) {
4193
- vnode_setAttr(null, vParent, "q:sref", consumeValue());
4194
4226
  } else if (peek() === VNodeDataChar.KEY) {
4195
4227
  vnode_setAttr(null, vParent, "q:key", consumeValue());
4196
4228
  } else if (peek() === VNodeDataChar.SEQ) {
@@ -4199,6 +4231,8 @@ function materializeFromVNodeData(vParent, vData, element, child) {
4199
4231
  vnode_setAttr(null, vParent, "q:seqIdx", consumeValue());
4200
4232
  } else if (peek() === VNodeDataChar.BACK_REFS) {
4201
4233
  container || (container = getDomContainer(element)), setEffectBackRefFromVNodeData(vParent, consumeValue(), container);
4234
+ } else if (peek() === VNodeDataChar.SLOT_PARENT) {
4235
+ vnode_setProp(vParent, "q:sparent", consumeValue());
4202
4236
  } else if (peek() === VNodeDataChar.CONTEXT) {
4203
4237
  vnode_setAttr(null, vParent, "q:ctx", consumeValue());
4204
4238
  } else if (peek() === VNodeDataChar.OPEN) {
@@ -4248,7 +4282,7 @@ const vnode_getProjectionParentComponent = (vHost, rootVNode) => {
4248
4282
  let projectionDepth = 1;
4249
4283
  for (;projectionDepth--; ) {
4250
4284
  for (;vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, "q:renderFn", null)); ) {
4251
- const qSlotParent = vnode_getProp(vHost, ":", (id => vnode_locate(rootVNode, id)));
4285
+ const qSlotParent = vnode_getProp(vHost, "q:sparent", (id => vnode_locate(rootVNode, id)));
4252
4286
  const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
4253
4287
  vProjectionParent && projectionDepth++, vHost = vProjectionParent || vnode_getParent(vHost);
4254
4288
  }
@@ -4713,7 +4747,7 @@ class DomContainer extends _SharedContainer {
4713
4747
  if (null !== vnode_getProp(vNode, "q:renderFn", null)) {
4714
4748
  return vNode;
4715
4749
  }
4716
- vNode = vnode_getParent(vNode) || vnode_getProp(vNode, ":", this.vNodeLocate);
4750
+ vNode = vnode_getParent(vNode) || vnode_getProp(vNode, "q:sparent", this.vNodeLocate);
4717
4751
  } else {
4718
4752
  vNode = vnode_getParent(vNode);
4719
4753
  }
@@ -4943,7 +4977,8 @@ const inflate = (container, target, typeId, data) => {
4943
4977
  const signal = target;
4944
4978
  const d = data;
4945
4979
  signal.$func$ = container.getSyncFn(d[0]), signal.$args$ = d[1], signal[_EFFECT_BACK_REF] = d[2],
4946
- signal.$untrackedValue$ = d[3], signal.$hostElement$ = d[4], signal.$effects$ = new Set(d.slice(5));
4980
+ signal.$untrackedValue$ = d[3], signal.$flags$ = d[4], signal.$hostElement$ = d[5],
4981
+ signal.$effects$ = new Set(d.slice(6));
4947
4982
  break;
4948
4983
  }
4949
4984
 
@@ -4951,7 +4986,7 @@ const inflate = (container, target, typeId, data) => {
4951
4986
  {
4952
4987
  const computed = target;
4953
4988
  const d = data;
4954
- computed.$computeQrl$ = d[0], computed.$effects$ = d[1], 3 === d.length ? computed.$untrackedValue$ = d[2] : (computed.$invalid$ = !0,
4989
+ computed.$computeQrl$ = d[0], computed.$effects$ = d[1], 3 === d.length ? computed.$untrackedValue$ = d[2] : (computed.$flags$ |= SignalFlags.INVALID,
4955
4990
  computed.$computeQrl$.resolve(), container.$scheduler$?.(ChoreType.QRL_RESOLVE, null, computed.$computeQrl$));
4956
4991
  break;
4957
4992
  }
@@ -5047,7 +5082,7 @@ const inflate = (container, target, typeId, data) => {
5047
5082
  return target;
5048
5083
  };
5049
5084
 
5050
- const _constants = [ void 0, null, !0, !1, "", EMPTY_ARRAY, EMPTY_OBJ, NEEDS_COMPUTATION, STORE_ARRAY_PROP, Slot, Fragment, NaN, 1 / 0, -1 / 0, Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER - 1, Number.MIN_SAFE_INTEGER ];
5085
+ const _constants = [ void 0, null, !0, !1, "", EMPTY_ARRAY, EMPTY_OBJ, NEEDS_COMPUTATION, STORE_ALL_PROPS, Slot, Fragment, NaN, 1 / 0, -1 / 0, Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER - 1, Number.MIN_SAFE_INTEGER ];
5051
5086
 
5052
5087
  const allocate = (container, typeId, value) => {
5053
5088
  if (void 0 === value) {
@@ -5282,10 +5317,11 @@ const createSerializationContext = (NodeConstructor, DomRefConstructor, symbolTo
5282
5317
  discoveredValues.push(k, v);
5283
5318
  }));
5284
5319
  } else if (obj instanceof Signal) {
5285
- const v = obj instanceof WrappedSignal ? obj.untrackedValue : obj instanceof ComputedSignal && (obj.$invalid$ || fastSkipSerialize(obj)) ? NEEDS_COMPUTATION : obj.$untrackedValue$;
5286
- v !== NEEDS_COMPUTATION && discoveredValues.push(v), obj.$effects$ && discoveredValues.push(...obj.$effects$),
5320
+ const v = obj instanceof WrappedSignal ? obj.untrackedValue : obj instanceof ComputedSignal && (obj.$flags$ & SignalFlags.INVALID || fastSkipSerialize(obj)) ? NEEDS_COMPUTATION : obj.$untrackedValue$;
5321
+ v !== NEEDS_COMPUTATION && discoveredValues.push(v), obj.$effects$ && discoveredValues.push(obj.$effects$),
5287
5322
  obj instanceof WrappedSignal ? (discoverEffectBackRefs(obj[_EFFECT_BACK_REF], discoveredValues),
5288
- obj.$args$ && discoveredValues.push(...obj.$args$), obj.$hostElement$ && discoveredValues.push(obj.$hostElement$)) : obj instanceof ComputedSignal && discoveredValues.push(obj.$computeQrl$);
5323
+ obj.$args$ && discoveredValues.push(...obj.$args$), obj.$hostElement$ && discoveredValues.push(obj.$hostElement$)) : obj instanceof ComputedSignal && (discoverEffectBackRefs(obj[_EFFECT_BACK_REF], discoveredValues),
5324
+ discoveredValues.push(obj.$computeQrl$));
5289
5325
  } else if (obj instanceof Task) {
5290
5326
  discoveredValues.push(obj.$el$, obj.$qrl$, obj.$state$), discoverEffectBackRefs(obj[_EFFECT_BACK_REF], discoveredValues);
5291
5327
  } else if (isSsrNode(obj)) {
@@ -5361,16 +5397,7 @@ const discoverValuesForVNodeData = (vnodeData, discoveredValues) => {
5361
5397
  };
5362
5398
 
5363
5399
  const discoverEffectBackRefs = (effectsBackRefs, discoveredValues) => {
5364
- if (effectsBackRefs) {
5365
- let hasBackRefs = !1;
5366
- for (const [, effect] of effectsBackRefs) {
5367
- if (effect[EffectSubscriptionProp.BACK_REF]) {
5368
- hasBackRefs = !0;
5369
- break;
5370
- }
5371
- }
5372
- hasBackRefs && discoveredValues.push(effectsBackRefs);
5373
- }
5400
+ effectsBackRefs && discoveredValues.push(effectsBackRefs);
5374
5401
  };
5375
5402
 
5376
5403
  const promiseResults = new WeakMap;
@@ -5440,10 +5467,10 @@ function serialize(serializationContext) {
5440
5467
  } else if (value === NEEDS_COMPUTATION) {
5441
5468
  output(TypeIds.Constant, Constants.NEEDS_COMPUTATION);
5442
5469
  } else {
5443
- if (value !== STORE_ARRAY_PROP) {
5470
+ if (value !== STORE_ALL_PROPS) {
5444
5471
  throw qError(QError.serializeErrorUnknownType, [ typeof value ]);
5445
5472
  }
5446
- output(TypeIds.Constant, Constants.STORE_ARRAY_PROP);
5473
+ output(TypeIds.Constant, Constants.STORE_ALL_PROPS);
5447
5474
  }
5448
5475
  };
5449
5476
  const writeObjectValue = (value, idx) => {
@@ -5501,9 +5528,9 @@ function serialize(serializationContext) {
5501
5528
  } else if ($isDomRef$(value)) {
5502
5529
  value.$ssrNode$.vnodeData[0] |= VNodeDataFlag.SERIALIZE, output(TypeIds.RefVNode, value.$ssrNode$.id);
5503
5530
  } else if (value instanceof Signal) {
5504
- const v = value instanceof ComputedSignal && (value.$invalid$ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
5531
+ const v = value instanceof ComputedSignal && (value.$flags$ & SignalFlags.INVALID || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
5505
5532
  if (value instanceof WrappedSignal) {
5506
- output(TypeIds.WrappedSignal, [ ...serializeWrappingFn(serializationContext, value), filterEffectBackRefs(value[_EFFECT_BACK_REF]), v, value.$hostElement$, ...value.$effects$ || [] ]);
5533
+ output(TypeIds.WrappedSignal, [ ...serializeWrappingFn(serializationContext, value), filterEffectBackRefs(value[_EFFECT_BACK_REF]), v, value.$flags$, value.$hostElement$, ...value.$effects$ || [] ]);
5507
5534
  } else if (value instanceof ComputedSignal) {
5508
5535
  const out = [ value.$computeQrl$, value.$effects$ ];
5509
5536
  v !== NEEDS_COMPUTATION && out.push(v), output(TypeIds.ComputedSignal, out);
@@ -5797,7 +5824,7 @@ var Constants;
5797
5824
  Constants[Constants.True = 2] = "True", Constants[Constants.False = 3] = "False",
5798
5825
  Constants[Constants.EmptyString = 4] = "EmptyString", Constants[Constants.EMPTY_ARRAY = 5] = "EMPTY_ARRAY",
5799
5826
  Constants[Constants.EMPTY_OBJ = 6] = "EMPTY_OBJ", Constants[Constants.NEEDS_COMPUTATION = 7] = "NEEDS_COMPUTATION",
5800
- Constants[Constants.STORE_ARRAY_PROP = 8] = "STORE_ARRAY_PROP", Constants[Constants.Slot = 9] = "Slot",
5827
+ Constants[Constants.STORE_ALL_PROPS = 8] = "STORE_ALL_PROPS", Constants[Constants.Slot = 9] = "Slot",
5801
5828
  Constants[Constants.Fragment = 10] = "Fragment", Constants[Constants.NaN = 11] = "NaN",
5802
5829
  Constants[Constants.PositiveInfinity = 12] = "PositiveInfinity", Constants[Constants.NegativeInfinity = 13] = "NegativeInfinity",
5803
5830
  Constants[Constants.MaxSafeInt = 14] = "MaxSafeInt", Constants[Constants.AlmostMaxSafeInt = 15] = "AlmostMaxSafeInt",
@@ -6422,4 +6449,4 @@ const PrefetchGraph = (opts = {}) => {
6422
6449
  }, null, 0, "prefetch-graph");
6423
6450
  };
6424
6451
 
6425
- export { $, Fragment, PrefetchGraph, PrefetchServiceWorker, RenderOnce, Resource, SSRComment, SSRRaw, SSRStream, SSRStreamBlock, SkipRender, Slot, _CONST_PROPS, DomContainer as _DomContainer, _EFFECT_BACK_REF, EMPTY_ARRAY as _EMPTY_ARRAY, SubscriptionData as _EffectData, _IMMUTABLE, _SharedContainer, _VAR_PROPS, _deserialize, _fnSignal, _getContextElement, _getContextEvent, getDomContainer as _getDomContainer, _getQContainerElement, isJSXNode as _isJSXNode, isStringifiable as _isStringifiable, _jsxBranch, _jsxC, _jsxQ, _jsxS, _jsxSorted, _jsxSplit, _noopQrl, _noopQrlDEV, _qrlSync, _regSymbol, _restProps, queueQRL as _run, _serialize, scheduleTask as _task, verifySerializable as _verifySerializable, _waitUntilRendered, _walkJSX, _weakSerialize, _wrapProp, _wrapSignal, component$, componentQrl, createComputed$, createComputedQrl, createContextId, h as createElement, createSignal, event$, eventQrl, getDomContainer, getLocale, getPlatform, h, implicit$FirstArg, inlinedQrl, inlinedQrlDEV, isSignal, jsx, jsxDEV, jsx as jsxs, noSerialize, qrl, qrlDEV, render, setPlatform, sync$, untrack, unwrapStore, useComputed$, useComputedQrl, useConstant, useContext, useContextProvider, useErrorBoundary, useId, useLexicalScope, useOn, useOnDocument, useOnWindow, useResource$, useResourceQrl, useServerData, useSignal, useStore, useStyles$, useStylesQrl, useStylesScoped$, useStylesScopedQrl, useTask$, useTaskQrl, useVisibleTask$, useVisibleTaskQrl, version, withLocale };
6452
+ export { $, Fragment, PrefetchGraph, PrefetchServiceWorker, RenderOnce, Resource, SSRComment, SSRRaw, SSRStream, SSRStreamBlock, SkipRender, Slot, _CONST_PROPS, DomContainer as _DomContainer, _EFFECT_BACK_REF, EMPTY_ARRAY as _EMPTY_ARRAY, SubscriptionData as _EffectData, _IMMUTABLE, _SharedContainer, _VAR_PROPS, _deserialize, _fnSignal, _getContextElement, _getContextEvent, getDomContainer as _getDomContainer, _getQContainerElement, isJSXNode as _isJSXNode, isStringifiable as _isStringifiable, _jsxBranch, _jsxC, _jsxQ, _jsxS, _jsxSorted, _jsxSplit, _noopQrl, _noopQrlDEV, _qrlSync, _regSymbol, _restProps, queueQRL as _run, _serialize, scheduleTask as _task, verifySerializable as _verifySerializable, _waitUntilRendered, _walkJSX, _weakSerialize, _wrapProp, _wrapSignal, _wrapStore, component$, componentQrl, createComputed$, createComputedQrl, createContextId, h as createElement, createSignal, event$, eventQrl, getDomContainer, getLocale, getPlatform, h, implicit$FirstArg, inlinedQrl, inlinedQrlDEV, isSignal, jsx, jsxDEV, jsx as jsxs, noSerialize, qrl, qrlDEV, render, setPlatform, sync$, untrack, unwrapStore, useComputed$, useComputedQrl, useConstant, useContext, useContextProvider, useErrorBoundary, useId, useLexicalScope, useOn, useOnDocument, useOnWindow, useResource$, useResourceQrl, useServerData, useSignal, useStore, useStyles$, useStylesQrl, useStylesScoped$, useStylesScopedQrl, useTask$, useTaskQrl, useVisibleTask$, useVisibleTaskQrl, version, withLocale };