@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.
@@ -4934,7 +4934,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4934
4934
  const Component = instance.type;
4935
4935
  // explicit self name has highest priority
4936
4936
  if (type === COMPONENTS) {
4937
- const selfName = getComponentName(Component);
4937
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4938
4938
  if (selfName &&
4939
4939
  (selfName === name ||
4940
4940
  selfName === camelize(name) ||
@@ -7029,7 +7029,7 @@ function createCompatVue(createApp, createSingletonApp) {
7029
7029
  return vm;
7030
7030
  }
7031
7031
  }
7032
- Vue.version = `2.6.14-compat:${"3.2.34"}`;
7032
+ Vue.version = `2.6.14-compat:${"3.2.37"}`;
7033
7033
  Vue.config = singletonApp.config;
7034
7034
  Vue.use = (p, ...options) => {
7035
7035
  if (p && isFunction(p.install)) {
@@ -7195,9 +7195,11 @@ function installLegacyAPIs(app) {
7195
7195
  });
7196
7196
  }
7197
7197
  function applySingletonAppMutations(app) {
7198
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7198
+ // copy over asset registries and deopt flag
7199
+ app._context.mixins = [...singletonApp._context.mixins];
7200
+ ['components', 'directives', 'filters'].forEach(key => {
7199
7201
  // @ts-ignore
7200
- app._context[key] = singletonApp._context[key];
7202
+ app._context[key] = Object.create(singletonApp._context[key]);
7201
7203
  });
7202
7204
  // copy over global config mutations
7203
7205
  isCopyingConfig = true;
@@ -7210,7 +7212,7 @@ function applySingletonAppMutations(app) {
7210
7212
  }
7211
7213
  const val = singletonApp.config[key];
7212
7214
  // @ts-ignore
7213
- app.config[key] = val;
7215
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7214
7216
  // compat for runtime ignoredElements -> isCustomElement
7215
7217
  if (key === 'ignoredElements' &&
7216
7218
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7683,7 +7685,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7683
7685
  setupState[ref] = value;
7684
7686
  }
7685
7687
  }
7686
- else if (isRef(ref)) {
7688
+ else if (_isRef) {
7687
7689
  ref.value = value;
7688
7690
  if (rawRef.k)
7689
7691
  refs[rawRef.k] = value;
@@ -7722,11 +7724,13 @@ function createHydrationFunctions(rendererInternals) {
7722
7724
  `Performing full mount instead.`);
7723
7725
  patch(null, vnode, container);
7724
7726
  flushPostFlushCbs();
7727
+ container._vnode = vnode;
7725
7728
  return;
7726
7729
  }
7727
7730
  hasMismatch = false;
7728
7731
  hydrateNode(container.firstChild, vnode, null, null, null);
7729
7732
  flushPostFlushCbs();
7733
+ container._vnode = vnode;
7730
7734
  if (hasMismatch && !false) {
7731
7735
  // this error should show up in production
7732
7736
  console.error(`Hydration completed but contains mismatches.`);
@@ -7749,7 +7753,7 @@ function createHydrationFunctions(rendererInternals) {
7749
7753
  // #5728 empty text node inside a slot can cause hydration failure
7750
7754
  // because the server rendered HTML won't contain a text node
7751
7755
  if (vnode.children === '') {
7752
- insert((vnode.el = createText('')), node.parentElement, node);
7756
+ insert((vnode.el = createText('')), parentNode(node), node);
7753
7757
  nextNode = node;
7754
7758
  }
7755
7759
  else {
@@ -7776,7 +7780,7 @@ function createHydrationFunctions(rendererInternals) {
7776
7780
  }
7777
7781
  break;
7778
7782
  case Static:
7779
- if (domType !== 1 /* ELEMENT */) {
7783
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7780
7784
  nextNode = onMismatch();
7781
7785
  }
7782
7786
  else {
@@ -7787,7 +7791,10 @@ function createHydrationFunctions(rendererInternals) {
7787
7791
  const needToAdoptContent = !vnode.children.length;
7788
7792
  for (let i = 0; i < vnode.staticCount; i++) {
7789
7793
  if (needToAdoptContent)
7790
- vnode.children += nextNode.outerHTML;
7794
+ vnode.children +=
7795
+ nextNode.nodeType === 1 /* ELEMENT */
7796
+ ? nextNode.outerHTML
7797
+ : nextNode.data;
7791
7798
  if (i === vnode.staticCount - 1) {
7792
7799
  vnode.anchor = nextNode;
7793
7800
  }
@@ -10571,10 +10578,10 @@ function getExposeProxy(instance) {
10571
10578
  }
10572
10579
  const classifyRE = /(?:^|[-_])(\w)/g;
10573
10580
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10574
- function getComponentName(Component) {
10581
+ function getComponentName(Component, includeInferred = true) {
10575
10582
  return isFunction(Component)
10576
10583
  ? Component.displayName || Component.name
10577
- : Component.name;
10584
+ : Component.name || (includeInferred && Component.__name);
10578
10585
  }
10579
10586
  /* istanbul ignore next */
10580
10587
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11018,9 +11025,9 @@ function isMemoSame(cached, memo) {
11018
11025
  }
11019
11026
 
11020
11027
  // Core API ------------------------------------------------------------------
11021
- const version = "3.2.34";
11028
+ const version = "3.2.37";
11022
11029
  /**
11023
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11030
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11024
11031
  * @internal
11025
11032
  */
11026
11033
  const ssrUtils = (null);
@@ -11374,7 +11381,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11374
11381
  // if the low-res timestamp which is bigger than the event timestamp
11375
11382
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11376
11383
  // and we need to use the hi-res version for event listeners as well.
11377
- _getNow = () => performance.now();
11384
+ _getNow = performance.now.bind(performance);
11378
11385
  }
11379
11386
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11380
11387
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -11924,9 +11931,8 @@ function resolveTransitionProps(rawProps) {
11924
11931
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11925
11932
  done && done();
11926
11933
  };
11927
- let isLeaving = false;
11928
11934
  const finishLeave = (el, done) => {
11929
- isLeaving = false;
11935
+ el._isLeaving = false;
11930
11936
  removeTransitionClass(el, leaveFromClass);
11931
11937
  removeTransitionClass(el, leaveToClass);
11932
11938
  removeTransitionClass(el, leaveActiveClass);
@@ -11969,7 +11975,7 @@ function resolveTransitionProps(rawProps) {
11969
11975
  onEnter: makeEnterHook(false),
11970
11976
  onAppear: makeEnterHook(true),
11971
11977
  onLeave(el, done) {
11972
- isLeaving = true;
11978
+ el._isLeaving = true;
11973
11979
  const resolve = () => finishLeave(el, done);
11974
11980
  addTransitionClass(el, leaveFromClass);
11975
11981
  if (legacyClassEnabled) {
@@ -11979,7 +11985,7 @@ function resolveTransitionProps(rawProps) {
11979
11985
  forceReflow();
11980
11986
  addTransitionClass(el, leaveActiveClass);
11981
11987
  nextFrame(() => {
11982
- if (!isLeaving) {
11988
+ if (!el._isLeaving) {
11983
11989
  // cancelled
11984
11990
  return;
11985
11991
  }