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
  **/
@@ -131,10 +131,10 @@ var Vue = (function (exports) {
131
131
  }
132
132
  const listDelimiterRE = /;(?![^(]*\))/g;
133
133
  const propertyDelimiterRE = /:([^]+)/;
134
- const styleCommentRE = /\/\*[^]*?\*\//g;
134
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
135
135
  function parseStringStyle(cssText) {
136
136
  const ret = {};
137
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
137
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
138
138
  if (item) {
139
139
  const tmp = item.split(propertyDelimiterRE);
140
140
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -224,22 +224,22 @@ var Vue = (function (exports) {
224
224
  );
225
225
  }
226
226
 
227
- function looseCompareArrays(a, b) {
227
+ function looseCompareArrays(a, b, seen) {
228
228
  if (a.length !== b.length) return false;
229
229
  let equal = true;
230
230
  for (let i = 0; equal && i < a.length; i++) {
231
- equal = looseEqual(a[i], b[i]);
231
+ equal = looseEqual(a[i], b[i], seen);
232
232
  }
233
233
  return equal;
234
234
  }
235
- function looseCompareCollections(a, b) {
235
+ function looseCompareCollections(a, b, seen) {
236
236
  if (a.size !== b.size) return false;
237
237
  const candidates = Array.from(b);
238
238
  const matched = new Uint8Array(candidates.length);
239
239
  for (const item of a) {
240
240
  let index = -1;
241
241
  for (let i = 0; i < candidates.length; i++) {
242
- if (!matched[i] && looseEqual(item, candidates[i])) {
242
+ if (!matched[i] && looseEqual(item, candidates[i], seen)) {
243
243
  index = i;
244
244
  break;
245
245
  }
@@ -249,7 +249,47 @@ var Vue = (function (exports) {
249
249
  }
250
250
  return true;
251
251
  }
252
- function looseEqual(a, b) {
252
+ function looseCompareObjects(a, b, seen) {
253
+ let aValidType = isMap(a);
254
+ let bValidType = isMap(b);
255
+ if (aValidType || bValidType) {
256
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
257
+ }
258
+ aValidType = isSet(a);
259
+ bValidType = isSet(b);
260
+ if (aValidType || bValidType) {
261
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
262
+ }
263
+ const aKeysCount = Object.keys(a).length;
264
+ const bKeysCount = Object.keys(b).length;
265
+ if (aKeysCount !== bKeysCount) {
266
+ return false;
267
+ }
268
+ for (const key in a) {
269
+ const aHasKey = a.hasOwnProperty(key);
270
+ const bHasKey = b.hasOwnProperty(key);
271
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
272
+ return false;
273
+ }
274
+ }
275
+ return String(a) === String(b);
276
+ }
277
+ function looseCompareNested(a, b, seen, compare) {
278
+ if (!seen) {
279
+ seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
280
+ }
281
+ const [seenA, seenB] = seen;
282
+ if (seenA.has(a) || seenB.has(b)) {
283
+ return seenA.get(a) === b && seenB.get(b) === a;
284
+ }
285
+ seenA.set(a, b);
286
+ seenB.set(b, a);
287
+ const equal = compare(a, b, seen);
288
+ seenA.delete(a);
289
+ seenB.delete(b);
290
+ return equal;
291
+ }
292
+ function looseEqual(a, b, seen) {
253
293
  if (a === b) return true;
254
294
  let aValidType = isDate(a);
255
295
  let bValidType = isDate(b);
@@ -264,7 +304,7 @@ var Vue = (function (exports) {
264
304
  aValidType = isArray(a);
265
305
  bValidType = isArray(b);
266
306
  if (aValidType || bValidType) {
267
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
307
+ return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
268
308
  }
269
309
  aValidType = isObject(a);
270
310
  bValidType = isObject(b);
@@ -272,28 +312,7 @@ var Vue = (function (exports) {
272
312
  if (!aValidType || !bValidType) {
273
313
  return false;
274
314
  }
275
- aValidType = isMap(a);
276
- bValidType = isMap(b);
277
- if (aValidType || bValidType) {
278
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
279
- }
280
- aValidType = isSet(a);
281
- bValidType = isSet(b);
282
- if (aValidType || bValidType) {
283
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
284
- }
285
- const aKeysCount = Object.keys(a).length;
286
- const bKeysCount = Object.keys(b).length;
287
- if (aKeysCount !== bKeysCount) {
288
- return false;
289
- }
290
- for (const key in a) {
291
- const aHasKey = a.hasOwnProperty(key);
292
- const bHasKey = b.hasOwnProperty(key);
293
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
294
- return false;
295
- }
296
- }
315
+ return looseCompareNested(a, b, seen, looseCompareObjects);
297
316
  }
298
317
  return String(a) === String(b);
299
318
  }
@@ -1094,7 +1113,9 @@ var Vue = (function (exports) {
1094
1113
  const raw = toRaw(array);
1095
1114
  if (raw === array) return raw;
1096
1115
  track(raw, "iterate", ARRAY_ITERATE_KEY);
1097
- return isShallow(array) ? raw : raw.map(toReactive);
1116
+ if (isShallow(array)) return raw;
1117
+ if (!isReadonly(array)) return raw.map(toReactive);
1118
+ return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
1098
1119
  }
1099
1120
  function shallowReadArray(arr) {
1100
1121
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
@@ -4335,13 +4356,15 @@ var Vue = (function (exports) {
4335
4356
  getContainerType(container),
4336
4357
  optimized
4337
4358
  );
4338
- if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4359
+ if ((isAsyncWrapper(vnode) || vnode.component.asyncDep) && !vnode.component.subTree) {
4339
4360
  let subTree;
4340
4361
  if (isFragmentStart) {
4341
4362
  subTree = createVNode(Static);
4342
4363
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4343
4364
  } else {
4344
- subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4365
+ subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(
4366
+ node.nodeType === 8 ? Comment : "div"
4367
+ );
4345
4368
  }
4346
4369
  subTree.el = node;
4347
4370
  vnode.component.subTree = subTree;
@@ -7778,6 +7801,12 @@ If you want to remount the same app, move your app creation logic into a factory
7778
7801
  optimized = false;
7779
7802
  n2.dynamicChildren = null;
7780
7803
  }
7804
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
7805
+ if (n2.dynamicChildren === EMPTY_ARR) {
7806
+ n2.dynamicChildren = [];
7807
+ }
7808
+ n2.dynamicChildren.hasOnce = true;
7809
+ }
7781
7810
  const { type, ref, shapeFlag } = n2;
7782
7811
  switch (type) {
7783
7812
  case Text:
@@ -8385,6 +8414,7 @@ If you want to remount the same app, move your app creation logic into a factory
8385
8414
  {
8386
8415
  pushWarningContext(n2);
8387
8416
  }
8417
+ n2.el = n1.el;
8388
8418
  updateComponentPreRender(instance, n2, optimized);
8389
8419
  {
8390
8420
  popWarningContext();
@@ -8976,7 +9006,7 @@ If you want to remount the same app, move your app creation logic into a factory
8976
9006
  cacheIndex,
8977
9007
  memo
8978
9008
  } = vnode;
8979
- if (patchFlag === -2) {
9009
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
8980
9010
  optimized = false;
8981
9011
  }
8982
9012
  if (ref != null) {
@@ -8984,7 +9014,7 @@ If you want to remount the same app, move your app creation logic into a factory
8984
9014
  setRef(ref, null, parentSuspense, vnode, true);
8985
9015
  resetTracking();
8986
9016
  }
8987
- if (cacheIndex != null) {
9017
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
8988
9018
  parentComponent.renderCache[cacheIndex] = void 0;
8989
9019
  }
8990
9020
  if (shapeFlag & 256) {
@@ -9065,6 +9095,9 @@ If you want to remount the same app, move your app creation logic into a factory
9065
9095
  }
9066
9096
  if (type === Static) {
9067
9097
  removeStaticNode(vnode);
9098
+ if (transition && !transition.persisted && transition.afterLeave) {
9099
+ transition.afterLeave();
9100
+ }
9068
9101
  return;
9069
9102
  }
9070
9103
  const performRemove = () => {
@@ -9108,6 +9141,9 @@ If you want to remount the same app, move your app creation logic into a factory
9108
9141
  if (job) {
9109
9142
  job.flags |= 8;
9110
9143
  unmount(subTree, instance, parentSuspense, doRemove);
9144
+ } else if (instance.vnode.el && subTree) {
9145
+ subTree.transition = instance.vnode.transition;
9146
+ unmount(subTree, instance, parentSuspense, doRemove);
9111
9147
  }
9112
9148
  if (um) {
9113
9149
  queuePostRenderEffect(um, parentSuspense);
@@ -9322,7 +9358,7 @@ If you want to remount the same app, move your app creation logic into a factory
9322
9358
  rendererInternals
9323
9359
  );
9324
9360
  } else {
9325
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
9361
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9326
9362
  n2.suspense = n1.suspense;
9327
9363
  n2.suspense.vnode = n2;
9328
9364
  n2.el = n1.el;
@@ -9408,10 +9444,12 @@ If you want to remount the same app, move your app creation logic into a factory
9408
9444
  if (pendingBranch) {
9409
9445
  suspense.pendingBranch = newBranch;
9410
9446
  if (isSameVNodeType(pendingBranch, newBranch)) {
9447
+ suspense.deps++;
9411
9448
  patch(
9412
9449
  pendingBranch,
9413
9450
  newBranch,
9414
- suspense.hiddenContainer,
9451
+ // a hydrating pending branch is adopted SSR DOM, already in place
9452
+ isHydrating ? container : suspense.hiddenContainer,
9415
9453
  null,
9416
9454
  parentComponent,
9417
9455
  suspense,
@@ -9419,6 +9457,7 @@ If you want to remount the same app, move your app creation logic into a factory
9419
9457
  slotScopeIds,
9420
9458
  optimized
9421
9459
  );
9460
+ suspense.deps--;
9422
9461
  if (suspense.deps <= 0) {
9423
9462
  suspense.resolve();
9424
9463
  } else if (isInFallback) {
@@ -9684,6 +9723,7 @@ If you want to remount the same app, move your app creation logic into a factory
9684
9723
  suspense.effects = [];
9685
9724
  if (isSuspensible) {
9686
9725
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
9726
+ parentSuspenseId = void 0;
9687
9727
  parentSuspense.deps--;
9688
9728
  if (parentSuspense.deps === 0 && !sync) {
9689
9729
  parentSuspense.resolve();
@@ -9757,6 +9797,12 @@ If you want to remount the same app, move your app creation logic into a factory
9757
9797
  return;
9758
9798
  }
9759
9799
  unsetCurrentInstance();
9800
+ if (hydratedEl && !instance.scope.active) {
9801
+ if (isInPendingSuspense && --suspense.deps === 0) {
9802
+ suspense.resolve();
9803
+ }
9804
+ return;
9805
+ }
9760
9806
  instance.asyncResolved = true;
9761
9807
  const { vnode: vnode2 } = instance;
9762
9808
  {
@@ -10178,7 +10224,8 @@ Component that was made reactive: `,
10178
10224
  el: vnode.el,
10179
10225
  anchor: vnode.anchor,
10180
10226
  ctx: vnode.ctx,
10181
- ce: vnode.ce
10227
+ ce: vnode.ce,
10228
+ cacheIndex: vnode.cacheIndex
10182
10229
  };
10183
10230
  if (transition && cloneTransition) {
10184
10231
  setTransitionHooks(
@@ -10969,7 +11016,7 @@ Component that was made reactive: `,
10969
11016
  return true;
10970
11017
  }
10971
11018
 
10972
- const version = "3.5.42";
11019
+ const version = "3.5.43";
10973
11020
  const warn = warn$1 ;
10974
11021
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10975
11022
  const devtools = devtools$1 ;