@qwik.dev/core 2.0.0-alpha.4 → 2.0.0-alpha.5

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/testing 2.0.0-alpha.4-dev+374e0d6
3
+ * @qwik.dev/core/testing 2.0.0-alpha.5-dev+cb53bbd
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
@@ -22294,7 +22294,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
22294
22294
  // 30
22295
22295
  "QRLs can not be dynamically resolved, because it does not have a chunk path",
22296
22296
  // 31
22297
- "The JSX ref attribute must be a Signal",
22297
+ "{{0}}\nThe JSX ref attribute must be a Signal",
22298
22298
  // 32
22299
22299
  "Serialization Error: Deserialization of data type {{0}} is not implemented",
22300
22300
  // 33
@@ -22310,7 +22310,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
22310
22310
  // 38
22311
22311
  "Serialization Error: Missing QRL chunk for {{0}}",
22312
22312
  // 39
22313
- "The value of the textarea must be a string",
22313
+ "{{0}}\nThe value of the textarea must be a string found {{1}}",
22314
22314
  // 40
22315
22315
  "Unable to find q:container",
22316
22316
  // 41
@@ -23041,7 +23041,6 @@ var StoreHandler = class {
23041
23041
  }
23042
23042
  /** In the case of oldValue and value are the same, the effects are not triggered. */
23043
23043
  set(target, prop, value) {
23044
- target = unwrapDeserializerProxy(target);
23045
23044
  if (typeof prop === "symbol") {
23046
23045
  target[prop] = value;
23047
23046
  return true;
@@ -23109,6 +23108,11 @@ function addEffect(target, prop, store, effectSubscriber) {
23109
23108
  const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
23110
23109
  ensureContainsEffect(effects, effectSubscriber);
23111
23110
  ensureContains(effectSubscriber, target);
23111
+ ensureEffectContainsSubscriber(
23112
+ effectSubscriber[0 /* EFFECT */],
23113
+ target,
23114
+ store.$container$
23115
+ );
23112
23116
  DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
23113
23117
  }
23114
23118
  function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
@@ -23180,32 +23184,39 @@ function clearVNodeEffectDependencies(container, value) {
23180
23184
  }
23181
23185
  for (let i = effects.length - 1; i >= 0; i--) {
23182
23186
  const subscriber = effects[i];
23183
- const subscriptionRemoved = clearEffects(subscriber, value);
23184
- if (subscriptionRemoved) {
23185
- effects.splice(i, 1);
23186
- }
23187
+ clearEffects(subscriber, value, effects, i, container);
23188
+ }
23189
+ if (effects.length === 0) {
23190
+ vnode_setProp(value, QSubscribers, null);
23187
23191
  }
23188
23192
  }
23189
- function clearSubscriberEffectDependencies(value) {
23193
+ function clearSubscriberEffectDependencies(container, value) {
23190
23194
  if (value.$effectDependencies$) {
23191
23195
  for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
23192
23196
  const subscriber = value.$effectDependencies$[i];
23193
- const subscriptionRemoved = clearEffects(subscriber, value);
23194
- if (subscriptionRemoved) {
23195
- value.$effectDependencies$.splice(i, 1);
23196
- }
23197
+ clearEffects(subscriber, value, value.$effectDependencies$, i, container);
23198
+ }
23199
+ if (value.$effectDependencies$.length === 0) {
23200
+ value.$effectDependencies$ = null;
23197
23201
  }
23198
23202
  }
23199
23203
  }
23200
- function clearEffects(subscriber, value) {
23201
- if (!isSignal(subscriber)) {
23202
- return false;
23204
+ function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
23205
+ let subscriptionRemoved = false;
23206
+ const seenSet = /* @__PURE__ */ new Set();
23207
+ if (subscriber instanceof WrappedSignal) {
23208
+ subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
23209
+ } else if (container.$storeProxyMap$.has(subscriber)) {
23210
+ const store = container.$storeProxyMap$.get(subscriber);
23211
+ const handler = getStoreHandler(store);
23212
+ subscriptionRemoved = clearStoreEffects(handler, value);
23203
23213
  }
23204
- const effectSubscriptions = subscriber.$effects$;
23205
- const hostElement = subscriber.$hostElement$;
23206
- if (hostElement && hostElement === value) {
23207
- subscriber.$hostElement$ = null;
23214
+ if (subscriptionRemoved) {
23215
+ effectArray.splice(indexToRemove, 1);
23208
23216
  }
23217
+ }
23218
+ function clearSignalEffects(subscriber, value, seenSet) {
23219
+ const effectSubscriptions = subscriber.$effects$;
23209
23220
  let subscriptionRemoved = false;
23210
23221
  if (effectSubscriptions) {
23211
23222
  for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
@@ -23216,14 +23227,65 @@ function clearEffects(subscriber, value) {
23216
23227
  }
23217
23228
  }
23218
23229
  }
23219
- const args = subscriber.$args$;
23220
- if (args) {
23221
- for (let i = args.length - 1; i >= 0; i--) {
23222
- clearEffects(args[i], subscriber);
23230
+ if (subscriber instanceof WrappedSignal) {
23231
+ const hostElement = subscriber.$hostElement$;
23232
+ if (hostElement && hostElement === value) {
23233
+ subscriber.$hostElement$ = null;
23234
+ }
23235
+ const args = subscriber.$args$;
23236
+ if (args) {
23237
+ clearArgsEffects(args, subscriber, seenSet);
23223
23238
  }
23224
23239
  }
23225
23240
  return subscriptionRemoved;
23226
23241
  }
23242
+ function clearStoreEffects(storeHandler, value) {
23243
+ const effectSubscriptions = storeHandler.$effects$;
23244
+ if (!effectSubscriptions) {
23245
+ return false;
23246
+ }
23247
+ let subscriptionRemoved = false;
23248
+ for (const key in effectSubscriptions) {
23249
+ const effects = effectSubscriptions[key];
23250
+ for (let i = effects.length - 1; i >= 0; i--) {
23251
+ const effect = effects[i];
23252
+ if (effect[0 /* EFFECT */] === value) {
23253
+ effects.splice(i, 1);
23254
+ subscriptionRemoved = true;
23255
+ }
23256
+ }
23257
+ if (effects.length === 0) {
23258
+ delete effectSubscriptions[key];
23259
+ }
23260
+ }
23261
+ return subscriptionRemoved;
23262
+ }
23263
+ function clearArgsEffects(args, subscriber, seenSet) {
23264
+ for (let i = args.length - 1; i >= 0; i--) {
23265
+ const arg = args[i];
23266
+ clearArgEffect(arg, subscriber, seenSet);
23267
+ }
23268
+ }
23269
+ function clearArgEffect(arg, subscriber, seenSet) {
23270
+ if (seenSet.has(arg)) {
23271
+ return;
23272
+ }
23273
+ seenSet.add(arg);
23274
+ if (isSignal(arg)) {
23275
+ clearSignalEffects(arg, subscriber, seenSet);
23276
+ } else if (typeof arg === "object" && arg !== null) {
23277
+ if (isStore(arg)) {
23278
+ clearStoreEffects(getStoreHandler(arg), subscriber);
23279
+ } else {
23280
+ for (const key in arg) {
23281
+ clearArgEffect(arg[key], subscriber, seenSet);
23282
+ }
23283
+ }
23284
+ } else if (Array.isArray(arg)) {
23285
+ clearArgsEffects(arg, subscriber, seenSet);
23286
+ } else {
23287
+ }
23288
+ }
23227
23289
 
23228
23290
  // packages/qwik/src/core/use/use-resource.ts
23229
23291
  var _createResourceReturn = (opts) => {
@@ -23249,7 +23311,7 @@ var runResource = (task, container, host) => {
23249
23311
  cleanupTask(task);
23250
23312
  const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
23251
23313
  iCtx.$container$ = container;
23252
- const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(task));
23314
+ const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(container, task));
23253
23315
  const resource = task.$state$;
23254
23316
  assertDefined(
23255
23317
  resource,
@@ -23737,6 +23799,18 @@ function escapeHTML(html) {
23737
23799
  }
23738
23800
  }
23739
23801
 
23802
+ // packages/qwik/src/core/shared/utils/jsx-filename.ts
23803
+ function getFileLocationFromJsx(jsxDev) {
23804
+ if (!jsxDev) {
23805
+ return null;
23806
+ }
23807
+ const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
23808
+ if (sanitizedFileName) {
23809
+ return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
23810
+ }
23811
+ return null;
23812
+ }
23813
+
23740
23814
  // packages/qwik/src/core/client/vnode-diff.ts
23741
23815
  var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
23742
23816
  let journal = container.$journal$;
@@ -24077,7 +24151,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24077
24151
  vnode_remove(journal, vParent, toRemove, true);
24078
24152
  }
24079
24153
  }
24080
- function createNewElement(jsx4, elementName) {
24154
+ function createNewElement(jsx4, elementName, currentFile) {
24081
24155
  const element = createElementWithNamespace(elementName);
24082
24156
  const { constProps } = jsx4;
24083
24157
  let needsQDispatchEventPatch = false;
@@ -24105,6 +24179,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24105
24179
  } else if (typeof value === "function") {
24106
24180
  value(element);
24107
24181
  continue;
24182
+ } else {
24183
+ throw qError(32 /* invalidRefValue */, [currentFile]);
24108
24184
  }
24109
24185
  }
24110
24186
  if (isSignal(value)) {
@@ -24126,13 +24202,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24126
24202
  continue;
24127
24203
  }
24128
24204
  if (elementName === "textarea" && key2 === "value") {
24129
- if (typeof value !== "string") {
24205
+ if (value && typeof value !== "string") {
24130
24206
  if (isDev4) {
24131
- throw qError(40 /* wrongTextareaValue */);
24207
+ throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
24132
24208
  }
24133
24209
  continue;
24134
24210
  }
24135
- element.value = escapeHTML(value);
24211
+ element.value = escapeHTML(value || "");
24136
24212
  continue;
24137
24213
  }
24138
24214
  value = serializeAttribute(key2, value, scopedStyleIdPrefix);
@@ -24168,19 +24244,24 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24168
24244
  const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
24169
24245
  const jsxKey = jsx4.key;
24170
24246
  let needsQDispatchEventPatch = false;
24247
+ const currentFile = getFileLocationFromJsx(jsx4.dev);
24171
24248
  if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
24172
24249
  vNewNode = retrieveChildWithKey(elementName, jsxKey);
24173
24250
  if (vNewNode === null) {
24174
24251
  needsQDispatchEventPatch = createNewElement(jsx4, elementName);
24175
24252
  } else {
24176
24253
  vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
24254
+ vCurrent = vNewNode;
24255
+ vNewNode = null;
24256
+ if (vSiblings !== null) {
24257
+ vSiblingsIdx -= 3 /* Size */;
24258
+ }
24177
24259
  }
24178
24260
  }
24179
24261
  const jsxAttrs = [];
24180
24262
  const props = jsx4.varProps;
24181
24263
  for (const key in props) {
24182
- let value = props[key];
24183
- value = serializeAttribute(key, value, scopedStyleIdPrefix);
24264
+ const value = props[key];
24184
24265
  if (value != null) {
24185
24266
  mapArray_set(jsxAttrs, key, value, 0);
24186
24267
  }
@@ -24189,7 +24270,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24189
24270
  mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
24190
24271
  }
24191
24272
  const vNode = vNewNode || vCurrent;
24192
- needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
24273
+ needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
24193
24274
  if (needsQDispatchEventPatch) {
24194
24275
  const element = vnode_getNode(vNode);
24195
24276
  if (!element.qDispatchEvent) {
@@ -24212,7 +24293,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24212
24293
  }
24213
24294
  }
24214
24295
  }
24215
- function setBulkProps(vnode, srcAttrs) {
24296
+ function setBulkProps(vnode, srcAttrs, currentFile) {
24216
24297
  vnode_ensureElementInflated(vnode);
24217
24298
  const dstAttrs = vnode;
24218
24299
  let srcIdx = 0;
@@ -24235,12 +24316,18 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24235
24316
  } else if (typeof value === "function") {
24236
24317
  value(element);
24237
24318
  return;
24319
+ } else {
24320
+ throw qError(32 /* invalidRefValue */, [currentFile]);
24238
24321
  }
24239
24322
  }
24240
24323
  if (isSignal(value)) {
24241
- value = untrack(() => value.value);
24324
+ const signalData = new EffectPropData({
24325
+ $scopedStyleIdPrefix$: scopedStyleIdPrefix,
24326
+ $isConst$: false
24327
+ });
24328
+ value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
24242
24329
  }
24243
- vnode_setAttr(journal, vnode, key, value);
24330
+ vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
24244
24331
  if (value === null) {
24245
24332
  dstLength = dstAttrs.length;
24246
24333
  }
@@ -24282,6 +24369,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24282
24369
  }
24283
24370
  srcIdx++;
24284
24371
  srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
24372
+ dstIdx++;
24373
+ dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
24285
24374
  } else if (srcKey == dstKey) {
24286
24375
  const srcValue = srcAttrs[srcIdx++];
24287
24376
  const dstValue = dstAttrs[dstIdx++];
@@ -24358,7 +24447,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24358
24447
  vnode_insertBefore(
24359
24448
  journal,
24360
24449
  vParent,
24361
- vNewNode = vnode_newVirtual(),
24450
+ vNewNode,
24362
24451
  vCurrent && getInsertBefore()
24363
24452
  );
24364
24453
  return;
@@ -24556,7 +24645,7 @@ function cleanup(container, vNode) {
24556
24645
  const obj = seq[i];
24557
24646
  if (isTask(obj)) {
24558
24647
  const task = obj;
24559
- clearSubscriberEffectDependencies(task);
24648
+ clearSubscriberEffectDependencies(container, task);
24560
24649
  if (task.$flags$ & 1 /* VISIBLE_TASK */) {
24561
24650
  container.$scheduler$(48 /* CLEANUP_VISIBLE */, task);
24562
24651
  } else {
@@ -24674,7 +24763,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24674
24763
  };
24675
24764
  chore.$promise$ = new Promise((resolve) => chore.$resolve$ = resolve);
24676
24765
  DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
24677
- chore = sortedInsert(choreQueue, chore);
24766
+ chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
24678
24767
  if (!journalFlushScheduled && runLater) {
24679
24768
  journalFlushScheduled = true;
24680
24769
  schedule(16 /* JOURNAL_FLUSH */);
@@ -24683,10 +24772,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24683
24772
  if (runLater) {
24684
24773
  return chore.$promise$;
24685
24774
  } else {
24686
- return drainUpTo(chore);
24775
+ return drainUpTo(chore, container.rootVNode || null);
24687
24776
  }
24688
24777
  }
24689
- function drainUpTo(runUptoChore) {
24778
+ function drainUpTo(runUptoChore, rootVNode) {
24690
24779
  if (runUptoChore.$executed$) {
24691
24780
  return runUptoChore.$returnValue$;
24692
24781
  }
@@ -24695,7 +24784,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24695
24784
  }
24696
24785
  while (choreQueue.length) {
24697
24786
  const nextChore = choreQueue.shift();
24698
- const order = choreComparator(nextChore, runUptoChore, false);
24787
+ const order = choreComparator(nextChore, runUptoChore, rootVNode, false);
24699
24788
  if (order === null) {
24700
24789
  continue;
24701
24790
  }
@@ -24710,7 +24799,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24710
24799
  }
24711
24800
  const returnValue = executeChore(nextChore);
24712
24801
  if (isPromise(returnValue)) {
24713
- const promise = returnValue.then(() => drainUpTo(runUptoChore));
24802
+ const promise = returnValue.then(() => drainUpTo(runUptoChore, rootVNode));
24714
24803
  return promise;
24715
24804
  }
24716
24805
  }
@@ -24835,7 +24924,7 @@ var choreUpdate = (existing, newChore) => {
24835
24924
  function vNodeAlreadyDeleted(chore) {
24836
24925
  return !!(chore.$host$ && vnode_isVNode(chore.$host$) && chore.$host$[0 /* flags */] & 32 /* Deleted */);
24837
24926
  }
24838
- function choreComparator(a, b, shouldThrowOnHostMismatch) {
24927
+ function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
24839
24928
  const macroTypeDiff = (a.$type$ & 240 /* MACRO */) - (b.$type$ & 240 /* MACRO */);
24840
24929
  if (macroTypeDiff !== 0) {
24841
24930
  return macroTypeDiff;
@@ -24845,7 +24934,7 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
24845
24934
  const bHost = b.$host$;
24846
24935
  if (aHost !== bHost && aHost !== null && bHost !== null) {
24847
24936
  if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
24848
- const hostDiff = vnode_documentPosition(aHost, bHost);
24937
+ const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
24849
24938
  if (hostDiff !== 0) {
24850
24939
  return hostDiff;
24851
24940
  }
@@ -24875,13 +24964,13 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
24875
24964
  }
24876
24965
  return 0;
24877
24966
  }
24878
- function sortedFindIndex(sortedArray, value) {
24967
+ function sortedFindIndex(sortedArray, value, rootVNode) {
24879
24968
  let bottom = 0;
24880
24969
  let top = sortedArray.length;
24881
24970
  while (bottom < top) {
24882
24971
  const middle = bottom + (top - bottom >> 1);
24883
24972
  const midChore = sortedArray[middle];
24884
- const comp = choreComparator(value, midChore, true);
24973
+ const comp = choreComparator(value, midChore, rootVNode, true);
24885
24974
  if (comp < 0) {
24886
24975
  top = middle;
24887
24976
  } else if (comp > 0) {
@@ -24892,8 +24981,8 @@ function sortedFindIndex(sortedArray, value) {
24892
24981
  }
24893
24982
  return ~bottom;
24894
24983
  }
24895
- function sortedInsert(sortedArray, value) {
24896
- const idx = sortedFindIndex(sortedArray, value);
24984
+ function sortedInsert(sortedArray, value, rootVNode) {
24985
+ const idx = sortedFindIndex(sortedArray, value, rootVNode);
24897
24986
  if (idx < 0) {
24898
24987
  sortedArray.splice(~idx, 0, value);
24899
24988
  return value;
@@ -24945,7 +25034,10 @@ var runTask = (task, container, host) => {
24945
25034
  cleanupTask(task);
24946
25035
  const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
24947
25036
  iCtx.$container$ = container;
24948
- const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(task));
25037
+ const taskFn = task.$qrl$.getFn(
25038
+ iCtx,
25039
+ () => clearSubscriberEffectDependencies(container, task)
25040
+ );
24949
25041
  const track = (obj, prop) => {
24950
25042
  const ctx = newInvokeContext();
24951
25043
  ctx.$effectSubscriber$ = [task, ":" /* COMPONENT */];
@@ -26988,7 +27080,7 @@ var vnode_getNode = (vnode) => {
26988
27080
  assertTrue(vnode_isTextVNode(vnode), "Expecting Text Node.");
26989
27081
  return vnode[4 /* node */];
26990
27082
  };
26991
- function vnode_toString(depth = 10, offset = "", materialize2 = false, siblings = false) {
27083
+ function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
26992
27084
  let vnode = this;
26993
27085
  if (depth === 0) {
26994
27086
  return "...";
@@ -27186,17 +27278,19 @@ var isElement = (node) => node && typeof node == "object" && fastNodeType(node)
27186
27278
  1;
27187
27279
  var aPath = [];
27188
27280
  var bPath = [];
27189
- var vnode_documentPosition = (a, b) => {
27281
+ var vnode_documentPosition = (a, b, rootVNode) => {
27190
27282
  if (a === b) {
27191
27283
  return 0;
27192
27284
  }
27193
27285
  let aDepth = -1;
27194
27286
  let bDepth = -1;
27195
27287
  while (a) {
27196
- a = (aPath[++aDepth] = a)[1 /* parent */];
27288
+ const vNode = aPath[++aDepth] = a;
27289
+ a = vNode[1 /* parent */] || rootVNode && vnode_getProp(a, QSlotParent, (id) => vnode_locate(rootVNode, id));
27197
27290
  }
27198
27291
  while (b) {
27199
- b = (bPath[++bDepth] = b)[1 /* parent */];
27292
+ const vNode = bPath[++bDepth] = b;
27293
+ b = vNode[1 /* parent */] || rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id));
27200
27294
  }
27201
27295
  while (aDepth >= 0 && bDepth >= 0) {
27202
27296
  a = aPath[aDepth];
@@ -27219,6 +27313,9 @@ var vnode_documentPosition = (a, b) => {
27219
27313
  return -1;
27220
27314
  }
27221
27315
  } while (cursor);
27316
+ if (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))) {
27317
+ return -1;
27318
+ }
27222
27319
  return 1;
27223
27320
  }
27224
27321
  }
@@ -27228,8 +27325,11 @@ var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
27228
27325
  let projectionDepth = 1;
27229
27326
  while (projectionDepth--) {
27230
27327
  while (vHost && (vnode_isVirtualVNode(vHost) ? vnode_getProp(vHost, OnRenderProp, null) === null : true)) {
27231
- const qSlotParentProp = vnode_getProp(vHost, QSlotParent, null);
27232
- const qSlotParent = qSlotParentProp && (typeof qSlotParentProp === "string" ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
27328
+ const qSlotParent = vnode_getProp(
27329
+ vHost,
27330
+ QSlotParent,
27331
+ (id) => vnode_locate(rootVNode, id)
27332
+ );
27233
27333
  const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
27234
27334
  if (vProjectionParent) {
27235
27335
  projectionDepth++;
@@ -27816,13 +27916,11 @@ var DomContainer = class extends _SharedContainer {
27816
27916
  if (vnode_getProp(vNode, OnRenderProp, null) !== null) {
27817
27917
  return vNode;
27818
27918
  }
27819
- const parent = vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
27820
- if (parent) {
27821
- vNode = parent;
27822
- continue;
27823
- }
27919
+ vNode = vnode_getParent(vNode) || // If virtual node, than it could be a slot so we need to read its parent.
27920
+ vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
27921
+ } else {
27922
+ vNode = vnode_getParent(vNode);
27824
27923
  }
27825
- vNode = vnode_getParent(vNode);
27826
27924
  }
27827
27925
  return null;
27828
27926
  }
@@ -27915,10 +28013,6 @@ var DomContainer = class extends _SharedContainer {
27915
28013
 
27916
28014
  // packages/qwik/src/core/shared/shared-serialization.ts
27917
28015
  var deserializedProxyMap = /* @__PURE__ */ new WeakMap();
27918
- var unwrapDeserializerProxy = (value) => {
27919
- const unwrapped = typeof value === "object" && value !== null && value[SERIALIZER_PROXY_UNWRAP];
27920
- return unwrapped ? unwrapped : value;
27921
- };
27922
28016
  var isDeserializerProxy = (value) => {
27923
28017
  return typeof value === "object" && value !== null && SERIALIZER_PROXY_UNWRAP in value;
27924
28018
  };
@@ -27960,13 +28054,13 @@ var DeserializationHandler = class {
27960
28054
  return value;
27961
28055
  }
27962
28056
  const container = this.$container$;
27963
- const propValue = allocate(container, typeId, value);
28057
+ let propValue = allocate(container, typeId, value);
28058
+ if (typeId >= 12 /* Error */) {
28059
+ propValue = inflate(container, propValue, typeId, value);
28060
+ }
27964
28061
  Reflect.set(target, property, propValue);
27965
28062
  this.$data$[idx] = void 0;
27966
28063
  this.$data$[idx + 1] = propValue;
27967
- if (typeId >= 12 /* Error */) {
27968
- inflate(container, propValue, typeId, value);
27969
- }
27970
28064
  return propValue;
27971
28065
  }
27972
28066
  has(target, property) {
@@ -28000,7 +28094,7 @@ var _eagerDeserializeArray = (container, data) => {
28000
28094
  var resolvers = /* @__PURE__ */ new WeakMap();
28001
28095
  var inflate = (container, target, typeId, data) => {
28002
28096
  if (typeId === void 0) {
28003
- return;
28097
+ return target;
28004
28098
  }
28005
28099
  if (typeId !== 13 /* Object */ && Array.isArray(data)) {
28006
28100
  data = _eagerDeserializeArray(container, data);
@@ -28071,14 +28165,13 @@ var inflate = (container, target, typeId, data) => {
28071
28165
  case 25 /* Store */:
28072
28166
  case 26 /* StoreArray */: {
28073
28167
  const [value, flags, effects2, storeEffect] = data;
28074
- const handler = getStoreHandler(target);
28075
- handler.$flags$ = flags;
28076
- Object.assign(getStoreTarget(target), value);
28168
+ const store = getOrCreateStore(value, flags, container);
28169
+ const storeHandler = getStoreHandler(store);
28077
28170
  if (storeEffect) {
28078
28171
  effects2[STORE_ARRAY_PROP] = storeEffect;
28079
28172
  }
28080
- handler.$effects$ = effects2;
28081
- container.$storeProxyMap$.set(value, target);
28173
+ storeHandler.$effects$ = effects2;
28174
+ target = store;
28082
28175
  break;
28083
28176
  }
28084
28177
  case 22 /* Signal */: {
@@ -28199,6 +28292,7 @@ var inflate = (container, target, typeId, data) => {
28199
28292
  default:
28200
28293
  throw qError(33 /* serializeErrorNotImplemented */, [typeId]);
28201
28294
  }
28295
+ return target;
28202
28296
  };
28203
28297
  var _constants = [
28204
28298
  void 0,
@@ -28284,9 +28378,8 @@ var allocate = (container, typeId, value) => {
28284
28378
  case 24 /* ComputedSignal */:
28285
28379
  return new ComputedSignal(container, null);
28286
28380
  case 25 /* Store */:
28287
- return createStore(container, {}, 0);
28288
28381
  case 26 /* StoreArray */:
28289
- return createStore(container, [], 0);
28382
+ return null;
28290
28383
  case 11 /* URLSearchParams */:
28291
28384
  return new URLSearchParams(value);
28292
28385
  case 27 /* FormData */:
@@ -28935,15 +29028,15 @@ function qrlToString(serializationContext, value) {
28935
29028
  }
28936
29029
  return qrlStringInline;
28937
29030
  }
28938
- function deserializeData(container, typeId, propValue) {
29031
+ function deserializeData(container, typeId, value) {
28939
29032
  if (typeId === void 0) {
28940
- return propValue;
29033
+ return value;
28941
29034
  }
28942
- const value = allocate(container, typeId, propValue);
29035
+ let propValue = allocate(container, typeId, value);
28943
29036
  if (typeId >= 12 /* Error */) {
28944
- inflate(container, value, typeId, propValue);
29037
+ propValue = inflate(container, propValue, typeId, value);
28945
29038
  }
28946
- return value;
29039
+ return propValue;
28947
29040
  }
28948
29041
  function shouldTrackObj(obj) {
28949
29042
  return (
@@ -30803,7 +30896,7 @@ var SsrComponentFrame = class {
30803
30896
  if (isJSXNode2(children)) {
30804
30897
  const slotName = this.getSlotName(children);
30805
30898
  mapArray_set(this.slots, slotName, children, 0);
30806
- } else if (Array.isArray(children)) {
30899
+ } else if (Array.isArray(children) && children.length > 0) {
30807
30900
  const defaultSlot = [];
30808
30901
  for (let i = 0; i < children.length; i++) {
30809
30902
  const child = children[i];
@@ -30818,7 +30911,7 @@ var SsrComponentFrame = class {
30818
30911
  defaultSlot.push(child);
30819
30912
  }
30820
30913
  }
30821
- defaultSlot.length && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
30914
+ defaultSlot.length > 0 && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
30822
30915
  } else {
30823
30916
  mapArray_set(this.slots, QDefaultSlot, children, 0);
30824
30917
  }
@@ -31434,12 +31527,12 @@ var SSRContainer = class extends _SharedContainer2 {
31434
31527
  this.write("<");
31435
31528
  this.write(elementName);
31436
31529
  if (varAttrs) {
31437
- innerHTML = this.writeAttrs(elementName, varAttrs, false);
31530
+ innerHTML = this.writeAttrs(elementName, varAttrs, false, currentFile);
31438
31531
  }
31439
31532
  this.write(" " + Q_PROPS_SEPARATOR);
31440
31533
  isDev11 && this.write('=""');
31441
31534
  if (constAttrs && constAttrs.length) {
31442
- innerHTML = this.writeAttrs(elementName, constAttrs, true) || innerHTML;
31535
+ innerHTML = this.writeAttrs(elementName, constAttrs, true, currentFile) || innerHTML;
31443
31536
  }
31444
31537
  this.write(">");
31445
31538
  this.lastNode = null;
@@ -31514,12 +31607,9 @@ var SSRContainer = class extends _SharedContainer2 {
31514
31607
  }
31515
31608
  openProjection(attrs) {
31516
31609
  this.openFragment(attrs);
31517
- const vNode = this.currentElementFrame?.vNodeData;
31518
- if (vNode) {
31519
- vNode[0] |= 16 /* SERIALIZE */;
31520
- }
31521
31610
  const componentFrame = this.getComponentFrame();
31522
31611
  if (componentFrame) {
31612
+ this.serializationCtx.$addRoot$(componentFrame.componentNode);
31523
31613
  componentFrame.projectionDepth++;
31524
31614
  }
31525
31615
  }
@@ -32077,7 +32167,7 @@ var SSRContainer = class extends _SharedContainer2 {
32077
32167
  this.write(element);
32078
32168
  }
32079
32169
  }
32080
- writeAttrs(tag, attrs, isConst) {
32170
+ writeAttrs(tag, attrs, isConst, currentFile) {
32081
32171
  let innerHTML = void 0;
32082
32172
  if (attrs.length) {
32083
32173
  for (let i = 0; i < attrs.length; i++) {
@@ -32104,7 +32194,7 @@ var SSRContainer = class extends _SharedContainer2 {
32104
32194
  value(new DomRef(lastNode));
32105
32195
  continue;
32106
32196
  } else {
32107
- throw qError(32 /* invalidRefValue */);
32197
+ throw qError(32 /* invalidRefValue */, [currentFile]);
32108
32198
  }
32109
32199
  }
32110
32200
  if (isSignal3(value)) {
@@ -32124,13 +32214,13 @@ var SSRContainer = class extends _SharedContainer2 {
32124
32214
  }
32125
32215
  }
32126
32216
  if (tag === "textarea" && key === "value") {
32127
- if (typeof value !== "string") {
32217
+ if (value && typeof value !== "string") {
32128
32218
  if (isDev11) {
32129
- throw qError(40 /* wrongTextareaValue */);
32219
+ throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
32130
32220
  }
32131
32221
  continue;
32132
32222
  }
32133
- innerHTML = escapeHTML(value);
32223
+ innerHTML = escapeHTML(value || "");
32134
32224
  key = QContainerAttr;
32135
32225
  value = "text" /* TEXT */;
32136
32226
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/testing",
3
- "version": "2.0.0-alpha.4-dev+374e0d6",
3
+ "version": "2.0.0-alpha.5-dev+cb53bbd",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,