vue 3.5.42 → 3.5.43

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,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.42
2
+ * vue v3.5.43
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.42
2
+ * vue v3.5.43
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -202,10 +202,10 @@ var Vue = (function (exports) {
202
202
  }
203
203
  const listDelimiterRE = /;(?![^(]*\))/g;
204
204
  const propertyDelimiterRE = /:([^]+)/;
205
- const styleCommentRE = /\/\*[^]*?\*\//g;
205
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
206
206
  function parseStringStyle(cssText) {
207
207
  const ret = {};
208
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
208
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
209
209
  if (item) {
210
210
  const tmp = item.split(propertyDelimiterRE);
211
211
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -297,22 +297,22 @@ var Vue = (function (exports) {
297
297
  );
298
298
  }
299
299
 
300
- function looseCompareArrays(a, b) {
300
+ function looseCompareArrays(a, b, seen) {
301
301
  if (a.length !== b.length) return false;
302
302
  let equal = true;
303
303
  for (let i = 0; equal && i < a.length; i++) {
304
- equal = looseEqual(a[i], b[i]);
304
+ equal = looseEqual(a[i], b[i], seen);
305
305
  }
306
306
  return equal;
307
307
  }
308
- function looseCompareCollections(a, b) {
308
+ function looseCompareCollections(a, b, seen) {
309
309
  if (a.size !== b.size) return false;
310
310
  const candidates = Array.from(b);
311
311
  const matched = new Uint8Array(candidates.length);
312
312
  for (const item of a) {
313
313
  let index = -1;
314
314
  for (let i = 0; i < candidates.length; i++) {
315
- if (!matched[i] && looseEqual(item, candidates[i])) {
315
+ if (!matched[i] && looseEqual(item, candidates[i], seen)) {
316
316
  index = i;
317
317
  break;
318
318
  }
@@ -322,7 +322,47 @@ var Vue = (function (exports) {
322
322
  }
323
323
  return true;
324
324
  }
325
- function looseEqual(a, b) {
325
+ function looseCompareObjects(a, b, seen) {
326
+ let aValidType = isMap(a);
327
+ let bValidType = isMap(b);
328
+ if (aValidType || bValidType) {
329
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
330
+ }
331
+ aValidType = isSet(a);
332
+ bValidType = isSet(b);
333
+ if (aValidType || bValidType) {
334
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
335
+ }
336
+ const aKeysCount = Object.keys(a).length;
337
+ const bKeysCount = Object.keys(b).length;
338
+ if (aKeysCount !== bKeysCount) {
339
+ return false;
340
+ }
341
+ for (const key in a) {
342
+ const aHasKey = a.hasOwnProperty(key);
343
+ const bHasKey = b.hasOwnProperty(key);
344
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
345
+ return false;
346
+ }
347
+ }
348
+ return String(a) === String(b);
349
+ }
350
+ function looseCompareNested(a, b, seen, compare) {
351
+ if (!seen) {
352
+ seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
353
+ }
354
+ const [seenA, seenB] = seen;
355
+ if (seenA.has(a) || seenB.has(b)) {
356
+ return seenA.get(a) === b && seenB.get(b) === a;
357
+ }
358
+ seenA.set(a, b);
359
+ seenB.set(b, a);
360
+ const equal = compare(a, b, seen);
361
+ seenA.delete(a);
362
+ seenB.delete(b);
363
+ return equal;
364
+ }
365
+ function looseEqual(a, b, seen) {
326
366
  if (a === b) return true;
327
367
  let aValidType = isDate(a);
328
368
  let bValidType = isDate(b);
@@ -337,7 +377,7 @@ var Vue = (function (exports) {
337
377
  aValidType = isArray(a);
338
378
  bValidType = isArray(b);
339
379
  if (aValidType || bValidType) {
340
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
380
+ return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
341
381
  }
342
382
  aValidType = isObject(a);
343
383
  bValidType = isObject(b);
@@ -345,28 +385,7 @@ var Vue = (function (exports) {
345
385
  if (!aValidType || !bValidType) {
346
386
  return false;
347
387
  }
348
- aValidType = isMap(a);
349
- bValidType = isMap(b);
350
- if (aValidType || bValidType) {
351
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
352
- }
353
- aValidType = isSet(a);
354
- bValidType = isSet(b);
355
- if (aValidType || bValidType) {
356
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
357
- }
358
- const aKeysCount = Object.keys(a).length;
359
- const bKeysCount = Object.keys(b).length;
360
- if (aKeysCount !== bKeysCount) {
361
- return false;
362
- }
363
- for (const key in a) {
364
- const aHasKey = a.hasOwnProperty(key);
365
- const bHasKey = b.hasOwnProperty(key);
366
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
367
- return false;
368
- }
369
- }
388
+ return looseCompareNested(a, b, seen, looseCompareObjects);
370
389
  }
371
390
  return String(a) === String(b);
372
391
  }
@@ -1167,7 +1186,9 @@ var Vue = (function (exports) {
1167
1186
  const raw = toRaw(array);
1168
1187
  if (raw === array) return raw;
1169
1188
  track(raw, "iterate", ARRAY_ITERATE_KEY);
1170
- return isShallow(array) ? raw : raw.map(toReactive);
1189
+ if (isShallow(array)) return raw;
1190
+ if (!isReadonly(array)) return raw.map(toReactive);
1191
+ return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
1171
1192
  }
1172
1193
  function shallowReadArray(arr) {
1173
1194
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
@@ -4408,13 +4429,15 @@ var Vue = (function (exports) {
4408
4429
  getContainerType(container),
4409
4430
  optimized
4410
4431
  );
4411
- if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4432
+ if ((isAsyncWrapper(vnode) || vnode.component.asyncDep) && !vnode.component.subTree) {
4412
4433
  let subTree;
4413
4434
  if (isFragmentStart) {
4414
4435
  subTree = createVNode(Static);
4415
4436
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4416
4437
  } else {
4417
- subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4438
+ subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(
4439
+ node.nodeType === 8 ? Comment : "div"
4440
+ );
4418
4441
  }
4419
4442
  subTree.el = node;
4420
4443
  vnode.component.subTree = subTree;
@@ -7851,6 +7874,12 @@ If you want to remount the same app, move your app creation logic into a factory
7851
7874
  optimized = false;
7852
7875
  n2.dynamicChildren = null;
7853
7876
  }
7877
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
7878
+ if (n2.dynamicChildren === EMPTY_ARR) {
7879
+ n2.dynamicChildren = [];
7880
+ }
7881
+ n2.dynamicChildren.hasOnce = true;
7882
+ }
7854
7883
  const { type, ref, shapeFlag } = n2;
7855
7884
  switch (type) {
7856
7885
  case Text:
@@ -8458,6 +8487,7 @@ If you want to remount the same app, move your app creation logic into a factory
8458
8487
  {
8459
8488
  pushWarningContext(n2);
8460
8489
  }
8490
+ n2.el = n1.el;
8461
8491
  updateComponentPreRender(instance, n2, optimized);
8462
8492
  {
8463
8493
  popWarningContext();
@@ -9049,7 +9079,7 @@ If you want to remount the same app, move your app creation logic into a factory
9049
9079
  cacheIndex,
9050
9080
  memo
9051
9081
  } = vnode;
9052
- if (patchFlag === -2) {
9082
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
9053
9083
  optimized = false;
9054
9084
  }
9055
9085
  if (ref != null) {
@@ -9057,7 +9087,7 @@ If you want to remount the same app, move your app creation logic into a factory
9057
9087
  setRef(ref, null, parentSuspense, vnode, true);
9058
9088
  resetTracking();
9059
9089
  }
9060
- if (cacheIndex != null) {
9090
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
9061
9091
  parentComponent.renderCache[cacheIndex] = void 0;
9062
9092
  }
9063
9093
  if (shapeFlag & 256) {
@@ -9138,6 +9168,9 @@ If you want to remount the same app, move your app creation logic into a factory
9138
9168
  }
9139
9169
  if (type === Static) {
9140
9170
  removeStaticNode(vnode);
9171
+ if (transition && !transition.persisted && transition.afterLeave) {
9172
+ transition.afterLeave();
9173
+ }
9141
9174
  return;
9142
9175
  }
9143
9176
  const performRemove = () => {
@@ -9181,6 +9214,9 @@ If you want to remount the same app, move your app creation logic into a factory
9181
9214
  if (job) {
9182
9215
  job.flags |= 8;
9183
9216
  unmount(subTree, instance, parentSuspense, doRemove);
9217
+ } else if (instance.vnode.el && subTree) {
9218
+ subTree.transition = instance.vnode.transition;
9219
+ unmount(subTree, instance, parentSuspense, doRemove);
9184
9220
  }
9185
9221
  if (um) {
9186
9222
  queuePostRenderEffect(um, parentSuspense);
@@ -9395,7 +9431,7 @@ If you want to remount the same app, move your app creation logic into a factory
9395
9431
  rendererInternals
9396
9432
  );
9397
9433
  } else {
9398
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
9434
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9399
9435
  n2.suspense = n1.suspense;
9400
9436
  n2.suspense.vnode = n2;
9401
9437
  n2.el = n1.el;
@@ -9481,10 +9517,12 @@ If you want to remount the same app, move your app creation logic into a factory
9481
9517
  if (pendingBranch) {
9482
9518
  suspense.pendingBranch = newBranch;
9483
9519
  if (isSameVNodeType(pendingBranch, newBranch)) {
9520
+ suspense.deps++;
9484
9521
  patch(
9485
9522
  pendingBranch,
9486
9523
  newBranch,
9487
- suspense.hiddenContainer,
9524
+ // a hydrating pending branch is adopted SSR DOM, already in place
9525
+ isHydrating ? container : suspense.hiddenContainer,
9488
9526
  null,
9489
9527
  parentComponent,
9490
9528
  suspense,
@@ -9492,6 +9530,7 @@ If you want to remount the same app, move your app creation logic into a factory
9492
9530
  slotScopeIds,
9493
9531
  optimized
9494
9532
  );
9533
+ suspense.deps--;
9495
9534
  if (suspense.deps <= 0) {
9496
9535
  suspense.resolve();
9497
9536
  } else if (isInFallback) {
@@ -9757,6 +9796,7 @@ If you want to remount the same app, move your app creation logic into a factory
9757
9796
  suspense.effects = [];
9758
9797
  if (isSuspensible) {
9759
9798
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
9799
+ parentSuspenseId = void 0;
9760
9800
  parentSuspense.deps--;
9761
9801
  if (parentSuspense.deps === 0 && !sync) {
9762
9802
  parentSuspense.resolve();
@@ -9830,6 +9870,12 @@ If you want to remount the same app, move your app creation logic into a factory
9830
9870
  return;
9831
9871
  }
9832
9872
  unsetCurrentInstance();
9873
+ if (hydratedEl && !instance.scope.active) {
9874
+ if (isInPendingSuspense && --suspense.deps === 0) {
9875
+ suspense.resolve();
9876
+ }
9877
+ return;
9878
+ }
9833
9879
  instance.asyncResolved = true;
9834
9880
  const { vnode: vnode2 } = instance;
9835
9881
  {
@@ -10251,7 +10297,8 @@ Component that was made reactive: `,
10251
10297
  el: vnode.el,
10252
10298
  anchor: vnode.anchor,
10253
10299
  ctx: vnode.ctx,
10254
- ce: vnode.ce
10300
+ ce: vnode.ce,
10301
+ cacheIndex: vnode.cacheIndex
10255
10302
  };
10256
10303
  if (transition && cloneTransition) {
10257
10304
  setTransitionHooks(
@@ -11042,7 +11089,7 @@ Component that was made reactive: `,
11042
11089
  return true;
11043
11090
  }
11044
11091
 
11045
- const version = "3.5.42";
11092
+ const version = "3.5.43";
11046
11093
  const warn = warn$1 ;
11047
11094
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11048
11095
  const devtools = devtools$1 ;