@vue/runtime-core 3.5.14 → 3.5.15

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.14
2
+ * @vue/runtime-core v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -856,15 +856,16 @@ const TeleportImpl = {
856
856
  updateCssVars(n2, true);
857
857
  }
858
858
  if (isTeleportDeferred(n2.props)) {
859
+ n2.el.__isMounted = false;
859
860
  queuePostRenderEffect(() => {
860
861
  mountToTarget();
861
- n2.el.__isMounted = true;
862
+ delete n2.el.__isMounted;
862
863
  }, parentSuspense);
863
864
  } else {
864
865
  mountToTarget();
865
866
  }
866
867
  } else {
867
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
868
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
868
869
  queuePostRenderEffect(() => {
869
870
  TeleportImpl.process(
870
871
  n1,
@@ -878,7 +879,6 @@ const TeleportImpl = {
878
879
  optimized,
879
880
  internals
880
881
  );
881
- delete n1.el.__isMounted;
882
882
  }, parentSuspense);
883
883
  return;
884
884
  }
@@ -1866,6 +1866,8 @@ function createHydrationFunctions(rendererInternals) {
1866
1866
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1867
1867
  const content = el.content.firstChild;
1868
1868
  if (needCallTransitionHooks) {
1869
+ const cls = content.getAttribute("class");
1870
+ if (cls) content.$cls = cls;
1869
1871
  transition.beforeEnter(content);
1870
1872
  }
1871
1873
  replaceNode(content, el, parentComponent);
@@ -2118,7 +2120,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2118
2120
  let actual;
2119
2121
  let expected;
2120
2122
  if (key === "class") {
2121
- actual = el.getAttribute("class");
2123
+ if (el.$cls) {
2124
+ actual = el.$cls;
2125
+ delete el.$cls;
2126
+ } else {
2127
+ actual = el.getAttribute("class");
2128
+ }
2122
2129
  expected = shared.normalizeClass(clientValue);
2123
2130
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
2124
2131
  mismatchType = 2 /* CLASS */;
@@ -2413,14 +2420,25 @@ function defineAsyncComponent(source) {
2413
2420
  name: "AsyncComponentWrapper",
2414
2421
  __asyncLoader: load,
2415
2422
  __asyncHydrate(el, instance, hydrate) {
2423
+ let patched = false;
2416
2424
  const doHydrate = hydrateStrategy ? () => {
2425
+ const performHydrate = () => {
2426
+ if (patched) {
2427
+ warn$1(
2428
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
2429
+ );
2430
+ return;
2431
+ }
2432
+ hydrate();
2433
+ };
2417
2434
  const teardown = hydrateStrategy(
2418
- hydrate,
2435
+ performHydrate,
2419
2436
  (cb) => forEachElement(el, cb)
2420
2437
  );
2421
2438
  if (teardown) {
2422
2439
  (instance.bum || (instance.bum = [])).push(teardown);
2423
2440
  }
2441
+ (instance.u || (instance.u = [])).push(() => patched = true);
2424
2442
  } : hydrate;
2425
2443
  if (resolvedComp) {
2426
2444
  doHydrate();
@@ -3963,9 +3981,15 @@ If you want to remount the same app, move your app creation logic into a factory
3963
3981
  },
3964
3982
  provide(key, value) {
3965
3983
  if (key in context.provides) {
3966
- warn$1(
3967
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
3968
- );
3984
+ if (shared.hasOwn(context.provides, key)) {
3985
+ warn$1(
3986
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
3987
+ );
3988
+ } else {
3989
+ warn$1(
3990
+ `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
3991
+ );
3992
+ }
3969
3993
  }
3970
3994
  context.provides[key] = value;
3971
3995
  return app;
@@ -4002,7 +4026,7 @@ function provide(key, value) {
4002
4026
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
4003
4027
  const instance = currentInstance || currentRenderingInstance;
4004
4028
  if (instance || currentApp) {
4005
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
4029
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
4006
4030
  if (provides && key in provides) {
4007
4031
  return provides[key];
4008
4032
  } else if (arguments.length > 1) {
@@ -4999,7 +5023,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4999
5023
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5000
5024
  // which also requires the correct parent container
5001
5025
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5002
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
5026
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
5003
5027
  // In other cases, the parent container is not actually used so we
5004
5028
  // just pass the block element here to avoid a DOM parentNode call.
5005
5029
  fallbackContainer
@@ -8351,7 +8375,7 @@ function isMemoSame(cached, memo) {
8351
8375
  return true;
8352
8376
  }
8353
8377
 
8354
- const version = "3.5.14";
8378
+ const version = "3.5.15";
8355
8379
  const warn = warn$1 ;
8356
8380
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8357
8381
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.14
2
+ * @vue/runtime-core v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -449,15 +449,16 @@ const TeleportImpl = {
449
449
  updateCssVars(n2, true);
450
450
  }
451
451
  if (isTeleportDeferred(n2.props)) {
452
+ n2.el.__isMounted = false;
452
453
  queuePostRenderEffect(() => {
453
454
  mountToTarget();
454
- n2.el.__isMounted = true;
455
+ delete n2.el.__isMounted;
455
456
  }, parentSuspense);
456
457
  } else {
457
458
  mountToTarget();
458
459
  }
459
460
  } else {
460
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
461
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
461
462
  queuePostRenderEffect(() => {
462
463
  TeleportImpl.process(
463
464
  n1,
@@ -471,7 +472,6 @@ const TeleportImpl = {
471
472
  optimized,
472
473
  internals
473
474
  );
474
- delete n1.el.__isMounted;
475
475
  }, parentSuspense);
476
476
  return;
477
477
  }
@@ -1390,6 +1390,8 @@ function createHydrationFunctions(rendererInternals) {
1390
1390
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1391
1391
  const content = el.content.firstChild;
1392
1392
  if (needCallTransitionHooks) {
1393
+ const cls = content.getAttribute("class");
1394
+ if (cls) content.$cls = cls;
1393
1395
  transition.beforeEnter(content);
1394
1396
  }
1395
1397
  replaceNode(content, el, parentComponent);
@@ -1780,13 +1782,17 @@ function defineAsyncComponent(source) {
1780
1782
  __asyncLoader: load,
1781
1783
  __asyncHydrate(el, instance, hydrate) {
1782
1784
  const doHydrate = hydrateStrategy ? () => {
1785
+ const performHydrate = () => {
1786
+ hydrate();
1787
+ };
1783
1788
  const teardown = hydrateStrategy(
1784
- hydrate,
1789
+ performHydrate,
1785
1790
  (cb) => forEachElement(el, cb)
1786
1791
  );
1787
1792
  if (teardown) {
1788
1793
  (instance.bum || (instance.bum = [])).push(teardown);
1789
1794
  }
1795
+ (instance.u || (instance.u = [])).push(() => true);
1790
1796
  } : hydrate;
1791
1797
  if (resolvedComp) {
1792
1798
  doHydrate();
@@ -3042,7 +3048,7 @@ function provide(key, value) {
3042
3048
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
3043
3049
  const instance = currentInstance || currentRenderingInstance;
3044
3050
  if (instance || currentApp) {
3045
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3051
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3046
3052
  if (provides && key in provides) {
3047
3053
  return provides[key];
3048
3054
  } else if (arguments.length > 1) {
@@ -3803,7 +3809,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3803
3809
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
3804
3810
  // which also requires the correct parent container
3805
3811
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
3806
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
3812
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
3807
3813
  // In other cases, the parent container is not actually used so we
3808
3814
  // just pass the block element here to avoid a DOM parentNode call.
3809
3815
  fallbackContainer
@@ -6515,7 +6521,7 @@ function isMemoSame(cached, memo) {
6515
6521
  return true;
6516
6522
  }
6517
6523
 
6518
- const version = "3.5.14";
6524
+ const version = "3.5.15";
6519
6525
  const warn$1 = shared.NOOP;
6520
6526
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6521
6527
  const devtools = void 0;
@@ -129,7 +129,9 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
129
129
  * To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
130
130
  */
131
131
  export type ExtractPropTypes<O> = {
132
- [K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
132
+ [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
133
+ default: any;
134
+ } ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]>;
133
135
  } & {
134
136
  [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
135
137
  };
@@ -1317,7 +1319,9 @@ type Data = Record<string, unknown>;
1317
1319
  */
1318
1320
  export type ComponentInstance<T> = T extends {
1319
1321
  new (): ComponentPublicInstance;
1320
- } ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer Props, infer RawBindings, infer D, infer C, infer M> ? ComponentPublicInstance<unknown extends Props ? {} : Props, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
1322
+ } ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer PropsOrInstance, infer RawBindings, infer D, infer C, infer M> ? PropsOrInstance extends {
1323
+ $props: unknown;
1324
+ } ? PropsOrInstance : ComponentPublicInstance<unknown extends PropsOrInstance ? {} : PropsOrInstance, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
1321
1325
  /**
1322
1326
  * For extending allowed non-declared props on components in TSX
1323
1327
  */
@@ -1406,7 +1410,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
1406
1410
  * A type used in public APIs where a component type is expected.
1407
1411
  * The constructor type is an artificial type returned by defineComponent().
1408
1412
  */
1409
- export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<Props, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<Props>;
1413
+ export type Component<PropsOrInstance = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<PropsOrInstance, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<PropsOrInstance>;
1410
1414
 
1411
1415
  export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
1412
1416
  attrs: Data;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.14
2
+ * @vue/runtime-core v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -859,15 +859,16 @@ const TeleportImpl = {
859
859
  updateCssVars(n2, true);
860
860
  }
861
861
  if (isTeleportDeferred(n2.props)) {
862
+ n2.el.__isMounted = false;
862
863
  queuePostRenderEffect(() => {
863
864
  mountToTarget();
864
- n2.el.__isMounted = true;
865
+ delete n2.el.__isMounted;
865
866
  }, parentSuspense);
866
867
  } else {
867
868
  mountToTarget();
868
869
  }
869
870
  } else {
870
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
871
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
871
872
  queuePostRenderEffect(() => {
872
873
  TeleportImpl.process(
873
874
  n1,
@@ -881,7 +882,6 @@ const TeleportImpl = {
881
882
  optimized,
882
883
  internals
883
884
  );
884
- delete n1.el.__isMounted;
885
885
  }, parentSuspense);
886
886
  return;
887
887
  }
@@ -1870,6 +1870,8 @@ function createHydrationFunctions(rendererInternals) {
1870
1870
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
1871
1871
  const content = el.content.firstChild;
1872
1872
  if (needCallTransitionHooks) {
1873
+ const cls = content.getAttribute("class");
1874
+ if (cls) content.$cls = cls;
1873
1875
  transition.beforeEnter(content);
1874
1876
  }
1875
1877
  replaceNode(content, el, parentComponent);
@@ -2133,7 +2135,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2133
2135
  let actual;
2134
2136
  let expected;
2135
2137
  if (key === "class") {
2136
- actual = el.getAttribute("class");
2138
+ if (el.$cls) {
2139
+ actual = el.$cls;
2140
+ delete el.$cls;
2141
+ } else {
2142
+ actual = el.getAttribute("class");
2143
+ }
2137
2144
  expected = normalizeClass(clientValue);
2138
2145
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
2139
2146
  mismatchType = 2 /* CLASS */;
@@ -2428,14 +2435,25 @@ function defineAsyncComponent(source) {
2428
2435
  name: "AsyncComponentWrapper",
2429
2436
  __asyncLoader: load,
2430
2437
  __asyncHydrate(el, instance, hydrate) {
2438
+ let patched = false;
2431
2439
  const doHydrate = hydrateStrategy ? () => {
2440
+ const performHydrate = () => {
2441
+ if (!!(process.env.NODE_ENV !== "production") && patched) {
2442
+ warn$1(
2443
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
2444
+ );
2445
+ return;
2446
+ }
2447
+ hydrate();
2448
+ };
2432
2449
  const teardown = hydrateStrategy(
2433
- hydrate,
2450
+ performHydrate,
2434
2451
  (cb) => forEachElement(el, cb)
2435
2452
  );
2436
2453
  if (teardown) {
2437
2454
  (instance.bum || (instance.bum = [])).push(teardown);
2438
2455
  }
2456
+ (instance.u || (instance.u = [])).push(() => patched = true);
2439
2457
  } : hydrate;
2440
2458
  if (resolvedComp) {
2441
2459
  doHydrate();
@@ -3985,9 +4003,15 @@ If you want to remount the same app, move your app creation logic into a factory
3985
4003
  },
3986
4004
  provide(key, value) {
3987
4005
  if (!!(process.env.NODE_ENV !== "production") && key in context.provides) {
3988
- warn$1(
3989
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
3990
- );
4006
+ if (hasOwn(context.provides, key)) {
4007
+ warn$1(
4008
+ `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
4009
+ );
4010
+ } else {
4011
+ warn$1(
4012
+ `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
4013
+ );
4014
+ }
3991
4015
  }
3992
4016
  context.provides[key] = value;
3993
4017
  return app;
@@ -4024,7 +4048,7 @@ function provide(key, value) {
4024
4048
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
4025
4049
  const instance = currentInstance || currentRenderingInstance;
4026
4050
  if (instance || currentApp) {
4027
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
4051
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
4028
4052
  if (provides && key in provides) {
4029
4053
  return provides[key];
4030
4054
  } else if (arguments.length > 1) {
@@ -5048,7 +5072,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5048
5072
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5049
5073
  // which also requires the correct parent container
5050
5074
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5051
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
5075
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
5052
5076
  // In other cases, the parent container is not actually used so we
5053
5077
  // just pass the block element here to avoid a DOM parentNode call.
5054
5078
  fallbackContainer
@@ -8425,7 +8449,7 @@ function isMemoSame(cached, memo) {
8425
8449
  return true;
8426
8450
  }
8427
8451
 
8428
- const version = "3.5.14";
8452
+ const version = "3.5.15";
8429
8453
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8430
8454
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8431
8455
  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.14",
3
+ "version": "3.5.15",
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.14",
50
- "@vue/reactivity": "3.5.14"
49
+ "@vue/shared": "3.5.15",
50
+ "@vue/reactivity": "3.5.15"
51
51
  }
52
52
  }