@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.
@@ -5071,7 +5071,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
5071
5071
  const Component = instance.type;
5072
5072
  // explicit self name has highest priority
5073
5073
  if (type === COMPONENTS) {
5074
- const selfName = getComponentName(Component);
5074
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
5075
5075
  if (selfName &&
5076
5076
  (selfName === name ||
5077
5077
  selfName === camelize(name) ||
@@ -7179,7 +7179,7 @@ function createCompatVue(createApp, createSingletonApp) {
7179
7179
  return vm;
7180
7180
  }
7181
7181
  }
7182
- Vue.version = `2.6.14-compat:${"3.2.34"}`;
7182
+ Vue.version = `2.6.14-compat:${"3.2.37"}`;
7183
7183
  Vue.config = singletonApp.config;
7184
7184
  Vue.use = (p, ...options) => {
7185
7185
  if (p && isFunction(p.install)) {
@@ -7346,9 +7346,11 @@ function installLegacyAPIs(app) {
7346
7346
  });
7347
7347
  }
7348
7348
  function applySingletonAppMutations(app) {
7349
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7349
+ // copy over asset registries and deopt flag
7350
+ app._context.mixins = [...singletonApp._context.mixins];
7351
+ ['components', 'directives', 'filters'].forEach(key => {
7350
7352
  // @ts-ignore
7351
- app._context[key] = singletonApp._context[key];
7353
+ app._context[key] = Object.create(singletonApp._context[key]);
7352
7354
  });
7353
7355
  // copy over global config mutations
7354
7356
  isCopyingConfig = true;
@@ -7361,7 +7363,7 @@ function applySingletonAppMutations(app) {
7361
7363
  }
7362
7364
  const val = singletonApp.config[key];
7363
7365
  // @ts-ignore
7364
- app.config[key] = val;
7366
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7365
7367
  // compat for runtime ignoredElements -> isCustomElement
7366
7368
  if (key === 'ignoredElements' &&
7367
7369
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7838,7 +7840,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7838
7840
  setupState[ref] = value;
7839
7841
  }
7840
7842
  }
7841
- else if (isRef(ref)) {
7843
+ else if (_isRef) {
7842
7844
  ref.value = value;
7843
7845
  if (rawRef.k)
7844
7846
  refs[rawRef.k] = value;
@@ -7878,11 +7880,13 @@ function createHydrationFunctions(rendererInternals) {
7878
7880
  `Performing full mount instead.`);
7879
7881
  patch(null, vnode, container);
7880
7882
  flushPostFlushCbs();
7883
+ container._vnode = vnode;
7881
7884
  return;
7882
7885
  }
7883
7886
  hasMismatch = false;
7884
7887
  hydrateNode(container.firstChild, vnode, null, null, null);
7885
7888
  flushPostFlushCbs();
7889
+ container._vnode = vnode;
7886
7890
  if (hasMismatch && !false) {
7887
7891
  // this error should show up in production
7888
7892
  console.error(`Hydration completed but contains mismatches.`);
@@ -7905,7 +7909,7 @@ function createHydrationFunctions(rendererInternals) {
7905
7909
  // #5728 empty text node inside a slot can cause hydration failure
7906
7910
  // because the server rendered HTML won't contain a text node
7907
7911
  if (vnode.children === '') {
7908
- insert((vnode.el = createText('')), node.parentElement, node);
7912
+ insert((vnode.el = createText('')), parentNode(node), node);
7909
7913
  nextNode = node;
7910
7914
  }
7911
7915
  else {
@@ -7933,7 +7937,7 @@ function createHydrationFunctions(rendererInternals) {
7933
7937
  }
7934
7938
  break;
7935
7939
  case Static:
7936
- if (domType !== 1 /* ELEMENT */) {
7940
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7937
7941
  nextNode = onMismatch();
7938
7942
  }
7939
7943
  else {
@@ -7944,7 +7948,10 @@ function createHydrationFunctions(rendererInternals) {
7944
7948
  const needToAdoptContent = !vnode.children.length;
7945
7949
  for (let i = 0; i < vnode.staticCount; i++) {
7946
7950
  if (needToAdoptContent)
7947
- vnode.children += nextNode.outerHTML;
7951
+ vnode.children +=
7952
+ nextNode.nodeType === 1 /* ELEMENT */
7953
+ ? nextNode.outerHTML
7954
+ : nextNode.data;
7948
7955
  if (i === vnode.staticCount - 1) {
7949
7956
  vnode.anchor = nextNode;
7950
7957
  }
@@ -10803,10 +10810,10 @@ function getExposeProxy(instance) {
10803
10810
  }
10804
10811
  const classifyRE = /(?:^|[-_])(\w)/g;
10805
10812
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10806
- function getComponentName(Component) {
10813
+ function getComponentName(Component, includeInferred = true) {
10807
10814
  return isFunction(Component)
10808
10815
  ? Component.displayName || Component.name
10809
- : Component.name;
10816
+ : Component.name || (includeInferred && Component.__name);
10810
10817
  }
10811
10818
  /* istanbul ignore next */
10812
10819
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11250,7 +11257,7 @@ function isMemoSame(cached, memo) {
11250
11257
  }
11251
11258
 
11252
11259
  // Core API ------------------------------------------------------------------
11253
- const version = "3.2.34";
11260
+ const version = "3.2.37";
11254
11261
  const _ssrUtils = {
11255
11262
  createComponentInstance,
11256
11263
  setupComponent,
@@ -11260,7 +11267,7 @@ const _ssrUtils = {
11260
11267
  normalizeVNode
11261
11268
  };
11262
11269
  /**
11263
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11270
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11264
11271
  * @internal
11265
11272
  */
11266
11273
  const ssrUtils = (_ssrUtils );
@@ -11615,7 +11622,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11615
11622
  // if the low-res timestamp which is bigger than the event timestamp
11616
11623
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11617
11624
  // and we need to use the hi-res version for event listeners as well.
11618
- _getNow = () => performance.now();
11625
+ _getNow = performance.now.bind(performance);
11619
11626
  }
11620
11627
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11621
11628
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -12167,9 +12174,8 @@ function resolveTransitionProps(rawProps) {
12167
12174
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12168
12175
  done && done();
12169
12176
  };
12170
- let isLeaving = false;
12171
12177
  const finishLeave = (el, done) => {
12172
- isLeaving = false;
12178
+ el._isLeaving = false;
12173
12179
  removeTransitionClass(el, leaveFromClass);
12174
12180
  removeTransitionClass(el, leaveToClass);
12175
12181
  removeTransitionClass(el, leaveActiveClass);
@@ -12212,7 +12218,7 @@ function resolveTransitionProps(rawProps) {
12212
12218
  onEnter: makeEnterHook(false),
12213
12219
  onAppear: makeEnterHook(true),
12214
12220
  onLeave(el, done) {
12215
- isLeaving = true;
12221
+ el._isLeaving = true;
12216
12222
  const resolve = () => finishLeave(el, done);
12217
12223
  addTransitionClass(el, leaveFromClass);
12218
12224
  if (legacyClassEnabled) {
@@ -12222,7 +12228,7 @@ function resolveTransitionProps(rawProps) {
12222
12228
  forceReflow();
12223
12229
  addTransitionClass(el, leaveActiveClass);
12224
12230
  nextFrame(() => {
12225
- if (!isLeaving) {
12231
+ if (!el._isLeaving) {
12226
12232
  // cancelled
12227
12233
  return;
12228
12234
  }
@@ -14968,6 +14974,14 @@ function getConstantType(node, context) {
14968
14974
  // static then they don't need to be blocks since there will be no
14969
14975
  // nested updates.
14970
14976
  if (codegenNode.isBlock) {
14977
+ // except set custom directives.
14978
+ for (let i = 0; i < node.props.length; i++) {
14979
+ const p = node.props[i];
14980
+ if (p.type === 7 /* DIRECTIVE */) {
14981
+ constantCache.set(node, 0 /* NOT_CONSTANT */);
14982
+ return 0 /* NOT_CONSTANT */;
14983
+ }
14984
+ }
14971
14985
  context.removeHelper(OPEN_BLOCK);
14972
14986
  context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
14973
14987
  codegenNode.isBlock = false;
@@ -5016,7 +5016,7 @@ var Vue = (function () {
5016
5016
  const Component = instance.type;
5017
5017
  // explicit self name has highest priority
5018
5018
  if (type === COMPONENTS) {
5019
- const selfName = getComponentName(Component);
5019
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
5020
5020
  if (selfName &&
5021
5021
  (selfName === name ||
5022
5022
  selfName === camelize(name) ||
@@ -7111,7 +7111,7 @@ var Vue = (function () {
7111
7111
  return vm;
7112
7112
  }
7113
7113
  }
7114
- Vue.version = `2.6.14-compat:${"3.2.34"}`;
7114
+ Vue.version = `2.6.14-compat:${"3.2.37"}`;
7115
7115
  Vue.config = singletonApp.config;
7116
7116
  Vue.use = (p, ...options) => {
7117
7117
  if (p && isFunction(p.install)) {
@@ -7277,9 +7277,11 @@ var Vue = (function () {
7277
7277
  });
7278
7278
  }
7279
7279
  function applySingletonAppMutations(app) {
7280
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7280
+ // copy over asset registries and deopt flag
7281
+ app._context.mixins = [...singletonApp._context.mixins];
7282
+ ['components', 'directives', 'filters'].forEach(key => {
7281
7283
  // @ts-ignore
7282
- app._context[key] = singletonApp._context[key];
7284
+ app._context[key] = Object.create(singletonApp._context[key]);
7283
7285
  });
7284
7286
  // copy over global config mutations
7285
7287
  isCopyingConfig = true;
@@ -7292,7 +7294,7 @@ var Vue = (function () {
7292
7294
  }
7293
7295
  const val = singletonApp.config[key];
7294
7296
  // @ts-ignore
7295
- app.config[key] = val;
7297
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7296
7298
  // compat for runtime ignoredElements -> isCustomElement
7297
7299
  if (key === 'ignoredElements' &&
7298
7300
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7765,7 +7767,7 @@ var Vue = (function () {
7765
7767
  setupState[ref] = value;
7766
7768
  }
7767
7769
  }
7768
- else if (isRef(ref)) {
7770
+ else if (_isRef) {
7769
7771
  ref.value = value;
7770
7772
  if (rawRef.k)
7771
7773
  refs[rawRef.k] = value;
@@ -7804,11 +7806,13 @@ var Vue = (function () {
7804
7806
  `Performing full mount instead.`);
7805
7807
  patch(null, vnode, container);
7806
7808
  flushPostFlushCbs();
7809
+ container._vnode = vnode;
7807
7810
  return;
7808
7811
  }
7809
7812
  hasMismatch = false;
7810
7813
  hydrateNode(container.firstChild, vnode, null, null, null);
7811
7814
  flushPostFlushCbs();
7815
+ container._vnode = vnode;
7812
7816
  if (hasMismatch && !false) {
7813
7817
  // this error should show up in production
7814
7818
  console.error(`Hydration completed but contains mismatches.`);
@@ -7831,7 +7835,7 @@ var Vue = (function () {
7831
7835
  // #5728 empty text node inside a slot can cause hydration failure
7832
7836
  // because the server rendered HTML won't contain a text node
7833
7837
  if (vnode.children === '') {
7834
- insert((vnode.el = createText('')), node.parentElement, node);
7838
+ insert((vnode.el = createText('')), parentNode(node), node);
7835
7839
  nextNode = node;
7836
7840
  }
7837
7841
  else {
@@ -7858,7 +7862,7 @@ var Vue = (function () {
7858
7862
  }
7859
7863
  break;
7860
7864
  case Static:
7861
- if (domType !== 1 /* ELEMENT */) {
7865
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7862
7866
  nextNode = onMismatch();
7863
7867
  }
7864
7868
  else {
@@ -7869,7 +7873,10 @@ var Vue = (function () {
7869
7873
  const needToAdoptContent = !vnode.children.length;
7870
7874
  for (let i = 0; i < vnode.staticCount; i++) {
7871
7875
  if (needToAdoptContent)
7872
- vnode.children += nextNode.outerHTML;
7876
+ vnode.children +=
7877
+ nextNode.nodeType === 1 /* ELEMENT */
7878
+ ? nextNode.outerHTML
7879
+ : nextNode.data;
7873
7880
  if (i === vnode.staticCount - 1) {
7874
7881
  vnode.anchor = nextNode;
7875
7882
  }
@@ -10653,10 +10660,10 @@ var Vue = (function () {
10653
10660
  }
10654
10661
  const classifyRE = /(?:^|[-_])(\w)/g;
10655
10662
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10656
- function getComponentName(Component) {
10663
+ function getComponentName(Component, includeInferred = true) {
10657
10664
  return isFunction(Component)
10658
10665
  ? Component.displayName || Component.name
10659
- : Component.name;
10666
+ : Component.name || (includeInferred && Component.__name);
10660
10667
  }
10661
10668
  /* istanbul ignore next */
10662
10669
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11095,9 +11102,9 @@ var Vue = (function () {
11095
11102
  }
11096
11103
 
11097
11104
  // Core API ------------------------------------------------------------------
11098
- const version = "3.2.34";
11105
+ const version = "3.2.37";
11099
11106
  /**
11100
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11107
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11101
11108
  * @internal
11102
11109
  */
11103
11110
  const ssrUtils = (null);
@@ -11451,7 +11458,7 @@ var Vue = (function () {
11451
11458
  // if the low-res timestamp which is bigger than the event timestamp
11452
11459
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11453
11460
  // and we need to use the hi-res version for event listeners as well.
11454
- _getNow = () => performance.now();
11461
+ _getNow = performance.now.bind(performance);
11455
11462
  }
11456
11463
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11457
11464
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -11989,9 +11996,8 @@ var Vue = (function () {
11989
11996
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11990
11997
  done && done();
11991
11998
  };
11992
- let isLeaving = false;
11993
11999
  const finishLeave = (el, done) => {
11994
- isLeaving = false;
12000
+ el._isLeaving = false;
11995
12001
  removeTransitionClass(el, leaveFromClass);
11996
12002
  removeTransitionClass(el, leaveToClass);
11997
12003
  removeTransitionClass(el, leaveActiveClass);
@@ -12034,7 +12040,7 @@ var Vue = (function () {
12034
12040
  onEnter: makeEnterHook(false),
12035
12041
  onAppear: makeEnterHook(true),
12036
12042
  onLeave(el, done) {
12037
- isLeaving = true;
12043
+ el._isLeaving = true;
12038
12044
  const resolve = () => finishLeave(el, done);
12039
12045
  addTransitionClass(el, leaveFromClass);
12040
12046
  if (legacyClassEnabled) {
@@ -12044,7 +12050,7 @@ var Vue = (function () {
12044
12050
  forceReflow();
12045
12051
  addTransitionClass(el, leaveActiveClass);
12046
12052
  nextFrame(() => {
12047
- if (!isLeaving) {
12053
+ if (!el._isLeaving) {
12048
12054
  // cancelled
12049
12055
  return;
12050
12056
  }
@@ -14735,6 +14741,14 @@ var Vue = (function () {
14735
14741
  // static then they don't need to be blocks since there will be no
14736
14742
  // nested updates.
14737
14743
  if (codegenNode.isBlock) {
14744
+ // except set custom directives.
14745
+ for (let i = 0; i < node.props.length; i++) {
14746
+ const p = node.props[i];
14747
+ if (p.type === 7 /* DIRECTIVE */) {
14748
+ constantCache.set(node, 0 /* NOT_CONSTANT */);
14749
+ return 0 /* NOT_CONSTANT */;
14750
+ }
14751
+ }
14738
14752
  context.removeHelper(OPEN_BLOCK);
14739
14753
  context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
14740
14754
  codegenNode.isBlock = false;