vue 3.2.27 → 3.2.31

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.
@@ -206,8 +206,20 @@ const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,col
206
206
  'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
207
207
  'text,textPath,title,tspan,unknown,use,view';
208
208
  const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
209
+ /**
210
+ * Compiler only.
211
+ * Do NOT use in runtime code paths unless behind `true` flag.
212
+ */
209
213
  const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
214
+ /**
215
+ * Compiler only.
216
+ * Do NOT use in runtime code paths unless behind `true` flag.
217
+ */
210
218
  const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
219
+ /**
220
+ * Compiler only.
221
+ * Do NOT use in runtime code paths unless behind `true` flag.
222
+ */
211
223
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
212
224
 
213
225
  function looseCompareArrays(a, b) {
@@ -265,13 +277,15 @@ function looseIndexOf(arr, val) {
265
277
  * @private
266
278
  */
267
279
  const toDisplayString = (val) => {
268
- return val == null
269
- ? ''
270
- : isArray(val) ||
271
- (isObject(val) &&
272
- (val.toString === objectToString || !isFunction(val.toString)))
273
- ? JSON.stringify(val, replacer, 2)
274
- : String(val);
280
+ return isString(val)
281
+ ? val
282
+ : val == null
283
+ ? ''
284
+ : isArray(val) ||
285
+ (isObject(val) &&
286
+ (val.toString === objectToString || !isFunction(val.toString)))
287
+ ? JSON.stringify(val, replacer, 2)
288
+ : String(val);
275
289
  };
276
290
  const replacer = (_key, val) => {
277
291
  // can't use isRef here since @vue/shared has no deps
@@ -345,6 +359,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
345
359
  'onVnodeBeforeMount,onVnodeMounted,' +
346
360
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
347
361
  'onVnodeBeforeUnmount,onVnodeUnmounted');
362
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
348
363
  const cacheStringFunction = (fn) => {
349
364
  const cache = Object.create(null);
350
365
  return ((str) => {
@@ -410,7 +425,6 @@ function warn(msg, ...args) {
410
425
  }
411
426
 
412
427
  let activeEffectScope;
413
- const effectScopeStack = [];
414
428
  class EffectScope {
415
429
  constructor(detached = false) {
416
430
  this.active = true;
@@ -425,11 +439,11 @@ class EffectScope {
425
439
  run(fn) {
426
440
  if (this.active) {
427
441
  try {
428
- this.on();
442
+ activeEffectScope = this;
429
443
  return fn();
430
444
  }
431
445
  finally {
432
- this.off();
446
+ activeEffectScope = this.parent;
433
447
  }
434
448
  }
435
449
  else {
@@ -437,23 +451,24 @@ class EffectScope {
437
451
  }
438
452
  }
439
453
  on() {
440
- if (this.active) {
441
- effectScopeStack.push(this);
442
- activeEffectScope = this;
443
- }
454
+ activeEffectScope = this;
444
455
  }
445
456
  off() {
446
- if (this.active) {
447
- effectScopeStack.pop();
448
- activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
449
- }
457
+ activeEffectScope = this.parent;
450
458
  }
451
459
  stop(fromParent) {
452
460
  if (this.active) {
453
- this.effects.forEach(e => e.stop());
454
- this.cleanups.forEach(cleanup => cleanup());
461
+ let i, l;
462
+ for (i = 0, l = this.effects.length; i < l; i++) {
463
+ this.effects[i].stop();
464
+ }
465
+ for (i = 0, l = this.cleanups.length; i < l; i++) {
466
+ this.cleanups[i]();
467
+ }
455
468
  if (this.scopes) {
456
- this.scopes.forEach(e => e.stop(true));
469
+ for (i = 0, l = this.scopes.length; i < l; i++) {
470
+ this.scopes[i].stop(true);
471
+ }
457
472
  }
458
473
  // nested scope, dereference from parent to avoid memory leaks
459
474
  if (this.parent && !fromParent) {
@@ -471,8 +486,7 @@ class EffectScope {
471
486
  function effectScope(detached) {
472
487
  return new EffectScope(detached);
473
488
  }
474
- function recordEffectScope(effect, scope) {
475
- scope = scope || activeEffectScope;
489
+ function recordEffectScope(effect, scope = activeEffectScope) {
476
490
  if (scope && scope.active) {
477
491
  scope.effects.push(effect);
478
492
  }
@@ -535,7 +549,6 @@ let trackOpBit = 1;
535
549
  * When recursion depth is greater, fall back to using a full cleanup.
536
550
  */
537
551
  const maxMarkerBits = 30;
538
- const effectStack = [];
539
552
  let activeEffect;
540
553
  const ITERATE_KEY = Symbol('iterate' );
541
554
  const MAP_KEY_ITERATE_KEY = Symbol('Map key iterate' );
@@ -545,35 +558,42 @@ class ReactiveEffect {
545
558
  this.scheduler = scheduler;
546
559
  this.active = true;
547
560
  this.deps = [];
561
+ this.parent = undefined;
548
562
  recordEffectScope(this, scope);
549
563
  }
550
564
  run() {
551
565
  if (!this.active) {
552
566
  return this.fn();
553
567
  }
554
- if (!effectStack.includes(this)) {
555
- try {
556
- effectStack.push((activeEffect = this));
557
- enableTracking();
558
- trackOpBit = 1 << ++effectTrackDepth;
559
- if (effectTrackDepth <= maxMarkerBits) {
560
- initDepMarkers(this);
561
- }
562
- else {
563
- cleanupEffect(this);
564
- }
565
- return this.fn();
568
+ let parent = activeEffect;
569
+ let lastShouldTrack = shouldTrack;
570
+ while (parent) {
571
+ if (parent === this) {
572
+ return;
566
573
  }
567
- finally {
568
- if (effectTrackDepth <= maxMarkerBits) {
569
- finalizeDepMarkers(this);
570
- }
571
- trackOpBit = 1 << --effectTrackDepth;
572
- resetTracking();
573
- effectStack.pop();
574
- const n = effectStack.length;
575
- activeEffect = n > 0 ? effectStack[n - 1] : undefined;
574
+ parent = parent.parent;
575
+ }
576
+ try {
577
+ this.parent = activeEffect;
578
+ activeEffect = this;
579
+ shouldTrack = true;
580
+ trackOpBit = 1 << ++effectTrackDepth;
581
+ if (effectTrackDepth <= maxMarkerBits) {
582
+ initDepMarkers(this);
583
+ }
584
+ else {
585
+ cleanupEffect(this);
586
+ }
587
+ return this.fn();
588
+ }
589
+ finally {
590
+ if (effectTrackDepth <= maxMarkerBits) {
591
+ finalizeDepMarkers(this);
576
592
  }
593
+ trackOpBit = 1 << --effectTrackDepth;
594
+ activeEffect = this.parent;
595
+ shouldTrack = lastShouldTrack;
596
+ this.parent = undefined;
577
597
  }
578
598
  }
579
599
  stop() {
@@ -621,32 +641,24 @@ function pauseTracking() {
621
641
  trackStack.push(shouldTrack);
622
642
  shouldTrack = false;
623
643
  }
624
- function enableTracking() {
625
- trackStack.push(shouldTrack);
626
- shouldTrack = true;
627
- }
628
644
  function resetTracking() {
629
645
  const last = trackStack.pop();
630
646
  shouldTrack = last === undefined ? true : last;
631
647
  }
632
648
  function track(target, type, key) {
633
- if (!isTracking()) {
634
- return;
635
- }
636
- let depsMap = targetMap.get(target);
637
- if (!depsMap) {
638
- targetMap.set(target, (depsMap = new Map()));
639
- }
640
- let dep = depsMap.get(key);
641
- if (!dep) {
642
- depsMap.set(key, (dep = createDep()));
649
+ if (shouldTrack && activeEffect) {
650
+ let depsMap = targetMap.get(target);
651
+ if (!depsMap) {
652
+ targetMap.set(target, (depsMap = new Map()));
653
+ }
654
+ let dep = depsMap.get(key);
655
+ if (!dep) {
656
+ depsMap.set(key, (dep = createDep()));
657
+ }
658
+ const eventInfo = { effect: activeEffect, target, type, key }
659
+ ;
660
+ trackEffects(dep, eventInfo);
643
661
  }
644
- const eventInfo = { effect: activeEffect, target, type, key }
645
- ;
646
- trackEffects(dep, eventInfo);
647
- }
648
- function isTracking() {
649
- return shouldTrack && activeEffect !== undefined;
650
662
  }
651
663
  function trackEffects(dep, debuggerEventExtraInfo) {
652
664
  let shouldTrack = false;
@@ -807,6 +819,9 @@ function createGetter(isReadonly = false, shallow = false) {
807
819
  else if (key === "__v_isReadonly" /* IS_READONLY */) {
808
820
  return isReadonly;
809
821
  }
822
+ else if (key === "__v_isShallow" /* IS_SHALLOW */) {
823
+ return shallow;
824
+ }
810
825
  else if (key === "__v_raw" /* RAW */ &&
811
826
  receiver ===
812
827
  (isReadonly
@@ -851,9 +866,14 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
851
866
  function createSetter(shallow = false) {
852
867
  return function set(target, key, value, receiver) {
853
868
  let oldValue = target[key];
869
+ if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
870
+ return false;
871
+ }
854
872
  if (!shallow && !isReadonly(value)) {
855
- value = toRaw(value);
856
- oldValue = toRaw(oldValue);
873
+ if (!isShallow(value)) {
874
+ value = toRaw(value);
875
+ oldValue = toRaw(oldValue);
876
+ }
857
877
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
858
878
  oldValue.value = value;
859
879
  return true;
@@ -1240,7 +1260,7 @@ function getTargetType(value) {
1240
1260
  }
1241
1261
  function reactive(target) {
1242
1262
  // if trying to observe a readonly proxy, return the readonly version.
1243
- if (target && target["__v_isReadonly" /* IS_READONLY */]) {
1263
+ if (isReadonly(target)) {
1244
1264
  return target;
1245
1265
  }
1246
1266
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1305,6 +1325,9 @@ function isReactive(value) {
1305
1325
  function isReadonly(value) {
1306
1326
  return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
1307
1327
  }
1328
+ function isShallow(value) {
1329
+ return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
1330
+ }
1308
1331
  function isProxy(value) {
1309
1332
  return isReactive(value) || isReadonly(value);
1310
1333
  }
@@ -1320,13 +1343,10 @@ const toReactive = (value) => isObject(value) ? reactive(value) : value;
1320
1343
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1321
1344
 
1322
1345
  function trackRefValue(ref) {
1323
- if (isTracking()) {
1346
+ if (shouldTrack && activeEffect) {
1324
1347
  ref = toRaw(ref);
1325
- if (!ref.dep) {
1326
- ref.dep = createDep();
1327
- }
1328
1348
  {
1329
- trackEffects(ref.dep, {
1349
+ trackEffects(ref.dep || (ref.dep = createDep()), {
1330
1350
  target: ref,
1331
1351
  type: "get" /* GET */,
1332
1352
  key: 'value'
@@ -1348,7 +1368,7 @@ function triggerRefValue(ref, newVal) {
1348
1368
  }
1349
1369
  }
1350
1370
  function isRef(r) {
1351
- return Boolean(r && r.__v_isRef === true);
1371
+ return !!(r && r.__v_isRef === true);
1352
1372
  }
1353
1373
  function ref(value) {
1354
1374
  return createRef(value, false);
@@ -1363,22 +1383,22 @@ function createRef(rawValue, shallow) {
1363
1383
  return new RefImpl(rawValue, shallow);
1364
1384
  }
1365
1385
  class RefImpl {
1366
- constructor(value, _shallow) {
1367
- this._shallow = _shallow;
1386
+ constructor(value, __v_isShallow) {
1387
+ this.__v_isShallow = __v_isShallow;
1368
1388
  this.dep = undefined;
1369
1389
  this.__v_isRef = true;
1370
- this._rawValue = _shallow ? value : toRaw(value);
1371
- this._value = _shallow ? value : toReactive(value);
1390
+ this._rawValue = __v_isShallow ? value : toRaw(value);
1391
+ this._value = __v_isShallow ? value : toReactive(value);
1372
1392
  }
1373
1393
  get value() {
1374
1394
  trackRefValue(this);
1375
1395
  return this._value;
1376
1396
  }
1377
1397
  set value(newVal) {
1378
- newVal = this._shallow ? newVal : toRaw(newVal);
1398
+ newVal = this.__v_isShallow ? newVal : toRaw(newVal);
1379
1399
  if (hasChanged(newVal, this._rawValue)) {
1380
1400
  this._rawValue = newVal;
1381
- this._value = this._shallow ? newVal : toReactive(newVal);
1401
+ this._value = this.__v_isShallow ? newVal : toReactive(newVal);
1382
1402
  triggerRefValue(this, newVal);
1383
1403
  }
1384
1404
  }
@@ -1461,22 +1481,23 @@ class ComputedRefImpl {
1461
1481
  constructor(getter, _setter, isReadonly, isSSR) {
1462
1482
  this._setter = _setter;
1463
1483
  this.dep = undefined;
1464
- this._dirty = true;
1465
1484
  this.__v_isRef = true;
1485
+ this._dirty = true;
1466
1486
  this.effect = new ReactiveEffect(getter, () => {
1467
1487
  if (!this._dirty) {
1468
1488
  this._dirty = true;
1469
1489
  triggerRefValue(this);
1470
1490
  }
1471
1491
  });
1472
- this.effect.active = !isSSR;
1492
+ this.effect.computed = this;
1493
+ this.effect.active = this._cacheable = !isSSR;
1473
1494
  this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
1474
1495
  }
1475
1496
  get value() {
1476
1497
  // the computed ref may get wrapped by other proxies e.g. readonly() #3376
1477
1498
  const self = toRaw(this);
1478
1499
  trackRefValue(self);
1479
- if (self._dirty) {
1500
+ if (self._dirty || !self._cacheable) {
1480
1501
  self._dirty = false;
1481
1502
  self._value = self.effect.run();
1482
1503
  }
@@ -1653,7 +1674,7 @@ const ErrorTypeStrings = {
1653
1674
  [12 /* FUNCTION_REF */]: 'ref function',
1654
1675
  [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
1655
1676
  [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
1656
- 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'
1677
+ 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
1657
1678
  };
1658
1679
  function callWithErrorHandling(fn, instance, type, args) {
1659
1680
  let res;
@@ -3115,7 +3136,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3115
3136
  if (instance) {
3116
3137
  // #2400
3117
3138
  // to support `app.use` plugins,
3118
- // fallback to appContext's `provides` if the intance is at root
3139
+ // fallback to appContext's `provides` if the instance is at root
3119
3140
  const provides = instance.parent == null
3120
3141
  ? instance.vnode.appContext && instance.vnode.appContext.provides
3121
3142
  : instance.parent.provides;
@@ -3181,7 +3202,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3181
3202
  let isMultiSource = false;
3182
3203
  if (isRef(source)) {
3183
3204
  getter = () => source.value;
3184
- forceTrigger = !!source._shallow;
3205
+ forceTrigger = isShallow(source);
3185
3206
  }
3186
3207
  else if (isReactive(source)) {
3187
3208
  getter = () => source;
@@ -4056,7 +4077,7 @@ function matches(pattern, name) {
4056
4077
  return pattern.some((p) => matches(p, name));
4057
4078
  }
4058
4079
  else if (isString(pattern)) {
4059
- return pattern.split(',').indexOf(name) > -1;
4080
+ return pattern.split(',').includes(name);
4060
4081
  }
4061
4082
  else if (pattern.test) {
4062
4083
  return pattern.test(name);
@@ -4309,7 +4330,7 @@ function applyOptions(instance) {
4309
4330
  warn$1(`Write operation failed: computed property "${key}" is readonly.`);
4310
4331
  }
4311
4332
  ;
4312
- const c = computed({
4333
+ const c = computed$1({
4313
4334
  get,
4314
4335
  set
4315
4336
  });
@@ -4708,7 +4729,9 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
4708
4729
  // attrs point to the same object so it should already have been updated.
4709
4730
  if (attrs !== rawCurrentProps) {
4710
4731
  for (const key in attrs) {
4711
- if (!rawProps || !hasOwn(rawProps, key)) {
4732
+ if (!rawProps ||
4733
+ (!hasOwn(rawProps, key) &&
4734
+ (!false ))) {
4712
4735
  delete attrs[key];
4713
4736
  hasAttrsChanged = true;
4714
4737
  }
@@ -5158,7 +5181,6 @@ return withDirectives(h(comp), [
5158
5181
  [bar, this.y]
5159
5182
  ])
5160
5183
  */
5161
- const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
5162
5184
  function validateDirectiveName(name) {
5163
5185
  if (isBuiltInDirective(name)) {
5164
5186
  warn$1('Do not use built-in directive ids as custom directive id: ' + name);
@@ -5639,7 +5661,8 @@ function createHydrationFunctions(rendererInternals) {
5639
5661
  // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
5640
5662
  const forcePatchValue = (type === 'input' && dirs) || type === 'option';
5641
5663
  // skip props & children if this is hoisted static nodes
5642
- if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {
5664
+ // #5405 in dev, always hydrate children for HMR
5665
+ {
5643
5666
  if (dirs) {
5644
5667
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
5645
5668
  }
@@ -5804,6 +5827,7 @@ function createHydrationFunctions(rendererInternals) {
5804
5827
  return [hydrate, hydrateNode];
5805
5828
  }
5806
5829
 
5830
+ /* eslint-disable no-restricted-globals */
5807
5831
  let supported;
5808
5832
  let perf;
5809
5833
  function startMeasure(instance, type) {
@@ -5831,7 +5855,6 @@ function isSupported() {
5831
5855
  if (supported !== undefined) {
5832
5856
  return supported;
5833
5857
  }
5834
- /* eslint-disable no-restricted-globals */
5835
5858
  if (typeof window !== 'undefined' && window.performance) {
5836
5859
  supported = true;
5837
5860
  perf = window.performance;
@@ -5839,7 +5862,6 @@ function isSupported() {
5839
5862
  else {
5840
5863
  supported = false;
5841
5864
  }
5842
- /* eslint-enable no-restricted-globals */
5843
5865
  return supported;
5844
5866
  }
5845
5867
 
@@ -7716,7 +7738,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
7716
7738
  shapeFlag: vnode.shapeFlag,
7717
7739
  // if the vnode is cloned with extra props, we can no longer assume its
7718
7740
  // existing patch flag to be reliable and need to add the FULL_PROPS flag.
7719
- // note: perserve flag for fragments since they use the flag for children
7741
+ // note: preserve flag for fragments since they use the flag for children
7720
7742
  // fast paths only.
7721
7743
  patchFlag: extraProps && vnode.type !== Fragment
7722
7744
  ? patchFlag === -1 // hoisted node
@@ -7878,7 +7900,8 @@ function mergeProps(...args) {
7878
7900
  else if (isOn(key)) {
7879
7901
  const existing = ret[key];
7880
7902
  const incoming = toMerge[key];
7881
- if (existing !== incoming &&
7903
+ if (incoming &&
7904
+ existing !== incoming &&
7882
7905
  !(isArray(existing) && existing.includes(incoming))) {
7883
7906
  ret[key] = existing
7884
7907
  ? [].concat(existing, incoming)
@@ -8173,9 +8196,11 @@ const PublicInstanceProxyHandlers = {
8173
8196
  const { data, setupState, ctx } = instance;
8174
8197
  if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
8175
8198
  setupState[key] = value;
8199
+ return true;
8176
8200
  }
8177
8201
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
8178
8202
  data[key] = value;
8203
+ return true;
8179
8204
  }
8180
8205
  else if (hasOwn(instance.props, key)) {
8181
8206
  warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
@@ -8209,6 +8234,15 @@ const PublicInstanceProxyHandlers = {
8209
8234
  hasOwn(ctx, key) ||
8210
8235
  hasOwn(publicPropertiesMap, key) ||
8211
8236
  hasOwn(appContext.config.globalProperties, key));
8237
+ },
8238
+ defineProperty(target, key, descriptor) {
8239
+ if (descriptor.get != null) {
8240
+ this.set(target, key, descriptor.get(), null);
8241
+ }
8242
+ else if (descriptor.value != null) {
8243
+ this.set(target, key, descriptor.value, null);
8244
+ }
8245
+ return Reflect.defineProperty(target, key, descriptor);
8212
8246
  }
8213
8247
  };
8214
8248
  {
@@ -8698,7 +8732,7 @@ function defineEmits() {
8698
8732
  * instance properties when it is accessed by a parent component via template
8699
8733
  * refs.
8700
8734
  *
8701
- * `<script setup>` components are closed by default - i.e. varaibles inside
8735
+ * `<script setup>` components are closed by default - i.e. variables inside
8702
8736
  * the `<script setup>` scope is not exposed to parent unless explicitly exposed
8703
8737
  * via `defineExpose`.
8704
8738
  *
@@ -8901,7 +8935,7 @@ function initCustomFormatter() {
8901
8935
  return [
8902
8936
  'div',
8903
8937
  {},
8904
- ['span', vueStyle, 'Reactive'],
8938
+ ['span', vueStyle, isShallow(obj) ? 'ShallowReactive' : 'Reactive'],
8905
8939
  '<',
8906
8940
  formatValue(obj),
8907
8941
  `>${isReadonly(obj) ? ` (readonly)` : ``}`
@@ -8911,7 +8945,7 @@ function initCustomFormatter() {
8911
8945
  return [
8912
8946
  'div',
8913
8947
  {},
8914
- ['span', vueStyle, 'Readonly'],
8948
+ ['span', vueStyle, isShallow(obj) ? 'ShallowReadonly' : 'Readonly'],
8915
8949
  '<',
8916
8950
  formatValue(obj),
8917
8951
  '>'
@@ -9040,7 +9074,7 @@ function initCustomFormatter() {
9040
9074
  }
9041
9075
  }
9042
9076
  function genRefFlag(v) {
9043
- if (v._shallow) {
9077
+ if (isShallow(v)) {
9044
9078
  return `ShallowRef`;
9045
9079
  }
9046
9080
  if (v.effect) {
@@ -9084,7 +9118,7 @@ function isMemoSame(cached, memo) {
9084
9118
  }
9085
9119
 
9086
9120
  // Core API ------------------------------------------------------------------
9087
- const version = "3.2.27";
9121
+ const version = "3.2.31";
9088
9122
  /**
9089
9123
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9090
9124
  * @internal
@@ -9158,7 +9192,10 @@ const nodeOps = {
9158
9192
  insertStaticContent(content, parent, anchor, isSVG, start, end) {
9159
9193
  // <parent> before | first ... last | anchor </parent>
9160
9194
  const before = anchor ? anchor.previousSibling : parent.lastChild;
9161
- if (start && end) {
9195
+ // #5308 can only take cached path if:
9196
+ // - has a single root node
9197
+ // - nextSibling info is still available
9198
+ if (start && (start === end || start.nextSibling)) {
9162
9199
  // cached
9163
9200
  while (true) {
9164
9201
  parent.insertBefore(start.cloneNode(true), anchor);
@@ -9471,7 +9508,7 @@ function patchStopImmediatePropagation(e, value) {
9471
9508
  originalStop.call(e);
9472
9509
  e._stopped = true;
9473
9510
  };
9474
- return value.map(fn => (e) => !e._stopped && fn(e));
9511
+ return value.map(fn => (e) => !e._stopped && fn && fn(e));
9475
9512
  }
9476
9513
  else {
9477
9514
  return value;
@@ -10760,6 +10797,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
10760
10797
  isProxy: isProxy,
10761
10798
  isReactive: isReactive,
10762
10799
  isReadonly: isReadonly,
10800
+ isShallow: isShallow,
10763
10801
  customRef: customRef,
10764
10802
  triggerRef: triggerRef,
10765
10803
  shallowRef: shallowRef,
@@ -11508,13 +11546,13 @@ const deprecationData = {
11508
11546
  message: `Platform-native elements with "is" prop will no longer be ` +
11509
11547
  `treated as components in Vue 3 unless the "is" value is explicitly ` +
11510
11548
  `prefixed with "vue:".`,
11511
- link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
11549
+ link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`
11512
11550
  },
11513
11551
  ["COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */]: {
11514
11552
  message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
11515
11553
  `argument instead. \`v-bind:${key}.sync\` should be changed to ` +
11516
11554
  `\`v-model:${key}\`.`,
11517
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
11555
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
11518
11556
  },
11519
11557
  ["COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */]: {
11520
11558
  message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
@@ -11526,11 +11564,11 @@ const deprecationData = {
11526
11564
  `that appears before v-bind in the case of conflict. ` +
11527
11565
  `To retain 2.x behavior, move v-bind to make it the first attribute. ` +
11528
11566
  `You can also suppress this warning if the usage is intended.`,
11529
- link: `https://v3.vuejs.org/guide/migration/v-bind.html`
11567
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
11530
11568
  },
11531
11569
  ["COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */]: {
11532
11570
  message: `.native modifier for v-on has been removed as is no longer necessary.`,
11533
- link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
11571
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`
11534
11572
  },
11535
11573
  ["COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {
11536
11574
  message: `v-if / v-for precedence when used on the same element has changed ` +
@@ -11538,7 +11576,7 @@ const deprecationData = {
11538
11576
  `access to v-for scope variables. It is best to avoid the ambiguity ` +
11539
11577
  `with <template> tags or use a computed property that filters v-for ` +
11540
11578
  `data source.`,
11541
- link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
11579
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`
11542
11580
  },
11543
11581
  ["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
11544
11582
  message: `<template> with no special directives will render as a native template ` +
@@ -11546,13 +11584,13 @@ const deprecationData = {
11546
11584
  },
11547
11585
  ["COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */]: {
11548
11586
  message: `"inline-template" has been removed in Vue 3.`,
11549
- link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
11587
+ link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
11550
11588
  },
11551
11589
  ["COMPILER_FILTER" /* COMPILER_FILTERS */]: {
11552
11590
  message: `filters have been removed in Vue 3. ` +
11553
11591
  `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
11554
11592
  `Use method calls or computed properties instead.`,
11555
- link: `https://v3.vuejs.org/guide/migration/filters.html`
11593
+ link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
11556
11594
  }
11557
11595
  };
11558
11596
  function getCompatValue(key, context) {
@@ -12037,7 +12075,7 @@ function parseAttributes(context, type) {
12037
12075
  }
12038
12076
  const attr = parseAttribute(context, attributeNames);
12039
12077
  // Trim whitespace between class
12040
- // https://github.com/vuejs/vue-next/issues/4251
12078
+ // https://github.com/vuejs/core/issues/4251
12041
12079
  if (attr.type === 6 /* ATTRIBUTE */ &&
12042
12080
  attr.value &&
12043
12081
  attr.name === 'class') {
@@ -12262,7 +12300,7 @@ function parseTextData(context, length, mode) {
12262
12300
  advanceBy(context, length);
12263
12301
  if (mode === 2 /* RAWTEXT */ ||
12264
12302
  mode === 3 /* CDATA */ ||
12265
- rawText.indexOf('&') === -1) {
12303
+ !rawText.includes('&')) {
12266
12304
  return rawText;
12267
12305
  }
12268
12306
  else {
@@ -13767,6 +13805,7 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
13767
13805
  const renderExp = createCallExpression(helper(RENDER_LIST), [
13768
13806
  forNode.source
13769
13807
  ]);
13808
+ const isTemplate = isTemplateNode(node);
13770
13809
  const memo = findDir(node, 'memo');
13771
13810
  const keyProp = findProp(node, `key`);
13772
13811
  const keyExp = keyProp &&
@@ -13786,7 +13825,6 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
13786
13825
  return () => {
13787
13826
  // finish the codegen now that all children have been traversed
13788
13827
  let childBlock;
13789
- const isTemplate = isTemplateNode(node);
13790
13828
  const { children } = forNode;
13791
13829
  // check <template v-for> key placement
13792
13830
  if (isTemplate) {
@@ -14556,7 +14594,7 @@ function buildProps(node, context, props = node.props, ssr = false) {
14556
14594
  }
14557
14595
  }
14558
14596
  }
14559
- else {
14597
+ else if (!isBuiltInDirective(name)) {
14560
14598
  // no built-in transform, this is a user custom directive.
14561
14599
  runtimeDirectives.push(prop);
14562
14600
  // custom dirs may use beforeUpdate so they need to force blocks
@@ -15727,4 +15765,4 @@ function compileToFunction(template, options) {
15727
15765
  }
15728
15766
  registerRuntimeCompiler(compileToFunction);
15729
15767
 
15730
- export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed$1 as computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
15768
+ export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed$1 as computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };