vue 3.5.0-rc.1 → 3.5.1

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.1
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.1
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.1
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;
@@ -1034,7 +1042,7 @@ const arrayInstrumentations = {
1034
1042
  },
1035
1043
  concat(...args) {
1036
1044
  return reactiveReadArray(this).concat(
1037
- ...args.map((x) => reactiveReadArray(x))
1045
+ ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
1038
1046
  );
1039
1047
  },
1040
1048
  entries() {
@@ -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;
@@ -3360,7 +3368,9 @@ const BaseTransitionImpl = {
3360
3368
  // #11061, ensure enterHooks is fresh after clone
3361
3369
  (hooks) => enterHooks = hooks
3362
3370
  );
3363
- setTransitionHooks(innerChild, enterHooks);
3371
+ if (innerChild.type !== Comment) {
3372
+ setTransitionHooks(innerChild, enterHooks);
3373
+ }
3364
3374
  const oldChild = instance.subTree;
3365
3375
  const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3366
3376
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
@@ -3683,10 +3693,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3683
3693
  const oldRef = oldRawRef && oldRawRef.r;
3684
3694
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3685
3695
  const setupState = owner.setupState;
3696
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3686
3697
  if (oldRef != null && oldRef !== ref) {
3687
3698
  if (isString(oldRef)) {
3688
3699
  refs[oldRef] = null;
3689
- if (hasOwn(setupState, oldRef)) {
3700
+ if (canSetSetupRef(oldRef)) {
3690
3701
  setupState[oldRef] = null;
3691
3702
  }
3692
3703
  } else if (isRef(oldRef)) {
@@ -3701,14 +3712,14 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3701
3712
  if (_isString || _isRef) {
3702
3713
  const doSet = () => {
3703
3714
  if (rawRef.f) {
3704
- const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
3715
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3705
3716
  if (isUnmount) {
3706
3717
  isArray(existing) && remove(existing, refValue);
3707
3718
  } else {
3708
3719
  if (!isArray(existing)) {
3709
3720
  if (_isString) {
3710
3721
  refs[ref] = [refValue];
3711
- if (hasOwn(setupState, ref)) {
3722
+ if (canSetSetupRef(ref)) {
3712
3723
  setupState[ref] = refs[ref];
3713
3724
  }
3714
3725
  } else {
@@ -3721,7 +3732,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3721
3732
  }
3722
3733
  } else if (_isString) {
3723
3734
  refs[ref] = value;
3724
- if (hasOwn(setupState, ref)) {
3735
+ if (canSetSetupRef(ref)) {
3725
3736
  setupState[ref] = value;
3726
3737
  }
3727
3738
  } else if (_isRef) {
@@ -4071,8 +4082,7 @@ Server rendered element contains more child nodes than client vdom.`
4071
4082
  const isText = vnode.type === Text;
4072
4083
  if (node) {
4073
4084
  if (isText && !optimized) {
4074
- let next = children[i + 1];
4075
- if (next && (next = normalizeVNode(next)).type === Text) {
4085
+ if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4076
4086
  insert(
4077
4087
  createText(
4078
4088
  node.data.slice(vnode.children.length)
@@ -4328,7 +4338,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
4328
4338
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4329
4339
  const cssVars = instance.getCssVars();
4330
4340
  for (const key in cssVars) {
4331
- expectedMap.set(`--${key}`, String(cssVars[key]));
4341
+ expectedMap.set(
4342
+ `--${getEscapedCssVarName(key)}`,
4343
+ String(cssVars[key])
4344
+ );
4332
4345
  }
4333
4346
  }
4334
4347
  if (vnode === root && instance.parent) {
@@ -10417,7 +10430,7 @@ function isMemoSame(cached, memo) {
10417
10430
  return true;
10418
10431
  }
10419
10432
 
10420
- const version = "3.5.0-rc.1";
10433
+ const version = "3.5.1";
10421
10434
  const warn = warn$1 ;
10422
10435
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10423
10436
  const devtools = devtools$1 ;
@@ -10521,8 +10534,6 @@ const nodeOps = {
10521
10534
  const TRANSITION$1 = "transition";
10522
10535
  const ANIMATION = "animation";
10523
10536
  const vtcKey = Symbol("_vtc");
10524
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10525
- Transition.displayName = "Transition";
10526
10537
  const DOMTransitionPropsValidators = {
10527
10538
  name: String,
10528
10539
  type: String,
@@ -10541,11 +10552,19 @@ const DOMTransitionPropsValidators = {
10541
10552
  leaveActiveClass: String,
10542
10553
  leaveToClass: String
10543
10554
  };
10544
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10555
+ const TransitionPropsValidators = /* @__PURE__ */ extend(
10545
10556
  {},
10546
10557
  BaseTransitionPropsValidators,
10547
10558
  DOMTransitionPropsValidators
10548
10559
  );
10560
+ const decorate$1 = (t) => {
10561
+ t.displayName = "Transition";
10562
+ t.props = TransitionPropsValidators;
10563
+ return t;
10564
+ };
10565
+ const Transition = /* @__PURE__ */ decorate$1(
10566
+ (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
10567
+ );
10549
10568
  const callHook = (hook, args = []) => {
10550
10569
  if (isArray(hook)) {
10551
10570
  hook.forEach((h2) => h2(...args));
@@ -11053,7 +11072,11 @@ function patchDOMProp(el, key, value, parentComponent) {
11053
11072
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11054
11073
  !tag.includes("-")) {
11055
11074
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
11056
- const newValue = value == null ? "" : String(value);
11075
+ const newValue = value == null ? (
11076
+ // #11647: value should be set as empty string for null and undefined,
11077
+ // but <input type="checkbox"> should be set as 'on'.
11078
+ el.type === "checkbox" ? "on" : ""
11079
+ ) : String(value);
11057
11080
  if (oldValue !== newValue || !("_value" in el)) {
11058
11081
  el.value = newValue;
11059
11082
  }
@@ -11677,7 +11700,11 @@ const positionMap = /* @__PURE__ */ new WeakMap();
11677
11700
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11678
11701
  const moveCbKey = Symbol("_moveCb");
11679
11702
  const enterCbKey = Symbol("_enterCb");
11680
- const TransitionGroupImpl = {
11703
+ const decorate = (t) => {
11704
+ delete t.props.mode;
11705
+ return t;
11706
+ };
11707
+ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11681
11708
  name: "TransitionGroup",
11682
11709
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
11683
11710
  tag: String,
@@ -11763,9 +11790,7 @@ const TransitionGroupImpl = {
11763
11790
  return createVNode(tag, null, children);
11764
11791
  };
11765
11792
  }
11766
- };
11767
- const removeMode = (props) => delete props.mode;
11768
- /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
11793
+ });
11769
11794
  const TransitionGroup = TransitionGroupImpl;
11770
11795
  function callPendingCbs(c) {
11771
11796
  const el = c.el;
@@ -11914,12 +11939,16 @@ const vModelCheckbox = {
11914
11939
  };
11915
11940
  function setChecked(el, { value, oldValue }, vnode) {
11916
11941
  el._modelValue = value;
11942
+ let checked;
11917
11943
  if (isArray(value)) {
11918
- el.checked = looseIndexOf(value, vnode.props.value) > -1;
11944
+ checked = looseIndexOf(value, vnode.props.value) > -1;
11919
11945
  } 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));
11946
+ checked = value.has(vnode.props.value);
11947
+ } else {
11948
+ checked = looseEqual(value, getCheckboxValue(el, true));
11949
+ }
11950
+ if (el.checked !== checked) {
11951
+ el.checked = checked;
11923
11952
  }
11924
11953
  }
11925
11954
  const vModelRadio = {
@@ -15065,7 +15094,7 @@ function createStructuralDirectiveTransform(name, fn) {
15065
15094
  };
15066
15095
  }
15067
15096
 
15068
- const PURE_ANNOTATION = `/*#__PURE__*/`;
15097
+ const PURE_ANNOTATION = `/*@__PURE__*/`;
15069
15098
  const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
15070
15099
  function createCodegenContext(ast, {
15071
15100
  mode = "function",