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.
@@ -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
  **/
@@ -214,6 +214,14 @@ function isRenderableAttrValue(value) {
214
214
  return type === "string" || type === "number" || type === "boolean";
215
215
  }
216
216
 
217
+ const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
218
+ function getEscapedCssVarName(key, doubleEscape) {
219
+ return key.replace(
220
+ cssVarNameEscapeSymbolsRE,
221
+ (s) => `\\${s}`
222
+ );
223
+ }
224
+
217
225
  function looseCompareArrays(a, b) {
218
226
  if (a.length !== b.length) return false;
219
227
  let equal = true;
@@ -1073,7 +1081,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1073
1081
  const needsWrap = arr !== self && !isShallow(self);
1074
1082
  const methodFn = arr[method];
1075
1083
  if (methodFn !== arrayProto[method]) {
1076
- const result2 = methodFn.apply(arr, args);
1084
+ const result2 = methodFn.apply(self, args);
1077
1085
  return needsWrap ? toReactive(result2) : result2;
1078
1086
  }
1079
1087
  let wrappedFn = fn;
@@ -4004,8 +4012,7 @@ Server rendered element contains more child nodes than client vdom.`
4004
4012
  const isText = vnode.type === Text;
4005
4013
  if (node) {
4006
4014
  if (isText && !optimized) {
4007
- let next = children[i + 1];
4008
- if (next && (next = normalizeVNode(next)).type === Text) {
4015
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4009
4016
  insert(
4010
4017
  createText(
4011
4018
  node.data.slice(vnode.children.length)
@@ -4261,7 +4268,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4261
4268
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4262
4269
  const cssVars = instance.getCssVars();
4263
4270
  for (const key in cssVars) {
4264
- expectedMap.set(`--${key}`, String(cssVars[key]));
4271
+ expectedMap.set(
4272
+ `--${getEscapedCssVarName(key)}`,
4273
+ String(cssVars[key])
4274
+ );
4265
4275
  }
4266
4276
  }
4267
4277
  if (vnode === root && instance.parent) {
@@ -10350,7 +10360,7 @@ function isMemoSame(cached, memo) {
10350
10360
  return true;
10351
10361
  }
10352
10362
 
10353
- const version = "3.5.0-rc.1";
10363
+ const version = "3.5.0";
10354
10364
  const warn = warn$1 ;
10355
10365
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10356
10366
  const devtools = devtools$1 ;
@@ -10986,7 +10996,11 @@ function patchDOMProp(el, key, value, parentComponent) {
10986
10996
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10987
10997
  !tag.includes("-")) {
10988
10998
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10989
- const newValue = value == null ? "" : String(value);
10999
+ const newValue = value == null ? (
11000
+ // #11647: value should be set as empty string for null and undefined,
11001
+ // but <input type="checkbox"> should be set as 'on'.
11002
+ el.type === "checkbox" ? "on" : ""
11003
+ ) : String(value);
10990
11004
  if (oldValue !== newValue || !("_value" in el)) {
10991
11005
  el.value = newValue;
10992
11006
  }
@@ -11847,12 +11861,16 @@ const vModelCheckbox = {
11847
11861
  };
11848
11862
  function setChecked(el, { value, oldValue }, vnode) {
11849
11863
  el._modelValue = value;
11864
+ let checked;
11850
11865
  if (isArray(value)) {
11851
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11866
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11852
11867
  } else if (isSet(value)) {
11853
- el.checked = value.has(vnode.props.value);
11854
- } else if (value !== oldValue) {
11855
- el.checked = looseEqual(value, getCheckboxValue(el, true));
11868
+ checked = value.has(vnode.props.value);
11869
+ } else {
11870
+ checked = looseEqual(value, getCheckboxValue(el, true));
11871
+ }
11872
+ if (el.checked !== checked) {
11873
+ el.checked = checked;
11856
11874
  }
11857
11875
  }
11858
11876
  const vModelRadio = {