@vue/compat 3.4.34 → 3.4.36

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.4.34
2
+ * @vue/compat v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -5194,7 +5194,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5194
5194
  return vm;
5195
5195
  }
5196
5196
  }
5197
- Vue.version = `2.6.14-compat:${"3.4.34"}`;
5197
+ Vue.version = `2.6.14-compat:${"3.4.36"}`;
5198
5198
  Vue.config = singletonApp.config;
5199
5199
  Vue.use = (plugin, ...options) => {
5200
5200
  if (plugin && isFunction(plugin.install)) {
@@ -6113,14 +6113,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6113
6113
  if (validatePropName(normalizedKey)) {
6114
6114
  const opt = raw[key];
6115
6115
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6116
- if (prop) {
6117
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6118
- const stringIndex = getTypeIndex(String, prop.type);
6119
- prop[0 /* shouldCast */] = booleanIndex > -1;
6120
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6121
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6122
- needCastKeys.push(normalizedKey);
6116
+ const propType = prop.type;
6117
+ let shouldCast = false;
6118
+ let shouldCastTrue = true;
6119
+ if (isArray(propType)) {
6120
+ for (let index = 0; index < propType.length; ++index) {
6121
+ const type = propType[index];
6122
+ const typeName = isFunction(type) && type.name;
6123
+ if (typeName === "Boolean") {
6124
+ shouldCast = true;
6125
+ break;
6126
+ } else if (typeName === "String") {
6127
+ shouldCastTrue = false;
6128
+ }
6123
6129
  }
6130
+ } else {
6131
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
6132
+ }
6133
+ prop[0 /* shouldCast */] = shouldCast;
6134
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
6135
+ if (shouldCast || hasOwn(prop, "default")) {
6136
+ needCastKeys.push(normalizedKey);
6124
6137
  }
6125
6138
  }
6126
6139
  }
@@ -6151,17 +6164,6 @@ function getType(ctor) {
6151
6164
  }
6152
6165
  return "";
6153
6166
  }
6154
- function isSameType(a, b) {
6155
- return getType(a) === getType(b);
6156
- }
6157
- function getTypeIndex(type, expectedTypes) {
6158
- if (isArray(expectedTypes)) {
6159
- return expectedTypes.findIndex((t) => isSameType(t, type));
6160
- } else if (isFunction(expectedTypes)) {
6161
- return isSameType(expectedTypes, type) ? 0 : -1;
6162
- }
6163
- return -1;
6164
- }
6165
6167
  function validateProps(rawProps, props, instance) {
6166
6168
  const resolvedValues = toRaw(props);
6167
6169
  const options = instance.propsOptions[0];
@@ -6501,15 +6503,11 @@ const TeleportImpl = {
6501
6503
  if (n1 == null) {
6502
6504
  const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
6503
6505
  const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
6504
- const target = n2.target = resolveTarget(n2.props, querySelector);
6505
- const targetStart = n2.targetStart = createText("");
6506
- const targetAnchor = n2.targetAnchor = createText("");
6507
6506
  insert(placeholder, container, anchor);
6508
6507
  insert(mainAnchor, container, anchor);
6509
- targetStart[TeleportEndKey] = targetAnchor;
6508
+ const target = n2.target = resolveTarget(n2.props, querySelector);
6509
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
6510
6510
  if (target) {
6511
- insert(targetStart, target);
6512
- insert(targetAnchor, target);
6513
6511
  if (namespace === "svg" || isTargetSVG(target)) {
6514
6512
  namespace = "svg";
6515
6513
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -6681,7 +6679,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
6681
6679
  }
6682
6680
  }
6683
6681
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
6684
- o: { nextSibling, parentNode, querySelector }
6682
+ o: { nextSibling, parentNode, querySelector, insert, createText }
6685
6683
  }, hydrateChildren) {
6686
6684
  const target = vnode.target = resolveTarget(
6687
6685
  vnode.props,
@@ -6700,20 +6698,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6700
6698
  slotScopeIds,
6701
6699
  optimized
6702
6700
  );
6703
- vnode.targetAnchor = targetNode;
6701
+ vnode.targetStart = targetNode;
6702
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
6704
6703
  } else {
6705
6704
  vnode.anchor = nextSibling(node);
6706
6705
  let targetAnchor = targetNode;
6707
6706
  while (targetAnchor) {
6708
- targetAnchor = nextSibling(targetAnchor);
6709
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
6710
- vnode.targetAnchor = targetAnchor;
6711
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6712
- break;
6707
+ if (targetAnchor && targetAnchor.nodeType === 8) {
6708
+ if (targetAnchor.data === "teleport start anchor") {
6709
+ vnode.targetStart = targetAnchor;
6710
+ } else if (targetAnchor.data === "teleport anchor") {
6711
+ vnode.targetAnchor = targetAnchor;
6712
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6713
+ break;
6714
+ }
6713
6715
  }
6716
+ targetAnchor = nextSibling(targetAnchor);
6717
+ }
6718
+ if (!vnode.targetAnchor) {
6719
+ prepareAnchor(target, vnode, createText, insert);
6714
6720
  }
6715
6721
  hydrateChildren(
6716
- targetNode,
6722
+ targetNode && nextSibling(targetNode),
6717
6723
  vnode,
6718
6724
  target,
6719
6725
  parentComponent,
@@ -6739,6 +6745,16 @@ function updateCssVars(vnode) {
6739
6745
  ctx.ut();
6740
6746
  }
6741
6747
  }
6748
+ function prepareAnchor(target, vnode, createText, insert) {
6749
+ const targetStart = vnode.targetStart = createText("");
6750
+ const targetAnchor = vnode.targetAnchor = createText("");
6751
+ targetStart[TeleportEndKey] = targetAnchor;
6752
+ if (target) {
6753
+ insert(targetStart, target);
6754
+ insert(targetAnchor, target);
6755
+ }
6756
+ return targetAnchor;
6757
+ }
6742
6758
 
6743
6759
  let hasLoggedMismatchError = false;
6744
6760
  const logMismatchError = () => {
@@ -7022,6 +7038,7 @@ Server rendered element contains more child nodes than client vdom.`
7022
7038
  }
7023
7039
  if (props) {
7024
7040
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
7041
+ const isCustomElement = el.tagName.includes("-");
7025
7042
  for (const key in props) {
7026
7043
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
7027
7044
  // as it could have mutated the DOM in any possible way
@@ -7029,7 +7046,7 @@ Server rendered element contains more child nodes than client vdom.`
7029
7046
  logMismatchError();
7030
7047
  }
7031
7048
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7032
- key[0] === ".") {
7049
+ key[0] === "." || isCustomElement) {
7033
7050
  patchProp(el, key, null, props[key], void 0, parentComponent);
7034
7051
  }
7035
7052
  }
@@ -11464,7 +11481,7 @@ function isMemoSame(cached, memo) {
11464
11481
  return true;
11465
11482
  }
11466
11483
 
11467
- const version = "3.4.34";
11484
+ const version = "3.4.36";
11468
11485
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11469
11486
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11470
11487
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.34
2
+ * @vue/compat v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -5182,7 +5182,7 @@ If this is a native custom element, make sure to exclude it from component resol
5182
5182
  return vm;
5183
5183
  }
5184
5184
  }
5185
- Vue.version = `2.6.14-compat:${"3.4.34"}`;
5185
+ Vue.version = `2.6.14-compat:${"3.4.36"}`;
5186
5186
  Vue.config = singletonApp.config;
5187
5187
  Vue.use = (plugin, ...options) => {
5188
5188
  if (plugin && isFunction(plugin.install)) {
@@ -6099,14 +6099,27 @@ If you want to remount the same app, move your app creation logic into a factory
6099
6099
  if (validatePropName(normalizedKey)) {
6100
6100
  const opt = raw[key];
6101
6101
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6102
- if (prop) {
6103
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6104
- const stringIndex = getTypeIndex(String, prop.type);
6105
- prop[0 /* shouldCast */] = booleanIndex > -1;
6106
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6107
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6108
- needCastKeys.push(normalizedKey);
6102
+ const propType = prop.type;
6103
+ let shouldCast = false;
6104
+ let shouldCastTrue = true;
6105
+ if (isArray(propType)) {
6106
+ for (let index = 0; index < propType.length; ++index) {
6107
+ const type = propType[index];
6108
+ const typeName = isFunction(type) && type.name;
6109
+ if (typeName === "Boolean") {
6110
+ shouldCast = true;
6111
+ break;
6112
+ } else if (typeName === "String") {
6113
+ shouldCastTrue = false;
6114
+ }
6109
6115
  }
6116
+ } else {
6117
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
6118
+ }
6119
+ prop[0 /* shouldCast */] = shouldCast;
6120
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
6121
+ if (shouldCast || hasOwn(prop, "default")) {
6122
+ needCastKeys.push(normalizedKey);
6110
6123
  }
6111
6124
  }
6112
6125
  }
@@ -6137,17 +6150,6 @@ If you want to remount the same app, move your app creation logic into a factory
6137
6150
  }
6138
6151
  return "";
6139
6152
  }
6140
- function isSameType(a, b) {
6141
- return getType(a) === getType(b);
6142
- }
6143
- function getTypeIndex(type, expectedTypes) {
6144
- if (isArray(expectedTypes)) {
6145
- return expectedTypes.findIndex((t) => isSameType(t, type));
6146
- } else if (isFunction(expectedTypes)) {
6147
- return isSameType(expectedTypes, type) ? 0 : -1;
6148
- }
6149
- return -1;
6150
- }
6151
6153
  function validateProps(rawProps, props, instance) {
6152
6154
  const resolvedValues = toRaw(props);
6153
6155
  const options = instance.propsOptions[0];
@@ -6487,15 +6489,11 @@ If you want to remount the same app, move your app creation logic into a factory
6487
6489
  if (n1 == null) {
6488
6490
  const placeholder = n2.el = createComment("teleport start") ;
6489
6491
  const mainAnchor = n2.anchor = createComment("teleport end") ;
6490
- const target = n2.target = resolveTarget(n2.props, querySelector);
6491
- const targetStart = n2.targetStart = createText("");
6492
- const targetAnchor = n2.targetAnchor = createText("");
6493
6492
  insert(placeholder, container, anchor);
6494
6493
  insert(mainAnchor, container, anchor);
6495
- targetStart[TeleportEndKey] = targetAnchor;
6494
+ const target = n2.target = resolveTarget(n2.props, querySelector);
6495
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
6496
6496
  if (target) {
6497
- insert(targetStart, target);
6498
- insert(targetAnchor, target);
6499
6497
  if (namespace === "svg" || isTargetSVG(target)) {
6500
6498
  namespace = "svg";
6501
6499
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -6667,7 +6665,7 @@ If you want to remount the same app, move your app creation logic into a factory
6667
6665
  }
6668
6666
  }
6669
6667
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
6670
- o: { nextSibling, parentNode, querySelector }
6668
+ o: { nextSibling, parentNode, querySelector, insert, createText }
6671
6669
  }, hydrateChildren) {
6672
6670
  const target = vnode.target = resolveTarget(
6673
6671
  vnode.props,
@@ -6686,20 +6684,28 @@ If you want to remount the same app, move your app creation logic into a factory
6686
6684
  slotScopeIds,
6687
6685
  optimized
6688
6686
  );
6689
- vnode.targetAnchor = targetNode;
6687
+ vnode.targetStart = targetNode;
6688
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
6690
6689
  } else {
6691
6690
  vnode.anchor = nextSibling(node);
6692
6691
  let targetAnchor = targetNode;
6693
6692
  while (targetAnchor) {
6694
- targetAnchor = nextSibling(targetAnchor);
6695
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
6696
- vnode.targetAnchor = targetAnchor;
6697
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6698
- break;
6693
+ if (targetAnchor && targetAnchor.nodeType === 8) {
6694
+ if (targetAnchor.data === "teleport start anchor") {
6695
+ vnode.targetStart = targetAnchor;
6696
+ } else if (targetAnchor.data === "teleport anchor") {
6697
+ vnode.targetAnchor = targetAnchor;
6698
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6699
+ break;
6700
+ }
6699
6701
  }
6702
+ targetAnchor = nextSibling(targetAnchor);
6703
+ }
6704
+ if (!vnode.targetAnchor) {
6705
+ prepareAnchor(target, vnode, createText, insert);
6700
6706
  }
6701
6707
  hydrateChildren(
6702
- targetNode,
6708
+ targetNode && nextSibling(targetNode),
6703
6709
  vnode,
6704
6710
  target,
6705
6711
  parentComponent,
@@ -6725,6 +6731,16 @@ If you want to remount the same app, move your app creation logic into a factory
6725
6731
  ctx.ut();
6726
6732
  }
6727
6733
  }
6734
+ function prepareAnchor(target, vnode, createText, insert) {
6735
+ const targetStart = vnode.targetStart = createText("");
6736
+ const targetAnchor = vnode.targetAnchor = createText("");
6737
+ targetStart[TeleportEndKey] = targetAnchor;
6738
+ if (target) {
6739
+ insert(targetStart, target);
6740
+ insert(targetAnchor, target);
6741
+ }
6742
+ return targetAnchor;
6743
+ }
6728
6744
 
6729
6745
  let hasLoggedMismatchError = false;
6730
6746
  const logMismatchError = () => {
@@ -7008,6 +7024,7 @@ Server rendered element contains more child nodes than client vdom.`
7008
7024
  }
7009
7025
  if (props) {
7010
7026
  {
7027
+ const isCustomElement = el.tagName.includes("-");
7011
7028
  for (const key in props) {
7012
7029
  if (// #11189 skip if this node has directives that have created hooks
7013
7030
  // as it could have mutated the DOM in any possible way
@@ -7015,7 +7032,7 @@ Server rendered element contains more child nodes than client vdom.`
7015
7032
  logMismatchError();
7016
7033
  }
7017
7034
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7018
- key[0] === ".") {
7035
+ key[0] === "." || isCustomElement) {
7019
7036
  patchProp(el, key, null, props[key], void 0, parentComponent);
7020
7037
  }
7021
7038
  }
@@ -11347,7 +11364,7 @@ Component that was made reactive: `,
11347
11364
  return true;
11348
11365
  }
11349
11366
 
11350
- const version = "3.4.34";
11367
+ const version = "3.4.36";
11351
11368
  const warn = warn$1 ;
11352
11369
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11353
11370
  const devtools = devtools$1 ;