@vue/compat 3.5.11 → 3.5.12

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.5.11
2
+ * @vue/compat v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -690,16 +690,16 @@ function removeSub(link, soft = false) {
690
690
  nextSub.prevSub = prevSub;
691
691
  link.nextSub = void 0;
692
692
  }
693
- if (dep.subs === link) {
694
- dep.subs = prevSub;
695
- }
696
693
  if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
697
694
  dep.subsHead = nextSub;
698
695
  }
699
- if (!dep.subs && dep.computed) {
700
- dep.computed.flags &= ~4;
701
- for (let l = dep.computed.deps; l; l = l.nextDep) {
702
- removeSub(l, true);
696
+ if (dep.subs === link) {
697
+ dep.subs = prevSub;
698
+ if (!prevSub && dep.computed) {
699
+ dep.computed.flags &= ~4;
700
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
701
+ removeSub(l, true);
702
+ }
703
703
  }
704
704
  }
705
705
  if (!soft && !--dep.sc && dep.map) {
@@ -963,7 +963,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
963
963
  }
964
964
  });
965
965
  } else {
966
- if (key !== void 0) {
966
+ if (key !== void 0 || depsMap.has(void 0)) {
967
967
  run(depsMap.get(key));
968
968
  }
969
969
  if (isArrayIndex) {
@@ -1338,117 +1338,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1338
1338
 
1339
1339
  const toShallow = (value) => value;
1340
1340
  const getProto = (v) => Reflect.getPrototypeOf(v);
1341
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1342
- target = target["__v_raw"];
1343
- const rawTarget = toRaw(target);
1344
- const rawKey = toRaw(key);
1345
- if (!isReadonly2) {
1346
- if (hasChanged(key, rawKey)) {
1347
- track(rawTarget, "get", key);
1348
- }
1349
- track(rawTarget, "get", rawKey);
1350
- }
1351
- const { has: has2 } = getProto(rawTarget);
1352
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1353
- if (has2.call(rawTarget, key)) {
1354
- return wrap(target.get(key));
1355
- } else if (has2.call(rawTarget, rawKey)) {
1356
- return wrap(target.get(rawKey));
1357
- } else if (target !== rawTarget) {
1358
- target.get(key);
1359
- }
1360
- }
1361
- function has(key, isReadonly2 = false) {
1362
- const target = this["__v_raw"];
1363
- const rawTarget = toRaw(target);
1364
- const rawKey = toRaw(key);
1365
- if (!isReadonly2) {
1366
- if (hasChanged(key, rawKey)) {
1367
- track(rawTarget, "has", key);
1368
- }
1369
- track(rawTarget, "has", rawKey);
1370
- }
1371
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1372
- }
1373
- function size(target, isReadonly2 = false) {
1374
- target = target["__v_raw"];
1375
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1376
- return Reflect.get(target, "size", target);
1377
- }
1378
- function add(value, _isShallow = false) {
1379
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1380
- value = toRaw(value);
1381
- }
1382
- const target = toRaw(this);
1383
- const proto = getProto(target);
1384
- const hadKey = proto.has.call(target, value);
1385
- if (!hadKey) {
1386
- target.add(value);
1387
- trigger(target, "add", value, value);
1388
- }
1389
- return this;
1390
- }
1391
- function set(key, value, _isShallow = false) {
1392
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1393
- value = toRaw(value);
1394
- }
1395
- const target = toRaw(this);
1396
- const { has: has2, get: get2 } = getProto(target);
1397
- let hadKey = has2.call(target, key);
1398
- if (!hadKey) {
1399
- key = toRaw(key);
1400
- hadKey = has2.call(target, key);
1401
- } else if (!!(process.env.NODE_ENV !== "production")) {
1402
- checkIdentityKeys(target, has2, key);
1403
- }
1404
- const oldValue = get2.call(target, key);
1405
- target.set(key, value);
1406
- if (!hadKey) {
1407
- trigger(target, "add", key, value);
1408
- } else if (hasChanged(value, oldValue)) {
1409
- trigger(target, "set", key, value, oldValue);
1410
- }
1411
- return this;
1412
- }
1413
- function deleteEntry(key) {
1414
- const target = toRaw(this);
1415
- const { has: has2, get: get2 } = getProto(target);
1416
- let hadKey = has2.call(target, key);
1417
- if (!hadKey) {
1418
- key = toRaw(key);
1419
- hadKey = has2.call(target, key);
1420
- } else if (!!(process.env.NODE_ENV !== "production")) {
1421
- checkIdentityKeys(target, has2, key);
1422
- }
1423
- const oldValue = get2 ? get2.call(target, key) : void 0;
1424
- const result = target.delete(key);
1425
- if (hadKey) {
1426
- trigger(target, "delete", key, void 0, oldValue);
1427
- }
1428
- return result;
1429
- }
1430
- function clear() {
1431
- const target = toRaw(this);
1432
- const hadItems = target.size !== 0;
1433
- const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1434
- const result = target.clear();
1435
- if (hadItems) {
1436
- trigger(target, "clear", void 0, void 0, oldTarget);
1437
- }
1438
- return result;
1439
- }
1440
- function createForEach(isReadonly2, isShallow2) {
1441
- return function forEach(callback, thisArg) {
1442
- const observed = this;
1443
- const target = observed["__v_raw"];
1444
- const rawTarget = toRaw(target);
1445
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1446
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1447
- return target.forEach((value, key) => {
1448
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1449
- });
1450
- };
1451
- }
1452
1341
  function createIterableMethod(method, isReadonly2, isShallow2) {
1453
1342
  return function(...args) {
1454
1343
  const target = this["__v_raw"];
@@ -1491,71 +1380,134 @@ function createReadonlyMethod(type) {
1491
1380
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1492
1381
  };
1493
1382
  }
1494
- function createInstrumentations() {
1495
- const mutableInstrumentations2 = {
1496
- get(key) {
1497
- return get(this, key);
1498
- },
1499
- get size() {
1500
- return size(this);
1501
- },
1502
- has,
1503
- add,
1504
- set,
1505
- delete: deleteEntry,
1506
- clear,
1507
- forEach: createForEach(false, false)
1508
- };
1509
- const shallowInstrumentations2 = {
1383
+ function createInstrumentations(readonly, shallow) {
1384
+ const instrumentations = {
1510
1385
  get(key) {
1511
- return get(this, key, false, true);
1512
- },
1513
- get size() {
1514
- return size(this);
1515
- },
1516
- has,
1517
- add(value) {
1518
- return add.call(this, value, true);
1519
- },
1520
- set(key, value) {
1521
- return set.call(this, key, value, true);
1522
- },
1523
- delete: deleteEntry,
1524
- clear,
1525
- forEach: createForEach(false, true)
1526
- };
1527
- const readonlyInstrumentations2 = {
1528
- get(key) {
1529
- return get(this, key, true);
1530
- },
1531
- get size() {
1532
- return size(this, true);
1533
- },
1534
- has(key) {
1535
- return has.call(this, key, true);
1536
- },
1537
- add: createReadonlyMethod("add"),
1538
- set: createReadonlyMethod("set"),
1539
- delete: createReadonlyMethod("delete"),
1540
- clear: createReadonlyMethod("clear"),
1541
- forEach: createForEach(true, false)
1542
- };
1543
- const shallowReadonlyInstrumentations2 = {
1544
- get(key) {
1545
- return get(this, key, true, true);
1386
+ const target = this["__v_raw"];
1387
+ const rawTarget = toRaw(target);
1388
+ const rawKey = toRaw(key);
1389
+ if (!readonly) {
1390
+ if (hasChanged(key, rawKey)) {
1391
+ track(rawTarget, "get", key);
1392
+ }
1393
+ track(rawTarget, "get", rawKey);
1394
+ }
1395
+ const { has } = getProto(rawTarget);
1396
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1397
+ if (has.call(rawTarget, key)) {
1398
+ return wrap(target.get(key));
1399
+ } else if (has.call(rawTarget, rawKey)) {
1400
+ return wrap(target.get(rawKey));
1401
+ } else if (target !== rawTarget) {
1402
+ target.get(key);
1403
+ }
1546
1404
  },
1547
1405
  get size() {
1548
- return size(this, true);
1406
+ const target = this["__v_raw"];
1407
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1408
+ return Reflect.get(target, "size", target);
1549
1409
  },
1550
1410
  has(key) {
1551
- return has.call(this, key, true);
1411
+ const target = this["__v_raw"];
1412
+ const rawTarget = toRaw(target);
1413
+ const rawKey = toRaw(key);
1414
+ if (!readonly) {
1415
+ if (hasChanged(key, rawKey)) {
1416
+ track(rawTarget, "has", key);
1417
+ }
1418
+ track(rawTarget, "has", rawKey);
1419
+ }
1420
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1552
1421
  },
1553
- add: createReadonlyMethod("add"),
1554
- set: createReadonlyMethod("set"),
1555
- delete: createReadonlyMethod("delete"),
1556
- clear: createReadonlyMethod("clear"),
1557
- forEach: createForEach(true, true)
1422
+ forEach(callback, thisArg) {
1423
+ const observed = this;
1424
+ const target = observed["__v_raw"];
1425
+ const rawTarget = toRaw(target);
1426
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1427
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1428
+ return target.forEach((value, key) => {
1429
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1430
+ });
1431
+ }
1558
1432
  };
1433
+ extend(
1434
+ instrumentations,
1435
+ readonly ? {
1436
+ add: createReadonlyMethod("add"),
1437
+ set: createReadonlyMethod("set"),
1438
+ delete: createReadonlyMethod("delete"),
1439
+ clear: createReadonlyMethod("clear")
1440
+ } : {
1441
+ add(value) {
1442
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1443
+ value = toRaw(value);
1444
+ }
1445
+ const target = toRaw(this);
1446
+ const proto = getProto(target);
1447
+ const hadKey = proto.has.call(target, value);
1448
+ if (!hadKey) {
1449
+ target.add(value);
1450
+ trigger(target, "add", value, value);
1451
+ }
1452
+ return this;
1453
+ },
1454
+ set(key, value) {
1455
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1456
+ value = toRaw(value);
1457
+ }
1458
+ const target = toRaw(this);
1459
+ const { has, get } = getProto(target);
1460
+ let hadKey = has.call(target, key);
1461
+ if (!hadKey) {
1462
+ key = toRaw(key);
1463
+ hadKey = has.call(target, key);
1464
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1465
+ checkIdentityKeys(target, has, key);
1466
+ }
1467
+ const oldValue = get.call(target, key);
1468
+ target.set(key, value);
1469
+ if (!hadKey) {
1470
+ trigger(target, "add", key, value);
1471
+ } else if (hasChanged(value, oldValue)) {
1472
+ trigger(target, "set", key, value, oldValue);
1473
+ }
1474
+ return this;
1475
+ },
1476
+ delete(key) {
1477
+ const target = toRaw(this);
1478
+ const { has, get } = getProto(target);
1479
+ let hadKey = has.call(target, key);
1480
+ if (!hadKey) {
1481
+ key = toRaw(key);
1482
+ hadKey = has.call(target, key);
1483
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1484
+ checkIdentityKeys(target, has, key);
1485
+ }
1486
+ const oldValue = get ? get.call(target, key) : void 0;
1487
+ const result = target.delete(key);
1488
+ if (hadKey) {
1489
+ trigger(target, "delete", key, void 0, oldValue);
1490
+ }
1491
+ return result;
1492
+ },
1493
+ clear() {
1494
+ const target = toRaw(this);
1495
+ const hadItems = target.size !== 0;
1496
+ const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1497
+ const result = target.clear();
1498
+ if (hadItems) {
1499
+ trigger(
1500
+ target,
1501
+ "clear",
1502
+ void 0,
1503
+ void 0,
1504
+ oldTarget
1505
+ );
1506
+ }
1507
+ return result;
1508
+ }
1509
+ }
1510
+ );
1559
1511
  const iteratorMethods = [
1560
1512
  "keys",
1561
1513
  "values",
@@ -1563,30 +1515,12 @@ function createInstrumentations() {
1563
1515
  Symbol.iterator
1564
1516
  ];
1565
1517
  iteratorMethods.forEach((method) => {
1566
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1567
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1568
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1569
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1570
- method,
1571
- true,
1572
- true
1573
- );
1518
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1574
1519
  });
1575
- return [
1576
- mutableInstrumentations2,
1577
- readonlyInstrumentations2,
1578
- shallowInstrumentations2,
1579
- shallowReadonlyInstrumentations2
1580
- ];
1520
+ return instrumentations;
1581
1521
  }
1582
- const [
1583
- mutableInstrumentations,
1584
- readonlyInstrumentations,
1585
- shallowInstrumentations,
1586
- shallowReadonlyInstrumentations
1587
- ] = /* @__PURE__ */ createInstrumentations();
1588
1522
  function createInstrumentationGetter(isReadonly2, shallow) {
1589
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1523
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1590
1524
  return (target, key, receiver) => {
1591
1525
  if (key === "__v_isReactive") {
1592
1526
  return !isReadonly2;
@@ -1614,9 +1548,9 @@ const readonlyCollectionHandlers = {
1614
1548
  const shallowReadonlyCollectionHandlers = {
1615
1549
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1616
1550
  };
1617
- function checkIdentityKeys(target, has2, key) {
1551
+ function checkIdentityKeys(target, has, key) {
1618
1552
  const rawKey = toRaw(key);
1619
- if (rawKey !== key && has2.call(target, rawKey)) {
1553
+ if (rawKey !== key && has.call(target, rawKey)) {
1620
1554
  const type = toRawType(target);
1621
1555
  warn$2(
1622
1556
  `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
@@ -3584,7 +3518,7 @@ const TeleportImpl = {
3584
3518
  }
3585
3519
  if (!disabled) {
3586
3520
  mount(target, targetAnchor);
3587
- updateCssVars(n2);
3521
+ updateCssVars(n2, false);
3588
3522
  }
3589
3523
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
3590
3524
  warn$1(
@@ -3596,7 +3530,7 @@ const TeleportImpl = {
3596
3530
  };
3597
3531
  if (disabled) {
3598
3532
  mount(container, mainAnchor);
3599
- updateCssVars(n2);
3533
+ updateCssVars(n2, true);
3600
3534
  }
3601
3535
  if (isTeleportDeferred(n2.props)) {
3602
3536
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3686,7 +3620,7 @@ const TeleportImpl = {
3686
3620
  );
3687
3621
  }
3688
3622
  }
3689
- updateCssVars(n2);
3623
+ updateCssVars(n2, disabled);
3690
3624
  }
3691
3625
  },
3692
3626
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3754,9 +3688,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3754
3688
  querySelector
3755
3689
  );
3756
3690
  if (target) {
3691
+ const disabled = isTeleportDisabled(vnode.props);
3757
3692
  const targetNode = target._lpa || target.firstChild;
3758
3693
  if (vnode.shapeFlag & 16) {
3759
- if (isTeleportDisabled(vnode.props)) {
3694
+ if (disabled) {
3760
3695
  vnode.anchor = hydrateChildren(
3761
3696
  nextSibling(node),
3762
3697
  vnode,
@@ -3797,16 +3732,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3797
3732
  );
3798
3733
  }
3799
3734
  }
3800
- updateCssVars(vnode);
3735
+ updateCssVars(vnode, disabled);
3801
3736
  }
3802
3737
  return vnode.anchor && nextSibling(vnode.anchor);
3803
3738
  }
3804
3739
  const Teleport = TeleportImpl;
3805
- function updateCssVars(vnode) {
3740
+ function updateCssVars(vnode, isDisabled) {
3806
3741
  const ctx = vnode.ctx;
3807
3742
  if (ctx && ctx.ut) {
3808
- let node = vnode.targetStart;
3809
- while (node && node !== vnode.targetAnchor) {
3743
+ let node, anchor;
3744
+ if (isDisabled) {
3745
+ node = vnode.el;
3746
+ anchor = vnode.anchor;
3747
+ } else {
3748
+ node = vnode.targetStart;
3749
+ anchor = vnode.targetAnchor;
3750
+ }
3751
+ while (node && node !== anchor) {
3810
3752
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3811
3753
  node = node.nextSibling;
3812
3754
  }
@@ -4260,8 +4202,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4260
4202
  const setupState = owner.setupState;
4261
4203
  const rawSetupState = toRaw(setupState);
4262
4204
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4263
- if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(rawSetupState[key])) {
4264
- return false;
4205
+ if (!!(process.env.NODE_ENV !== "production")) {
4206
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4207
+ warn$1(
4208
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4209
+ );
4210
+ }
4211
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4212
+ return false;
4213
+ }
4265
4214
  }
4266
4215
  return hasOwn(rawSetupState, key);
4267
4216
  };
@@ -4558,7 +4507,11 @@ function createHydrationFunctions(rendererInternals) {
4558
4507
  }
4559
4508
  let needCallTransitionHooks = false;
4560
4509
  if (isTemplateNode(el)) {
4561
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4510
+ needCallTransitionHooks = needTransition(
4511
+ null,
4512
+ // no need check parentSuspense in hydration
4513
+ transition
4514
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4562
4515
  const content = el.content.firstChild;
4563
4516
  if (needCallTransitionHooks) {
4564
4517
  transition.beforeEnter(content);
@@ -4962,6 +4915,8 @@ function isMismatchAllowed(el, allowedType) {
4962
4915
  }
4963
4916
  }
4964
4917
 
4918
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4919
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
4965
4920
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4966
4921
  const id = requestIdleCallback(hydrate, { timeout });
4967
4922
  return () => cancelIdleCallback(id);
@@ -5955,12 +5910,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5955
5910
  }
5956
5911
  openBlock();
5957
5912
  const validSlotContent = slot && ensureValidVNode(slot(props));
5913
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5914
+ // key attached in the `createSlots` helper, respect that
5915
+ validSlotContent && validSlotContent.key;
5958
5916
  const rendered = createBlock(
5959
5917
  Fragment,
5960
5918
  {
5961
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
5962
- // key attached in the `createSlots` helper, respect that
5963
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5919
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5964
5920
  (!validSlotContent && fallback ? "_fb" : "")
5965
5921
  },
5966
5922
  validSlotContent || (fallback ? fallback() : []),
@@ -7131,7 +7087,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7131
7087
  return vm;
7132
7088
  }
7133
7089
  }
7134
- Vue.version = `2.6.14-compat:${"3.5.11"}`;
7090
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7135
7091
  Vue.config = singletonApp.config;
7136
7092
  Vue.use = (plugin, ...options) => {
7137
7093
  if (plugin && isFunction(plugin.install)) {
@@ -8121,6 +8077,7 @@ function getType(ctor) {
8121
8077
  function validateProps(rawProps, props, instance) {
8122
8078
  const resolvedValues = toRaw(props);
8123
8079
  const options = instance.propsOptions[0];
8080
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8124
8081
  for (const key in options) {
8125
8082
  let opt = options[key];
8126
8083
  if (opt == null) continue;
@@ -8129,7 +8086,7 @@ function validateProps(rawProps, props, instance) {
8129
8086
  resolvedValues[key],
8130
8087
  opt,
8131
8088
  !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
8132
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8089
+ !camelizePropsKey.includes(key)
8133
8090
  );
8134
8091
  }
8135
8092
  }
@@ -9981,14 +9938,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9981
9938
  }
9982
9939
  const baseWatchOptions = extend({}, options);
9983
9940
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
9941
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
9984
9942
  let ssrCleanup;
9985
9943
  if (isInSSRComponentSetup) {
9986
9944
  if (flush === "sync") {
9987
9945
  const ctx = useSSRContext();
9988
9946
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
9989
- } else if (!cb || immediate) {
9990
- baseWatchOptions.once = true;
9991
- } else {
9947
+ } else if (!runsImmediately) {
9992
9948
  const watchStopHandle = () => {
9993
9949
  };
9994
9950
  watchStopHandle.stop = NOOP;
@@ -10027,7 +9983,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10027
9983
  }
10028
9984
  };
10029
9985
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10030
- if (ssrCleanup) ssrCleanup.push(watchHandle);
9986
+ if (isInSSRComponentSetup) {
9987
+ if (ssrCleanup) {
9988
+ ssrCleanup.push(watchHandle);
9989
+ } else if (runsImmediately) {
9990
+ watchHandle();
9991
+ }
9992
+ }
10031
9993
  return watchHandle;
10032
9994
  }
10033
9995
  function instanceWatch(source, value, options) {
@@ -10062,19 +10024,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10062
10024
  warn$1(`useModel() called without active instance.`);
10063
10025
  return ref();
10064
10026
  }
10065
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
10027
+ const camelizedName = camelize(name);
10028
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
10066
10029
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10067
10030
  return ref();
10068
10031
  }
10069
- const camelizedName = camelize(name);
10070
10032
  const hyphenatedName = hyphenate(name);
10071
- const modifiers = getModelModifiers(props, name);
10033
+ const modifiers = getModelModifiers(props, camelizedName);
10072
10034
  const res = customRef((track, trigger) => {
10073
10035
  let localValue;
10074
10036
  let prevSetValue = EMPTY_OBJ;
10075
10037
  let prevEmittedValue;
10076
10038
  watchSyncEffect(() => {
10077
- const propValue = props[name];
10039
+ const propValue = props[camelizedName];
10078
10040
  if (hasChanged(localValue, propValue)) {
10079
10041
  localValue = propValue;
10080
10042
  trigger();
@@ -11798,9 +11760,9 @@ function setupStatefulComponent(instance, isSSR) {
11798
11760
  }
11799
11761
  const { setup } = Component;
11800
11762
  if (setup) {
11763
+ pauseTracking();
11801
11764
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11802
11765
  const reset = setCurrentInstance(instance);
11803
- pauseTracking();
11804
11766
  const setupResult = callWithErrorHandling(
11805
11767
  setup,
11806
11768
  instance,
@@ -11810,10 +11772,13 @@ function setupStatefulComponent(instance, isSSR) {
11810
11772
  setupContext
11811
11773
  ]
11812
11774
  );
11775
+ const isAsyncSetup = isPromise(setupResult);
11813
11776
  resetTracking();
11814
11777
  reset();
11815
- if (isPromise(setupResult)) {
11816
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11778
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11779
+ markAsyncBoundary(instance);
11780
+ }
11781
+ if (isAsyncSetup) {
11817
11782
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11818
11783
  if (isSSR) {
11819
11784
  return setupResult.then((resolvedResult) => {
@@ -12300,7 +12265,7 @@ function isMemoSame(cached, memo) {
12300
12265
  return true;
12301
12266
  }
12302
12267
 
12303
- const version = "3.5.11";
12268
+ const version = "3.5.12";
12304
12269
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12305
12270
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12306
12271
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13005,7 +12970,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
13005
12970
  return false;
13006
12971
  }
13007
12972
 
13008
- function patchDOMProp(el, key, value, parentComponent) {
12973
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
13009
12974
  if (key === "innerHTML" || key === "textContent") {
13010
12975
  if (value != null) {
13011
12976
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13069,7 +13034,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13069
13034
  );
13070
13035
  }
13071
13036
  }
13072
- needRemove && el.removeAttribute(key);
13037
+ needRemove && el.removeAttribute(attrName || key);
13073
13038
  }
13074
13039
 
13075
13040
  function addEventListener(el, event, handler, options) {
@@ -13179,7 +13144,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13179
13144
  // #11081 force set props for possible async custom element
13180
13145
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13181
13146
  ) {
13182
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13147
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13183
13148
  } else {
13184
13149
  if (key === "true-value") {
13185
13150
  el._trueValue = nextValue;
@@ -13906,7 +13871,7 @@ const vModelCheckbox = {
13906
13871
  setChecked(el, binding, vnode);
13907
13872
  }
13908
13873
  };
13909
- function setChecked(el, { value }, vnode) {
13874
+ function setChecked(el, { value, oldValue }, vnode) {
13910
13875
  el._modelValue = value;
13911
13876
  let checked;
13912
13877
  if (isArray(value)) {
@@ -13914,6 +13879,7 @@ function setChecked(el, { value }, vnode) {
13914
13879
  } else if (isSet(value)) {
13915
13880
  checked = value.has(vnode.props.value);
13916
13881
  } else {
13882
+ if (value === oldValue) return;
13917
13883
  checked = looseEqual(value, getCheckboxValue(el, true));
13918
13884
  }
13919
13885
  if (el.checked !== checked) {