@vue/compat 3.5.0-rc.1 → 3.5.0

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-rc.1
2
+ * @vue/compat v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -331,6 +331,13 @@ function escapeHtml(string) {
331
331
  }
332
332
  return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
333
333
  }
334
+ const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
335
+ function getEscapedCssVarName(key, doubleEscape) {
336
+ return key.replace(
337
+ cssVarNameEscapeSymbolsRE,
338
+ (s) => `\\${s}`
339
+ );
340
+ }
334
341
 
335
342
  function looseCompareArrays(a, b) {
336
343
  if (a.length !== b.length) return false;
@@ -1191,7 +1198,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1191
1198
  const needsWrap = arr !== self && !isShallow(self);
1192
1199
  const methodFn = arr[method];
1193
1200
  if (methodFn !== arrayProto[method]) {
1194
- const result2 = methodFn.apply(arr, args);
1201
+ const result2 = methodFn.apply(self, args);
1195
1202
  return needsWrap ? toReactive(result2) : result2;
1196
1203
  }
1197
1204
  let wrappedFn = fn;
@@ -4653,8 +4660,7 @@ Server rendered element contains more child nodes than client vdom.`
4653
4660
  const isText = vnode.type === Text;
4654
4661
  if (node) {
4655
4662
  if (isText && !optimized) {
4656
- let next = children[i + 1];
4657
- if (next && (next = normalizeVNode(next)).type === Text) {
4663
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4658
4664
  insert(
4659
4665
  createText(
4660
4666
  node.data.slice(vnode.children.length)
@@ -4910,7 +4916,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4910
4916
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4911
4917
  const cssVars = instance.getCssVars();
4912
4918
  for (const key in cssVars) {
4913
- expectedMap.set(`--${key}`, String(cssVars[key]));
4919
+ expectedMap.set(
4920
+ `--${getEscapedCssVarName(key)}`,
4921
+ String(cssVars[key])
4922
+ );
4914
4923
  }
4915
4924
  }
4916
4925
  if (vnode === root && instance.parent) {
@@ -7093,7 +7102,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7093
7102
  return vm;
7094
7103
  }
7095
7104
  }
7096
- Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
7105
+ Vue.version = `2.6.14-compat:${"3.5.0"}`;
7097
7106
  Vue.config = singletonApp.config;
7098
7107
  Vue.use = (plugin, ...options) => {
7099
7108
  if (plugin && isFunction(plugin.install)) {
@@ -12229,7 +12238,7 @@ function isMemoSame(cached, memo) {
12229
12238
  return true;
12230
12239
  }
12231
12240
 
12232
- const version = "3.5.0-rc.1";
12241
+ const version = "3.5.0";
12233
12242
  const warn = warn$1 ;
12234
12243
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12235
12244
  const devtools = devtools$1 ;
@@ -12871,7 +12880,11 @@ function patchDOMProp(el, key, value, parentComponent) {
12871
12880
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12872
12881
  !tag.includes("-")) {
12873
12882
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12874
- const newValue = value == null ? "" : String(value);
12883
+ const newValue = value == null ? (
12884
+ // #11647: value should be set as empty string for null and undefined,
12885
+ // but <input type="checkbox"> should be set as 'on'.
12886
+ el.type === "checkbox" ? "on" : ""
12887
+ ) : String(value);
12875
12888
  if (oldValue !== newValue || !("_value" in el)) {
12876
12889
  el.value = newValue;
12877
12890
  }
@@ -13757,12 +13770,16 @@ const vModelCheckbox = {
13757
13770
  };
13758
13771
  function setChecked(el, { value, oldValue }, vnode) {
13759
13772
  el._modelValue = value;
13773
+ let checked;
13760
13774
  if (isArray(value)) {
13761
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
13775
+ checked = looseIndexOf(value, vnode.props.value) > -1;
13762
13776
  } else if (isSet(value)) {
13763
- el.checked = value.has(vnode.props.value);
13764
- } else if (value !== oldValue) {
13765
- el.checked = looseEqual(value, getCheckboxValue(el, true));
13777
+ checked = value.has(vnode.props.value);
13778
+ } else {
13779
+ checked = looseEqual(value, getCheckboxValue(el, true));
13780
+ }
13781
+ if (el.checked !== checked) {
13782
+ el.checked = checked;
13766
13783
  }
13767
13784
  }
13768
13785
  const vModelRadio = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-rc.1
2
+ * @vue/compat v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1064,7 +1064,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1064
1064
  const needsWrap = arr !== self && !isShallow(self);
1065
1065
  const methodFn = arr[method];
1066
1066
  if (methodFn !== arrayProto[method]) {
1067
- const result2 = methodFn.apply(arr, args);
1067
+ const result2 = methodFn.apply(self, args);
1068
1068
  return needsWrap ? toReactive(result2) : result2;
1069
1069
  }
1070
1070
  let wrappedFn = fn;
@@ -3694,8 +3694,7 @@ function createHydrationFunctions(rendererInternals) {
3694
3694
  const isText = vnode.type === Text;
3695
3695
  if (node) {
3696
3696
  if (isText && !optimized) {
3697
- let next = children[i + 1];
3698
- if (next && (next = normalizeVNode(next)).type === Text) {
3697
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
3699
3698
  insert(
3700
3699
  createText(
3701
3700
  node.data.slice(vnode.children.length)
@@ -5703,7 +5702,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5703
5702
  return vm;
5704
5703
  }
5705
5704
  }
5706
- Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
5705
+ Vue.version = `2.6.14-compat:${"3.5.0"}`;
5707
5706
  Vue.config = singletonApp.config;
5708
5707
  Vue.use = (plugin, ...options) => {
5709
5708
  if (plugin && isFunction(plugin.install)) {
@@ -9839,7 +9838,7 @@ function isMemoSame(cached, memo) {
9839
9838
  return true;
9840
9839
  }
9841
9840
 
9842
- const version = "3.5.0-rc.1";
9841
+ const version = "3.5.0";
9843
9842
  const warn$1 = NOOP;
9844
9843
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9845
9844
  const devtools = void 0;
@@ -10466,7 +10465,11 @@ function patchDOMProp(el, key, value, parentComponent) {
10466
10465
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10467
10466
  !tag.includes("-")) {
10468
10467
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10469
- const newValue = value == null ? "" : String(value);
10468
+ const newValue = value == null ? (
10469
+ // #11647: value should be set as empty string for null and undefined,
10470
+ // but <input type="checkbox"> should be set as 'on'.
10471
+ el.type === "checkbox" ? "on" : ""
10472
+ ) : String(value);
10470
10473
  if (oldValue !== newValue || !("_value" in el)) {
10471
10474
  el.value = newValue;
10472
10475
  }
@@ -11267,12 +11270,16 @@ const vModelCheckbox = {
11267
11270
  };
11268
11271
  function setChecked(el, { value, oldValue }, vnode) {
11269
11272
  el._modelValue = value;
11273
+ let checked;
11270
11274
  if (isArray(value)) {
11271
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11275
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11272
11276
  } else if (isSet(value)) {
11273
- el.checked = value.has(vnode.props.value);
11274
- } else if (value !== oldValue) {
11275
- el.checked = looseEqual(value, getCheckboxValue(el, true));
11277
+ checked = value.has(vnode.props.value);
11278
+ } else {
11279
+ checked = looseEqual(value, getCheckboxValue(el, true));
11280
+ }
11281
+ if (el.checked !== checked) {
11282
+ el.checked = checked;
11276
11283
  }
11277
11284
  }
11278
11285
  const vModelRadio = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-rc.1
2
+ * @vue/compat v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -281,6 +281,14 @@ function isRenderableAttrValue(value) {
281
281
  return type === "string" || type === "number" || type === "boolean";
282
282
  }
283
283
 
284
+ const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
285
+ function getEscapedCssVarName(key, doubleEscape) {
286
+ return key.replace(
287
+ cssVarNameEscapeSymbolsRE,
288
+ (s) => `\\${s}`
289
+ );
290
+ }
291
+
284
292
  function looseCompareArrays(a, b) {
285
293
  if (a.length !== b.length) return false;
286
294
  let equal = true;
@@ -1140,7 +1148,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1140
1148
  const needsWrap = arr !== self && !isShallow(self);
1141
1149
  const methodFn = arr[method];
1142
1150
  if (methodFn !== arrayProto[method]) {
1143
- const result2 = methodFn.apply(arr, args);
1151
+ const result2 = methodFn.apply(self, args);
1144
1152
  return needsWrap ? toReactive(result2) : result2;
1145
1153
  }
1146
1154
  let wrappedFn = fn;
@@ -4602,8 +4610,7 @@ Server rendered element contains more child nodes than client vdom.`
4602
4610
  const isText = vnode.type === Text;
4603
4611
  if (node) {
4604
4612
  if (isText && !optimized) {
4605
- let next = children[i + 1];
4606
- if (next && (next = normalizeVNode(next)).type === Text) {
4613
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4607
4614
  insert(
4608
4615
  createText(
4609
4616
  node.data.slice(vnode.children.length)
@@ -4859,7 +4866,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4859
4866
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4860
4867
  const cssVars = instance.getCssVars();
4861
4868
  for (const key in cssVars) {
4862
- expectedMap.set(`--${key}`, String(cssVars[key]));
4869
+ expectedMap.set(
4870
+ `--${getEscapedCssVarName(key)}`,
4871
+ String(cssVars[key])
4872
+ );
4863
4873
  }
4864
4874
  }
4865
4875
  if (vnode === root && instance.parent) {
@@ -7042,7 +7052,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7042
7052
  return vm;
7043
7053
  }
7044
7054
  }
7045
- Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
7055
+ Vue.version = `2.6.14-compat:${"3.5.0"}`;
7046
7056
  Vue.config = singletonApp.config;
7047
7057
  Vue.use = (plugin, ...options) => {
7048
7058
  if (plugin && isFunction(plugin.install)) {
@@ -12178,7 +12188,7 @@ function isMemoSame(cached, memo) {
12178
12188
  return true;
12179
12189
  }
12180
12190
 
12181
- const version = "3.5.0-rc.1";
12191
+ const version = "3.5.0";
12182
12192
  const warn = warn$1 ;
12183
12193
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12184
12194
  const devtools = devtools$1 ;
@@ -12886,7 +12896,11 @@ function patchDOMProp(el, key, value, parentComponent) {
12886
12896
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12887
12897
  !tag.includes("-")) {
12888
12898
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12889
- const newValue = value == null ? "" : String(value);
12899
+ const newValue = value == null ? (
12900
+ // #11647: value should be set as empty string for null and undefined,
12901
+ // but <input type="checkbox"> should be set as 'on'.
12902
+ el.type === "checkbox" ? "on" : ""
12903
+ ) : String(value);
12890
12904
  if (oldValue !== newValue || !("_value" in el)) {
12891
12905
  el.value = newValue;
12892
12906
  }
@@ -13772,12 +13786,16 @@ const vModelCheckbox = {
13772
13786
  };
13773
13787
  function setChecked(el, { value, oldValue }, vnode) {
13774
13788
  el._modelValue = value;
13789
+ let checked;
13775
13790
  if (isArray(value)) {
13776
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
13791
+ checked = looseIndexOf(value, vnode.props.value) > -1;
13777
13792
  } else if (isSet(value)) {
13778
- el.checked = value.has(vnode.props.value);
13779
- } else if (value !== oldValue) {
13780
- el.checked = looseEqual(value, getCheckboxValue(el, true));
13793
+ checked = value.has(vnode.props.value);
13794
+ } else {
13795
+ checked = looseEqual(value, getCheckboxValue(el, true));
13796
+ }
13797
+ if (el.checked !== checked) {
13798
+ el.checked = checked;
13781
13799
  }
13782
13800
  }
13783
13801
  const vModelRadio = {