@vue/compat 3.2.34 → 3.2.37

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.
@@ -4992,7 +4992,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4992
4992
  const Component = instance.type;
4993
4993
  // explicit self name has highest priority
4994
4994
  if (type === COMPONENTS) {
4995
- const selfName = getComponentName(Component);
4995
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4996
4996
  if (selfName &&
4997
4997
  (selfName === name ||
4998
4998
  selfName === camelize(name) ||
@@ -7100,7 +7100,7 @@ function createCompatVue(createApp, createSingletonApp) {
7100
7100
  return vm;
7101
7101
  }
7102
7102
  }
7103
- Vue.version = `2.6.14-compat:${"3.2.34"}`;
7103
+ Vue.version = `2.6.14-compat:${"3.2.37"}`;
7104
7104
  Vue.config = singletonApp.config;
7105
7105
  Vue.use = (p, ...options) => {
7106
7106
  if (p && isFunction(p.install)) {
@@ -7267,9 +7267,11 @@ function installLegacyAPIs(app) {
7267
7267
  });
7268
7268
  }
7269
7269
  function applySingletonAppMutations(app) {
7270
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7270
+ // copy over asset registries and deopt flag
7271
+ app._context.mixins = [...singletonApp._context.mixins];
7272
+ ['components', 'directives', 'filters'].forEach(key => {
7271
7273
  // @ts-ignore
7272
- app._context[key] = singletonApp._context[key];
7274
+ app._context[key] = Object.create(singletonApp._context[key]);
7273
7275
  });
7274
7276
  // copy over global config mutations
7275
7277
  isCopyingConfig = true;
@@ -7282,7 +7284,7 @@ function applySingletonAppMutations(app) {
7282
7284
  }
7283
7285
  const val = singletonApp.config[key];
7284
7286
  // @ts-ignore
7285
- app.config[key] = val;
7287
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7286
7288
  // compat for runtime ignoredElements -> isCustomElement
7287
7289
  if (key === 'ignoredElements' &&
7288
7290
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7759,7 +7761,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7759
7761
  setupState[ref] = value;
7760
7762
  }
7761
7763
  }
7762
- else if (isRef(ref)) {
7764
+ else if (_isRef) {
7763
7765
  ref.value = value;
7764
7766
  if (rawRef.k)
7765
7767
  refs[rawRef.k] = value;
@@ -7799,11 +7801,13 @@ function createHydrationFunctions(rendererInternals) {
7799
7801
  `Performing full mount instead.`);
7800
7802
  patch(null, vnode, container);
7801
7803
  flushPostFlushCbs();
7804
+ container._vnode = vnode;
7802
7805
  return;
7803
7806
  }
7804
7807
  hasMismatch = false;
7805
7808
  hydrateNode(container.firstChild, vnode, null, null, null);
7806
7809
  flushPostFlushCbs();
7810
+ container._vnode = vnode;
7807
7811
  if (hasMismatch && !false) {
7808
7812
  // this error should show up in production
7809
7813
  console.error(`Hydration completed but contains mismatches.`);
@@ -7826,7 +7830,7 @@ function createHydrationFunctions(rendererInternals) {
7826
7830
  // #5728 empty text node inside a slot can cause hydration failure
7827
7831
  // because the server rendered HTML won't contain a text node
7828
7832
  if (vnode.children === '') {
7829
- insert((vnode.el = createText('')), node.parentElement, node);
7833
+ insert((vnode.el = createText('')), parentNode(node), node);
7830
7834
  nextNode = node;
7831
7835
  }
7832
7836
  else {
@@ -7854,7 +7858,7 @@ function createHydrationFunctions(rendererInternals) {
7854
7858
  }
7855
7859
  break;
7856
7860
  case Static:
7857
- if (domType !== 1 /* ELEMENT */) {
7861
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7858
7862
  nextNode = onMismatch();
7859
7863
  }
7860
7864
  else {
@@ -7865,7 +7869,10 @@ function createHydrationFunctions(rendererInternals) {
7865
7869
  const needToAdoptContent = !vnode.children.length;
7866
7870
  for (let i = 0; i < vnode.staticCount; i++) {
7867
7871
  if (needToAdoptContent)
7868
- vnode.children += nextNode.outerHTML;
7872
+ vnode.children +=
7873
+ nextNode.nodeType === 1 /* ELEMENT */
7874
+ ? nextNode.outerHTML
7875
+ : nextNode.data;
7869
7876
  if (i === vnode.staticCount - 1) {
7870
7877
  vnode.anchor = nextNode;
7871
7878
  }
@@ -10724,10 +10731,10 @@ function getExposeProxy(instance) {
10724
10731
  }
10725
10732
  const classifyRE = /(?:^|[-_])(\w)/g;
10726
10733
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10727
- function getComponentName(Component) {
10734
+ function getComponentName(Component, includeInferred = true) {
10728
10735
  return isFunction(Component)
10729
10736
  ? Component.displayName || Component.name
10730
- : Component.name;
10737
+ : Component.name || (includeInferred && Component.__name);
10731
10738
  }
10732
10739
  /* istanbul ignore next */
10733
10740
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11171,7 +11178,7 @@ function isMemoSame(cached, memo) {
11171
11178
  }
11172
11179
 
11173
11180
  // Core API ------------------------------------------------------------------
11174
- const version = "3.2.34";
11181
+ const version = "3.2.37";
11175
11182
  const _ssrUtils = {
11176
11183
  createComponentInstance,
11177
11184
  setupComponent,
@@ -11181,7 +11188,7 @@ const _ssrUtils = {
11181
11188
  normalizeVNode
11182
11189
  };
11183
11190
  /**
11184
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11191
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11185
11192
  * @internal
11186
11193
  */
11187
11194
  const ssrUtils = (_ssrUtils );
@@ -11536,7 +11543,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11536
11543
  // if the low-res timestamp which is bigger than the event timestamp
11537
11544
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11538
11545
  // and we need to use the hi-res version for event listeners as well.
11539
- _getNow = () => performance.now();
11546
+ _getNow = performance.now.bind(performance);
11540
11547
  }
11541
11548
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11542
11549
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -12088,9 +12095,8 @@ function resolveTransitionProps(rawProps) {
12088
12095
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12089
12096
  done && done();
12090
12097
  };
12091
- let isLeaving = false;
12092
12098
  const finishLeave = (el, done) => {
12093
- isLeaving = false;
12099
+ el._isLeaving = false;
12094
12100
  removeTransitionClass(el, leaveFromClass);
12095
12101
  removeTransitionClass(el, leaveToClass);
12096
12102
  removeTransitionClass(el, leaveActiveClass);
@@ -12133,7 +12139,7 @@ function resolveTransitionProps(rawProps) {
12133
12139
  onEnter: makeEnterHook(false),
12134
12140
  onAppear: makeEnterHook(true),
12135
12141
  onLeave(el, done) {
12136
- isLeaving = true;
12142
+ el._isLeaving = true;
12137
12143
  const resolve = () => finishLeave(el, done);
12138
12144
  addTransitionClass(el, leaveFromClass);
12139
12145
  if (legacyClassEnabled) {
@@ -12143,7 +12149,7 @@ function resolveTransitionProps(rawProps) {
12143
12149
  forceReflow();
12144
12150
  addTransitionClass(el, leaveActiveClass);
12145
12151
  nextFrame(() => {
12146
- if (!isLeaving) {
12152
+ if (!el._isLeaving) {
12147
12153
  // cancelled
12148
12154
  return;
12149
12155
  }
@@ -4937,7 +4937,7 @@ var Vue = (function () {
4937
4937
  const Component = instance.type;
4938
4938
  // explicit self name has highest priority
4939
4939
  if (type === COMPONENTS) {
4940
- const selfName = getComponentName(Component);
4940
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4941
4941
  if (selfName &&
4942
4942
  (selfName === name ||
4943
4943
  selfName === camelize(name) ||
@@ -7032,7 +7032,7 @@ var Vue = (function () {
7032
7032
  return vm;
7033
7033
  }
7034
7034
  }
7035
- Vue.version = `2.6.14-compat:${"3.2.34"}`;
7035
+ Vue.version = `2.6.14-compat:${"3.2.37"}`;
7036
7036
  Vue.config = singletonApp.config;
7037
7037
  Vue.use = (p, ...options) => {
7038
7038
  if (p && isFunction(p.install)) {
@@ -7198,9 +7198,11 @@ var Vue = (function () {
7198
7198
  });
7199
7199
  }
7200
7200
  function applySingletonAppMutations(app) {
7201
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7201
+ // copy over asset registries and deopt flag
7202
+ app._context.mixins = [...singletonApp._context.mixins];
7203
+ ['components', 'directives', 'filters'].forEach(key => {
7202
7204
  // @ts-ignore
7203
- app._context[key] = singletonApp._context[key];
7205
+ app._context[key] = Object.create(singletonApp._context[key]);
7204
7206
  });
7205
7207
  // copy over global config mutations
7206
7208
  isCopyingConfig = true;
@@ -7213,7 +7215,7 @@ var Vue = (function () {
7213
7215
  }
7214
7216
  const val = singletonApp.config[key];
7215
7217
  // @ts-ignore
7216
- app.config[key] = val;
7218
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7217
7219
  // compat for runtime ignoredElements -> isCustomElement
7218
7220
  if (key === 'ignoredElements' &&
7219
7221
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7686,7 +7688,7 @@ var Vue = (function () {
7686
7688
  setupState[ref] = value;
7687
7689
  }
7688
7690
  }
7689
- else if (isRef(ref)) {
7691
+ else if (_isRef) {
7690
7692
  ref.value = value;
7691
7693
  if (rawRef.k)
7692
7694
  refs[rawRef.k] = value;
@@ -7725,11 +7727,13 @@ var Vue = (function () {
7725
7727
  `Performing full mount instead.`);
7726
7728
  patch(null, vnode, container);
7727
7729
  flushPostFlushCbs();
7730
+ container._vnode = vnode;
7728
7731
  return;
7729
7732
  }
7730
7733
  hasMismatch = false;
7731
7734
  hydrateNode(container.firstChild, vnode, null, null, null);
7732
7735
  flushPostFlushCbs();
7736
+ container._vnode = vnode;
7733
7737
  if (hasMismatch && !false) {
7734
7738
  // this error should show up in production
7735
7739
  console.error(`Hydration completed but contains mismatches.`);
@@ -7752,7 +7756,7 @@ var Vue = (function () {
7752
7756
  // #5728 empty text node inside a slot can cause hydration failure
7753
7757
  // because the server rendered HTML won't contain a text node
7754
7758
  if (vnode.children === '') {
7755
- insert((vnode.el = createText('')), node.parentElement, node);
7759
+ insert((vnode.el = createText('')), parentNode(node), node);
7756
7760
  nextNode = node;
7757
7761
  }
7758
7762
  else {
@@ -7779,7 +7783,7 @@ var Vue = (function () {
7779
7783
  }
7780
7784
  break;
7781
7785
  case Static:
7782
- if (domType !== 1 /* ELEMENT */) {
7786
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7783
7787
  nextNode = onMismatch();
7784
7788
  }
7785
7789
  else {
@@ -7790,7 +7794,10 @@ var Vue = (function () {
7790
7794
  const needToAdoptContent = !vnode.children.length;
7791
7795
  for (let i = 0; i < vnode.staticCount; i++) {
7792
7796
  if (needToAdoptContent)
7793
- vnode.children += nextNode.outerHTML;
7797
+ vnode.children +=
7798
+ nextNode.nodeType === 1 /* ELEMENT */
7799
+ ? nextNode.outerHTML
7800
+ : nextNode.data;
7794
7801
  if (i === vnode.staticCount - 1) {
7795
7802
  vnode.anchor = nextNode;
7796
7803
  }
@@ -10574,10 +10581,10 @@ var Vue = (function () {
10574
10581
  }
10575
10582
  const classifyRE = /(?:^|[-_])(\w)/g;
10576
10583
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10577
- function getComponentName(Component) {
10584
+ function getComponentName(Component, includeInferred = true) {
10578
10585
  return isFunction(Component)
10579
10586
  ? Component.displayName || Component.name
10580
- : Component.name;
10587
+ : Component.name || (includeInferred && Component.__name);
10581
10588
  }
10582
10589
  /* istanbul ignore next */
10583
10590
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11016,9 +11023,9 @@ var Vue = (function () {
11016
11023
  }
11017
11024
 
11018
11025
  // Core API ------------------------------------------------------------------
11019
- const version = "3.2.34";
11026
+ const version = "3.2.37";
11020
11027
  /**
11021
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11028
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11022
11029
  * @internal
11023
11030
  */
11024
11031
  const ssrUtils = (null);
@@ -11372,7 +11379,7 @@ var Vue = (function () {
11372
11379
  // if the low-res timestamp which is bigger than the event timestamp
11373
11380
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11374
11381
  // and we need to use the hi-res version for event listeners as well.
11375
- _getNow = () => performance.now();
11382
+ _getNow = performance.now.bind(performance);
11376
11383
  }
11377
11384
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11378
11385
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -11910,9 +11917,8 @@ var Vue = (function () {
11910
11917
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11911
11918
  done && done();
11912
11919
  };
11913
- let isLeaving = false;
11914
11920
  const finishLeave = (el, done) => {
11915
- isLeaving = false;
11921
+ el._isLeaving = false;
11916
11922
  removeTransitionClass(el, leaveFromClass);
11917
11923
  removeTransitionClass(el, leaveToClass);
11918
11924
  removeTransitionClass(el, leaveActiveClass);
@@ -11955,7 +11961,7 @@ var Vue = (function () {
11955
11961
  onEnter: makeEnterHook(false),
11956
11962
  onAppear: makeEnterHook(true),
11957
11963
  onLeave(el, done) {
11958
- isLeaving = true;
11964
+ el._isLeaving = true;
11959
11965
  const resolve = () => finishLeave(el, done);
11960
11966
  addTransitionClass(el, leaveFromClass);
11961
11967
  if (legacyClassEnabled) {
@@ -11965,7 +11971,7 @@ var Vue = (function () {
11965
11971
  forceReflow();
11966
11972
  addTransitionClass(el, leaveActiveClass);
11967
11973
  nextFrame(() => {
11968
- if (!isLeaving) {
11974
+ if (!el._isLeaving) {
11969
11975
  // cancelled
11970
11976
  return;
11971
11977
  }