@vue/compat 3.5.14 → 3.5.16

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/compat v3.5.14
2
+ * @vue/compat v3.5.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2081,11 +2081,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2081
2081
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2082
2082
  boundCleanup
2083
2083
  ];
2084
+ oldValue = newValue;
2084
2085
  call ? call(cb, 3, args) : (
2085
2086
  // @ts-expect-error
2086
2087
  cb(...args)
2087
2088
  );
2088
- oldValue = newValue;
2089
2089
  } finally {
2090
2090
  activeWatcher = currentWatcher;
2091
2091
  }
@@ -3546,15 +3546,16 @@ const TeleportImpl = {
3546
3546
  updateCssVars(n2, true);
3547
3547
  }
3548
3548
  if (isTeleportDeferred(n2.props)) {
3549
+ n2.el.__isMounted = false;
3549
3550
  queuePostRenderEffect(() => {
3550
3551
  mountToTarget();
3551
- n2.el.__isMounted = true;
3552
+ delete n2.el.__isMounted;
3552
3553
  }, parentSuspense);
3553
3554
  } else {
3554
3555
  mountToTarget();
3555
3556
  }
3556
3557
  } else {
3557
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3558
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3558
3559
  queuePostRenderEffect(() => {
3559
3560
  TeleportImpl.process(
3560
3561
  n1,
@@ -3568,7 +3569,6 @@ const TeleportImpl = {
3568
3569
  optimized,
3569
3570
  internals
3570
3571
  );
3571
- delete n1.el.__isMounted;
3572
3572
  }, parentSuspense);
3573
3573
  return;
3574
3574
  }
@@ -4560,6 +4560,8 @@ function createHydrationFunctions(rendererInternals) {
4560
4560
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4561
4561
  const content = el.content.firstChild;
4562
4562
  if (needCallTransitionHooks) {
4563
+ const cls = content.getAttribute("class");
4564
+ if (cls) content.$cls = cls;
4563
4565
  transition.beforeEnter(content);
4564
4566
  }
4565
4567
  replaceNode(content, el, parentComponent);
@@ -4823,7 +4825,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4823
4825
  let actual;
4824
4826
  let expected;
4825
4827
  if (key === "class") {
4826
- actual = el.getAttribute("class");
4828
+ if (el.$cls) {
4829
+ actual = el.$cls;
4830
+ delete el.$cls;
4831
+ } else {
4832
+ actual = el.getAttribute("class");
4833
+ }
4827
4834
  expected = normalizeClass(clientValue);
4828
4835
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4829
4836
  mismatchType = 2 /* CLASS */;
@@ -5118,14 +5125,25 @@ function defineAsyncComponent(source) {
5118
5125
  name: "AsyncComponentWrapper",
5119
5126
  __asyncLoader: load,
5120
5127
  __asyncHydrate(el, instance, hydrate) {
5128
+ let patched = false;
5121
5129
  const doHydrate = hydrateStrategy ? () => {
5130
+ const performHydrate = () => {
5131
+ if (!!(process.env.NODE_ENV !== "production") && patched) {
5132
+ warn$1(
5133
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
5134
+ );
5135
+ return;
5136
+ }
5137
+ hydrate();
5138
+ };
5122
5139
  const teardown = hydrateStrategy(
5123
- hydrate,
5140
+ performHydrate,
5124
5141
  (cb) => forEachElement(el, cb)
5125
5142
  );
5126
5143
  if (teardown) {
5127
5144
  (instance.bum || (instance.bum = [])).push(teardown);
5128
5145
  }
5146
+ (instance.u || (instance.u = [])).push(() => patched = true);
5129
5147
  } : hydrate;
5130
5148
  if (resolvedComp) {
5131
5149
  doHydrate();
@@ -7142,7 +7160,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7142
7160
  return vm;
7143
7161
  }
7144
7162
  }
7145
- Vue.version = `2.6.14-compat:${"3.5.14"}`;
7163
+ Vue.version = `2.6.14-compat:${"3.5.16"}`;
7146
7164
  Vue.config = singletonApp.config;
7147
7165
  Vue.use = (plugin, ...options) => {
7148
7166
  if (plugin && isFunction(plugin.install)) {
@@ -7690,9 +7708,15 @@ If you want to remount the same app, move your app creation logic into a factory
7690
7708
  },
7691
7709
  provide(key, value) {
7692
7710
  if (!!(process.env.NODE_ENV !== "production") && key in context.provides) {
7693
- warn$1(
7694
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
7695
- );
7711
+ if (hasOwn(context.provides, key)) {
7712
+ warn$1(
7713
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
7714
+ );
7715
+ } else {
7716
+ warn$1(
7717
+ `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
7718
+ );
7719
+ }
7696
7720
  }
7697
7721
  context.provides[key] = value;
7698
7722
  return app;
@@ -7732,7 +7756,7 @@ function provide(key, value) {
7732
7756
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
7733
7757
  const instance = currentInstance || currentRenderingInstance;
7734
7758
  if (instance || currentApp) {
7735
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7759
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7736
7760
  if (provides && key in provides) {
7737
7761
  return provides[key];
7738
7762
  } else if (arguments.length > 1) {
@@ -8828,7 +8852,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8828
8852
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
8829
8853
  // which also requires the correct parent container
8830
8854
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
8831
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
8855
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
8832
8856
  // In other cases, the parent container is not actually used so we
8833
8857
  // just pass the block element here to avoid a DOM parentNode call.
8834
8858
  fallbackContainer
@@ -12346,7 +12370,7 @@ function isMemoSame(cached, memo) {
12346
12370
  return true;
12347
12371
  }
12348
12372
 
12349
- const version = "3.5.14";
12373
+ const version = "3.5.16";
12350
12374
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12351
12375
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12352
12376
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13046,7 +13070,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
13046
13070
  el.setAttribute(key, v2CoercedValue);
13047
13071
  return true;
13048
13072
  }
13049
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
13073
+ } else if (value === false && !(el.tagName === "INPUT" && key === "value") && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
13050
13074
  compatUtils.warnDeprecation(
13051
13075
  "ATTR_FALSE_VALUE",
13052
13076
  instance,
@@ -13335,13 +13359,10 @@ class VueElement extends BaseClass {
13335
13359
  this._root = this;
13336
13360
  }
13337
13361
  }
13338
- if (!this._def.__asyncLoader) {
13339
- this._resolveProps(this._def);
13340
- }
13341
13362
  }
13342
13363
  connectedCallback() {
13343
13364
  if (!this.isConnected) return;
13344
- if (!this.shadowRoot) {
13365
+ if (!this.shadowRoot && !this._resolved) {
13345
13366
  this._parseSlots();
13346
13367
  }
13347
13368
  this._connected = true;
@@ -13354,8 +13375,7 @@ class VueElement extends BaseClass {
13354
13375
  }
13355
13376
  if (!this._instance) {
13356
13377
  if (this._resolved) {
13357
- this._setParent();
13358
- this._update();
13378
+ this._mount(this._def);
13359
13379
  } else {
13360
13380
  if (parent && parent._pendingResolve) {
13361
13381
  this._pendingResolve = parent._pendingResolve.then(() => {
@@ -13371,7 +13391,15 @@ class VueElement extends BaseClass {
13371
13391
  _setParent(parent = this._parent) {
13372
13392
  if (parent) {
13373
13393
  this._instance.parent = parent._instance;
13374
- this._instance.provides = parent._instance.provides;
13394
+ this._inheritParentContext(parent);
13395
+ }
13396
+ }
13397
+ _inheritParentContext(parent = this._parent) {
13398
+ if (parent && this._app) {
13399
+ Object.setPrototypeOf(
13400
+ this._app._context.provides,
13401
+ parent._instance.provides
13402
+ );
13375
13403
  }
13376
13404
  }
13377
13405
  disconnectedCallback() {
@@ -13421,9 +13449,7 @@ class VueElement extends BaseClass {
13421
13449
  }
13422
13450
  }
13423
13451
  this._numberProps = numberProps;
13424
- if (isAsync) {
13425
- this._resolveProps(def);
13426
- }
13452
+ this._resolveProps(def);
13427
13453
  if (this.shadowRoot) {
13428
13454
  this._applyStyles(styles);
13429
13455
  } else if (!!(process.env.NODE_ENV !== "production") && styles) {
@@ -13447,6 +13473,7 @@ class VueElement extends BaseClass {
13447
13473
  def.name = "VueElement";
13448
13474
  }
13449
13475
  this._app = this._createApp(def);
13476
+ this._inheritParentContext();
13450
13477
  if (def.configureApp) {
13451
13478
  def.configureApp(this._app);
13452
13479
  }
@@ -13531,7 +13558,9 @@ class VueElement extends BaseClass {
13531
13558
  }
13532
13559
  }
13533
13560
  _update() {
13534
- render(this._createVNode(), this._root);
13561
+ const vnode = this._createVNode();
13562
+ if (this._app) vnode.appContext = this._app._context;
13563
+ render(vnode, this._root);
13535
13564
  }
13536
13565
  _createVNode() {
13537
13566
  const baseProps = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.14
2
+ * @vue/compat v3.5.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2074,11 +2074,11 @@ var Vue = (function () {
2074
2074
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2075
2075
  boundCleanup
2076
2076
  ];
2077
+ oldValue = newValue;
2077
2078
  call ? call(cb, 3, args) : (
2078
2079
  // @ts-expect-error
2079
2080
  cb(...args)
2080
2081
  );
2081
- oldValue = newValue;
2082
2082
  } finally {
2083
2083
  activeWatcher = currentWatcher;
2084
2084
  }
@@ -3531,15 +3531,16 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3531
3531
  updateCssVars(n2, true);
3532
3532
  }
3533
3533
  if (isTeleportDeferred(n2.props)) {
3534
+ n2.el.__isMounted = false;
3534
3535
  queuePostRenderEffect(() => {
3535
3536
  mountToTarget();
3536
- n2.el.__isMounted = true;
3537
+ delete n2.el.__isMounted;
3537
3538
  }, parentSuspense);
3538
3539
  } else {
3539
3540
  mountToTarget();
3540
3541
  }
3541
3542
  } else {
3542
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3543
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3543
3544
  queuePostRenderEffect(() => {
3544
3545
  TeleportImpl.process(
3545
3546
  n1,
@@ -3553,7 +3554,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3553
3554
  optimized,
3554
3555
  internals
3555
3556
  );
3556
- delete n1.el.__isMounted;
3557
3557
  }, parentSuspense);
3558
3558
  return;
3559
3559
  }
@@ -4544,6 +4544,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4544
4544
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4545
4545
  const content = el.content.firstChild;
4546
4546
  if (needCallTransitionHooks) {
4547
+ const cls = content.getAttribute("class");
4548
+ if (cls) content.$cls = cls;
4547
4549
  transition.beforeEnter(content);
4548
4550
  }
4549
4551
  replaceNode(content, el, parentComponent);
@@ -4796,7 +4798,12 @@ Server rendered element contains fewer child nodes than client vdom.`
4796
4798
  let actual;
4797
4799
  let expected;
4798
4800
  if (key === "class") {
4799
- actual = el.getAttribute("class");
4801
+ if (el.$cls) {
4802
+ actual = el.$cls;
4803
+ delete el.$cls;
4804
+ } else {
4805
+ actual = el.getAttribute("class");
4806
+ }
4800
4807
  expected = normalizeClass(clientValue);
4801
4808
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4802
4809
  mismatchType = 2 /* CLASS */;
@@ -5091,14 +5098,25 @@ Server rendered element contains fewer child nodes than client vdom.`
5091
5098
  name: "AsyncComponentWrapper",
5092
5099
  __asyncLoader: load,
5093
5100
  __asyncHydrate(el, instance, hydrate) {
5101
+ let patched = false;
5094
5102
  const doHydrate = hydrateStrategy ? () => {
5103
+ const performHydrate = () => {
5104
+ if (patched) {
5105
+ warn$1(
5106
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
5107
+ );
5108
+ return;
5109
+ }
5110
+ hydrate();
5111
+ };
5095
5112
  const teardown = hydrateStrategy(
5096
- hydrate,
5113
+ performHydrate,
5097
5114
  (cb) => forEachElement(el, cb)
5098
5115
  );
5099
5116
  if (teardown) {
5100
5117
  (instance.bum || (instance.bum = [])).push(teardown);
5101
5118
  }
5119
+ (instance.u || (instance.u = [])).push(() => patched = true);
5102
5120
  } : hydrate;
5103
5121
  if (resolvedComp) {
5104
5122
  doHydrate();
@@ -7104,7 +7122,7 @@ If this is a native custom element, make sure to exclude it from component resol
7104
7122
  return vm;
7105
7123
  }
7106
7124
  }
7107
- Vue.version = `2.6.14-compat:${"3.5.14"}`;
7125
+ Vue.version = `2.6.14-compat:${"3.5.16"}`;
7108
7126
  Vue.config = singletonApp.config;
7109
7127
  Vue.use = (plugin, ...options) => {
7110
7128
  if (plugin && isFunction(plugin.install)) {
@@ -7650,9 +7668,15 @@ If you want to remount the same app, move your app creation logic into a factory
7650
7668
  },
7651
7669
  provide(key, value) {
7652
7670
  if (key in context.provides) {
7653
- warn$1(
7654
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
7655
- );
7671
+ if (hasOwn(context.provides, key)) {
7672
+ warn$1(
7673
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
7674
+ );
7675
+ } else {
7676
+ warn$1(
7677
+ `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
7678
+ );
7679
+ }
7656
7680
  }
7657
7681
  context.provides[key] = value;
7658
7682
  return app;
@@ -7692,7 +7716,7 @@ If you want to remount the same app, move your app creation logic into a factory
7692
7716
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
7693
7717
  const instance = currentInstance || currentRenderingInstance;
7694
7718
  if (instance || currentApp) {
7695
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7719
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7696
7720
  if (provides && key in provides) {
7697
7721
  return provides[key];
7698
7722
  } else if (arguments.length > 1) {
@@ -8761,7 +8785,7 @@ If you want to remount the same app, move your app creation logic into a factory
8761
8785
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
8762
8786
  // which also requires the correct parent container
8763
8787
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
8764
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
8788
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
8765
8789
  // In other cases, the parent container is not actually used so we
8766
8790
  // just pass the block element here to avoid a DOM parentNode call.
8767
8791
  fallbackContainer
@@ -12212,7 +12236,7 @@ Component that was made reactive: `,
12212
12236
  return true;
12213
12237
  }
12214
12238
 
12215
- const version = "3.5.14";
12239
+ const version = "3.5.16";
12216
12240
  const warn = warn$1 ;
12217
12241
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12218
12242
  const devtools = devtools$1 ;
@@ -12893,7 +12917,7 @@ Component that was made reactive: `,
12893
12917
  el.setAttribute(key, v2CoercedValue);
12894
12918
  return true;
12895
12919
  }
12896
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
12920
+ } else if (value === false && !(el.tagName === "INPUT" && key === "value") && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
12897
12921
  compatUtils.warnDeprecation(
12898
12922
  "ATTR_FALSE_VALUE",
12899
12923
  instance,
@@ -13182,13 +13206,10 @@ Expected function or array of functions, received type ${typeof value}.`
13182
13206
  this._root = this;
13183
13207
  }
13184
13208
  }
13185
- if (!this._def.__asyncLoader) {
13186
- this._resolveProps(this._def);
13187
- }
13188
13209
  }
13189
13210
  connectedCallback() {
13190
13211
  if (!this.isConnected) return;
13191
- if (!this.shadowRoot) {
13212
+ if (!this.shadowRoot && !this._resolved) {
13192
13213
  this._parseSlots();
13193
13214
  }
13194
13215
  this._connected = true;
@@ -13201,8 +13222,7 @@ Expected function or array of functions, received type ${typeof value}.`
13201
13222
  }
13202
13223
  if (!this._instance) {
13203
13224
  if (this._resolved) {
13204
- this._setParent();
13205
- this._update();
13225
+ this._mount(this._def);
13206
13226
  } else {
13207
13227
  if (parent && parent._pendingResolve) {
13208
13228
  this._pendingResolve = parent._pendingResolve.then(() => {
@@ -13218,7 +13238,15 @@ Expected function or array of functions, received type ${typeof value}.`
13218
13238
  _setParent(parent = this._parent) {
13219
13239
  if (parent) {
13220
13240
  this._instance.parent = parent._instance;
13221
- this._instance.provides = parent._instance.provides;
13241
+ this._inheritParentContext(parent);
13242
+ }
13243
+ }
13244
+ _inheritParentContext(parent = this._parent) {
13245
+ if (parent && this._app) {
13246
+ Object.setPrototypeOf(
13247
+ this._app._context.provides,
13248
+ parent._instance.provides
13249
+ );
13222
13250
  }
13223
13251
  }
13224
13252
  disconnectedCallback() {
@@ -13268,9 +13296,7 @@ Expected function or array of functions, received type ${typeof value}.`
13268
13296
  }
13269
13297
  }
13270
13298
  this._numberProps = numberProps;
13271
- if (isAsync) {
13272
- this._resolveProps(def);
13273
- }
13299
+ this._resolveProps(def);
13274
13300
  if (this.shadowRoot) {
13275
13301
  this._applyStyles(styles);
13276
13302
  } else if (styles) {
@@ -13294,6 +13320,7 @@ Expected function or array of functions, received type ${typeof value}.`
13294
13320
  def.name = "VueElement";
13295
13321
  }
13296
13322
  this._app = this._createApp(def);
13323
+ this._inheritParentContext();
13297
13324
  if (def.configureApp) {
13298
13325
  def.configureApp(this._app);
13299
13326
  }
@@ -13378,7 +13405,9 @@ Expected function or array of functions, received type ${typeof value}.`
13378
13405
  }
13379
13406
  }
13380
13407
  _update() {
13381
- render(this._createVNode(), this._root);
13408
+ const vnode = this._createVNode();
13409
+ if (this._app) vnode.appContext = this._app._context;
13410
+ render(vnode, this._root);
13382
13411
  }
13383
13412
  _createVNode() {
13384
13413
  const baseProps = {};