@vue/runtime-core 3.5.28 → 3.5.30

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.28
2
+ * @vue/runtime-core v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1525,6 +1525,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1525
1525
  callHook(hook, [el]);
1526
1526
  },
1527
1527
  enter(el) {
1528
+ if (leavingVNodesCache[key] === vnode) return;
1528
1529
  let hook = onEnter;
1529
1530
  let afterHook = onAfterEnter;
1530
1531
  let cancelHook = onEnterCancelled;
@@ -3158,12 +3159,16 @@ function renderList(source, renderItem, cache, index) {
3158
3159
  );
3159
3160
  }
3160
3161
  } else if (typeof source === "number") {
3161
- if (!Number.isInteger(source)) {
3162
- warn$1(`The v-for range expect an integer value but got ${source}.`);
3163
- }
3164
- ret = new Array(source);
3165
- for (let i = 0; i < source; i++) {
3166
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3162
+ if (!Number.isInteger(source) || source < 0) {
3163
+ warn$1(
3164
+ `The v-for range expects a positive integer value but got ${source}.`
3165
+ );
3166
+ ret = [];
3167
+ } else {
3168
+ ret = new Array(source);
3169
+ for (let i = 0; i < source; i++) {
3170
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3171
+ }
3167
3172
  }
3168
3173
  } else if (shared.isObject(source)) {
3169
3174
  if (source[Symbol.iterator]) {
@@ -3614,6 +3619,7 @@ function createPropsRestProxy(props, excludedKeys) {
3614
3619
  }
3615
3620
  function withAsyncContext(getAwaitable) {
3616
3621
  const ctx = getCurrentInstance();
3622
+ const inSSRSetup = isInSSRComponentSetup;
3617
3623
  if (!ctx) {
3618
3624
  warn$1(
3619
3625
  `withAsyncContext called without active current instance. This is likely a bug.`
@@ -3621,13 +3627,36 @@ function withAsyncContext(getAwaitable) {
3621
3627
  }
3622
3628
  let awaitable = getAwaitable();
3623
3629
  unsetCurrentInstance();
3630
+ if (inSSRSetup) {
3631
+ setInSSRSetupState(false);
3632
+ }
3633
+ const restore = () => {
3634
+ setCurrentInstance(ctx);
3635
+ if (inSSRSetup) {
3636
+ setInSSRSetupState(true);
3637
+ }
3638
+ };
3639
+ const cleanup = () => {
3640
+ if (getCurrentInstance() !== ctx) ctx.scope.off();
3641
+ unsetCurrentInstance();
3642
+ if (inSSRSetup) {
3643
+ setInSSRSetupState(false);
3644
+ }
3645
+ };
3624
3646
  if (shared.isPromise(awaitable)) {
3625
3647
  awaitable = awaitable.catch((e) => {
3626
- setCurrentInstance(ctx);
3648
+ restore();
3649
+ Promise.resolve().then(() => Promise.resolve().then(cleanup));
3627
3650
  throw e;
3628
3651
  });
3629
3652
  }
3630
- return [awaitable, () => setCurrentInstance(ctx)];
3653
+ return [
3654
+ awaitable,
3655
+ () => {
3656
+ restore();
3657
+ Promise.resolve().then(cleanup);
3658
+ }
3659
+ ];
3631
3660
  }
3632
3661
 
3633
3662
  function createDuplicateChecker() {
@@ -5999,7 +6028,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5999
6028
  }
6000
6029
  } else {
6001
6030
  if (root.ce && root.ce._hasShadowRoot()) {
6002
- root.ce._injectChildStyle(type);
6031
+ root.ce._injectChildStyle(
6032
+ type,
6033
+ instance.parent ? instance.parent.type : void 0
6034
+ );
6003
6035
  }
6004
6036
  {
6005
6037
  startMeasure(instance, `render`);
@@ -8481,7 +8513,7 @@ function isMemoSame(cached, memo) {
8481
8513
  return true;
8482
8514
  }
8483
8515
 
8484
- const version = "3.5.28";
8516
+ const version = "3.5.30";
8485
8517
  const warn = warn$1 ;
8486
8518
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8487
8519
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.28
2
+ * @vue/runtime-core v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1062,6 +1062,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1062
1062
  callHook(hook, [el]);
1063
1063
  },
1064
1064
  enter(el) {
1065
+ if (leavingVNodesCache[key] === vnode) return;
1065
1066
  let hook = onEnter;
1066
1067
  let afterHook = onAfterEnter;
1067
1068
  let cancelHook = onEnterCancelled;
@@ -2448,9 +2449,11 @@ function renderList(source, renderItem, cache, index) {
2448
2449
  );
2449
2450
  }
2450
2451
  } else if (typeof source === "number") {
2451
- ret = new Array(source);
2452
- for (let i = 0; i < source; i++) {
2453
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2452
+ {
2453
+ ret = new Array(source);
2454
+ for (let i = 0; i < source; i++) {
2455
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2456
+ }
2454
2457
  }
2455
2458
  } else if (shared.isObject(source)) {
2456
2459
  if (source[Symbol.iterator]) {
@@ -2757,15 +2760,39 @@ function createPropsRestProxy(props, excludedKeys) {
2757
2760
  }
2758
2761
  function withAsyncContext(getAwaitable) {
2759
2762
  const ctx = getCurrentInstance();
2763
+ const inSSRSetup = isInSSRComponentSetup;
2760
2764
  let awaitable = getAwaitable();
2761
2765
  unsetCurrentInstance();
2766
+ if (inSSRSetup) {
2767
+ setInSSRSetupState(false);
2768
+ }
2769
+ const restore = () => {
2770
+ setCurrentInstance(ctx);
2771
+ if (inSSRSetup) {
2772
+ setInSSRSetupState(true);
2773
+ }
2774
+ };
2775
+ const cleanup = () => {
2776
+ if (getCurrentInstance() !== ctx) ctx.scope.off();
2777
+ unsetCurrentInstance();
2778
+ if (inSSRSetup) {
2779
+ setInSSRSetupState(false);
2780
+ }
2781
+ };
2762
2782
  if (shared.isPromise(awaitable)) {
2763
2783
  awaitable = awaitable.catch((e) => {
2764
- setCurrentInstance(ctx);
2784
+ restore();
2785
+ Promise.resolve().then(() => Promise.resolve().then(cleanup));
2765
2786
  throw e;
2766
2787
  });
2767
2788
  }
2768
- return [awaitable, () => setCurrentInstance(ctx)];
2789
+ return [
2790
+ awaitable,
2791
+ () => {
2792
+ restore();
2793
+ Promise.resolve().then(cleanup);
2794
+ }
2795
+ ];
2769
2796
  }
2770
2797
 
2771
2798
  let shouldCacheAccess = true;
@@ -4596,7 +4623,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4596
4623
  }
4597
4624
  } else {
4598
4625
  if (root.ce && root.ce._hasShadowRoot()) {
4599
- root.ce._injectChildStyle(type);
4626
+ root.ce._injectChildStyle(
4627
+ type,
4628
+ instance.parent ? instance.parent.type : void 0
4629
+ );
4600
4630
  }
4601
4631
  const subTree = instance.subTree = renderComponentRoot(instance);
4602
4632
  patch(
@@ -6628,7 +6658,7 @@ function isMemoSame(cached, memo) {
6628
6658
  return true;
6629
6659
  }
6630
6660
 
6631
- const version = "3.5.28";
6661
+ const version = "3.5.30";
6632
6662
  const warn$1 = shared.NOOP;
6633
6663
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6634
6664
  const devtools = void 0;
@@ -489,7 +489,7 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
489
489
  $: ComponentInternalInstance;
490
490
  $data: D;
491
491
  $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
492
- $attrs: Data;
492
+ $attrs: Attrs;
493
493
  $refs: Data & TypeRefs;
494
494
  $slots: UnwrapSlotsType<S>;
495
495
  $root: ComponentPublicInstance | null;
@@ -985,7 +985,7 @@ export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C
985
985
  export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
986
986
  type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
987
987
  export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
988
- props?: (keyof Props)[];
988
+ props?: (keyof NoInfer<Props>)[];
989
989
  emits?: E | EE[];
990
990
  slots?: S;
991
991
  }): DefineSetupFnComponent<Props, E, S>;
@@ -1307,6 +1307,12 @@ export declare function createCommentVNode(text?: string, asBlock?: boolean): VN
1307
1307
  export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
1308
1308
 
1309
1309
  type Data = Record<string, unknown>;
1310
+ /**
1311
+ * For extending allowed non-declared attrs on components in TSX
1312
+ */
1313
+ export interface AllowedAttrs {
1314
+ }
1315
+ export type Attrs = Data & AllowedAttrs;
1310
1316
  /**
1311
1317
  * Public utility type for extracting the instance type of a component.
1312
1318
  * Works with all valid component definition types. This is intended to replace
@@ -1415,7 +1421,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
1415
1421
  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>;
1416
1422
 
1417
1423
  export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
1418
- attrs: Data;
1424
+ attrs: Attrs;
1419
1425
  slots: UnwrapSlotsType<S>;
1420
1426
  emit: EmitFn<E>;
1421
1427
  expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.28
2
+ * @vue/runtime-core v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1529,6 +1529,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1529
1529
  callHook(hook, [el]);
1530
1530
  },
1531
1531
  enter(el) {
1532
+ if (leavingVNodesCache[key] === vnode) return;
1532
1533
  let hook = onEnter;
1533
1534
  let afterHook = onAfterEnter;
1534
1535
  let cancelHook = onEnterCancelled;
@@ -3176,12 +3177,16 @@ function renderList(source, renderItem, cache, index) {
3176
3177
  );
3177
3178
  }
3178
3179
  } else if (typeof source === "number") {
3179
- if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) {
3180
- warn$1(`The v-for range expect an integer value but got ${source}.`);
3181
- }
3182
- ret = new Array(source);
3183
- for (let i = 0; i < source; i++) {
3184
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3180
+ if (!!(process.env.NODE_ENV !== "production") && (!Number.isInteger(source) || source < 0)) {
3181
+ warn$1(
3182
+ `The v-for range expects a positive integer value but got ${source}.`
3183
+ );
3184
+ ret = [];
3185
+ } else {
3186
+ ret = new Array(source);
3187
+ for (let i = 0; i < source; i++) {
3188
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3189
+ }
3185
3190
  }
3186
3191
  } else if (isObject(source)) {
3187
3192
  if (source[Symbol.iterator]) {
@@ -3632,6 +3637,7 @@ function createPropsRestProxy(props, excludedKeys) {
3632
3637
  }
3633
3638
  function withAsyncContext(getAwaitable) {
3634
3639
  const ctx = getCurrentInstance();
3640
+ const inSSRSetup = isInSSRComponentSetup;
3635
3641
  if (!!(process.env.NODE_ENV !== "production") && !ctx) {
3636
3642
  warn$1(
3637
3643
  `withAsyncContext called without active current instance. This is likely a bug.`
@@ -3639,13 +3645,36 @@ function withAsyncContext(getAwaitable) {
3639
3645
  }
3640
3646
  let awaitable = getAwaitable();
3641
3647
  unsetCurrentInstance();
3648
+ if (inSSRSetup) {
3649
+ setInSSRSetupState(false);
3650
+ }
3651
+ const restore = () => {
3652
+ setCurrentInstance(ctx);
3653
+ if (inSSRSetup) {
3654
+ setInSSRSetupState(true);
3655
+ }
3656
+ };
3657
+ const cleanup = () => {
3658
+ if (getCurrentInstance() !== ctx) ctx.scope.off();
3659
+ unsetCurrentInstance();
3660
+ if (inSSRSetup) {
3661
+ setInSSRSetupState(false);
3662
+ }
3663
+ };
3642
3664
  if (isPromise(awaitable)) {
3643
3665
  awaitable = awaitable.catch((e) => {
3644
- setCurrentInstance(ctx);
3666
+ restore();
3667
+ Promise.resolve().then(() => Promise.resolve().then(cleanup));
3645
3668
  throw e;
3646
3669
  });
3647
3670
  }
3648
- return [awaitable, () => setCurrentInstance(ctx)];
3671
+ return [
3672
+ awaitable,
3673
+ () => {
3674
+ restore();
3675
+ Promise.resolve().then(cleanup);
3676
+ }
3677
+ ];
3649
3678
  }
3650
3679
 
3651
3680
  function createDuplicateChecker() {
@@ -6059,7 +6088,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6059
6088
  }
6060
6089
  } else {
6061
6090
  if (root.ce && root.ce._hasShadowRoot()) {
6062
- root.ce._injectChildStyle(type);
6091
+ root.ce._injectChildStyle(
6092
+ type,
6093
+ instance.parent ? instance.parent.type : void 0
6094
+ );
6063
6095
  }
6064
6096
  if (!!(process.env.NODE_ENV !== "production")) {
6065
6097
  startMeasure(instance, `render`);
@@ -8555,7 +8587,7 @@ function isMemoSame(cached, memo) {
8555
8587
  return true;
8556
8588
  }
8557
8589
 
8558
- const version = "3.5.28";
8590
+ const version = "3.5.30";
8559
8591
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8560
8592
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8561
8593
  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.28",
3
+ "version": "3.5.30",
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.28",
50
- "@vue/reactivity": "3.5.28"
49
+ "@vue/shared": "3.5.30",
50
+ "@vue/reactivity": "3.5.30"
51
51
  }
52
52
  }