@vue/runtime-core 3.6.0-rc.7 → 3.6.0-rc.9

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.6.0-rc.7
2
+ * @vue/runtime-core v3.6.0-rc.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1727,12 +1727,12 @@ function createHydrationFunctions(rendererInternals) {
1727
1727
  } else {
1728
1728
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
1729
1729
  const component = vnode.component;
1730
- if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
1730
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
1731
1731
  let subTree;
1732
1732
  if (isFragmentStart) {
1733
1733
  subTree = createVNode(Static);
1734
1734
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
1735
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
1735
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
1736
1736
  subTree.el = node;
1737
1737
  component.subTree = subTree;
1738
1738
  }
@@ -3120,37 +3120,32 @@ function createPropsRestProxy(props, excludedKeys) {
3120
3120
  function withAsyncContext(getAwaitable) {
3121
3121
  const ctx = getCurrentGenericInstance();
3122
3122
  const inSSRSetup = isInSSRComponentSetup;
3123
- const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
3124
3123
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
3125
3124
  let awaitable = getAwaitable();
3126
3125
  setCurrentInstance(null, void 0);
3127
3126
  if (inSSRSetup) setInSSRSetupState(false);
3128
3127
  const restore = () => {
3129
- const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
3128
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
3130
3129
  setCurrentInstance(ctx);
3131
3130
  if (inSSRSetup) setInSSRSetupState(true);
3132
- const reset = restoreAsyncContext && restoreAsyncContext();
3133
- return () => {
3134
- if (reset) reset();
3135
- if (resetStoppedScope) resetStoppedScope.reset();
3136
- };
3131
+ return stoppedScope;
3137
3132
  };
3138
3133
  const cleanup = () => {
3139
3134
  setCurrentInstance(null, void 0);
3140
3135
  if (inSSRSetup) setInSSRSetupState(false);
3141
3136
  };
3142
3137
  if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
3143
- const reset = restore();
3138
+ const stoppedScope = restore();
3144
3139
  Promise.resolve().then(() => Promise.resolve().then(() => {
3145
- if (reset) reset();
3140
+ if (stoppedScope) stoppedScope.reset();
3146
3141
  cleanup();
3147
3142
  }));
3148
3143
  throw e;
3149
3144
  });
3150
3145
  return [awaitable, () => {
3151
- const reset = restore();
3146
+ const stoppedScope = restore();
3152
3147
  Promise.resolve().then(() => {
3153
- if (reset) reset();
3148
+ if (stoppedScope) stoppedScope.reset();
3154
3149
  cleanup();
3155
3150
  });
3156
3151
  }];
@@ -4369,6 +4364,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4369
4364
  optimized = false;
4370
4365
  n2.dynamicChildren = null;
4371
4366
  }
4367
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
4368
+ if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
4369
+ n2.dynamicChildren.hasOnce = true;
4370
+ }
4372
4371
  const { type, ref, shapeFlag } = n2;
4373
4372
  switch (type) {
4374
4373
  case Text:
@@ -4685,6 +4684,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4685
4684
  if (shouldUpdateComponent(n1, n2, optimized)) {
4686
4685
  if (instance.asyncDep && !instance.asyncResolved) {
4687
4686
  pushWarningContext(n2);
4687
+ n2.el = n1.el;
4688
4688
  updateComponentPreRender(instance, n2, optimized);
4689
4689
  popWarningContext();
4690
4690
  return;
@@ -4993,13 +4993,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4993
4993
  };
4994
4994
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
4995
4995
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
4996
- if (patchFlag === -2) optimized = false;
4996
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
4997
4997
  if (ref != null) {
4998
4998
  const prevSub = (0, _vue_reactivity.setActiveSub)();
4999
4999
  setRef(ref, null, parentSuspense, vnode, true);
5000
5000
  (0, _vue_reactivity.setActiveSub)(prevSub);
5001
5001
  }
5002
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
5002
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
5003
5003
  if (shapeFlag & 256) {
5004
5004
  if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
5005
5005
  else parentComponent.ctx.deactivate(vnode);
@@ -5053,6 +5053,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5053
5053
  }
5054
5054
  if (type === Static) {
5055
5055
  removeStaticNode(vnode);
5056
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5056
5057
  return;
5057
5058
  }
5058
5059
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -5077,7 +5078,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5077
5078
  if (effect) {
5078
5079
  effect.stop();
5079
5080
  unmount(subTree, instance, parentSuspense, doRemove);
5080
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
5081
+ } else if (instance.vnode.el && subTree) {
5082
+ subTree.transition = instance.vnode.transition;
5083
+ unmount(subTree, instance, parentSuspense, doRemove);
5084
+ }
5081
5085
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
5082
5086
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
5083
5087
  devtoolsComponentRemoved(instance);
@@ -5283,7 +5287,7 @@ const Suspense = {
5283
5287
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
5284
5288
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
5285
5289
  else {
5286
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
5290
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
5287
5291
  n2.suspense = n1.suspense;
5288
5292
  n2.suspense.vnode = n2;
5289
5293
  n2.el = n1.el;
@@ -5321,7 +5325,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5321
5325
  if (pendingBranch) {
5322
5326
  suspense.pendingBranch = newBranch;
5323
5327
  if (isSameVNodeType(pendingBranch, newBranch)) {
5324
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5328
+ suspense.deps++;
5329
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5330
+ suspense.deps--;
5325
5331
  if (suspense.deps <= 0) suspense.resolve();
5326
5332
  else if (isInFallback) {
5327
5333
  if (!isHydrating && !suspense.isFallbackMountPending) {
@@ -5457,6 +5463,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5457
5463
  suspense.effects = [];
5458
5464
  if (isSuspensible) {
5459
5465
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
5466
+ parentSuspenseId = void 0;
5460
5467
  parentSuspense.deps--;
5461
5468
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
5462
5469
  }
@@ -5494,11 +5501,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5494
5501
  registerDep(instance, onResolve) {
5495
5502
  const isInPendingSuspense = !!suspense.pendingBranch;
5496
5503
  if (isInPendingSuspense) suspense.deps++;
5504
+ const hydratedEl = instance.vnode && instance.vnode.el;
5497
5505
  instance.asyncDep.catch((err) => {
5498
5506
  handleError(err, instance, 0);
5499
5507
  }).then((asyncSetupResult) => {
5500
5508
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
5501
5509
  setCurrentInstance(null, void 0);
5510
+ if (hydratedEl && !instance.scope.active) {
5511
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5512
+ return;
5513
+ }
5502
5514
  instance.asyncResolved = true;
5503
5515
  onResolve(asyncSetupResult);
5504
5516
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -5811,7 +5823,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5811
5823
  vs: cloneVaporSlotMeta(vnode),
5812
5824
  vb: vnode.vb,
5813
5825
  ibu: vnode.ibu,
5814
- iu: vnode.iu
5826
+ iu: vnode.iu,
5827
+ cacheIndex: vnode.cacheIndex
5815
5828
  };
5816
5829
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5817
5830
  return cloned;
@@ -6522,7 +6535,7 @@ function isMemoSame(cached, memo) {
6522
6535
  }
6523
6536
  //#endregion
6524
6537
  //#region packages/runtime-core/src/index.ts
6525
- const version = "3.6.0-rc.7";
6538
+ const version = "3.6.0-rc.9";
6526
6539
  const warn = warn$1;
6527
6540
  /**
6528
6541
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-rc.7
2
+ * @vue/runtime-core v3.6.0-rc.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1304,12 +1304,12 @@ function createHydrationFunctions(rendererInternals) {
1304
1304
  } else {
1305
1305
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
1306
1306
  const component = vnode.component;
1307
- if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
1307
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
1308
1308
  let subTree;
1309
1309
  if (isFragmentStart) {
1310
1310
  subTree = createVNode(Static);
1311
1311
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
1312
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
1312
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
1313
1313
  subTree.el = node;
1314
1314
  component.subTree = subTree;
1315
1315
  }
@@ -2433,36 +2433,31 @@ function createPropsRestProxy(props, excludedKeys) {
2433
2433
  function withAsyncContext(getAwaitable) {
2434
2434
  const ctx = getCurrentGenericInstance();
2435
2435
  const inSSRSetup = isInSSRComponentSetup;
2436
- const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
2437
2436
  let awaitable = getAwaitable();
2438
2437
  setCurrentInstance(null, void 0);
2439
2438
  if (inSSRSetup) setInSSRSetupState(false);
2440
2439
  const restore = () => {
2441
- const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
2440
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
2442
2441
  setCurrentInstance(ctx);
2443
2442
  if (inSSRSetup) setInSSRSetupState(true);
2444
- const reset = restoreAsyncContext && restoreAsyncContext();
2445
- return () => {
2446
- if (reset) reset();
2447
- if (resetStoppedScope) resetStoppedScope.reset();
2448
- };
2443
+ return stoppedScope;
2449
2444
  };
2450
2445
  const cleanup = () => {
2451
2446
  setCurrentInstance(null, void 0);
2452
2447
  if (inSSRSetup) setInSSRSetupState(false);
2453
2448
  };
2454
2449
  if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
2455
- const reset = restore();
2450
+ const stoppedScope = restore();
2456
2451
  Promise.resolve().then(() => Promise.resolve().then(() => {
2457
- if (reset) reset();
2452
+ if (stoppedScope) stoppedScope.reset();
2458
2453
  cleanup();
2459
2454
  }));
2460
2455
  throw e;
2461
2456
  });
2462
2457
  return [awaitable, () => {
2463
- const reset = restore();
2458
+ const stoppedScope = restore();
2464
2459
  Promise.resolve().then(() => {
2465
- if (reset) reset();
2460
+ if (stoppedScope) stoppedScope.reset();
2466
2461
  cleanup();
2467
2462
  });
2468
2463
  }];
@@ -3357,6 +3352,10 @@ function baseCreateRenderer(options, createHydrationFns) {
3357
3352
  optimized = false;
3358
3353
  n2.dynamicChildren = null;
3359
3354
  }
3355
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
3356
+ if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
3357
+ n2.dynamicChildren.hasOnce = true;
3358
+ }
3360
3359
  const { type, ref, shapeFlag } = n2;
3361
3360
  switch (type) {
3362
3361
  case Text:
@@ -3630,6 +3629,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3630
3629
  const instance = n2.component = n1.component;
3631
3630
  if (shouldUpdateComponent(n1, n2, optimized)) {
3632
3631
  if (instance.asyncDep && !instance.asyncResolved) {
3632
+ n2.el = n1.el;
3633
3633
  updateComponentPreRender(instance, n2, optimized);
3634
3634
  return;
3635
3635
  } else {
@@ -3916,13 +3916,13 @@ function baseCreateRenderer(options, createHydrationFns) {
3916
3916
  };
3917
3917
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
3918
3918
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
3919
- if (patchFlag === -2) optimized = false;
3919
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
3920
3920
  if (ref != null) {
3921
3921
  const prevSub = (0, _vue_reactivity.setActiveSub)();
3922
3922
  setRef(ref, null, parentSuspense, vnode, true);
3923
3923
  (0, _vue_reactivity.setActiveSub)(prevSub);
3924
3924
  }
3925
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
3925
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
3926
3926
  if (shapeFlag & 256) {
3927
3927
  if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
3928
3928
  else parentComponent.ctx.deactivate(vnode);
@@ -3972,6 +3972,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3972
3972
  }
3973
3973
  if (type === Static) {
3974
3974
  removeStaticNode(vnode);
3975
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
3975
3976
  return;
3976
3977
  }
3977
3978
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -3995,7 +3996,10 @@ function baseCreateRenderer(options, createHydrationFns) {
3995
3996
  if (effect) {
3996
3997
  effect.stop();
3997
3998
  unmount(subTree, instance, parentSuspense, doRemove);
3998
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
3999
+ } else if (instance.vnode.el && subTree) {
4000
+ subTree.transition = instance.vnode.transition;
4001
+ unmount(subTree, instance, parentSuspense, doRemove);
4002
+ }
3999
4003
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
4000
4004
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
4001
4005
  };
@@ -4190,7 +4194,7 @@ const Suspense = {
4190
4194
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
4191
4195
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
4192
4196
  else {
4193
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
4197
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
4194
4198
  n2.suspense = n1.suspense;
4195
4199
  n2.suspense.vnode = n2;
4196
4200
  n2.el = n1.el;
@@ -4228,7 +4232,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
4228
4232
  if (pendingBranch) {
4229
4233
  suspense.pendingBranch = newBranch;
4230
4234
  if (isSameVNodeType(pendingBranch, newBranch)) {
4231
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
4235
+ suspense.deps++;
4236
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
4237
+ suspense.deps--;
4232
4238
  if (suspense.deps <= 0) suspense.resolve();
4233
4239
  else if (isInFallback) {
4234
4240
  if (!isHydrating && !suspense.isFallbackMountPending) {
@@ -4355,6 +4361,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
4355
4361
  suspense.effects = [];
4356
4362
  if (isSuspensible) {
4357
4363
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
4364
+ parentSuspenseId = void 0;
4358
4365
  parentSuspense.deps--;
4359
4366
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
4360
4367
  }
@@ -4392,11 +4399,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
4392
4399
  registerDep(instance, onResolve) {
4393
4400
  const isInPendingSuspense = !!suspense.pendingBranch;
4394
4401
  if (isInPendingSuspense) suspense.deps++;
4402
+ const hydratedEl = instance.vnode && instance.vnode.el;
4395
4403
  instance.asyncDep.catch((err) => {
4396
4404
  handleError(err, instance, 0);
4397
4405
  }).then((asyncSetupResult) => {
4398
4406
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
4399
4407
  setCurrentInstance(null, void 0);
4408
+ if (hydratedEl && !instance.scope.active) {
4409
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
4410
+ return;
4411
+ }
4400
4412
  instance.asyncResolved = true;
4401
4413
  onResolve(asyncSetupResult);
4402
4414
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -4668,7 +4680,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
4668
4680
  vs: cloneVaporSlotMeta(vnode),
4669
4681
  vb: vnode.vb,
4670
4682
  ibu: vnode.ibu,
4671
- iu: vnode.iu
4683
+ iu: vnode.iu,
4684
+ cacheIndex: vnode.cacheIndex
4672
4685
  };
4673
4686
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
4674
4687
  return cloned;
@@ -5115,7 +5128,7 @@ function isMemoSame(cached, memo) {
5115
5128
  }
5116
5129
  //#endregion
5117
5130
  //#region packages/runtime-core/src/index.ts
5118
- const version = "3.6.0-rc.7";
5131
+ const version = "3.6.0-rc.9";
5119
5132
  const warn = _vue_shared.NOOP;
5120
5133
  /**
5121
5134
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -81,11 +81,11 @@ type PropConstructor<T = any> = {
81
81
  } | {
82
82
  (): T;
83
83
  } | PropMethod<T>;
84
- type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
84
+ type PropMethod<T, TConstructor = any> = {
85
85
  new (): TConstructor;
86
86
  (): T;
87
87
  readonly prototype: TConstructor;
88
- } : never;
88
+ };
89
89
  type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
90
90
  required: true;
91
91
  } | {
@@ -114,7 +114,7 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
114
114
  type: DateConstructor;
115
115
  }] ? Date : [T] extends [(infer U)[] | {
116
116
  type: (infer U)[];
117
- }] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
117
+ }] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, unknown extends D ? V : D> : V : V : T;
118
118
  /**
119
119
  * Extract prop types from a runtime props options object.
120
120
  * The extracted types are **internal** - i.e. the resolved props received by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-rc.7
2
+ * @vue/runtime-core v3.6.0-rc.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1762,12 +1762,12 @@ function createHydrationFunctions(rendererInternals) {
1762
1762
  } else {
1763
1763
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
1764
1764
  const component = vnode.component;
1765
- if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
1765
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
1766
1766
  let subTree;
1767
1767
  if (isFragmentStart) {
1768
1768
  subTree = createVNode(Static);
1769
1769
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
1770
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
1770
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
1771
1771
  subTree.el = node;
1772
1772
  component.subTree = subTree;
1773
1773
  }
@@ -3171,37 +3171,32 @@ function createPropsRestProxy(props, excludedKeys) {
3171
3171
  function withAsyncContext(getAwaitable) {
3172
3172
  const ctx = getCurrentGenericInstance();
3173
3173
  const inSSRSetup = isInSSRComponentSetup;
3174
- const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
3175
3174
  if (!!(process.env.NODE_ENV !== "production") && !ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
3176
3175
  let awaitable = getAwaitable();
3177
3176
  setCurrentInstance(null, void 0);
3178
3177
  if (inSSRSetup) setInSSRSetupState(false);
3179
3178
  const restore = () => {
3180
- const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
3179
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
3181
3180
  setCurrentInstance(ctx);
3182
3181
  if (inSSRSetup) setInSSRSetupState(true);
3183
- const reset = restoreAsyncContext && restoreAsyncContext();
3184
- return () => {
3185
- if (reset) reset();
3186
- if (resetStoppedScope) resetStoppedScope.reset();
3187
- };
3182
+ return stoppedScope;
3188
3183
  };
3189
3184
  const cleanup = () => {
3190
3185
  setCurrentInstance(null, void 0);
3191
3186
  if (inSSRSetup) setInSSRSetupState(false);
3192
3187
  };
3193
3188
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
3194
- const reset = restore();
3189
+ const stoppedScope = restore();
3195
3190
  Promise.resolve().then(() => Promise.resolve().then(() => {
3196
- if (reset) reset();
3191
+ if (stoppedScope) stoppedScope.reset();
3197
3192
  cleanup();
3198
3193
  }));
3199
3194
  throw e;
3200
3195
  });
3201
3196
  return [awaitable, () => {
3202
- const reset = restore();
3197
+ const stoppedScope = restore();
3203
3198
  Promise.resolve().then(() => {
3204
- if (reset) reset();
3199
+ if (stoppedScope) stoppedScope.reset();
3205
3200
  cleanup();
3206
3201
  });
3207
3202
  }];
@@ -4461,6 +4456,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4461
4456
  optimized = false;
4462
4457
  n2.dynamicChildren = null;
4463
4458
  }
4459
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
4460
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
4461
+ n2.dynamicChildren.hasOnce = true;
4462
+ }
4464
4463
  const { type, ref, shapeFlag } = n2;
4465
4464
  switch (type) {
4466
4465
  case Text:
@@ -4784,6 +4783,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4784
4783
  if (shouldUpdateComponent(n1, n2, optimized)) {
4785
4784
  if (instance.asyncDep && !instance.asyncResolved) {
4786
4785
  if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
4786
+ n2.el = n1.el;
4787
4787
  updateComponentPreRender(instance, n2, optimized);
4788
4788
  if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
4789
4789
  return;
@@ -5094,13 +5094,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5094
5094
  };
5095
5095
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
5096
5096
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
5097
- if (patchFlag === -2) optimized = false;
5097
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
5098
5098
  if (ref != null) {
5099
5099
  const prevSub = setActiveSub();
5100
5100
  setRef(ref, null, parentSuspense, vnode, true);
5101
5101
  setActiveSub(prevSub);
5102
5102
  }
5103
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
5103
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
5104
5104
  if (shapeFlag & 256) {
5105
5105
  if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
5106
5106
  else parentComponent.ctx.deactivate(vnode);
@@ -5154,6 +5154,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5154
5154
  }
5155
5155
  if (type === Static) {
5156
5156
  removeStaticNode(vnode);
5157
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5157
5158
  return;
5158
5159
  }
5159
5160
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -5178,7 +5179,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5178
5179
  if (effect) {
5179
5180
  effect.stop();
5180
5181
  unmount(subTree, instance, parentSuspense, doRemove);
5181
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
5182
+ } else if (instance.vnode.el && subTree) {
5183
+ subTree.transition = instance.vnode.transition;
5184
+ unmount(subTree, instance, parentSuspense, doRemove);
5185
+ }
5182
5186
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
5183
5187
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
5184
5188
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentRemoved(instance);
@@ -5384,7 +5388,7 @@ const Suspense = {
5384
5388
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
5385
5389
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
5386
5390
  else {
5387
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
5391
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
5388
5392
  n2.suspense = n1.suspense;
5389
5393
  n2.suspense.vnode = n2;
5390
5394
  n2.el = n1.el;
@@ -5422,7 +5426,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5422
5426
  if (pendingBranch) {
5423
5427
  suspense.pendingBranch = newBranch;
5424
5428
  if (isSameVNodeType(pendingBranch, newBranch)) {
5425
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5429
+ suspense.deps++;
5430
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5431
+ suspense.deps--;
5426
5432
  if (suspense.deps <= 0) suspense.resolve();
5427
5433
  else if (isInFallback) {
5428
5434
  if (!isHydrating && !suspense.isFallbackMountPending) {
@@ -5560,6 +5566,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5560
5566
  suspense.effects = [];
5561
5567
  if (isSuspensible) {
5562
5568
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
5569
+ parentSuspenseId = void 0;
5563
5570
  parentSuspense.deps--;
5564
5571
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
5565
5572
  }
@@ -5597,11 +5604,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5597
5604
  registerDep(instance, onResolve) {
5598
5605
  const isInPendingSuspense = !!suspense.pendingBranch;
5599
5606
  if (isInPendingSuspense) suspense.deps++;
5607
+ const hydratedEl = instance.vnode && instance.vnode.el;
5600
5608
  instance.asyncDep.catch((err) => {
5601
5609
  handleError(err, instance, 0);
5602
5610
  }).then((asyncSetupResult) => {
5603
5611
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
5604
5612
  setCurrentInstance(null, void 0);
5613
+ if (hydratedEl && !instance.scope.active) {
5614
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5615
+ return;
5616
+ }
5605
5617
  instance.asyncResolved = true;
5606
5618
  onResolve(asyncSetupResult);
5607
5619
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -5914,7 +5926,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5914
5926
  vs: cloneVaporSlotMeta(vnode),
5915
5927
  vb: vnode.vb,
5916
5928
  ibu: vnode.ibu,
5917
- iu: vnode.iu
5929
+ iu: vnode.iu,
5930
+ cacheIndex: vnode.cacheIndex
5918
5931
  };
5919
5932
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5920
5933
  return cloned;
@@ -6644,7 +6657,7 @@ function isMemoSame(cached, memo) {
6644
6657
  }
6645
6658
  //#endregion
6646
6659
  //#region packages/runtime-core/src/index.ts
6647
- const version = "3.6.0-rc.7";
6660
+ const version = "3.6.0-rc.9";
6648
6661
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
6649
6662
  /**
6650
6663
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -6679,4 +6692,4 @@ const resolveFilter = null;
6679
6692
  const compatUtils = null;
6680
6693
  const DeprecationTypes = null;
6681
6694
  //#endregion
6682
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, vdomSlotFallbackKey, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
6695
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, vdomSlotFallbackKey, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.6.0-rc.7",
3
+ "version": "3.6.0-rc.9",
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/reactivity": "3.6.0-rc.7",
50
- "@vue/shared": "3.6.0-rc.7"
49
+ "@vue/shared": "3.6.0-rc.9",
50
+ "@vue/reactivity": "3.6.0-rc.9"
51
51
  }
52
52
  }