vue 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 v3.5.0-rc.1
2
+ * vue v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.0-rc.1
2
+ * vue v3.5.0
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.0-rc.1
2
+ * vue 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;
@@ -4071,8 +4079,7 @@ Server rendered element contains more child nodes than client vdom.`
4071
4079
  const isText = vnode.type === Text;
4072
4080
  if (node) {
4073
4081
  if (isText && !optimized) {
4074
- let next = children[i + 1];
4075
- if (next && (next = normalizeVNode(next)).type === Text) {
4082
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4076
4083
  insert(
4077
4084
  createText(
4078
4085
  node.data.slice(vnode.children.length)
@@ -4328,7 +4335,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4328
4335
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4329
4336
  const cssVars = instance.getCssVars();
4330
4337
  for (const key in cssVars) {
4331
- expectedMap.set(`--${key}`, String(cssVars[key]));
4338
+ expectedMap.set(
4339
+ `--${getEscapedCssVarName(key)}`,
4340
+ String(cssVars[key])
4341
+ );
4332
4342
  }
4333
4343
  }
4334
4344
  if (vnode === root && instance.parent) {
@@ -10417,7 +10427,7 @@ function isMemoSame(cached, memo) {
10417
10427
  return true;
10418
10428
  }
10419
10429
 
10420
- const version = "3.5.0-rc.1";
10430
+ const version = "3.5.0";
10421
10431
  const warn = warn$1 ;
10422
10432
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10423
10433
  const devtools = devtools$1 ;
@@ -11053,7 +11063,11 @@ function patchDOMProp(el, key, value, parentComponent) {
11053
11063
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11054
11064
  !tag.includes("-")) {
11055
11065
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
11056
- const newValue = value == null ? "" : String(value);
11066
+ const newValue = value == null ? (
11067
+ // #11647: value should be set as empty string for null and undefined,
11068
+ // but <input type="checkbox"> should be set as 'on'.
11069
+ el.type === "checkbox" ? "on" : ""
11070
+ ) : String(value);
11057
11071
  if (oldValue !== newValue || !("_value" in el)) {
11058
11072
  el.value = newValue;
11059
11073
  }
@@ -11914,12 +11928,16 @@ const vModelCheckbox = {
11914
11928
  };
11915
11929
  function setChecked(el, { value, oldValue }, vnode) {
11916
11930
  el._modelValue = value;
11931
+ let checked;
11917
11932
  if (isArray(value)) {
11918
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11933
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11919
11934
  } else if (isSet(value)) {
11920
- el.checked = value.has(vnode.props.value);
11921
- } else if (value !== oldValue) {
11922
- el.checked = looseEqual(value, getCheckboxValue(el, true));
11935
+ checked = value.has(vnode.props.value);
11936
+ } else {
11937
+ checked = looseEqual(value, getCheckboxValue(el, true));
11938
+ }
11939
+ if (el.checked !== checked) {
11940
+ el.checked = checked;
11923
11941
  }
11924
11942
  }
11925
11943
  const vModelRadio = {