@vue/runtime-core 3.6.0-alpha.6 → 3.6.0-beta.1

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-alpha.6
2
+ * @vue/runtime-core v3.6.0-beta.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -412,10 +412,10 @@ function flushPostFlushCbs(seen) {
412
412
  }
413
413
  }
414
414
  let isFlushing = false;
415
- function flushOnAppMount() {
415
+ function flushOnAppMount(instance) {
416
416
  if (!isFlushing) {
417
417
  isFlushing = true;
418
- flushPreFlushCbs();
418
+ flushPreFlushCbs(instance);
419
419
  flushPostFlushCbs();
420
420
  isFlushing = false;
421
421
  }
@@ -482,6 +482,7 @@ function checkRecursiveUpdates(seen, fn) {
482
482
 
483
483
  let isHmrUpdating = false;
484
484
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
485
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
485
486
  {
486
487
  shared.getGlobalThis().__VUE_HMR_RUNTIME__ = {
487
488
  createRecord: tryWrap(createRecord),
@@ -545,9 +546,10 @@ function reload(id, newComp) {
545
546
  const record = map.get(id);
546
547
  if (!record) return;
547
548
  newComp = normalizeClassComponent(newComp);
549
+ const isVapor = record.initialDef.__vapor;
548
550
  updateComponentDef(record.initialDef, newComp);
549
551
  const instances = [...record.instances];
550
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
552
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
551
553
  for (const instance of instances) {
552
554
  if (instance.root && instance.root.ce && instance !== instance.root) {
553
555
  instance.root.ce._removeChildStyle(instance.type);
@@ -567,6 +569,7 @@ function reload(id, newComp) {
567
569
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
568
570
  }
569
571
  dirtyInstances.add(instance);
572
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
570
573
  instance.appContext.propsCache.delete(instance.type);
571
574
  instance.appContext.emitsCache.delete(instance.type);
572
575
  instance.appContext.optionsCache.delete(instance.type);
@@ -607,6 +610,7 @@ function reload(id, newComp) {
607
610
  }
608
611
  queuePostFlushCb(() => {
609
612
  hmrDirtyComponents.clear();
613
+ hmrDirtyComponentsMode.clear();
610
614
  });
611
615
  }
612
616
  function updateComponentDef(oldComp, newComp) {
@@ -826,7 +830,203 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
826
830
  }
827
831
  }
828
832
 
829
- const TeleportEndKey = Symbol("_vte");
833
+ function provide(key, value) {
834
+ {
835
+ if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
836
+ warn$1(`provide() can only be used inside setup().`);
837
+ }
838
+ }
839
+ if (currentInstance) {
840
+ let provides = currentInstance.provides;
841
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
842
+ if (parentProvides === provides) {
843
+ provides = currentInstance.provides = Object.create(parentProvides);
844
+ }
845
+ provides[key] = value;
846
+ }
847
+ }
848
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
849
+ const instance = getCurrentGenericInstance();
850
+ if (instance || currentApp) {
851
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
852
+ if (provides && key in provides) {
853
+ return provides[key];
854
+ } else if (arguments.length > 1) {
855
+ return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
856
+ } else {
857
+ warn$1(`injection "${String(key)}" not found.`);
858
+ }
859
+ } else {
860
+ warn$1(`inject() can only be used inside setup() or functional components.`);
861
+ }
862
+ }
863
+ function hasInjectionContext() {
864
+ return !!(getCurrentGenericInstance() || currentApp);
865
+ }
866
+
867
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
868
+ const useSSRContext = () => {
869
+ {
870
+ const ctx = inject(ssrContextKey);
871
+ if (!ctx) {
872
+ warn$1(
873
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
874
+ );
875
+ }
876
+ return ctx;
877
+ }
878
+ };
879
+
880
+ function watchEffect(effect, options) {
881
+ return doWatch(effect, null, options);
882
+ }
883
+ function watchPostEffect(effect, options) {
884
+ return doWatch(
885
+ effect,
886
+ null,
887
+ shared.extend({}, options, { flush: "post" })
888
+ );
889
+ }
890
+ function watchSyncEffect(effect, options) {
891
+ return doWatch(
892
+ effect,
893
+ null,
894
+ shared.extend({}, options, { flush: "sync" })
895
+ );
896
+ }
897
+ function watch(source, cb, options) {
898
+ if (!shared.isFunction(cb)) {
899
+ warn$1(
900
+ `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
901
+ );
902
+ }
903
+ return doWatch(source, cb, options);
904
+ }
905
+ class RenderWatcherEffect extends reactivity.WatcherEffect {
906
+ constructor(instance, source, cb, options, flush) {
907
+ super(source, cb, options);
908
+ this.flush = flush;
909
+ const job = () => {
910
+ if (this.dirty) {
911
+ this.run();
912
+ }
913
+ };
914
+ if (cb) {
915
+ this.flags |= 128;
916
+ job.flags |= 2;
917
+ }
918
+ if (instance) {
919
+ job.i = instance;
920
+ }
921
+ this.job = job;
922
+ }
923
+ notify() {
924
+ const flags = this.flags;
925
+ if (!(flags & 256)) {
926
+ const flush = this.flush;
927
+ const job = this.job;
928
+ if (flush === "post") {
929
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
930
+ } else if (flush === "pre") {
931
+ queueJob(job, job.i ? job.i.uid : void 0, true);
932
+ } else {
933
+ job();
934
+ }
935
+ }
936
+ }
937
+ }
938
+ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
939
+ const { immediate, deep, flush = "pre", once } = options;
940
+ if (!cb) {
941
+ if (immediate !== void 0) {
942
+ warn$1(
943
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
944
+ );
945
+ }
946
+ if (deep !== void 0) {
947
+ warn$1(
948
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
949
+ );
950
+ }
951
+ if (once !== void 0) {
952
+ warn$1(
953
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
954
+ );
955
+ }
956
+ }
957
+ const baseWatchOptions = shared.extend({}, options);
958
+ baseWatchOptions.onWarn = warn$1;
959
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
960
+ let ssrCleanup;
961
+ if (isInSSRComponentSetup) {
962
+ if (flush === "sync") {
963
+ const ctx = useSSRContext();
964
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
965
+ } else if (!runsImmediately) {
966
+ const watchStopHandle = () => {
967
+ };
968
+ watchStopHandle.stop = shared.NOOP;
969
+ watchStopHandle.resume = shared.NOOP;
970
+ watchStopHandle.pause = shared.NOOP;
971
+ return watchStopHandle;
972
+ }
973
+ }
974
+ const instance = currentInstance;
975
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
976
+ const effect = new RenderWatcherEffect(
977
+ instance,
978
+ source,
979
+ cb,
980
+ baseWatchOptions,
981
+ flush
982
+ );
983
+ if (cb) {
984
+ effect.run(true);
985
+ } else if (flush === "post") {
986
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
987
+ } else {
988
+ effect.run(true);
989
+ }
990
+ const stop = effect.stop.bind(effect);
991
+ stop.pause = effect.pause.bind(effect);
992
+ stop.resume = effect.resume.bind(effect);
993
+ stop.stop = stop;
994
+ if (isInSSRComponentSetup) {
995
+ if (ssrCleanup) {
996
+ ssrCleanup.push(stop);
997
+ } else if (runsImmediately) {
998
+ stop();
999
+ }
1000
+ }
1001
+ return stop;
1002
+ }
1003
+ function instanceWatch(source, value, options) {
1004
+ const publicThis = this.proxy;
1005
+ const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
1006
+ let cb;
1007
+ if (shared.isFunction(value)) {
1008
+ cb = value;
1009
+ } else {
1010
+ cb = value.handler;
1011
+ options = value;
1012
+ }
1013
+ const prev = setCurrentInstance(this);
1014
+ const res = doWatch(getter, cb.bind(publicThis), options);
1015
+ setCurrentInstance(...prev);
1016
+ return res;
1017
+ }
1018
+ function createPathGetter(ctx, path) {
1019
+ const segments = path.split(".");
1020
+ return () => {
1021
+ let cur = ctx;
1022
+ for (let i = 0; i < segments.length && cur; i++) {
1023
+ cur = cur[segments[i]];
1024
+ }
1025
+ return cur;
1026
+ };
1027
+ }
1028
+
1029
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
830
1030
  const isTeleport = (type) => type.__isTeleport;
831
1031
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
832
1032
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -1198,8 +1398,8 @@ function prepareAnchor(target, vnode, createText, insert) {
1198
1398
  return targetAnchor;
1199
1399
  }
1200
1400
 
1201
- const leaveCbKey = Symbol("_leaveCb");
1202
- const enterCbKey = Symbol("_enterCb");
1401
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
1402
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
1203
1403
  function useTransitionState() {
1204
1404
  const state = {
1205
1405
  isMounted: false,
@@ -1237,7 +1437,7 @@ const BaseTransitionPropsValidators = {
1237
1437
  onAppearCancelled: TransitionHookValidator
1238
1438
  };
1239
1439
  const recursiveGetSubtree = (instance) => {
1240
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1440
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
1241
1441
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1242
1442
  };
1243
1443
  const BaseTransitionImpl = {
@@ -1544,7 +1744,7 @@ function getInnerChild$1(vnode) {
1544
1744
  }
1545
1745
  function setTransitionHooks(vnode, hooks) {
1546
1746
  if (vnode.shapeFlag & 6 && vnode.component) {
1547
- if (vnode.type.__vapor) {
1747
+ if (isVaporComponent(vnode.type)) {
1548
1748
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
1549
1749
  vnode.component,
1550
1750
  hooks
@@ -2812,7 +3012,9 @@ const KeepAliveImpl = {
2812
3012
  }
2813
3013
  function pruneCache(filter) {
2814
3014
  cache.forEach((vnode, key) => {
2815
- const name = getComponentName(vnode.type);
3015
+ const name = getComponentName(
3016
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
3017
+ );
2816
3018
  if (name && !filter(name)) {
2817
3019
  pruneCacheEntry(key);
2818
3020
  }
@@ -3111,7 +3313,7 @@ const DIRECTIVES = "directives";
3111
3313
  function resolveComponent(name, maybeSelfReference) {
3112
3314
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
3113
3315
  }
3114
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
3316
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
3115
3317
  function resolveDynamicComponent(component) {
3116
3318
  if (shared.isString(component)) {
3117
3319
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -3302,14 +3504,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
3302
3504
  }
3303
3505
  }
3304
3506
 
3305
- function toHandlers(obj, preserveCaseIfNecessary) {
3507
+ function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
3306
3508
  const ret = {};
3307
3509
  if (!shared.isObject(obj)) {
3308
3510
  warn$1(`v-on with no argument expects an object value.`);
3309
3511
  return ret;
3310
3512
  }
3311
3513
  for (const key in obj) {
3312
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
3514
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
3313
3515
  }
3314
3516
  return ret;
3315
3517
  }
@@ -4281,202 +4483,6 @@ If you want to remount the same app, move your app creation logic into a factory
4281
4483
  }
4282
4484
  let currentApp = null;
4283
4485
 
4284
- function provide(key, value) {
4285
- {
4286
- if (!currentInstance || currentInstance.isMounted) {
4287
- warn$1(`provide() can only be used inside setup().`);
4288
- }
4289
- }
4290
- if (currentInstance) {
4291
- let provides = currentInstance.provides;
4292
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
4293
- if (parentProvides === provides) {
4294
- provides = currentInstance.provides = Object.create(parentProvides);
4295
- }
4296
- provides[key] = value;
4297
- }
4298
- }
4299
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
4300
- const instance = getCurrentGenericInstance();
4301
- if (instance || currentApp) {
4302
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
4303
- if (provides && key in provides) {
4304
- return provides[key];
4305
- } else if (arguments.length > 1) {
4306
- return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
4307
- } else {
4308
- warn$1(`injection "${String(key)}" not found.`);
4309
- }
4310
- } else {
4311
- warn$1(`inject() can only be used inside setup() or functional components.`);
4312
- }
4313
- }
4314
- function hasInjectionContext() {
4315
- return !!(getCurrentGenericInstance() || currentApp);
4316
- }
4317
-
4318
- const ssrContextKey = Symbol.for("v-scx");
4319
- const useSSRContext = () => {
4320
- {
4321
- const ctx = inject(ssrContextKey);
4322
- if (!ctx) {
4323
- warn$1(
4324
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
4325
- );
4326
- }
4327
- return ctx;
4328
- }
4329
- };
4330
-
4331
- function watchEffect(effect, options) {
4332
- return doWatch(effect, null, options);
4333
- }
4334
- function watchPostEffect(effect, options) {
4335
- return doWatch(
4336
- effect,
4337
- null,
4338
- shared.extend({}, options, { flush: "post" })
4339
- );
4340
- }
4341
- function watchSyncEffect(effect, options) {
4342
- return doWatch(
4343
- effect,
4344
- null,
4345
- shared.extend({}, options, { flush: "sync" })
4346
- );
4347
- }
4348
- function watch(source, cb, options) {
4349
- if (!shared.isFunction(cb)) {
4350
- warn$1(
4351
- `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
4352
- );
4353
- }
4354
- return doWatch(source, cb, options);
4355
- }
4356
- class RenderWatcherEffect extends reactivity.WatcherEffect {
4357
- constructor(instance, source, cb, options, flush) {
4358
- super(source, cb, options);
4359
- this.flush = flush;
4360
- const job = () => {
4361
- if (this.dirty) {
4362
- this.run();
4363
- }
4364
- };
4365
- if (cb) {
4366
- this.flags |= 128;
4367
- job.flags |= 2;
4368
- }
4369
- if (instance) {
4370
- job.i = instance;
4371
- }
4372
- this.job = job;
4373
- }
4374
- notify() {
4375
- const flags = this.flags;
4376
- if (!(flags & 256)) {
4377
- const flush = this.flush;
4378
- const job = this.job;
4379
- if (flush === "post") {
4380
- queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
4381
- } else if (flush === "pre") {
4382
- queueJob(job, job.i ? job.i.uid : void 0, true);
4383
- } else {
4384
- job();
4385
- }
4386
- }
4387
- }
4388
- }
4389
- function doWatch(source, cb, options = shared.EMPTY_OBJ) {
4390
- const { immediate, deep, flush = "pre", once } = options;
4391
- if (!cb) {
4392
- if (immediate !== void 0) {
4393
- warn$1(
4394
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
4395
- );
4396
- }
4397
- if (deep !== void 0) {
4398
- warn$1(
4399
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
4400
- );
4401
- }
4402
- if (once !== void 0) {
4403
- warn$1(
4404
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
4405
- );
4406
- }
4407
- }
4408
- const baseWatchOptions = shared.extend({}, options);
4409
- baseWatchOptions.onWarn = warn$1;
4410
- const runsImmediately = cb && immediate || !cb && flush !== "post";
4411
- let ssrCleanup;
4412
- if (isInSSRComponentSetup) {
4413
- if (flush === "sync") {
4414
- const ctx = useSSRContext();
4415
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4416
- } else if (!runsImmediately) {
4417
- const watchStopHandle = () => {
4418
- };
4419
- watchStopHandle.stop = shared.NOOP;
4420
- watchStopHandle.resume = shared.NOOP;
4421
- watchStopHandle.pause = shared.NOOP;
4422
- return watchStopHandle;
4423
- }
4424
- }
4425
- const instance = currentInstance;
4426
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4427
- const effect = new RenderWatcherEffect(
4428
- instance,
4429
- source,
4430
- cb,
4431
- baseWatchOptions,
4432
- flush
4433
- );
4434
- if (cb) {
4435
- effect.run(true);
4436
- } else if (flush === "post") {
4437
- queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
4438
- } else {
4439
- effect.run(true);
4440
- }
4441
- const stop = effect.stop.bind(effect);
4442
- stop.pause = effect.pause.bind(effect);
4443
- stop.resume = effect.resume.bind(effect);
4444
- stop.stop = stop;
4445
- if (isInSSRComponentSetup) {
4446
- if (ssrCleanup) {
4447
- ssrCleanup.push(stop);
4448
- } else if (runsImmediately) {
4449
- stop();
4450
- }
4451
- }
4452
- return stop;
4453
- }
4454
- function instanceWatch(source, value, options) {
4455
- const publicThis = this.proxy;
4456
- const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
4457
- let cb;
4458
- if (shared.isFunction(value)) {
4459
- cb = value;
4460
- } else {
4461
- cb = value.handler;
4462
- options = value;
4463
- }
4464
- const prev = setCurrentInstance(this);
4465
- const res = doWatch(getter, cb.bind(publicThis), options);
4466
- setCurrentInstance(...prev);
4467
- return res;
4468
- }
4469
- function createPathGetter(ctx, path) {
4470
- const segments = path.split(".");
4471
- return () => {
4472
- let cur = ctx;
4473
- for (let i = 0; i < segments.length && cur; i++) {
4474
- cur = cur[segments[i]];
4475
- }
4476
- return cur;
4477
- };
4478
- }
4479
-
4480
4486
  function useModel(props, name, options = shared.EMPTY_OBJ) {
4481
4487
  const i = getCurrentGenericInstance();
4482
4488
  if (!i) {
@@ -5561,6 +5567,14 @@ function isSupported() {
5561
5567
  return supported;
5562
5568
  }
5563
5569
 
5570
+ const MoveType = {
5571
+ "ENTER": 0,
5572
+ "0": "ENTER",
5573
+ "LEAVE": 1,
5574
+ "1": "LEAVE",
5575
+ "REORDER": 2,
5576
+ "2": "REORDER"
5577
+ };
5564
5578
  const queuePostRenderEffect = queueEffectWithSuspense ;
5565
5579
  function createRenderer(options) {
5566
5580
  return baseCreateRenderer(options);
@@ -5630,7 +5644,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5630
5644
  );
5631
5645
  break;
5632
5646
  case VaporSlot:
5633
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
5647
+ getVaporInterface(parentComponent, n2).slot(
5648
+ n1,
5649
+ n2,
5650
+ container,
5651
+ anchor,
5652
+ parentComponent
5653
+ );
5634
5654
  break;
5635
5655
  default:
5636
5656
  if (shapeFlag & 1) {
@@ -5703,7 +5723,15 @@ function baseCreateRenderer(options, createHydrationFns) {
5703
5723
  } else {
5704
5724
  const el = n2.el = n1.el;
5705
5725
  if (n2.children !== n1.children) {
5706
- hostSetText(el, n2.children);
5726
+ if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
5727
+ const childNodes = container.childNodes;
5728
+ const newChild = hostCreateText(n2.children);
5729
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
5730
+ hostInsert(newChild, container, oldChild);
5731
+ hostRemove(oldChild);
5732
+ } else {
5733
+ hostSetText(el, n2.children);
5734
+ }
5707
5735
  }
5708
5736
  }
5709
5737
  };
@@ -6089,7 +6117,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6089
6117
  } else {
6090
6118
  if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
6091
6119
  // of renderSlot() with no valid children
6092
- n1.dynamicChildren) {
6120
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
6093
6121
  patchBlockChildren(
6094
6122
  n1.dynamicChildren,
6095
6123
  dynamicChildren,
@@ -6777,8 +6805,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6777
6805
  const nextChild = c2[nextIndex];
6778
6806
  const anchorVNode = c2[nextIndex + 1];
6779
6807
  const anchor = nextIndex + 1 < l2 ? (
6780
- // #13559, fallback to el placeholder for unresolved async component
6781
- anchorVNode.el || anchorVNode.placeholder
6808
+ // #13559, #14173 fallback to el placeholder for unresolved async component
6809
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
6782
6810
  ) : parentAnchor;
6783
6811
  if (newIndexToOldIndexMap[i] === 0) {
6784
6812
  patch(
@@ -6811,7 +6839,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6811
6839
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6812
6840
  const { el, type, transition, children, shapeFlag } = vnode;
6813
6841
  if (shapeFlag & 6) {
6814
- if (type.__vapor) {
6842
+ if (isVaporComponent(type)) {
6815
6843
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
6816
6844
  } else {
6817
6845
  move(
@@ -6921,7 +6949,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6921
6949
  parentComponent.renderCache[cacheIndex] = void 0;
6922
6950
  }
6923
6951
  if (shapeFlag & 256) {
6924
- if (vnode.type.__vapor) {
6952
+ if (isVaporComponent(vnode.type)) {
6925
6953
  getVaporInterface(parentComponent, vnode).deactivate(
6926
6954
  vnode,
6927
6955
  parentComponent.ctx.getStorageContainer()
@@ -6938,7 +6966,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6938
6966
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
6939
6967
  }
6940
6968
  if (shapeFlag & 6) {
6941
- if (type.__vapor) {
6969
+ if (isVaporComponent(type)) {
6942
6970
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6943
6971
  return;
6944
6972
  } else {
@@ -7070,7 +7098,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7070
7098
  };
7071
7099
  const getNextHostNode = (vnode) => {
7072
7100
  if (vnode.shapeFlag & 6) {
7073
- if (vnode.type.__vapor) {
7101
+ if (isVaporComponent(vnode.type)) {
7074
7102
  return hostNextSibling(vnode.anchor);
7075
7103
  }
7076
7104
  return getNextHostNode(vnode.component.subTree);
@@ -7083,9 +7111,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7083
7111
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7084
7112
  };
7085
7113
  const render = (vnode, container, namespace) => {
7114
+ let instance;
7086
7115
  if (vnode == null) {
7087
7116
  if (container._vnode) {
7088
7117
  unmount(container._vnode, null, null, true);
7118
+ instance = container._vnode.component;
7089
7119
  }
7090
7120
  } else {
7091
7121
  patch(
@@ -7099,7 +7129,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7099
7129
  );
7100
7130
  }
7101
7131
  container._vnode = vnode;
7102
- flushOnAppMount();
7132
+ flushOnAppMount(instance);
7103
7133
  };
7104
7134
  const internals = {
7105
7135
  p: patch,
@@ -7189,9 +7219,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7189
7219
  if (!shallow && c2.patchFlag !== -2)
7190
7220
  traverseStaticChildren(c1, c2);
7191
7221
  }
7192
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
7193
- c2.patchFlag !== -1) {
7194
- c2.el = c1.el;
7222
+ if (c2.type === Text) {
7223
+ if (c2.patchFlag !== -1) {
7224
+ c2.el = c1.el;
7225
+ } else {
7226
+ c2.__elIndex = i + // take fragment start anchor into account
7227
+ (n1.type === Fragment ? 1 : 0);
7228
+ }
7195
7229
  }
7196
7230
  if (c2.type === Comment && !c2.el) {
7197
7231
  c2.el = c1.el;
@@ -7227,16 +7261,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
7227
7261
  insert();
7228
7262
  }
7229
7263
  }
7230
- function performTransitionLeave(el, transition, remove, isElement = true) {
7264
+ function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
7231
7265
  const performRemove = () => {
7232
7266
  remove();
7233
7267
  if (transition && !transition.persisted && transition.afterLeave) {
7234
7268
  transition.afterLeave();
7235
7269
  }
7236
7270
  };
7237
- if (isElement && transition && !transition.persisted) {
7271
+ if (force || isElement && transition && !transition.persisted) {
7238
7272
  const { leave, delayLeave } = transition;
7239
- const performLeave = () => leave(el, performRemove);
7273
+ const performLeave = () => {
7274
+ if (el._isLeaving && force) {
7275
+ el[leaveCbKey](
7276
+ true
7277
+ /* cancelled */
7278
+ );
7279
+ }
7280
+ leave(el, performRemove);
7281
+ };
7240
7282
  if (delayLeave) {
7241
7283
  delayLeave(el, performRemove, performLeave);
7242
7284
  } else {
@@ -7260,6 +7302,12 @@ app.use(vaporInteropPlugin)
7260
7302
  }
7261
7303
  return res;
7262
7304
  }
7305
+ function isVaporComponent(type) {
7306
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
7307
+ return hmrDirtyComponentsMode.get(type);
7308
+ }
7309
+ return type.__vapor;
7310
+ }
7263
7311
  function getInheritedScopeIds(vnode, parentComponent) {
7264
7312
  const inheritedScopeIds = [];
7265
7313
  let currentParent = parentComponent;
@@ -7286,6 +7334,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
7286
7334
  }
7287
7335
  return inheritedScopeIds;
7288
7336
  }
7337
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
7338
+ if (anchorVnode.placeholder) {
7339
+ return anchorVnode.placeholder;
7340
+ }
7341
+ const instance = anchorVnode.component;
7342
+ if (instance) {
7343
+ return resolveAsyncComponentPlaceholder(instance.subTree);
7344
+ }
7345
+ return null;
7346
+ }
7289
7347
 
7290
7348
  const isSuspense = (type) => type.__isSuspense;
7291
7349
  let suspenseId = 0;
@@ -7868,11 +7926,11 @@ function isVNodeSuspensible(vnode) {
7868
7926
  return suspensible != null && suspensible !== false;
7869
7927
  }
7870
7928
 
7871
- const Fragment = Symbol.for("v-fgt");
7872
- const Text = Symbol.for("v-txt");
7873
- const Comment = Symbol.for("v-cmt");
7874
- const Static = Symbol.for("v-stc");
7875
- const VaporSlot = Symbol.for("v-vps");
7929
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
7930
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
7931
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
7932
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
7933
+ const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
7876
7934
  const blockStack = [];
7877
7935
  let currentBlock = null;
7878
7936
  function openBlock(disableTracking = false) {
@@ -8928,7 +8986,7 @@ function isMemoSame(cached, memo) {
8928
8986
  return true;
8929
8987
  }
8930
8988
 
8931
- const version = "3.6.0-alpha.6";
8989
+ const version = "3.6.0-beta.1";
8932
8990
  const warn = warn$1 ;
8933
8991
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8934
8992
  const devtools = devtools$1 ;
@@ -8996,6 +9054,7 @@ exports.ErrorCodes = ErrorCodes;
8996
9054
  exports.ErrorTypeStrings = ErrorTypeStrings;
8997
9055
  exports.Fragment = Fragment;
8998
9056
  exports.KeepAlive = KeepAlive;
9057
+ exports.MoveType = MoveType;
8999
9058
  exports.Static = Static;
9000
9059
  exports.Suspense = Suspense;
9001
9060
  exports.Teleport = Teleport;