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

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.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-alpha.5-dev+cb53bbd",
3
+ "version": "2.0.0-alpha.6-dev+d848ba5",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-alpha.5-dev+cb53bbd
3
+ * @qwik.dev/core/cli 2.0.0-alpha.6-dev+d848ba5
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
@@ -5321,26 +5321,6 @@ async function removeTsMorphFromPackageJson() {
5321
5321
  await writePackageJson(process.cwd(), packageJson);
5322
5322
  }
5323
5323
 
5324
- // packages/qwik/src/cli/migrate-v2/update-configurations.ts
5325
- var import_fs4 = require("fs");
5326
- init_dist2();
5327
- function updateConfigurations() {
5328
- try {
5329
- updateTsconfig();
5330
- } catch (error) {
5331
- f2.error("Failed to update tsconfig.json configuration.");
5332
- }
5333
- }
5334
- function updateTsconfig() {
5335
- const tsConfigPath = "tsconfig.json";
5336
- const tsConfig = JSON.parse((0, import_fs4.readFileSync)(tsConfigPath, "utf-8"));
5337
- if (!tsConfig) {
5338
- return;
5339
- }
5340
- tsConfig.compilerOptions.moduleResolution = "bundler";
5341
- (0, import_fs4.writeFileSync)(tsConfigPath, JSON.stringify(tsConfig, null, 2));
5342
- }
5343
-
5344
5324
  // packages/qwik/src/cli/migrate-v2/run-migration.ts
5345
5325
  async function runV2Migration(app) {
5346
5326
  oe(
@@ -5384,7 +5364,6 @@ ${bold(bgRed('Warning: migration tool is experimental and will migrate your appl
5384
5364
  if (installedTsMorph) {
5385
5365
  await removeTsMorphFromPackageJson();
5386
5366
  }
5387
- updateConfigurations();
5388
5367
  await updateDependencies();
5389
5368
  f2.success(`${green(`Your application has been successfully migrated to v2!`)}`);
5390
5369
  } catch (error) {
@@ -5534,7 +5513,7 @@ async function printHelp(app) {
5534
5513
  await runCommand2(Object.assign(app, { task: args[0], args }));
5535
5514
  }
5536
5515
  function printVersion() {
5537
- console.log("2.0.0-alpha.5-dev+cb53bbd");
5516
+ console.log("2.0.0-alpha.6-dev+d848ba5");
5538
5517
  }
5539
5518
  // Annotate the CommonJS export names for ESM import in node:
5540
5519
  0 && (module.exports = {
@@ -2531,7 +2531,7 @@ declare type SpecialAttrs = {
2531
2531
  * For type: HTMLInputTypeAttribute, excluding 'button' | 'reset' | 'submit' | 'checkbox' |
2532
2532
  * 'radio'
2533
2533
  */
2534
- 'bind:value'?: Signal<string | undefined>;
2534
+ 'bind:value'?: Signal<string | undefined | number>;
2535
2535
  enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;
2536
2536
  height?: Size | undefined;
2537
2537
  max?: number | string | undefined;
@@ -3732,7 +3732,7 @@ export declare const _VAR_PROPS: unique symbol;
3732
3732
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
3733
3733
 
3734
3734
  /**
3735
- * 2.0.0-alpha.5-dev+cb53bbd
3735
+ * 2.0.0-alpha.6-dev+d848ba5
3736
3736
  *
3737
3737
  * @public
3738
3738
  */
package/dist/core.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core 2.0.0-alpha.5-dev+cb53bbd
3
+ * @qwik.dev/core 2.0.0-alpha.6-dev+d848ba5
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
@@ -165,7 +165,6 @@
165
165
  "Element must have 'q:container' attribute.", // 42
166
166
  'Unknown vnode type {{0}}.', // 43
167
167
  'Materialize error: missing element: {{0}} {{1}} {{2}}', // 44
168
- 'SsrError: {{0}}', // 45
169
168
  'Cannot coerce a Signal, use `.value` instead', // 46
170
169
  'useComputedSignal$ QRL {{0}} {{1}} returned a Promise', // 47
171
170
  'ComputedSignal is read-only', // 48
@@ -237,19 +236,130 @@
237
236
  QError[QError["elementWithoutContainer"] = 42] = "elementWithoutContainer";
238
237
  QError[QError["invalidVNodeType"] = 43] = "invalidVNodeType";
239
238
  QError[QError["materializeVNodeDataError"] = 44] = "materializeVNodeDataError";
240
- QError[QError["serverHostMismatch"] = 45] = "serverHostMismatch";
241
- QError[QError["cannotCoerceSignal"] = 46] = "cannotCoerceSignal";
242
- QError[QError["computedNotSync"] = 47] = "computedNotSync";
243
- QError[QError["computedReadOnly"] = 48] = "computedReadOnly";
244
- QError[QError["wrappedReadOnly"] = 49] = "wrappedReadOnly";
245
- QError[QError["promisesNotExpected"] = 50] = "promisesNotExpected";
246
- QError[QError["unsafeAttr"] = 51] = "unsafeAttr";
239
+ QError[QError["cannotCoerceSignal"] = 45] = "cannotCoerceSignal";
240
+ QError[QError["computedNotSync"] = 46] = "computedNotSync";
241
+ QError[QError["computedReadOnly"] = 47] = "computedReadOnly";
242
+ QError[QError["wrappedReadOnly"] = 48] = "wrappedReadOnly";
243
+ QError[QError["promisesNotExpected"] = 49] = "promisesNotExpected";
244
+ QError[QError["unsafeAttr"] = 50] = "unsafeAttr";
247
245
  })(QError || (QError = {}));
248
246
  const qError = (code, errorMessageArgs = []) => {
249
247
  const text = codeToText(code, ...errorMessageArgs);
250
248
  return logErrorAndStop(text, ...errorMessageArgs);
251
249
  };
252
250
 
251
+ /**
252
+ * A friendly name tag for a VirtualVNode.
253
+ *
254
+ * Theses are used to give a name to a VirtualVNode. This is useful for debugging and testing.
255
+ *
256
+ * The name is only added in development mode and is not included in production builds.
257
+ */
258
+ const DEBUG_TYPE = 'q:type';
259
+ var VirtualType;
260
+ (function (VirtualType) {
261
+ VirtualType["Virtual"] = "V";
262
+ VirtualType["Fragment"] = "F";
263
+ VirtualType["WrappedSignal"] = "S";
264
+ VirtualType["Awaited"] = "A";
265
+ VirtualType["Component"] = "C";
266
+ VirtualType["InlineComponent"] = "I";
267
+ VirtualType["Projection"] = "P";
268
+ })(VirtualType || (VirtualType = {}));
269
+ const START = '\x1b[34m';
270
+ const END = '\x1b[0m';
271
+ const VirtualTypeName = {
272
+ [VirtualType.Virtual]: /* ********* */ START + 'Virtual' + END, //
273
+ [VirtualType.Fragment]: /* ******** */ START + 'Fragment' + END, //
274
+ [VirtualType.WrappedSignal]: /* *** */ START + 'Signal' + END, //
275
+ [VirtualType.Awaited]: /* ********* */ START + 'Awaited' + END, //
276
+ [VirtualType.Component]: /* ******* */ START + 'Component' + END, //
277
+ [VirtualType.InlineComponent]: /* * */ START + 'InlineComponent' + END, //
278
+ [VirtualType.Projection]: /* ****** */ START + 'Projection' + END, //
279
+ };
280
+ var QContainerValue;
281
+ (function (QContainerValue) {
282
+ QContainerValue["PAUSED"] = "paused";
283
+ QContainerValue["RESUMED"] = "resumed";
284
+ // these values below are used in the qwik loader as a plain text for the q:container selector
285
+ // standard dangerouslySetInnerHTML
286
+ QContainerValue["HTML"] = "html";
287
+ // textarea
288
+ QContainerValue["TEXT"] = "text";
289
+ })(QContainerValue || (QContainerValue = {}));
290
+
291
+ /** State factory of the component. */
292
+ const OnRenderProp = 'q:renderFn';
293
+ /** Component style content prefix */
294
+ const ComponentStylesPrefixContent = '⭐️';
295
+ /** `<some-element q:slot="...">` */
296
+ const QSlot = 'q:slot';
297
+ const QSlotParent = ':';
298
+ const QSlotRef = 'q:sref';
299
+ const QSlotS = 'q:s';
300
+ const QStyle = 'q:style';
301
+ const QStyleSelector = 'style[q\\:style]';
302
+ const QStyleSSelector = 'style[q\\:sstyle]';
303
+ const QStylesAllSelector = QStyleSelector + ',' + QStyleSSelector;
304
+ const QScopedStyle = 'q:sstyle';
305
+ const QCtxAttr = 'q:ctx';
306
+ const QSubscribers = 'q:subs';
307
+ const QFuncsPrefix = 'qFuncs_';
308
+ const getQFuncs = (document, hash) => {
309
+ return document[QFuncsPrefix + hash] || [];
310
+ };
311
+ const QBaseAttr = 'q:base';
312
+ const QLocaleAttr = 'q:locale';
313
+ const QManifestHashAttr = 'q:manifest-hash';
314
+ const QInstanceAttr = 'q:instance';
315
+ const QContainerIsland = 'q:container-island';
316
+ const QContainerIslandEnd = '/' + QContainerIsland;
317
+ const QIgnore = 'q:ignore';
318
+ const QIgnoreEnd = '/' + QIgnore;
319
+ const QContainerAttr = 'q:container';
320
+ const QContainerAttrEnd = '/' + QContainerAttr;
321
+ const QTemplate = 'q:template';
322
+ // the same selector should be inside the qwik loader
323
+ // and the same selector should be inside the qwik router spa-shim and spa-init
324
+ const QContainerSelector = '[q\\:container]:not([q\\:container=' +
325
+ QContainerValue.HTML +
326
+ ']):not([q\\:container=' +
327
+ QContainerValue.TEXT +
328
+ '])';
329
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
330
+ const SVG_NS = 'http://www.w3.org/2000/svg';
331
+ const MATH_NS = 'http://www.w3.org/1998/Math/MathML';
332
+ const ResourceEvent = 'qResource';
333
+ const RenderEvent = 'qRender';
334
+ const TaskEvent = 'qTask';
335
+ const QDefaultSlot = '';
336
+ /**
337
+ * Attribute to mark that this VNode has a pointer to itself from the `qwik/json` state.
338
+ *
339
+ * As the VNode get materialized the vnode now becomes eligible for mutation. Once the vnode mutates
340
+ * the `VNode` references from the `qwik/json` may become invalid. For this reason, these references
341
+ * need to be eagerly resolved. `VNODE_REF` stores a pointer to "this" vnode. This allows the system
342
+ * to eagerly resolve these pointes as the vnodes are materialized.
343
+ */
344
+ const ELEMENT_ID = 'q:id';
345
+ const ELEMENT_KEY = 'q:key';
346
+ const ELEMENT_PROPS = 'q:props';
347
+ const ELEMENT_SEQ = 'q:seq';
348
+ const ELEMENT_SEQ_IDX = 'q:seqIdx';
349
+ const Q_PREFIX = 'q:';
350
+ /** Non serializable markers - always begins with `:` character */
351
+ const NON_SERIALIZABLE_MARKER_PREFIX = ':';
352
+ const USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + 'on';
353
+ const USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + 'onIdx';
354
+ const USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + 'onFlags';
355
+ // comment nodes
356
+ const FLUSH_COMMENT = 'qkssr-f';
357
+ const STREAM_BLOCK_START_COMMENT = 'qkssr-pu';
358
+ const STREAM_BLOCK_END_COMMENT = 'qkssr-po';
359
+ const Q_PROPS_SEPARATOR = ':';
360
+ const dangerouslySetInnerHTML = 'dangerouslySetInnerHTML';
361
+ const qwikInspectorAttr = 'data-qwik-inspector';
362
+
253
363
  // keep this import from core/build so the cjs build works
254
364
  const createPlatform = () => {
255
365
  return {
@@ -310,7 +420,7 @@
310
420
  */
311
421
  const toUrl = (doc, containerEl, url) => {
312
422
  const baseURI = doc.baseURI;
313
- const base = new URL(containerEl.getAttribute('q:base') ?? baseURI, baseURI);
423
+ const base = new URL(containerEl.getAttribute(QBaseAttr) ?? baseURI, baseURI);
314
424
  return new URL(url, base);
315
425
  };
316
426
  let _platform = /*#__PURE__ */ createPlatform();
@@ -402,15 +512,24 @@
402
512
  setTimeout(resolve, timeout);
403
513
  });
404
514
  };
515
+ // Retries a function that throws a promise.
405
516
  function retryOnPromise(fn, retryCount = 0) {
406
- try {
407
- return fn();
408
- }
409
- catch (e) {
517
+ const retryOrThrow = (e) => {
410
518
  if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
411
519
  return e.then(retryOnPromise.bind(null, fn, retryCount++));
412
520
  }
413
521
  throw e;
522
+ };
523
+ try {
524
+ const result = fn();
525
+ if (isPromise(result)) {
526
+ // not awaited promise is not caught by try/catch block
527
+ return result.catch((e) => retryOrThrow(e));
528
+ }
529
+ return result;
530
+ }
531
+ catch (e) {
532
+ return retryOrThrow(e);
414
533
  }
415
534
  }
416
535
 
@@ -453,118 +572,6 @@
453
572
  VNodeDataFlag[VNodeDataFlag["SERIALIZE"] = 16] = "SERIALIZE";
454
573
  })(VNodeDataFlag || (VNodeDataFlag = {}));
455
574
 
456
- /**
457
- * A friendly name tag for a VirtualVNode.
458
- *
459
- * Theses are used to give a name to a VirtualVNode. This is useful for debugging and testing.
460
- *
461
- * The name is only added in development mode and is not included in production builds.
462
- */
463
- const DEBUG_TYPE = 'q:type';
464
- var VirtualType;
465
- (function (VirtualType) {
466
- VirtualType["Virtual"] = "V";
467
- VirtualType["Fragment"] = "F";
468
- VirtualType["WrappedSignal"] = "S";
469
- VirtualType["Awaited"] = "A";
470
- VirtualType["Component"] = "C";
471
- VirtualType["InlineComponent"] = "I";
472
- VirtualType["Projection"] = "P";
473
- })(VirtualType || (VirtualType = {}));
474
- const START = '\x1b[34m';
475
- const END = '\x1b[0m';
476
- const VirtualTypeName = {
477
- [VirtualType.Virtual]: /* ********* */ START + 'Virtual' + END, //
478
- [VirtualType.Fragment]: /* ******** */ START + 'Fragment' + END, //
479
- [VirtualType.WrappedSignal]: /* *** */ START + 'Signal' + END, //
480
- [VirtualType.Awaited]: /* ********* */ START + 'Awaited' + END, //
481
- [VirtualType.Component]: /* ******* */ START + 'Component' + END, //
482
- [VirtualType.InlineComponent]: /* * */ START + 'InlineComponent' + END, //
483
- [VirtualType.Projection]: /* ****** */ START + 'Projection' + END, //
484
- };
485
- var QContainerValue;
486
- (function (QContainerValue) {
487
- QContainerValue["PAUSED"] = "paused";
488
- QContainerValue["RESUMED"] = "resumed";
489
- // these values below are used in the qwik loader as a plain text for the q:container selector
490
- // standard dangerouslySetInnerHTML
491
- QContainerValue["HTML"] = "html";
492
- // textarea
493
- QContainerValue["TEXT"] = "text";
494
- })(QContainerValue || (QContainerValue = {}));
495
-
496
- /** State factory of the component. */
497
- const OnRenderProp = 'q:renderFn';
498
- /** Component style content prefix */
499
- const ComponentStylesPrefixContent = '⭐️';
500
- /** `<some-element q:slot="...">` */
501
- const QSlot = 'q:slot';
502
- const QSlotParent = ':';
503
- const QSlotRef = 'q:sref';
504
- const QSlotS = 'q:s';
505
- const QStyle = 'q:style';
506
- const QStyleSelector = 'style[q\\:style]';
507
- const QStyleSSelector = 'style[q\\:sstyle]';
508
- const QStylesAllSelector = QStyleSelector + ',' + QStyleSSelector;
509
- const QScopedStyle = 'q:sstyle';
510
- const QCtxAttr = 'q:ctx';
511
- const QSubscribers = 'q:subs';
512
- const QFuncsPrefix = 'qFuncs_';
513
- const getQFuncs = (document, hash) => {
514
- return document[QFuncsPrefix + hash] || [];
515
- };
516
- const QBaseAttr = 'q:base';
517
- const QLocaleAttr = 'q:locale';
518
- const QManifestHashAttr = 'q:manifest-hash';
519
- const QInstanceAttr = 'q:instance';
520
- const QContainerIsland = 'q:container-island';
521
- const QContainerIslandEnd = '/' + QContainerIsland;
522
- const QIgnore = 'q:ignore';
523
- const QIgnoreEnd = '/' + QIgnore;
524
- const QContainerAttr = 'q:container';
525
- const QContainerAttrEnd = '/' + QContainerAttr;
526
- const QTemplate = 'q:template';
527
- // the same selector should be inside the qwik loader
528
- // and the same selector should be inside the qwik router spa-shim and spa-init
529
- const QContainerSelector = '[q\\:container]:not([q\\:container=' +
530
- QContainerValue.HTML +
531
- ']):not([q\\:container=' +
532
- QContainerValue.TEXT +
533
- '])';
534
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
535
- const SVG_NS = 'http://www.w3.org/2000/svg';
536
- const MATH_NS = 'http://www.w3.org/1998/Math/MathML';
537
- const ResourceEvent = 'qResource';
538
- const RenderEvent = 'qRender';
539
- const TaskEvent = 'qTask';
540
- const QDefaultSlot = '';
541
- /**
542
- * Attribute to mark that this VNode has a pointer to itself from the `qwik/json` state.
543
- *
544
- * As the VNode get materialized the vnode now becomes eligible for mutation. Once the vnode mutates
545
- * the `VNode` references from the `qwik/json` may become invalid. For this reason, these references
546
- * need to be eagerly resolved. `VNODE_REF` stores a pointer to "this" vnode. This allows the system
547
- * to eagerly resolve these pointes as the vnodes are materialized.
548
- */
549
- const ELEMENT_ID = 'q:id';
550
- const ELEMENT_KEY = 'q:key';
551
- const ELEMENT_PROPS = 'q:props';
552
- const ELEMENT_SEQ = 'q:seq';
553
- const ELEMENT_SEQ_IDX = 'q:seqIdx';
554
- const Q_PREFIX = 'q:';
555
- /** Non serializable markers - always begins with `:` character */
556
- const NON_SERIALIZABLE_MARKER_PREFIX = ':';
557
- const USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + 'on';
558
- const USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + 'onIdx';
559
- const USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + 'onFlags';
560
- // comment nodes
561
- const FLUSH_COMMENT = 'qkssr-f';
562
- const STREAM_BLOCK_START_COMMENT = 'qkssr-pu';
563
- const STREAM_BLOCK_END_COMMENT = 'qkssr-po';
564
- const Q_PROPS_SEPARATOR = ':';
565
- const dangerouslySetInnerHTML = 'dangerouslySetInnerHTML';
566
- const qwikInspectorAttr = 'data-qwik-inspector';
567
-
568
575
  let _locale = undefined;
569
576
  /**
570
577
  * Retrieve the current locale.
@@ -1374,6 +1381,21 @@
1374
1381
  if (isStore(arg)) {
1375
1382
  clearStoreEffects(getStoreHandler(arg), subscriber);
1376
1383
  }
1384
+ else if (isPropsProxy(arg)) {
1385
+ // Separate check for props proxy, because props proxy getter could call signal getter.
1386
+ // To avoid that we need to get the constProps and varProps directly
1387
+ // from the props proxy object and loop over them.
1388
+ const constProps = arg[_CONST_PROPS];
1389
+ const varProps = arg[_VAR_PROPS];
1390
+ if (constProps) {
1391
+ for (const key in constProps) {
1392
+ clearArgEffect(constProps[key], subscriber, seenSet);
1393
+ }
1394
+ }
1395
+ for (const key in varProps) {
1396
+ clearArgEffect(varProps[key], subscriber, seenSet);
1397
+ }
1398
+ }
1377
1399
  else {
1378
1400
  for (const key in arg) {
1379
1401
  clearArgEffect(arg[key], subscriber, seenSet);
@@ -3583,6 +3605,108 @@
3583
3605
  */
3584
3606
  const createComputed$ = /*#__PURE__*/ implicit$FirstArg(createComputedQrl);
3585
3607
 
3608
+ /// These global variables are used to avoid creating new arrays for each call to `vnode_documentPosition`.
3609
+ const aVNodePath = [];
3610
+ const bVNodePath = [];
3611
+ /**
3612
+ * Compare two VNodes and determine their document position relative to each other.
3613
+ *
3614
+ * @param a VNode to compare
3615
+ * @param b VNode to compare
3616
+ * @param rootVNode - Root VNode of a container
3617
+ * @returns -1 if `a` is before `b`, 0 if `a` is the same as `b`, 1 if `a` is after `b`.
3618
+ */
3619
+ const vnode_documentPosition = (a, b, rootVNode) => {
3620
+ if (a === b) {
3621
+ return 0;
3622
+ }
3623
+ let aDepth = -1;
3624
+ let bDepth = -1;
3625
+ while (a) {
3626
+ const vNode = (aVNodePath[++aDepth] = a);
3627
+ a = (vNode[VNodeProps.parent] ||
3628
+ (rootVNode && vnode_getProp(a, QSlotParent, (id) => vnode_locate(rootVNode, id))));
3629
+ }
3630
+ while (b) {
3631
+ const vNode = (bVNodePath[++bDepth] = b);
3632
+ b = (vNode[VNodeProps.parent] ||
3633
+ (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))));
3634
+ }
3635
+ while (aDepth >= 0 && bDepth >= 0) {
3636
+ a = aVNodePath[aDepth];
3637
+ b = bVNodePath[bDepth];
3638
+ if (a === b) {
3639
+ // if the nodes are the same, we need to check the next level.
3640
+ aDepth--;
3641
+ bDepth--;
3642
+ }
3643
+ else {
3644
+ // We found a difference so we need to scan nodes at this level.
3645
+ let cursor = b;
3646
+ do {
3647
+ cursor = vnode_getNextSibling(cursor);
3648
+ if (cursor === a) {
3649
+ return 1;
3650
+ }
3651
+ } while (cursor);
3652
+ cursor = b;
3653
+ do {
3654
+ cursor = vnode_getPreviousSibling(cursor);
3655
+ if (cursor === a) {
3656
+ return -1;
3657
+ }
3658
+ } while (cursor);
3659
+ if (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))) {
3660
+ // The "b" node is a projection, so we need to set it after "a" node,
3661
+ // because the "a" node could be a context provider.
3662
+ return -1;
3663
+ }
3664
+ // The node is not in the list of siblings, that means it must be disconnected.
3665
+ return 1;
3666
+ }
3667
+ }
3668
+ return aDepth < bDepth ? -1 : 1;
3669
+ };
3670
+ /// These global variables are used to avoid creating new arrays for each call to `ssrNodeDocumentPosition`.
3671
+ const aSsrNodePath = [];
3672
+ const bSsrNodePath = [];
3673
+ /**
3674
+ * Compare two SSR nodes and determine their document position relative to each other. Compares only
3675
+ * position between parent and child.
3676
+ *
3677
+ * @param a SSR node to compare
3678
+ * @param b SSR node to compare
3679
+ * @returns -1 if `a` is before `b`, 0 if `a` is the same as `b`, 1 if `a` is after `b`.
3680
+ */
3681
+ const ssrNodeDocumentPosition = (a, b) => {
3682
+ if (a === b) {
3683
+ return 0;
3684
+ }
3685
+ let aDepth = -1;
3686
+ let bDepth = -1;
3687
+ while (a) {
3688
+ const ssrNode = (aSsrNodePath[++aDepth] = a);
3689
+ a = ssrNode.currentComponentNode;
3690
+ }
3691
+ while (b) {
3692
+ const ssrNode = (bSsrNodePath[++bDepth] = b);
3693
+ b = ssrNode.currentComponentNode;
3694
+ }
3695
+ while (aDepth >= 0 && bDepth >= 0) {
3696
+ a = aSsrNodePath[aDepth];
3697
+ b = bSsrNodePath[bDepth];
3698
+ if (a === b) {
3699
+ // if the nodes are the same, we need to check the next level.
3700
+ aDepth--;
3701
+ bDepth--;
3702
+ }
3703
+ else {
3704
+ return 1;
3705
+ }
3706
+ }
3707
+ return aDepth < bDepth ? -1 : 1;
3708
+ };
3709
+
3586
3710
  /**
3587
3711
  * Scheduler is responsible for running application code in predictable order.
3588
3712
  *
@@ -3745,7 +3869,7 @@
3745
3869
  }
3746
3870
  while (choreQueue.length) {
3747
3871
  const nextChore = choreQueue.shift();
3748
- const order = choreComparator(nextChore, runUptoChore, rootVNode, false);
3872
+ const order = choreComparator(nextChore, runUptoChore, rootVNode);
3749
3873
  if (order === null) {
3750
3874
  continue;
3751
3875
  }
@@ -3782,7 +3906,7 @@
3782
3906
  returnValue = safeCall(() => executeComponent(container, host, host, chore.$target$, chore.$payload$), (jsx) => {
3783
3907
  if (chore.$type$ === ChoreType.COMPONENT) {
3784
3908
  const styleScopedId = container.getHostProp(host, QScopedStyle);
3785
- return vnode_diff(container, jsx, host, addComponentStylePrefix(styleScopedId));
3909
+ return retryOnPromise(() => vnode_diff(container, jsx, host, addComponentStylePrefix(styleScopedId)));
3786
3910
  }
3787
3911
  else {
3788
3912
  return jsx;
@@ -3813,7 +3937,7 @@
3813
3937
  if (isSignal(jsx)) {
3814
3938
  jsx = jsx.value;
3815
3939
  }
3816
- returnValue = vnode_diff(container, jsx, parentVirtualNode, null);
3940
+ returnValue = retryOnPromise(() => vnode_diff(container, jsx, parentVirtualNode, null));
3817
3941
  break;
3818
3942
  case ChoreType.NODE_PROP:
3819
3943
  const virtualNode = chore.$host$;
@@ -3882,7 +4006,15 @@
3882
4006
  vnode_isVNode(chore.$host$) &&
3883
4007
  chore.$host$[VNodeProps.flags] & VNodeFlags.Deleted);
3884
4008
  }
3885
- function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
4009
+ /**
4010
+ * Compares two chores to determine their execution order in the scheduler's queue.
4011
+ *
4012
+ * @param a - The first chore to compare
4013
+ * @param b - The second chore to compare
4014
+ * @returns A number indicating the relative order of the chores. A negative number means `a` runs
4015
+ * before `b`.
4016
+ */
4017
+ function choreComparator(a, b, rootVNode) {
3886
4018
  const macroTypeDiff = (a.$type$ & ChoreType.MACRO) - (b.$type$ & ChoreType.MACRO);
3887
4019
  if (macroTypeDiff !== 0) {
3888
4020
  return macroTypeDiff;
@@ -3909,11 +4041,11 @@
3909
4041
  You are attempting to change a state that has already been streamed to the client.
3910
4042
  This can lead to inconsistencies between Server-Side Rendering (SSR) and Client-Side Rendering (CSR).
3911
4043
  Problematic Node: ${aHost.toString()}`;
3912
- if (shouldThrowOnHostMismatch) {
3913
- throw qError(QError.serverHostMismatch, [errorMessage]);
3914
- }
3915
4044
  logWarn(errorMessage);
3916
- return null;
4045
+ const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
4046
+ if (hostDiff !== 0) {
4047
+ return hostDiff;
4048
+ }
3917
4049
  }
3918
4050
  }
3919
4051
  const microTypeDiff = (a.$type$ & ChoreType.MICRO) - (b.$type$ & ChoreType.MICRO);
@@ -3944,7 +4076,7 @@
3944
4076
  while (bottom < top) {
3945
4077
  const middle = bottom + ((top - bottom) >> 1);
3946
4078
  const midChore = sortedArray[middle];
3947
- const comp = choreComparator(value, midChore, rootVNode, true);
4079
+ const comp = choreComparator(value, midChore, rootVNode);
3948
4080
  if (comp < 0) {
3949
4081
  top = middle;
3950
4082
  }
@@ -4966,7 +5098,7 @@
4966
5098
  *
4967
5099
  * @public
4968
5100
  */
4969
- const version = "2.0.0-alpha.5-dev+cb53bbd";
5101
+ const version = "2.0.0-alpha.6-dev+d848ba5";
4970
5102
 
4971
5103
  /** @internal */
4972
5104
  class _SharedContainer {
@@ -7074,60 +7206,6 @@
7074
7206
  throw qError(QError.invalidVNodeType, [type]);
7075
7207
  };
7076
7208
  const isElement = (node) => node && typeof node == 'object' && fastNodeType(node) === /** Node.ELEMENT_NODE* */ 1;
7077
- /// These global variables are used to avoid creating new arrays for each call to `vnode_documentPosition`.
7078
- const aPath = [];
7079
- const bPath = [];
7080
- const vnode_documentPosition = (a, b, rootVNode) => {
7081
- if (a === b) {
7082
- return 0;
7083
- }
7084
- let aDepth = -1;
7085
- let bDepth = -1;
7086
- while (a) {
7087
- const vNode = (aPath[++aDepth] = a);
7088
- a = (vNode[VNodeProps.parent] ||
7089
- (rootVNode && vnode_getProp(a, QSlotParent, (id) => vnode_locate(rootVNode, id))));
7090
- }
7091
- while (b) {
7092
- const vNode = (bPath[++bDepth] = b);
7093
- b = (vNode[VNodeProps.parent] ||
7094
- (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))));
7095
- }
7096
- while (aDepth >= 0 && bDepth >= 0) {
7097
- a = aPath[aDepth];
7098
- b = bPath[bDepth];
7099
- if (a === b) {
7100
- // if the nodes are the same, we need to check the next level.
7101
- aDepth--;
7102
- bDepth--;
7103
- }
7104
- else {
7105
- // We found a difference so we need to scan nodes at this level.
7106
- let cursor = b;
7107
- do {
7108
- cursor = vnode_getNextSibling(cursor);
7109
- if (cursor === a) {
7110
- return 1;
7111
- }
7112
- } while (cursor);
7113
- cursor = b;
7114
- do {
7115
- cursor = vnode_getPreviousSibling(cursor);
7116
- if (cursor === a) {
7117
- return -1;
7118
- }
7119
- } while (cursor);
7120
- if (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))) {
7121
- // The "b" node is a projection, so we need to set it after "a" node,
7122
- // because the "a" node could be a context provider.
7123
- return -1;
7124
- }
7125
- // The node is not in the list of siblings, that means it must be disconnected.
7126
- return 1;
7127
- }
7128
- }
7129
- return aDepth < bDepth ? -1 : 1;
7130
- };
7131
7209
  /**
7132
7210
  * Use this method to find the parent component for projection.
7133
7211
  *