@qwik.dev/core 2.0.0-beta.2 → 2.0.0-beta.3

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-beta.2-dev+3ddc6c7
3
+ * @qwik.dev/core/testing 2.0.0-beta.3-dev+aa098fc
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
@@ -22151,7 +22151,7 @@ module.exports = __toCommonJS(index_exports);
22151
22151
 
22152
22152
  // packages/qwik/src/testing/vdom-diff.unit-util.ts
22153
22153
  var import_core = require("../core.cjs");
22154
- var import_internal3 = require("@qwik.dev/core/internal");
22154
+ var import_internal4 = require("@qwik.dev/core/internal");
22155
22155
  var import_vitest = require("vitest");
22156
22156
 
22157
22157
  // packages/qwik/src/core/client/vnode.ts
@@ -23083,6 +23083,7 @@ var isServerPlatform = () => {
23083
23083
  // packages/qwik/src/core/shared/qrl/qrl-class.ts
23084
23084
  var import_build6 = require("@qwik.dev/core/build");
23085
23085
  var import_preloader = require("@qwik.dev/core/preloader");
23086
+ var resolvedSymbol = Symbol("resolved");
23086
23087
  var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23087
23088
  if (qDev && qSerialize) {
23088
23089
  if (captureRef) {
@@ -23131,9 +23132,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23131
23132
  };
23132
23133
  return bound;
23133
23134
  }
23134
- const resolveLazy = (containerEl) => {
23135
- return symbolRef !== null ? symbolRef : resolve(containerEl);
23136
- };
23137
23135
  const wrapFn = (fn) => {
23138
23136
  if (typeof fn !== "function" || !(capture == null ? void 0 : capture.length) && !(captureRef == null ? void 0 : captureRef.length)) {
23139
23137
  return fn;
@@ -23159,7 +23157,10 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23159
23157
  return invoke.call(this, context, fn, ...args);
23160
23158
  };
23161
23159
  };
23162
- const resolve = async (containerEl) => {
23160
+ if (symbolFn && resolvedSymbol in symbolFn) {
23161
+ symbolRef = symbolFn[resolvedSymbol];
23162
+ }
23163
+ const resolve = symbolRef ? async () => symbolRef : async (containerEl) => {
23163
23164
  if (symbolRef !== null) {
23164
23165
  return symbolRef;
23165
23166
  }
@@ -23179,14 +23180,17 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23179
23180
  const start = now();
23180
23181
  const ctx = tryGetInvokeContext();
23181
23182
  if (symbolFn !== null) {
23182
- symbolRef = symbolFn().then(
23183
- (module2) => qrl.resolved = wrapFn(symbolRef = module2[symbol])
23184
- );
23183
+ symbolRef = symbolFn().then((module2) => {
23184
+ const resolved = wrapFn(symbolRef = module2[symbol]);
23185
+ symbolFn[resolvedSymbol] = resolved;
23186
+ qrl.resolved = resolved;
23187
+ return resolved;
23188
+ });
23185
23189
  } else {
23186
23190
  const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);
23187
23191
  symbolRef = maybeThen(imported, (ref) => qrl.resolved = wrapFn(symbolRef = ref));
23188
23192
  }
23189
- if (typeof symbolRef === "object" && isPromise(symbolRef)) {
23193
+ if (isPromise(symbolRef)) {
23190
23194
  symbolRef.then(
23191
23195
  () => emitUsedSymbol(symbol, ctx == null ? void 0 : ctx.$element$, start),
23192
23196
  (err) => {
@@ -23212,7 +23216,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23212
23216
  getHash: () => hash3,
23213
23217
  getCaptured: () => captureRef,
23214
23218
  resolve,
23215
- $resolveLazy$: resolveLazy,
23216
23219
  $setContainer$: setContainer,
23217
23220
  $chunk$: chunk,
23218
23221
  $symbol$: symbol,
@@ -24148,7 +24151,6 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
24148
24151
  if (!isInlineComponent) {
24149
24152
  container.setHostProp(renderHost, ELEMENT_SEQ_IDX, null);
24150
24153
  container.setHostProp(renderHost, USE_ON_LOCAL_SEQ_IDX, null);
24151
- container.setHostProp(renderHost, ELEMENT_PROPS, props);
24152
24154
  }
24153
24155
  if (vnode_isVNode(renderHost)) {
24154
24156
  clearAllEffects(container, renderHost);
@@ -25160,11 +25162,22 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
25160
25162
  shouldRender = true;
25161
25163
  }
25162
25164
  if (host) {
25163
- const vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
25164
- shouldRender = shouldRender || propsDiffer(jsxProps, vNodeProps);
25165
+ let vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
25166
+ const propsAreDifferent = propsDiffer(jsxProps, vNodeProps);
25167
+ shouldRender = shouldRender || propsAreDifferent;
25165
25168
  if (shouldRender) {
25169
+ if (propsAreDifferent) {
25170
+ if (vNodeProps) {
25171
+ vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS];
25172
+ vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS];
25173
+ } else if (jsxProps) {
25174
+ vnode_setProp(host, ELEMENT_PROPS, jsxProps);
25175
+ vNodeProps = jsxProps;
25176
+ }
25177
+ }
25178
+ vnode_setProp(host, OnRenderProp, componentQRL);
25166
25179
  host[0 /* flags */] &= ~32 /* Deleted */;
25167
- container.$scheduler$(6 /* COMPONENT */, host, componentQRL, jsxProps);
25180
+ container.$scheduler$(6 /* COMPONENT */, host, componentQRL, vNodeProps);
25168
25181
  }
25169
25182
  }
25170
25183
  descendContentToProject(jsxNode2.children, host);
@@ -25572,7 +25585,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25572
25585
  return runUptoChore.$returnValue$;
25573
25586
  }
25574
25587
  function executeChore(chore, isServer5) {
25575
- var _a, _b, _c;
25588
+ var _a, _b;
25576
25589
  const host = chore.$host$;
25577
25590
  DEBUG6 && debugTrace("execute", chore, currentChore, choreQueue);
25578
25591
  assertEqual(currentChore, null, "Chore already running.");
@@ -25708,21 +25721,24 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25708
25721
  {
25709
25722
  const target = chore.$target$;
25710
25723
  const effects = chore.$payload$;
25724
+ const ctx = newInvokeContext();
25725
+ ctx.$container$ = container;
25711
25726
  if (target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
25712
25727
  const forceRunEffects = target.$forceRunEffects$;
25713
25728
  target.$forceRunEffects$ = false;
25714
- if (!((_b = target.$effects$) == null ? void 0 : _b.size)) {
25729
+ if (!(effects == null ? void 0 : effects.size)) {
25715
25730
  break;
25716
25731
  }
25717
- returnValue = retryOnPromise(() => {
25718
- if (target.$computeIfNeeded$() || forceRunEffects) {
25719
- triggerEffects(container, target, effects);
25732
+ returnValue = maybeThen(
25733
+ retryOnPromise(() => invoke.call(target, ctx, target.$computeIfNeeded$)),
25734
+ (didChange) => {
25735
+ if (didChange || forceRunEffects) {
25736
+ return retryOnPromise(() => triggerEffects(container, target, effects));
25737
+ }
25720
25738
  }
25721
- });
25739
+ );
25722
25740
  } else {
25723
- returnValue = retryOnPromise(() => {
25724
- triggerEffects(container, target, effects);
25725
- });
25741
+ returnValue = retryOnPromise(() => triggerEffects(container, target, effects));
25726
25742
  }
25727
25743
  }
25728
25744
  break;
@@ -25746,7 +25762,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25746
25762
  };
25747
25763
  if (isPromise(returnValue)) {
25748
25764
  chore.$promise$ = returnValue.then(after, (error) => after(void 0, error));
25749
- (_c = chore.$resolve$) == null ? void 0 : _c.call(chore, chore.$promise$);
25765
+ (_b = chore.$resolve$) == null ? void 0 : _b.call(chore, chore.$promise$);
25750
25766
  chore.$resolve$ = void 0;
25751
25767
  } else {
25752
25768
  after(returnValue);
@@ -25787,7 +25803,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25787
25803
  if (idxDiff !== 0) {
25788
25804
  return idxDiff;
25789
25805
  }
25790
- if (a.$target$ !== b.$target$ || a.$payload$ !== b.$payload$) {
25806
+ if (a.$target$ !== b.$target$) {
25807
+ if (isQrl(a.$target$) && isQrl(b.$target$) && a.$target$.$hash$ === b.$target$.$hash$) {
25808
+ return 0;
25809
+ }
25791
25810
  return 1;
25792
25811
  }
25793
25812
  if (b === currentChore) {
@@ -25819,7 +25838,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25819
25838
  return value;
25820
25839
  }
25821
25840
  const existing = sortedArray[idx];
25822
- if (existing.$type$ === 4 /* NODE_DIFF */) {
25841
+ if (existing.$payload$ !== value.$payload$) {
25823
25842
  existing.$payload$ = value.$payload$;
25824
25843
  }
25825
25844
  if (existing.$executed$) {
@@ -29674,11 +29693,14 @@ var processVNodeData2 = (vData, callback) => {
29674
29693
  let nextToConsumeIdx = 0;
29675
29694
  let ch = 0;
29676
29695
  let peekCh = 0;
29696
+ const getChar = (idx) => {
29697
+ return idx < vData.length ? vData.charCodeAt(idx) : 0;
29698
+ };
29677
29699
  const peek = () => {
29678
29700
  if (peekCh !== 0) {
29679
29701
  return peekCh;
29680
29702
  } else {
29681
- return peekCh = nextToConsumeIdx < vData.length ? vData.charCodeAt(nextToConsumeIdx) : 0;
29703
+ return peekCh = getChar(nextToConsumeIdx);
29682
29704
  }
29683
29705
  };
29684
29706
  const consume = () => {
@@ -29696,7 +29718,7 @@ var processVNodeData2 = (vData, callback) => {
29696
29718
  return vData.substring(start, nextToConsumeIdx);
29697
29719
  };
29698
29720
  while (peek() !== 0) {
29699
- callback(peek, consumeValue, consume, nextToConsumeIdx);
29721
+ callback(peek, consumeValue, consume, getChar, nextToConsumeIdx);
29700
29722
  }
29701
29723
  };
29702
29724
  var vnode_getNextSibling = (vnode) => {
@@ -29905,17 +29927,17 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29905
29927
  let textIdx = 0;
29906
29928
  let combinedText = null;
29907
29929
  let container = null;
29908
- processVNodeData2(vData, (peek, consumeValue, consume, nextToConsumeIdx) => {
29930
+ processVNodeData2(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
29909
29931
  if (isNumber(peek())) {
29910
- while (!isElement2(child)) {
29932
+ while (!isElement2(child) || // We pretend that style element's don't exist as they can get moved out.
29933
+ // skip over style elements, as those need to be moved to the head
29934
+ // and are not included in the counts.
29935
+ isQStyleElement(child)) {
29911
29936
  child = fastNextSibling(child);
29912
29937
  if (!child) {
29913
29938
  throw qError(27 /* materializeVNodeDataError */, [vData, peek(), nextToConsumeIdx]);
29914
29939
  }
29915
29940
  }
29916
- while (isQStyleElement(child)) {
29917
- child = fastNextSibling(child);
29918
- }
29919
29941
  combinedText = null;
29920
29942
  previousTextNode = null;
29921
29943
  let value = 0;
@@ -29941,7 +29963,16 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29941
29963
  } else if (peek() === VNodeDataChar.PROPS) {
29942
29964
  vnode_setAttr(null, vParent, ELEMENT_PROPS, consumeValue());
29943
29965
  } else if (peek() === VNodeDataChar.KEY) {
29944
- vnode_setAttr(null, vParent, ELEMENT_KEY, consumeValue());
29966
+ const isEscapedValue = getChar(nextToConsumeIdx + 1) === VNodeDataChar.SEPARATOR;
29967
+ let value;
29968
+ if (isEscapedValue) {
29969
+ consume();
29970
+ value = decodeURI(consumeValue());
29971
+ consume();
29972
+ } else {
29973
+ value = consumeValue();
29974
+ }
29975
+ vnode_setAttr(null, vParent, ELEMENT_KEY, value);
29945
29976
  } else if (peek() === VNodeDataChar.SEQ) {
29946
29977
  vnode_setAttr(null, vParent, ELEMENT_SEQ, consumeValue());
29947
29978
  } else if (peek() === VNodeDataChar.SEQ_IDX) {
@@ -29977,6 +30008,9 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29977
30008
  } else if (peek() === VNodeDataChar.SLOT) {
29978
30009
  vnode_setAttr(null, vParent, QSlot, consumeValue());
29979
30010
  } else {
30011
+ while (isQStyleElement(child)) {
30012
+ child = fastNextSibling(child);
30013
+ }
29980
30014
  const textNode = child && fastNodeType(child) === /* Node.TEXT_NODE */
29981
30015
  3 ? child : null;
29982
30016
  if (combinedText === null) {
@@ -30633,7 +30667,7 @@ function diffJsxVNodeChildren(received, expected, path, container, isSsr, diffs)
30633
30667
  const expectedChildren = getFilteredJSXChildren(allExpectedChildren, isSsr, {
30634
30668
  mergedText: void 0
30635
30669
  });
30636
- if ((0, import_internal3._isJSXNode)(expected)) {
30670
+ if ((0, import_internal4._isJSXNode)(expected)) {
30637
30671
  expected.children = expectedChildren;
30638
30672
  }
30639
30673
  const receivedChildren = getVNodeChildren(container, received);
@@ -30670,7 +30704,7 @@ function getFilteredJSXChildren(children, isSsr, data) {
30670
30704
  }
30671
30705
  continue;
30672
30706
  }
30673
- if (isSsr && (0, import_internal3._isJSXNode)(child) && isSkippableNode(child)) {
30707
+ if (isSsr && (0, import_internal4._isJSXNode)(child) && isSkippableNode(child)) {
30674
30708
  const skippedNodeChildren = getJSXChildren(child);
30675
30709
  processChildren(skippedNodeChildren);
30676
30710
  } else {
@@ -30751,7 +30785,7 @@ function shouldSkip(vNode) {
30751
30785
  return false;
30752
30786
  }
30753
30787
  function walkJSX(jsx3, apply) {
30754
- if ((0, import_internal3._isJSXNode)(jsx3)) {
30788
+ if ((0, import_internal4._isJSXNode)(jsx3)) {
30755
30789
  apply.enter(jsx3);
30756
30790
  if (Array.isArray(jsx3.children)) {
30757
30791
  for (const child of jsx3.children) {
@@ -30768,9 +30802,9 @@ function walkJSX(jsx3, apply) {
30768
30802
  if ((0, import_core.isSignal)(child)) {
30769
30803
  child = child.value;
30770
30804
  }
30771
- if ((0, import_internal3._isStringifiable)(child)) {
30805
+ if ((0, import_internal4._isStringifiable)(child)) {
30772
30806
  apply.text(child);
30773
- } else if ((0, import_internal3._isJSXNode)(child)) {
30807
+ } else if ((0, import_internal4._isJSXNode)(child)) {
30774
30808
  walkJSX(child, apply);
30775
30809
  } else {
30776
30810
  throw new Error("Unknown type: " + child);
@@ -32497,6 +32531,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32497
32531
  for (let i = 0; i < fragmentAttrs.length; ) {
32498
32532
  const key = fragmentAttrs[i++];
32499
32533
  let value = fragmentAttrs[i++];
32534
+ let encodeValue = false;
32500
32535
  if (typeof value !== "string") {
32501
32536
  const rootId = addRoot(value);
32502
32537
  if (rootId === void 0) {
@@ -32518,6 +32553,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32518
32553
  write(VNodeDataChar.PROPS_CHAR);
32519
32554
  break;
32520
32555
  case ELEMENT_KEY:
32556
+ encodeValue = true;
32521
32557
  write(VNodeDataChar.KEY_CHAR);
32522
32558
  break;
32523
32559
  case ELEMENT_SEQ:
@@ -32544,7 +32580,15 @@ var SSRContainer = class extends import_core6._SharedContainer {
32544
32580
  write(key);
32545
32581
  write(VNodeDataChar.SEPARATOR_CHAR);
32546
32582
  }
32547
- write(value);
32583
+ const encodedValue = encodeValue ? encodeURI(value) : value;
32584
+ const isEncoded = encodeValue ? encodedValue !== value : false;
32585
+ if (isEncoded) {
32586
+ write(VNodeDataChar.SEPARATOR_CHAR);
32587
+ write(encodedValue);
32588
+ write(VNodeDataChar.SEPARATOR_CHAR);
32589
+ } else {
32590
+ write(value);
32591
+ }
32548
32592
  }
32549
32593
  }
32550
32594
  this.closeElement();
@@ -32638,7 +32682,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32638
32682
  if (unclaimedProjections.length) {
32639
32683
  const previousCurrentComponentNode = this.currentComponentNode;
32640
32684
  try {
32641
- this.openElement(QTemplate, ["style", "display:none"], null);
32685
+ this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
32642
32686
  let idx = 0;
32643
32687
  let ssrComponentNode = null;
32644
32688
  let ssrComponentFrame = null;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/testing 2.0.0-beta.2-dev+3ddc6c7
3
+ * @qwik.dev/core/testing 2.0.0-beta.3-dev+aa098fc
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
@@ -23066,6 +23066,7 @@ var isServerPlatform = () => {
23066
23066
  // packages/qwik/src/core/shared/qrl/qrl-class.ts
23067
23067
  import { isBrowser as isBrowser2, isDev as isDev5 } from "@qwik.dev/core/build";
23068
23068
  import { p as preload } from "@qwik.dev/core/preloader";
23069
+ var resolvedSymbol = Symbol("resolved");
23069
23070
  var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23070
23071
  if (qDev && qSerialize) {
23071
23072
  if (captureRef) {
@@ -23114,9 +23115,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23114
23115
  };
23115
23116
  return bound;
23116
23117
  }
23117
- const resolveLazy = (containerEl) => {
23118
- return symbolRef !== null ? symbolRef : resolve(containerEl);
23119
- };
23120
23118
  const wrapFn = (fn) => {
23121
23119
  if (typeof fn !== "function" || !capture?.length && !captureRef?.length) {
23122
23120
  return fn;
@@ -23141,7 +23139,10 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23141
23139
  return invoke.call(this, context, fn, ...args);
23142
23140
  };
23143
23141
  };
23144
- const resolve = async (containerEl) => {
23142
+ if (symbolFn && resolvedSymbol in symbolFn) {
23143
+ symbolRef = symbolFn[resolvedSymbol];
23144
+ }
23145
+ const resolve = symbolRef ? async () => symbolRef : async (containerEl) => {
23145
23146
  if (symbolRef !== null) {
23146
23147
  return symbolRef;
23147
23148
  }
@@ -23161,14 +23162,17 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23161
23162
  const start = now();
23162
23163
  const ctx = tryGetInvokeContext();
23163
23164
  if (symbolFn !== null) {
23164
- symbolRef = symbolFn().then(
23165
- (module) => qrl.resolved = wrapFn(symbolRef = module[symbol])
23166
- );
23165
+ symbolRef = symbolFn().then((module) => {
23166
+ const resolved = wrapFn(symbolRef = module[symbol]);
23167
+ symbolFn[resolvedSymbol] = resolved;
23168
+ qrl.resolved = resolved;
23169
+ return resolved;
23170
+ });
23167
23171
  } else {
23168
23172
  const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);
23169
23173
  symbolRef = maybeThen(imported, (ref) => qrl.resolved = wrapFn(symbolRef = ref));
23170
23174
  }
23171
- if (typeof symbolRef === "object" && isPromise(symbolRef)) {
23175
+ if (isPromise(symbolRef)) {
23172
23176
  symbolRef.then(
23173
23177
  () => emitUsedSymbol(symbol, ctx?.$element$, start),
23174
23178
  (err) => {
@@ -23194,7 +23198,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
23194
23198
  getHash: () => hash3,
23195
23199
  getCaptured: () => captureRef,
23196
23200
  resolve,
23197
- $resolveLazy$: resolveLazy,
23198
23201
  $setContainer$: setContainer,
23199
23202
  $chunk$: chunk,
23200
23203
  $symbol$: symbol,
@@ -24129,7 +24132,6 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
24129
24132
  if (!isInlineComponent) {
24130
24133
  container.setHostProp(renderHost, ELEMENT_SEQ_IDX, null);
24131
24134
  container.setHostProp(renderHost, USE_ON_LOCAL_SEQ_IDX, null);
24132
- container.setHostProp(renderHost, ELEMENT_PROPS, props);
24133
24135
  }
24134
24136
  if (vnode_isVNode(renderHost)) {
24135
24137
  clearAllEffects(container, renderHost);
@@ -25140,11 +25142,22 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
25140
25142
  shouldRender = true;
25141
25143
  }
25142
25144
  if (host) {
25143
- const vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
25144
- shouldRender = shouldRender || propsDiffer(jsxProps, vNodeProps);
25145
+ let vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
25146
+ const propsAreDifferent = propsDiffer(jsxProps, vNodeProps);
25147
+ shouldRender = shouldRender || propsAreDifferent;
25145
25148
  if (shouldRender) {
25149
+ if (propsAreDifferent) {
25150
+ if (vNodeProps) {
25151
+ vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS];
25152
+ vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS];
25153
+ } else if (jsxProps) {
25154
+ vnode_setProp(host, ELEMENT_PROPS, jsxProps);
25155
+ vNodeProps = jsxProps;
25156
+ }
25157
+ }
25158
+ vnode_setProp(host, OnRenderProp, componentQRL);
25146
25159
  host[0 /* flags */] &= ~32 /* Deleted */;
25147
- container.$scheduler$(6 /* COMPONENT */, host, componentQRL, jsxProps);
25160
+ container.$scheduler$(6 /* COMPONENT */, host, componentQRL, vNodeProps);
25148
25161
  }
25149
25162
  }
25150
25163
  descendContentToProject(jsxNode2.children, host);
@@ -25686,21 +25699,24 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25686
25699
  {
25687
25700
  const target = chore.$target$;
25688
25701
  const effects = chore.$payload$;
25702
+ const ctx = newInvokeContext();
25703
+ ctx.$container$ = container;
25689
25704
  if (target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
25690
25705
  const forceRunEffects = target.$forceRunEffects$;
25691
25706
  target.$forceRunEffects$ = false;
25692
- if (!target.$effects$?.size) {
25707
+ if (!effects?.size) {
25693
25708
  break;
25694
25709
  }
25695
- returnValue = retryOnPromise(() => {
25696
- if (target.$computeIfNeeded$() || forceRunEffects) {
25697
- triggerEffects(container, target, effects);
25710
+ returnValue = maybeThen(
25711
+ retryOnPromise(() => invoke.call(target, ctx, target.$computeIfNeeded$)),
25712
+ (didChange) => {
25713
+ if (didChange || forceRunEffects) {
25714
+ return retryOnPromise(() => triggerEffects(container, target, effects));
25715
+ }
25698
25716
  }
25699
- });
25717
+ );
25700
25718
  } else {
25701
- returnValue = retryOnPromise(() => {
25702
- triggerEffects(container, target, effects);
25703
- });
25719
+ returnValue = retryOnPromise(() => triggerEffects(container, target, effects));
25704
25720
  }
25705
25721
  }
25706
25722
  break;
@@ -25764,7 +25780,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25764
25780
  if (idxDiff !== 0) {
25765
25781
  return idxDiff;
25766
25782
  }
25767
- if (a.$target$ !== b.$target$ || a.$payload$ !== b.$payload$) {
25783
+ if (a.$target$ !== b.$target$) {
25784
+ if (isQrl(a.$target$) && isQrl(b.$target$) && a.$target$.$hash$ === b.$target$.$hash$) {
25785
+ return 0;
25786
+ }
25768
25787
  return 1;
25769
25788
  }
25770
25789
  if (b === currentChore) {
@@ -25796,7 +25815,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
25796
25815
  return value;
25797
25816
  }
25798
25817
  const existing = sortedArray[idx];
25799
- if (existing.$type$ === 4 /* NODE_DIFF */) {
25818
+ if (existing.$payload$ !== value.$payload$) {
25800
25819
  existing.$payload$ = value.$payload$;
25801
25820
  }
25802
25821
  if (existing.$executed$) {
@@ -29640,11 +29659,14 @@ var processVNodeData2 = (vData, callback) => {
29640
29659
  let nextToConsumeIdx = 0;
29641
29660
  let ch = 0;
29642
29661
  let peekCh = 0;
29662
+ const getChar = (idx) => {
29663
+ return idx < vData.length ? vData.charCodeAt(idx) : 0;
29664
+ };
29643
29665
  const peek = () => {
29644
29666
  if (peekCh !== 0) {
29645
29667
  return peekCh;
29646
29668
  } else {
29647
- return peekCh = nextToConsumeIdx < vData.length ? vData.charCodeAt(nextToConsumeIdx) : 0;
29669
+ return peekCh = getChar(nextToConsumeIdx);
29648
29670
  }
29649
29671
  };
29650
29672
  const consume = () => {
@@ -29662,7 +29684,7 @@ var processVNodeData2 = (vData, callback) => {
29662
29684
  return vData.substring(start, nextToConsumeIdx);
29663
29685
  };
29664
29686
  while (peek() !== 0) {
29665
- callback(peek, consumeValue, consume, nextToConsumeIdx);
29687
+ callback(peek, consumeValue, consume, getChar, nextToConsumeIdx);
29666
29688
  }
29667
29689
  };
29668
29690
  var vnode_getNextSibling = (vnode) => {
@@ -29870,17 +29892,17 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29870
29892
  let textIdx = 0;
29871
29893
  let combinedText = null;
29872
29894
  let container = null;
29873
- processVNodeData2(vData, (peek, consumeValue, consume, nextToConsumeIdx) => {
29895
+ processVNodeData2(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
29874
29896
  if (isNumber(peek())) {
29875
- while (!isElement2(child)) {
29897
+ while (!isElement2(child) || // We pretend that style element's don't exist as they can get moved out.
29898
+ // skip over style elements, as those need to be moved to the head
29899
+ // and are not included in the counts.
29900
+ isQStyleElement(child)) {
29876
29901
  child = fastNextSibling(child);
29877
29902
  if (!child) {
29878
29903
  throw qError(27 /* materializeVNodeDataError */, [vData, peek(), nextToConsumeIdx]);
29879
29904
  }
29880
29905
  }
29881
- while (isQStyleElement(child)) {
29882
- child = fastNextSibling(child);
29883
- }
29884
29906
  combinedText = null;
29885
29907
  previousTextNode = null;
29886
29908
  let value = 0;
@@ -29906,7 +29928,16 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29906
29928
  } else if (peek() === VNodeDataChar.PROPS) {
29907
29929
  vnode_setAttr(null, vParent, ELEMENT_PROPS, consumeValue());
29908
29930
  } else if (peek() === VNodeDataChar.KEY) {
29909
- vnode_setAttr(null, vParent, ELEMENT_KEY, consumeValue());
29931
+ const isEscapedValue = getChar(nextToConsumeIdx + 1) === VNodeDataChar.SEPARATOR;
29932
+ let value;
29933
+ if (isEscapedValue) {
29934
+ consume();
29935
+ value = decodeURI(consumeValue());
29936
+ consume();
29937
+ } else {
29938
+ value = consumeValue();
29939
+ }
29940
+ vnode_setAttr(null, vParent, ELEMENT_KEY, value);
29910
29941
  } else if (peek() === VNodeDataChar.SEQ) {
29911
29942
  vnode_setAttr(null, vParent, ELEMENT_SEQ, consumeValue());
29912
29943
  } else if (peek() === VNodeDataChar.SEQ_IDX) {
@@ -29942,6 +29973,9 @@ function materializeFromVNodeData(vParent, vData, element, child) {
29942
29973
  } else if (peek() === VNodeDataChar.SLOT) {
29943
29974
  vnode_setAttr(null, vParent, QSlot, consumeValue());
29944
29975
  } else {
29976
+ while (isQStyleElement(child)) {
29977
+ child = fastNextSibling(child);
29978
+ }
29945
29979
  const textNode = child && fastNodeType(child) === /* Node.TEXT_NODE */
29946
29980
  3 ? child : null;
29947
29981
  if (combinedText === null) {
@@ -32468,6 +32502,7 @@ var SSRContainer = class extends _SharedContainer2 {
32468
32502
  for (let i = 0; i < fragmentAttrs.length; ) {
32469
32503
  const key = fragmentAttrs[i++];
32470
32504
  let value = fragmentAttrs[i++];
32505
+ let encodeValue = false;
32471
32506
  if (typeof value !== "string") {
32472
32507
  const rootId = addRoot(value);
32473
32508
  if (rootId === void 0) {
@@ -32489,6 +32524,7 @@ var SSRContainer = class extends _SharedContainer2 {
32489
32524
  write(VNodeDataChar.PROPS_CHAR);
32490
32525
  break;
32491
32526
  case ELEMENT_KEY:
32527
+ encodeValue = true;
32492
32528
  write(VNodeDataChar.KEY_CHAR);
32493
32529
  break;
32494
32530
  case ELEMENT_SEQ:
@@ -32515,7 +32551,15 @@ var SSRContainer = class extends _SharedContainer2 {
32515
32551
  write(key);
32516
32552
  write(VNodeDataChar.SEPARATOR_CHAR);
32517
32553
  }
32518
- write(value);
32554
+ const encodedValue = encodeValue ? encodeURI(value) : value;
32555
+ const isEncoded = encodeValue ? encodedValue !== value : false;
32556
+ if (isEncoded) {
32557
+ write(VNodeDataChar.SEPARATOR_CHAR);
32558
+ write(encodedValue);
32559
+ write(VNodeDataChar.SEPARATOR_CHAR);
32560
+ } else {
32561
+ write(value);
32562
+ }
32519
32563
  }
32520
32564
  }
32521
32565
  this.closeElement();
@@ -32604,7 +32648,7 @@ var SSRContainer = class extends _SharedContainer2 {
32604
32648
  if (unclaimedProjections.length) {
32605
32649
  const previousCurrentComponentNode = this.currentComponentNode;
32606
32650
  try {
32607
- this.openElement(QTemplate, ["style", "display:none"], null);
32651
+ this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
32608
32652
  let idx = 0;
32609
32653
  let ssrComponentNode = null;
32610
32654
  let ssrComponentFrame = null;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/testing",
3
- "version": "2.0.0-beta.2-dev+3ddc6c7",
3
+ "version": "2.0.0-beta.3-dev+aa098fc",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qwik.dev/core",
3
3
  "description": "An open source framework for building instant loading web apps at any scale, without the extra effort.",
4
- "version": "2.0.0-beta.2",
4
+ "version": "2.0.0-beta.3",
5
5
  "author": "Qwik Team",
6
6
  "bin": {
7
7
  "qwik": "./qwik-cli.cjs"
@@ -9,16 +9,16 @@
9
9
  "bugs": "https://github.com/QwikDev/qwik/issues",
10
10
  "dependencies": {
11
11
  "csstype": "^3.1",
12
- "rollup": ">= 4.39.0"
12
+ "rollup": "^4.44.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "ignore": "5.3.1",
16
16
  "image-size": "1.1.1",
17
17
  "kleur": "4.1.5",
18
- "prettier": "3.4.2",
18
+ "prettier": "3.5.3",
19
19
  "ts-morph": "23.0.0",
20
- "vitest": "3.1.1",
21
- "@qwik.dev/core": "2.0.0-beta.2",
20
+ "vitest": "3.2.4",
21
+ "@qwik.dev/core": "2.0.0-beta.3",
22
22
  "@qwik.dev/dom": "2.1.19"
23
23
  },
24
24
  "engines": {
@@ -181,7 +181,7 @@
181
181
  "main": "./src/index.ts",
182
182
  "peerDependencies": {
183
183
  "prettier": "*",
184
- "vite": ">=5 <7",
184
+ "vite": ">=5 <8",
185
185
  "vitest": ">=2 <3"
186
186
  },
187
187
  "peerDependenciesMeta": {