@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
  **/
@@ -5261,7 +5261,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5261
5261
  return vm;
5262
5262
  }
5263
5263
  }
5264
- Vue.version = `2.6.14-compat:${"3.4.34"}`;
5264
+ Vue.version = `2.6.14-compat:${"3.4.36"}`;
5265
5265
  Vue.config = singletonApp.config;
5266
5266
  Vue.use = (plugin, ...options) => {
5267
5267
  if (plugin && isFunction(plugin.install)) {
@@ -6180,14 +6180,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6180
6180
  if (validatePropName(normalizedKey)) {
6181
6181
  const opt = raw[key];
6182
6182
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6183
- if (prop) {
6184
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6185
- const stringIndex = getTypeIndex(String, prop.type);
6186
- prop[0 /* shouldCast */] = booleanIndex > -1;
6187
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6188
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6189
- needCastKeys.push(normalizedKey);
6183
+ const propType = prop.type;
6184
+ let shouldCast = false;
6185
+ let shouldCastTrue = true;
6186
+ if (isArray(propType)) {
6187
+ for (let index = 0; index < propType.length; ++index) {
6188
+ const type = propType[index];
6189
+ const typeName = isFunction(type) && type.name;
6190
+ if (typeName === "Boolean") {
6191
+ shouldCast = true;
6192
+ break;
6193
+ } else if (typeName === "String") {
6194
+ shouldCastTrue = false;
6195
+ }
6190
6196
  }
6197
+ } else {
6198
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
6199
+ }
6200
+ prop[0 /* shouldCast */] = shouldCast;
6201
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
6202
+ if (shouldCast || hasOwn(prop, "default")) {
6203
+ needCastKeys.push(normalizedKey);
6191
6204
  }
6192
6205
  }
6193
6206
  }
@@ -6218,17 +6231,6 @@ function getType(ctor) {
6218
6231
  }
6219
6232
  return "";
6220
6233
  }
6221
- function isSameType(a, b) {
6222
- return getType(a) === getType(b);
6223
- }
6224
- function getTypeIndex(type, expectedTypes) {
6225
- if (isArray(expectedTypes)) {
6226
- return expectedTypes.findIndex((t) => isSameType(t, type));
6227
- } else if (isFunction(expectedTypes)) {
6228
- return isSameType(expectedTypes, type) ? 0 : -1;
6229
- }
6230
- return -1;
6231
- }
6232
6234
  function validateProps(rawProps, props, instance) {
6233
6235
  const resolvedValues = toRaw(props);
6234
6236
  const options = instance.propsOptions[0];
@@ -6568,15 +6570,11 @@ const TeleportImpl = {
6568
6570
  if (n1 == null) {
6569
6571
  const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
6570
6572
  const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
6571
- const target = n2.target = resolveTarget(n2.props, querySelector);
6572
- const targetStart = n2.targetStart = createText("");
6573
- const targetAnchor = n2.targetAnchor = createText("");
6574
6573
  insert(placeholder, container, anchor);
6575
6574
  insert(mainAnchor, container, anchor);
6576
- targetStart[TeleportEndKey] = targetAnchor;
6575
+ const target = n2.target = resolveTarget(n2.props, querySelector);
6576
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
6577
6577
  if (target) {
6578
- insert(targetStart, target);
6579
- insert(targetAnchor, target);
6580
6578
  if (namespace === "svg" || isTargetSVG(target)) {
6581
6579
  namespace = "svg";
6582
6580
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -6748,7 +6746,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
6748
6746
  }
6749
6747
  }
6750
6748
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
6751
- o: { nextSibling, parentNode, querySelector }
6749
+ o: { nextSibling, parentNode, querySelector, insert, createText }
6752
6750
  }, hydrateChildren) {
6753
6751
  const target = vnode.target = resolveTarget(
6754
6752
  vnode.props,
@@ -6767,20 +6765,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6767
6765
  slotScopeIds,
6768
6766
  optimized
6769
6767
  );
6770
- vnode.targetAnchor = targetNode;
6768
+ vnode.targetStart = targetNode;
6769
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
6771
6770
  } else {
6772
6771
  vnode.anchor = nextSibling(node);
6773
6772
  let targetAnchor = targetNode;
6774
6773
  while (targetAnchor) {
6775
- targetAnchor = nextSibling(targetAnchor);
6776
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
6777
- vnode.targetAnchor = targetAnchor;
6778
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6779
- break;
6774
+ if (targetAnchor && targetAnchor.nodeType === 8) {
6775
+ if (targetAnchor.data === "teleport start anchor") {
6776
+ vnode.targetStart = targetAnchor;
6777
+ } else if (targetAnchor.data === "teleport anchor") {
6778
+ vnode.targetAnchor = targetAnchor;
6779
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6780
+ break;
6781
+ }
6780
6782
  }
6783
+ targetAnchor = nextSibling(targetAnchor);
6784
+ }
6785
+ if (!vnode.targetAnchor) {
6786
+ prepareAnchor(target, vnode, createText, insert);
6781
6787
  }
6782
6788
  hydrateChildren(
6783
- targetNode,
6789
+ targetNode && nextSibling(targetNode),
6784
6790
  vnode,
6785
6791
  target,
6786
6792
  parentComponent,
@@ -6806,6 +6812,16 @@ function updateCssVars(vnode) {
6806
6812
  ctx.ut();
6807
6813
  }
6808
6814
  }
6815
+ function prepareAnchor(target, vnode, createText, insert) {
6816
+ const targetStart = vnode.targetStart = createText("");
6817
+ const targetAnchor = vnode.targetAnchor = createText("");
6818
+ targetStart[TeleportEndKey] = targetAnchor;
6819
+ if (target) {
6820
+ insert(targetStart, target);
6821
+ insert(targetAnchor, target);
6822
+ }
6823
+ return targetAnchor;
6824
+ }
6809
6825
 
6810
6826
  let hasLoggedMismatchError = false;
6811
6827
  const logMismatchError = () => {
@@ -7089,6 +7105,7 @@ Server rendered element contains more child nodes than client vdom.`
7089
7105
  }
7090
7106
  if (props) {
7091
7107
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
7108
+ const isCustomElement = el.tagName.includes("-");
7092
7109
  for (const key in props) {
7093
7110
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
7094
7111
  // as it could have mutated the DOM in any possible way
@@ -7096,7 +7113,7 @@ Server rendered element contains more child nodes than client vdom.`
7096
7113
  logMismatchError();
7097
7114
  }
7098
7115
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7099
- key[0] === ".") {
7116
+ key[0] === "." || isCustomElement) {
7100
7117
  patchProp(el, key, null, props[key], void 0, parentComponent);
7101
7118
  }
7102
7119
  }
@@ -11531,7 +11548,7 @@ function isMemoSame(cached, memo) {
11531
11548
  return true;
11532
11549
  }
11533
11550
 
11534
- const version = "3.4.34";
11551
+ const version = "3.4.36";
11535
11552
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11536
11553
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11537
11554
  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
  **/
@@ -5249,7 +5249,7 @@ If this is a native custom element, make sure to exclude it from component resol
5249
5249
  return vm;
5250
5250
  }
5251
5251
  }
5252
- Vue.version = `2.6.14-compat:${"3.4.34"}`;
5252
+ Vue.version = `2.6.14-compat:${"3.4.36"}`;
5253
5253
  Vue.config = singletonApp.config;
5254
5254
  Vue.use = (plugin, ...options) => {
5255
5255
  if (plugin && isFunction(plugin.install)) {
@@ -6166,14 +6166,27 @@ If you want to remount the same app, move your app creation logic into a factory
6166
6166
  if (validatePropName(normalizedKey)) {
6167
6167
  const opt = raw[key];
6168
6168
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6169
- if (prop) {
6170
- const booleanIndex = getTypeIndex(Boolean, prop.type);
6171
- const stringIndex = getTypeIndex(String, prop.type);
6172
- prop[0 /* shouldCast */] = booleanIndex > -1;
6173
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
6174
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
6175
- needCastKeys.push(normalizedKey);
6169
+ const propType = prop.type;
6170
+ let shouldCast = false;
6171
+ let shouldCastTrue = true;
6172
+ if (isArray(propType)) {
6173
+ for (let index = 0; index < propType.length; ++index) {
6174
+ const type = propType[index];
6175
+ const typeName = isFunction(type) && type.name;
6176
+ if (typeName === "Boolean") {
6177
+ shouldCast = true;
6178
+ break;
6179
+ } else if (typeName === "String") {
6180
+ shouldCastTrue = false;
6181
+ }
6176
6182
  }
6183
+ } else {
6184
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
6185
+ }
6186
+ prop[0 /* shouldCast */] = shouldCast;
6187
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
6188
+ if (shouldCast || hasOwn(prop, "default")) {
6189
+ needCastKeys.push(normalizedKey);
6177
6190
  }
6178
6191
  }
6179
6192
  }
@@ -6204,17 +6217,6 @@ If you want to remount the same app, move your app creation logic into a factory
6204
6217
  }
6205
6218
  return "";
6206
6219
  }
6207
- function isSameType(a, b) {
6208
- return getType(a) === getType(b);
6209
- }
6210
- function getTypeIndex(type, expectedTypes) {
6211
- if (isArray(expectedTypes)) {
6212
- return expectedTypes.findIndex((t) => isSameType(t, type));
6213
- } else if (isFunction(expectedTypes)) {
6214
- return isSameType(expectedTypes, type) ? 0 : -1;
6215
- }
6216
- return -1;
6217
- }
6218
6220
  function validateProps(rawProps, props, instance) {
6219
6221
  const resolvedValues = toRaw(props);
6220
6222
  const options = instance.propsOptions[0];
@@ -6554,15 +6556,11 @@ If you want to remount the same app, move your app creation logic into a factory
6554
6556
  if (n1 == null) {
6555
6557
  const placeholder = n2.el = createComment("teleport start") ;
6556
6558
  const mainAnchor = n2.anchor = createComment("teleport end") ;
6557
- const target = n2.target = resolveTarget(n2.props, querySelector);
6558
- const targetStart = n2.targetStart = createText("");
6559
- const targetAnchor = n2.targetAnchor = createText("");
6560
6559
  insert(placeholder, container, anchor);
6561
6560
  insert(mainAnchor, container, anchor);
6562
- targetStart[TeleportEndKey] = targetAnchor;
6561
+ const target = n2.target = resolveTarget(n2.props, querySelector);
6562
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
6563
6563
  if (target) {
6564
- insert(targetStart, target);
6565
- insert(targetAnchor, target);
6566
6564
  if (namespace === "svg" || isTargetSVG(target)) {
6567
6565
  namespace = "svg";
6568
6566
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -6734,7 +6732,7 @@ If you want to remount the same app, move your app creation logic into a factory
6734
6732
  }
6735
6733
  }
6736
6734
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
6737
- o: { nextSibling, parentNode, querySelector }
6735
+ o: { nextSibling, parentNode, querySelector, insert, createText }
6738
6736
  }, hydrateChildren) {
6739
6737
  const target = vnode.target = resolveTarget(
6740
6738
  vnode.props,
@@ -6753,20 +6751,28 @@ If you want to remount the same app, move your app creation logic into a factory
6753
6751
  slotScopeIds,
6754
6752
  optimized
6755
6753
  );
6756
- vnode.targetAnchor = targetNode;
6754
+ vnode.targetStart = targetNode;
6755
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
6757
6756
  } else {
6758
6757
  vnode.anchor = nextSibling(node);
6759
6758
  let targetAnchor = targetNode;
6760
6759
  while (targetAnchor) {
6761
- targetAnchor = nextSibling(targetAnchor);
6762
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
6763
- vnode.targetAnchor = targetAnchor;
6764
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6765
- break;
6760
+ if (targetAnchor && targetAnchor.nodeType === 8) {
6761
+ if (targetAnchor.data === "teleport start anchor") {
6762
+ vnode.targetStart = targetAnchor;
6763
+ } else if (targetAnchor.data === "teleport anchor") {
6764
+ vnode.targetAnchor = targetAnchor;
6765
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6766
+ break;
6767
+ }
6766
6768
  }
6769
+ targetAnchor = nextSibling(targetAnchor);
6770
+ }
6771
+ if (!vnode.targetAnchor) {
6772
+ prepareAnchor(target, vnode, createText, insert);
6767
6773
  }
6768
6774
  hydrateChildren(
6769
- targetNode,
6775
+ targetNode && nextSibling(targetNode),
6770
6776
  vnode,
6771
6777
  target,
6772
6778
  parentComponent,
@@ -6792,6 +6798,16 @@ If you want to remount the same app, move your app creation logic into a factory
6792
6798
  ctx.ut();
6793
6799
  }
6794
6800
  }
6801
+ function prepareAnchor(target, vnode, createText, insert) {
6802
+ const targetStart = vnode.targetStart = createText("");
6803
+ const targetAnchor = vnode.targetAnchor = createText("");
6804
+ targetStart[TeleportEndKey] = targetAnchor;
6805
+ if (target) {
6806
+ insert(targetStart, target);
6807
+ insert(targetAnchor, target);
6808
+ }
6809
+ return targetAnchor;
6810
+ }
6795
6811
 
6796
6812
  let hasLoggedMismatchError = false;
6797
6813
  const logMismatchError = () => {
@@ -7075,6 +7091,7 @@ Server rendered element contains more child nodes than client vdom.`
7075
7091
  }
7076
7092
  if (props) {
7077
7093
  {
7094
+ const isCustomElement = el.tagName.includes("-");
7078
7095
  for (const key in props) {
7079
7096
  if (// #11189 skip if this node has directives that have created hooks
7080
7097
  // as it could have mutated the DOM in any possible way
@@ -7082,7 +7099,7 @@ Server rendered element contains more child nodes than client vdom.`
7082
7099
  logMismatchError();
7083
7100
  }
7084
7101
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7085
- key[0] === ".") {
7102
+ key[0] === "." || isCustomElement) {
7086
7103
  patchProp(el, key, null, props[key], void 0, parentComponent);
7087
7104
  }
7088
7105
  }
@@ -11414,7 +11431,7 @@ Component that was made reactive: `,
11414
11431
  return true;
11415
11432
  }
11416
11433
 
11417
- const version = "3.4.34";
11434
+ const version = "3.4.36";
11418
11435
  const warn = warn$1 ;
11419
11436
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11420
11437
  const devtools = devtools$1 ;