@vue/runtime-core 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/runtime-core v3.5.11
2
+ * @vue/runtime-core v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -841,7 +841,7 @@ const TeleportImpl = {
841
841
  }
842
842
  if (!disabled) {
843
843
  mount(target, targetAnchor);
844
- updateCssVars(n2);
844
+ updateCssVars(n2, false);
845
845
  }
846
846
  } else if (!disabled) {
847
847
  warn$1(
@@ -853,7 +853,7 @@ const TeleportImpl = {
853
853
  };
854
854
  if (disabled) {
855
855
  mount(container, mainAnchor);
856
- updateCssVars(n2);
856
+ updateCssVars(n2, true);
857
857
  }
858
858
  if (isTeleportDeferred(n2.props)) {
859
859
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -943,7 +943,7 @@ const TeleportImpl = {
943
943
  );
944
944
  }
945
945
  }
946
- updateCssVars(n2);
946
+ updateCssVars(n2, disabled);
947
947
  }
948
948
  },
949
949
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -1011,9 +1011,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1011
1011
  querySelector
1012
1012
  );
1013
1013
  if (target) {
1014
+ const disabled = isTeleportDisabled(vnode.props);
1014
1015
  const targetNode = target._lpa || target.firstChild;
1015
1016
  if (vnode.shapeFlag & 16) {
1016
- if (isTeleportDisabled(vnode.props)) {
1017
+ if (disabled) {
1017
1018
  vnode.anchor = hydrateChildren(
1018
1019
  nextSibling(node),
1019
1020
  vnode,
@@ -1054,16 +1055,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1054
1055
  );
1055
1056
  }
1056
1057
  }
1057
- updateCssVars(vnode);
1058
+ updateCssVars(vnode, disabled);
1058
1059
  }
1059
1060
  return vnode.anchor && nextSibling(vnode.anchor);
1060
1061
  }
1061
1062
  const Teleport = TeleportImpl;
1062
- function updateCssVars(vnode) {
1063
+ function updateCssVars(vnode, isDisabled) {
1063
1064
  const ctx = vnode.ctx;
1064
1065
  if (ctx && ctx.ut) {
1065
- let node = vnode.targetStart;
1066
- while (node && node !== vnode.targetAnchor) {
1066
+ let node, anchor;
1067
+ if (isDisabled) {
1068
+ node = vnode.el;
1069
+ anchor = vnode.anchor;
1070
+ } else {
1071
+ node = vnode.targetStart;
1072
+ anchor = vnode.targetAnchor;
1073
+ }
1074
+ while (node && node !== anchor) {
1067
1075
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
1068
1076
  node = node.nextSibling;
1069
1077
  }
@@ -1513,8 +1521,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1513
1521
  const setupState = owner.setupState;
1514
1522
  const rawSetupState = reactivity.toRaw(setupState);
1515
1523
  const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
1516
- if (knownTemplateRefs.has(rawSetupState[key])) {
1517
- return false;
1524
+ {
1525
+ if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
1526
+ warn$1(
1527
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1528
+ );
1529
+ }
1530
+ if (knownTemplateRefs.has(rawSetupState[key])) {
1531
+ return false;
1532
+ }
1518
1533
  }
1519
1534
  return shared.hasOwn(rawSetupState, key);
1520
1535
  };
@@ -1811,7 +1826,11 @@ function createHydrationFunctions(rendererInternals) {
1811
1826
  }
1812
1827
  let needCallTransitionHooks = false;
1813
1828
  if (isTemplateNode(el)) {
1814
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1829
+ needCallTransitionHooks = needTransition(
1830
+ null,
1831
+ // no need check parentSuspense in hydration
1832
+ transition
1833
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1815
1834
  const content = el.content.firstChild;
1816
1835
  if (needCallTransitionHooks) {
1817
1836
  transition.beforeEnter(content);
@@ -2204,6 +2223,8 @@ function isMismatchAllowed(el, allowedType) {
2204
2223
  }
2205
2224
  }
2206
2225
 
2226
+ const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
2227
+ const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
2207
2228
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
2208
2229
  const id = requestIdleCallback(hydrate, { timeout });
2209
2230
  return () => cancelIdleCallback(id);
@@ -2906,12 +2927,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2906
2927
  }
2907
2928
  openBlock();
2908
2929
  const validSlotContent = slot && ensureValidVNode(slot(props));
2930
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
2931
+ // key attached in the `createSlots` helper, respect that
2932
+ validSlotContent && validSlotContent.key;
2909
2933
  const rendered = createBlock(
2910
2934
  Fragment,
2911
2935
  {
2912
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
2913
- // key attached in the `createSlots` helper, respect that
2914
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
2936
+ key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
2915
2937
  (!validSlotContent && fallback ? "_fb" : "")
2916
2938
  },
2917
2939
  validSlotContent || (fallback ? fallback() : []),
@@ -4269,6 +4291,7 @@ function getType(ctor) {
4269
4291
  function validateProps(rawProps, props, instance) {
4270
4292
  const resolvedValues = reactivity.toRaw(props);
4271
4293
  const options = instance.propsOptions[0];
4294
+ const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
4272
4295
  for (const key in options) {
4273
4296
  let opt = options[key];
4274
4297
  if (opt == null) continue;
@@ -4277,7 +4300,7 @@ function validateProps(rawProps, props, instance) {
4277
4300
  resolvedValues[key],
4278
4301
  opt,
4279
4302
  reactivity.shallowReadonly(resolvedValues) ,
4280
- !shared.hasOwn(rawProps, key) && !shared.hasOwn(rawProps, shared.hyphenate(key))
4303
+ !camelizePropsKey.includes(key)
4281
4304
  );
4282
4305
  }
4283
4306
  }
@@ -6057,14 +6080,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
6057
6080
  }
6058
6081
  const baseWatchOptions = shared.extend({}, options);
6059
6082
  baseWatchOptions.onWarn = warn$1;
6083
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
6060
6084
  let ssrCleanup;
6061
6085
  if (isInSSRComponentSetup) {
6062
6086
  if (flush === "sync") {
6063
6087
  const ctx = useSSRContext();
6064
6088
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
6065
- } else if (!cb || immediate) {
6066
- baseWatchOptions.once = true;
6067
- } else {
6089
+ } else if (!runsImmediately) {
6068
6090
  const watchStopHandle = () => {
6069
6091
  };
6070
6092
  watchStopHandle.stop = shared.NOOP;
@@ -6103,7 +6125,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
6103
6125
  }
6104
6126
  };
6105
6127
  const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
6106
- if (ssrCleanup) ssrCleanup.push(watchHandle);
6128
+ if (isInSSRComponentSetup) {
6129
+ if (ssrCleanup) {
6130
+ ssrCleanup.push(watchHandle);
6131
+ } else if (runsImmediately) {
6132
+ watchHandle();
6133
+ }
6134
+ }
6107
6135
  return watchHandle;
6108
6136
  }
6109
6137
  function instanceWatch(source, value, options) {
@@ -6138,19 +6166,19 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6138
6166
  warn$1(`useModel() called without active instance.`);
6139
6167
  return reactivity.ref();
6140
6168
  }
6141
- if (!i.propsOptions[0][name]) {
6169
+ const camelizedName = shared.camelize(name);
6170
+ if (!i.propsOptions[0][camelizedName]) {
6142
6171
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
6143
6172
  return reactivity.ref();
6144
6173
  }
6145
- const camelizedName = shared.camelize(name);
6146
6174
  const hyphenatedName = shared.hyphenate(name);
6147
- const modifiers = getModelModifiers(props, name);
6175
+ const modifiers = getModelModifiers(props, camelizedName);
6148
6176
  const res = reactivity.customRef((track, trigger) => {
6149
6177
  let localValue;
6150
6178
  let prevSetValue = shared.EMPTY_OBJ;
6151
6179
  let prevEmittedValue;
6152
6180
  watchSyncEffect(() => {
6153
- const propValue = props[name];
6181
+ const propValue = props[camelizedName];
6154
6182
  if (shared.hasChanged(localValue, propValue)) {
6155
6183
  localValue = propValue;
6156
6184
  trigger();
@@ -7777,9 +7805,9 @@ function setupStatefulComponent(instance, isSSR) {
7777
7805
  }
7778
7806
  const { setup } = Component;
7779
7807
  if (setup) {
7808
+ reactivity.pauseTracking();
7780
7809
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
7781
7810
  const reset = setCurrentInstance(instance);
7782
- reactivity.pauseTracking();
7783
7811
  const setupResult = callWithErrorHandling(
7784
7812
  setup,
7785
7813
  instance,
@@ -7789,10 +7817,13 @@ function setupStatefulComponent(instance, isSSR) {
7789
7817
  setupContext
7790
7818
  ]
7791
7819
  );
7820
+ const isAsyncSetup = shared.isPromise(setupResult);
7792
7821
  reactivity.resetTracking();
7793
7822
  reset();
7794
- if (shared.isPromise(setupResult)) {
7795
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
7823
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
7824
+ markAsyncBoundary(instance);
7825
+ }
7826
+ if (isAsyncSetup) {
7796
7827
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7797
7828
  if (isSSR) {
7798
7829
  return setupResult.then((resolvedResult) => {
@@ -8255,7 +8286,7 @@ function isMemoSame(cached, memo) {
8255
8286
  return true;
8256
8287
  }
8257
8288
 
8258
- const version = "3.5.11";
8289
+ const version = "3.5.12";
8259
8290
  const warn = warn$1 ;
8260
8291
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8261
8292
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.11
2
+ * @vue/runtime-core v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -440,13 +440,13 @@ const TeleportImpl = {
440
440
  }
441
441
  if (!disabled) {
442
442
  mount(target, targetAnchor);
443
- updateCssVars(n2);
443
+ updateCssVars(n2, false);
444
444
  }
445
445
  }
446
446
  };
447
447
  if (disabled) {
448
448
  mount(container, mainAnchor);
449
- updateCssVars(n2);
449
+ updateCssVars(n2, true);
450
450
  }
451
451
  if (isTeleportDeferred(n2.props)) {
452
452
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -530,7 +530,7 @@ const TeleportImpl = {
530
530
  );
531
531
  }
532
532
  }
533
- updateCssVars(n2);
533
+ updateCssVars(n2, disabled);
534
534
  }
535
535
  },
536
536
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -598,9 +598,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
598
598
  querySelector
599
599
  );
600
600
  if (target) {
601
+ const disabled = isTeleportDisabled(vnode.props);
601
602
  const targetNode = target._lpa || target.firstChild;
602
603
  if (vnode.shapeFlag & 16) {
603
- if (isTeleportDisabled(vnode.props)) {
604
+ if (disabled) {
604
605
  vnode.anchor = hydrateChildren(
605
606
  nextSibling(node),
606
607
  vnode,
@@ -641,16 +642,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
641
642
  );
642
643
  }
643
644
  }
644
- updateCssVars(vnode);
645
+ updateCssVars(vnode, disabled);
645
646
  }
646
647
  return vnode.anchor && nextSibling(vnode.anchor);
647
648
  }
648
649
  const Teleport = TeleportImpl;
649
- function updateCssVars(vnode) {
650
+ function updateCssVars(vnode, isDisabled) {
650
651
  const ctx = vnode.ctx;
651
652
  if (ctx && ctx.ut) {
652
- let node = vnode.targetStart;
653
- while (node && node !== vnode.targetAnchor) {
653
+ let node, anchor;
654
+ if (isDisabled) {
655
+ node = vnode.el;
656
+ anchor = vnode.anchor;
657
+ } else {
658
+ node = vnode.targetStart;
659
+ anchor = vnode.targetAnchor;
660
+ }
661
+ while (node && node !== anchor) {
654
662
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
655
663
  node = node.nextSibling;
656
664
  }
@@ -1339,7 +1347,11 @@ function createHydrationFunctions(rendererInternals) {
1339
1347
  }
1340
1348
  let needCallTransitionHooks = false;
1341
1349
  if (isTemplateNode(el)) {
1342
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1350
+ needCallTransitionHooks = needTransition(
1351
+ null,
1352
+ // no need check parentSuspense in hydration
1353
+ transition
1354
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1343
1355
  const content = el.content.firstChild;
1344
1356
  if (needCallTransitionHooks) {
1345
1357
  transition.beforeEnter(content);
@@ -1582,6 +1594,8 @@ function isMismatchAllowed(el, allowedType) {
1582
1594
  }
1583
1595
  }
1584
1596
 
1597
+ const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
1598
+ const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
1585
1599
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
1586
1600
  const id = requestIdleCallback(hydrate, { timeout });
1587
1601
  return () => cancelIdleCallback(id);
@@ -2241,12 +2255,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2241
2255
  }
2242
2256
  openBlock();
2243
2257
  const validSlotContent = slot && ensureValidVNode(slot(props));
2258
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
2259
+ // key attached in the `createSlots` helper, respect that
2260
+ validSlotContent && validSlotContent.key;
2244
2261
  const rendered = createBlock(
2245
2262
  Fragment,
2246
2263
  {
2247
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
2248
- // key attached in the `createSlots` helper, respect that
2249
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
2264
+ key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
2250
2265
  (!validSlotContent && fallback ? "_fb" : "")
2251
2266
  },
2252
2267
  validSlotContent || (fallback ? fallback() : []),
@@ -4739,14 +4754,13 @@ function watch(source, cb, options) {
4739
4754
  function doWatch(source, cb, options = shared.EMPTY_OBJ) {
4740
4755
  const { immediate, deep, flush, once } = options;
4741
4756
  const baseWatchOptions = shared.extend({}, options);
4757
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
4742
4758
  let ssrCleanup;
4743
4759
  if (isInSSRComponentSetup) {
4744
4760
  if (flush === "sync") {
4745
4761
  const ctx = useSSRContext();
4746
4762
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4747
- } else if (!cb || immediate) {
4748
- baseWatchOptions.once = true;
4749
- } else {
4763
+ } else if (!runsImmediately) {
4750
4764
  const watchStopHandle = () => {
4751
4765
  };
4752
4766
  watchStopHandle.stop = shared.NOOP;
@@ -4785,7 +4799,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
4785
4799
  }
4786
4800
  };
4787
4801
  const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
4788
- if (ssrCleanup) ssrCleanup.push(watchHandle);
4802
+ if (isInSSRComponentSetup) {
4803
+ if (ssrCleanup) {
4804
+ ssrCleanup.push(watchHandle);
4805
+ } else if (runsImmediately) {
4806
+ watchHandle();
4807
+ }
4808
+ }
4789
4809
  return watchHandle;
4790
4810
  }
4791
4811
  function instanceWatch(source, value, options) {
@@ -4818,13 +4838,13 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4818
4838
  const i = getCurrentInstance();
4819
4839
  const camelizedName = shared.camelize(name);
4820
4840
  const hyphenatedName = shared.hyphenate(name);
4821
- const modifiers = getModelModifiers(props, name);
4841
+ const modifiers = getModelModifiers(props, camelizedName);
4822
4842
  const res = reactivity.customRef((track, trigger) => {
4823
4843
  let localValue;
4824
4844
  let prevSetValue = shared.EMPTY_OBJ;
4825
4845
  let prevEmittedValue;
4826
4846
  watchSyncEffect(() => {
4827
- const propValue = props[name];
4847
+ const propValue = props[camelizedName];
4828
4848
  if (shared.hasChanged(localValue, propValue)) {
4829
4849
  localValue = propValue;
4830
4850
  trigger();
@@ -6229,9 +6249,9 @@ function setupStatefulComponent(instance, isSSR) {
6229
6249
  instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
6230
6250
  const { setup } = Component;
6231
6251
  if (setup) {
6252
+ reactivity.pauseTracking();
6232
6253
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
6233
6254
  const reset = setCurrentInstance(instance);
6234
- reactivity.pauseTracking();
6235
6255
  const setupResult = callWithErrorHandling(
6236
6256
  setup,
6237
6257
  instance,
@@ -6241,10 +6261,13 @@ function setupStatefulComponent(instance, isSSR) {
6241
6261
  setupContext
6242
6262
  ]
6243
6263
  );
6264
+ const isAsyncSetup = shared.isPromise(setupResult);
6244
6265
  reactivity.resetTracking();
6245
6266
  reset();
6246
- if (shared.isPromise(setupResult)) {
6247
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
6267
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
6268
+ markAsyncBoundary(instance);
6269
+ }
6270
+ if (isAsyncSetup) {
6248
6271
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
6249
6272
  if (isSSR) {
6250
6273
  return setupResult.then((resolvedResult) => {
@@ -6424,7 +6447,7 @@ function isMemoSame(cached, memo) {
6424
6447
  return true;
6425
6448
  }
6426
6449
 
6427
- const version = "3.5.11";
6450
+ const version = "3.5.12";
6428
6451
  const warn$1 = shared.NOOP;
6429
6452
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6430
6453
  const devtools = void 0;
@@ -331,11 +331,11 @@ type InferDefaults<T> = {
331
331
  };
332
332
  type NativeType = null | number | string | boolean | symbol | Function;
333
333
  type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
334
- type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
334
+ type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
335
335
  readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
336
336
  } & {
337
337
  readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
338
- };
338
+ } : never;
339
339
  /**
340
340
  * Vue `<script setup>` compiler macro for providing props default values when
341
341
  * using type-based `defineProps` declaration.
@@ -1012,7 +1012,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
1012
1012
  */
1013
1013
  __typeEl?: TypeEl;
1014
1014
  } & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
1015
- InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
1015
+ InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
1016
1016
 
1017
1017
  export interface App<HostElement = any> {
1018
1018
  version: string;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.11
2
+ * @vue/runtime-core v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
7
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
8
- import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
8
+ import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
9
9
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
10
10
 
11
11
  const stack = [];
@@ -844,7 +844,7 @@ const TeleportImpl = {
844
844
  }
845
845
  if (!disabled) {
846
846
  mount(target, targetAnchor);
847
- updateCssVars(n2);
847
+ updateCssVars(n2, false);
848
848
  }
849
849
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
850
850
  warn$1(
@@ -856,7 +856,7 @@ const TeleportImpl = {
856
856
  };
857
857
  if (disabled) {
858
858
  mount(container, mainAnchor);
859
- updateCssVars(n2);
859
+ updateCssVars(n2, true);
860
860
  }
861
861
  if (isTeleportDeferred(n2.props)) {
862
862
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -946,7 +946,7 @@ const TeleportImpl = {
946
946
  );
947
947
  }
948
948
  }
949
- updateCssVars(n2);
949
+ updateCssVars(n2, disabled);
950
950
  }
951
951
  },
952
952
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -1014,9 +1014,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1014
1014
  querySelector
1015
1015
  );
1016
1016
  if (target) {
1017
+ const disabled = isTeleportDisabled(vnode.props);
1017
1018
  const targetNode = target._lpa || target.firstChild;
1018
1019
  if (vnode.shapeFlag & 16) {
1019
- if (isTeleportDisabled(vnode.props)) {
1020
+ if (disabled) {
1020
1021
  vnode.anchor = hydrateChildren(
1021
1022
  nextSibling(node),
1022
1023
  vnode,
@@ -1057,16 +1058,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1057
1058
  );
1058
1059
  }
1059
1060
  }
1060
- updateCssVars(vnode);
1061
+ updateCssVars(vnode, disabled);
1061
1062
  }
1062
1063
  return vnode.anchor && nextSibling(vnode.anchor);
1063
1064
  }
1064
1065
  const Teleport = TeleportImpl;
1065
- function updateCssVars(vnode) {
1066
+ function updateCssVars(vnode, isDisabled) {
1066
1067
  const ctx = vnode.ctx;
1067
1068
  if (ctx && ctx.ut) {
1068
- let node = vnode.targetStart;
1069
- while (node && node !== vnode.targetAnchor) {
1069
+ let node, anchor;
1070
+ if (isDisabled) {
1071
+ node = vnode.el;
1072
+ anchor = vnode.anchor;
1073
+ } else {
1074
+ node = vnode.targetStart;
1075
+ anchor = vnode.targetAnchor;
1076
+ }
1077
+ while (node && node !== anchor) {
1070
1078
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
1071
1079
  node = node.nextSibling;
1072
1080
  }
@@ -1517,8 +1525,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1517
1525
  const setupState = owner.setupState;
1518
1526
  const rawSetupState = toRaw(setupState);
1519
1527
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
1520
- if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(rawSetupState[key])) {
1521
- return false;
1528
+ if (!!(process.env.NODE_ENV !== "production")) {
1529
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
1530
+ warn$1(
1531
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1532
+ );
1533
+ }
1534
+ if (knownTemplateRefs.has(rawSetupState[key])) {
1535
+ return false;
1536
+ }
1522
1537
  }
1523
1538
  return hasOwn(rawSetupState, key);
1524
1539
  };
@@ -1815,7 +1830,11 @@ function createHydrationFunctions(rendererInternals) {
1815
1830
  }
1816
1831
  let needCallTransitionHooks = false;
1817
1832
  if (isTemplateNode(el)) {
1818
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1833
+ needCallTransitionHooks = needTransition(
1834
+ null,
1835
+ // no need check parentSuspense in hydration
1836
+ transition
1837
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1819
1838
  const content = el.content.firstChild;
1820
1839
  if (needCallTransitionHooks) {
1821
1840
  transition.beforeEnter(content);
@@ -2219,6 +2238,8 @@ function isMismatchAllowed(el, allowedType) {
2219
2238
  }
2220
2239
  }
2221
2240
 
2241
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
2242
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
2222
2243
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
2223
2244
  const id = requestIdleCallback(hydrate, { timeout });
2224
2245
  return () => cancelIdleCallback(id);
@@ -2921,12 +2942,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2921
2942
  }
2922
2943
  openBlock();
2923
2944
  const validSlotContent = slot && ensureValidVNode(slot(props));
2945
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
2946
+ // key attached in the `createSlots` helper, respect that
2947
+ validSlotContent && validSlotContent.key;
2924
2948
  const rendered = createBlock(
2925
2949
  Fragment,
2926
2950
  {
2927
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
2928
- // key attached in the `createSlots` helper, respect that
2929
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
2951
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
2930
2952
  (!validSlotContent && fallback ? "_fb" : "")
2931
2953
  },
2932
2954
  validSlotContent || (fallback ? fallback() : []),
@@ -4288,6 +4310,7 @@ function getType(ctor) {
4288
4310
  function validateProps(rawProps, props, instance) {
4289
4311
  const resolvedValues = toRaw(props);
4290
4312
  const options = instance.propsOptions[0];
4313
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
4291
4314
  for (const key in options) {
4292
4315
  let opt = options[key];
4293
4316
  if (opt == null) continue;
@@ -4296,7 +4319,7 @@ function validateProps(rawProps, props, instance) {
4296
4319
  resolvedValues[key],
4297
4320
  opt,
4298
4321
  !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
4299
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
4322
+ !camelizePropsKey.includes(key)
4300
4323
  );
4301
4324
  }
4302
4325
  }
@@ -6114,14 +6137,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
6114
6137
  }
6115
6138
  const baseWatchOptions = extend({}, options);
6116
6139
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
6140
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
6117
6141
  let ssrCleanup;
6118
6142
  if (isInSSRComponentSetup) {
6119
6143
  if (flush === "sync") {
6120
6144
  const ctx = useSSRContext();
6121
6145
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
6122
- } else if (!cb || immediate) {
6123
- baseWatchOptions.once = true;
6124
- } else {
6146
+ } else if (!runsImmediately) {
6125
6147
  const watchStopHandle = () => {
6126
6148
  };
6127
6149
  watchStopHandle.stop = NOOP;
@@ -6160,7 +6182,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
6160
6182
  }
6161
6183
  };
6162
6184
  const watchHandle = watch$1(source, cb, baseWatchOptions);
6163
- if (ssrCleanup) ssrCleanup.push(watchHandle);
6185
+ if (isInSSRComponentSetup) {
6186
+ if (ssrCleanup) {
6187
+ ssrCleanup.push(watchHandle);
6188
+ } else if (runsImmediately) {
6189
+ watchHandle();
6190
+ }
6191
+ }
6164
6192
  return watchHandle;
6165
6193
  }
6166
6194
  function instanceWatch(source, value, options) {
@@ -6195,19 +6223,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
6195
6223
  warn$1(`useModel() called without active instance.`);
6196
6224
  return ref();
6197
6225
  }
6198
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
6226
+ const camelizedName = camelize(name);
6227
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
6199
6228
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
6200
6229
  return ref();
6201
6230
  }
6202
- const camelizedName = camelize(name);
6203
6231
  const hyphenatedName = hyphenate(name);
6204
- const modifiers = getModelModifiers(props, name);
6232
+ const modifiers = getModelModifiers(props, camelizedName);
6205
6233
  const res = customRef((track, trigger) => {
6206
6234
  let localValue;
6207
6235
  let prevSetValue = EMPTY_OBJ;
6208
6236
  let prevEmittedValue;
6209
6237
  watchSyncEffect(() => {
6210
- const propValue = props[name];
6238
+ const propValue = props[camelizedName];
6211
6239
  if (hasChanged(localValue, propValue)) {
6212
6240
  localValue = propValue;
6213
6241
  trigger();
@@ -7836,9 +7864,9 @@ function setupStatefulComponent(instance, isSSR) {
7836
7864
  }
7837
7865
  const { setup } = Component;
7838
7866
  if (setup) {
7867
+ pauseTracking();
7839
7868
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
7840
7869
  const reset = setCurrentInstance(instance);
7841
- pauseTracking();
7842
7870
  const setupResult = callWithErrorHandling(
7843
7871
  setup,
7844
7872
  instance,
@@ -7848,10 +7876,13 @@ function setupStatefulComponent(instance, isSSR) {
7848
7876
  setupContext
7849
7877
  ]
7850
7878
  );
7879
+ const isAsyncSetup = isPromise(setupResult);
7851
7880
  resetTracking();
7852
7881
  reset();
7853
- if (isPromise(setupResult)) {
7854
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
7882
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
7883
+ markAsyncBoundary(instance);
7884
+ }
7885
+ if (isAsyncSetup) {
7855
7886
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7856
7887
  if (isSSR) {
7857
7888
  return setupResult.then((resolvedResult) => {
@@ -8326,7 +8357,7 @@ function isMemoSame(cached, memo) {
8326
8357
  return true;
8327
8358
  }
8328
8359
 
8329
- const version = "3.5.11";
8360
+ const version = "3.5.12";
8330
8361
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8331
8362
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8332
8363
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.11",
3
+ "version": "3.5.12",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.5.11",
50
- "@vue/reactivity": "3.5.11"
49
+ "@vue/shared": "3.5.12",
50
+ "@vue/reactivity": "3.5.12"
51
51
  }
52
52
  }