@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,11 +1,11 @@
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
  **/
6
- import { setActiveSub, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, WatcherEffect, customRef, shallowReactive, trigger, ReactiveEffect, setCurrentScope, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
6
+ import { setActiveSub, isRef, toRaw, traverse, WatcherEffect, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, setCurrentScope, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
7
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
8
- import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, NOOP, isGloballyAllowed, hyphenate, hasChanged, getModifierPropName, looseToNumber, isModelListener, EMPTY_ARR, makeMap, toRawType, getSequence, toNumber, isBuiltInTag } from '@vue/shared';
8
+ import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NOOP, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, hyphenate, hasChanged, getModifierPropName, looseToNumber, isModelListener, EMPTY_ARR, makeMap, toRawType, getSequence, toNumber, isBuiltInTag } from '@vue/shared';
9
9
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
10
10
 
11
11
  const stack = [];
@@ -415,10 +415,10 @@ function flushPostFlushCbs(seen) {
415
415
  }
416
416
  }
417
417
  let isFlushing = false;
418
- function flushOnAppMount() {
418
+ function flushOnAppMount(instance) {
419
419
  if (!isFlushing) {
420
420
  isFlushing = true;
421
- flushPreFlushCbs();
421
+ flushPreFlushCbs(instance);
422
422
  flushPostFlushCbs();
423
423
  isFlushing = false;
424
424
  }
@@ -485,6 +485,7 @@ function checkRecursiveUpdates(seen, fn) {
485
485
 
486
486
  let isHmrUpdating = false;
487
487
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
488
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
488
489
  if (!!(process.env.NODE_ENV !== "production")) {
489
490
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
490
491
  createRecord: tryWrap(createRecord),
@@ -548,9 +549,10 @@ function reload(id, newComp) {
548
549
  const record = map.get(id);
549
550
  if (!record) return;
550
551
  newComp = normalizeClassComponent(newComp);
552
+ const isVapor = record.initialDef.__vapor;
551
553
  updateComponentDef(record.initialDef, newComp);
552
554
  const instances = [...record.instances];
553
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
555
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
554
556
  for (const instance of instances) {
555
557
  if (instance.root && instance.root.ce && instance !== instance.root) {
556
558
  instance.root.ce._removeChildStyle(instance.type);
@@ -570,6 +572,7 @@ function reload(id, newComp) {
570
572
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
571
573
  }
572
574
  dirtyInstances.add(instance);
575
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
573
576
  instance.appContext.propsCache.delete(instance.type);
574
577
  instance.appContext.emitsCache.delete(instance.type);
575
578
  instance.appContext.optionsCache.delete(instance.type);
@@ -610,6 +613,7 @@ function reload(id, newComp) {
610
613
  }
611
614
  queuePostFlushCb(() => {
612
615
  hmrDirtyComponents.clear();
616
+ hmrDirtyComponentsMode.clear();
613
617
  });
614
618
  }
615
619
  function updateComponentDef(oldComp, newComp) {
@@ -829,7 +833,203 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
829
833
  }
830
834
  }
831
835
 
832
- const TeleportEndKey = Symbol("_vte");
836
+ function provide(key, value) {
837
+ if (!!(process.env.NODE_ENV !== "production")) {
838
+ if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
839
+ warn$1(`provide() can only be used inside setup().`);
840
+ }
841
+ }
842
+ if (currentInstance) {
843
+ let provides = currentInstance.provides;
844
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
845
+ if (parentProvides === provides) {
846
+ provides = currentInstance.provides = Object.create(parentProvides);
847
+ }
848
+ provides[key] = value;
849
+ }
850
+ }
851
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
852
+ const instance = getCurrentGenericInstance();
853
+ if (instance || currentApp) {
854
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
855
+ if (provides && key in provides) {
856
+ return provides[key];
857
+ } else if (arguments.length > 1) {
858
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
859
+ } else if (!!(process.env.NODE_ENV !== "production")) {
860
+ warn$1(`injection "${String(key)}" not found.`);
861
+ }
862
+ } else if (!!(process.env.NODE_ENV !== "production")) {
863
+ warn$1(`inject() can only be used inside setup() or functional components.`);
864
+ }
865
+ }
866
+ function hasInjectionContext() {
867
+ return !!(getCurrentGenericInstance() || currentApp);
868
+ }
869
+
870
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
871
+ const useSSRContext = () => {
872
+ {
873
+ const ctx = inject(ssrContextKey);
874
+ if (!ctx) {
875
+ !!(process.env.NODE_ENV !== "production") && warn$1(
876
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
877
+ );
878
+ }
879
+ return ctx;
880
+ }
881
+ };
882
+
883
+ function watchEffect(effect, options) {
884
+ return doWatch(effect, null, options);
885
+ }
886
+ function watchPostEffect(effect, options) {
887
+ return doWatch(
888
+ effect,
889
+ null,
890
+ !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
891
+ );
892
+ }
893
+ function watchSyncEffect(effect, options) {
894
+ return doWatch(
895
+ effect,
896
+ null,
897
+ !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
898
+ );
899
+ }
900
+ function watch(source, cb, options) {
901
+ if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
902
+ warn$1(
903
+ `\`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.`
904
+ );
905
+ }
906
+ return doWatch(source, cb, options);
907
+ }
908
+ class RenderWatcherEffect extends WatcherEffect {
909
+ constructor(instance, source, cb, options, flush) {
910
+ super(source, cb, options);
911
+ this.flush = flush;
912
+ const job = () => {
913
+ if (this.dirty) {
914
+ this.run();
915
+ }
916
+ };
917
+ if (cb) {
918
+ this.flags |= 128;
919
+ job.flags |= 2;
920
+ }
921
+ if (instance) {
922
+ job.i = instance;
923
+ }
924
+ this.job = job;
925
+ }
926
+ notify() {
927
+ const flags = this.flags;
928
+ if (!(flags & 256)) {
929
+ const flush = this.flush;
930
+ const job = this.job;
931
+ if (flush === "post") {
932
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
933
+ } else if (flush === "pre") {
934
+ queueJob(job, job.i ? job.i.uid : void 0, true);
935
+ } else {
936
+ job();
937
+ }
938
+ }
939
+ }
940
+ }
941
+ function doWatch(source, cb, options = EMPTY_OBJ) {
942
+ const { immediate, deep, flush = "pre", once } = options;
943
+ if (!!(process.env.NODE_ENV !== "production") && !cb) {
944
+ if (immediate !== void 0) {
945
+ warn$1(
946
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
947
+ );
948
+ }
949
+ if (deep !== void 0) {
950
+ warn$1(
951
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
952
+ );
953
+ }
954
+ if (once !== void 0) {
955
+ warn$1(
956
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
957
+ );
958
+ }
959
+ }
960
+ const baseWatchOptions = extend({}, options);
961
+ if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
962
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
963
+ let ssrCleanup;
964
+ if (isInSSRComponentSetup) {
965
+ if (flush === "sync") {
966
+ const ctx = useSSRContext();
967
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
968
+ } else if (!runsImmediately) {
969
+ const watchStopHandle = () => {
970
+ };
971
+ watchStopHandle.stop = NOOP;
972
+ watchStopHandle.resume = NOOP;
973
+ watchStopHandle.pause = NOOP;
974
+ return watchStopHandle;
975
+ }
976
+ }
977
+ const instance = currentInstance;
978
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
979
+ const effect = new RenderWatcherEffect(
980
+ instance,
981
+ source,
982
+ cb,
983
+ baseWatchOptions,
984
+ flush
985
+ );
986
+ if (cb) {
987
+ effect.run(true);
988
+ } else if (flush === "post") {
989
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
990
+ } else {
991
+ effect.run(true);
992
+ }
993
+ const stop = effect.stop.bind(effect);
994
+ stop.pause = effect.pause.bind(effect);
995
+ stop.resume = effect.resume.bind(effect);
996
+ stop.stop = stop;
997
+ if (isInSSRComponentSetup) {
998
+ if (ssrCleanup) {
999
+ ssrCleanup.push(stop);
1000
+ } else if (runsImmediately) {
1001
+ stop();
1002
+ }
1003
+ }
1004
+ return stop;
1005
+ }
1006
+ function instanceWatch(source, value, options) {
1007
+ const publicThis = this.proxy;
1008
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
1009
+ let cb;
1010
+ if (isFunction(value)) {
1011
+ cb = value;
1012
+ } else {
1013
+ cb = value.handler;
1014
+ options = value;
1015
+ }
1016
+ const prev = setCurrentInstance(this);
1017
+ const res = doWatch(getter, cb.bind(publicThis), options);
1018
+ setCurrentInstance(...prev);
1019
+ return res;
1020
+ }
1021
+ function createPathGetter(ctx, path) {
1022
+ const segments = path.split(".");
1023
+ return () => {
1024
+ let cur = ctx;
1025
+ for (let i = 0; i < segments.length && cur; i++) {
1026
+ cur = cur[segments[i]];
1027
+ }
1028
+ return cur;
1029
+ };
1030
+ }
1031
+
1032
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
833
1033
  const isTeleport = (type) => type.__isTeleport;
834
1034
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
835
1035
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -1201,8 +1401,8 @@ function prepareAnchor(target, vnode, createText, insert) {
1201
1401
  return targetAnchor;
1202
1402
  }
1203
1403
 
1204
- const leaveCbKey = Symbol("_leaveCb");
1205
- const enterCbKey = Symbol("_enterCb");
1404
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
1405
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
1206
1406
  function useTransitionState() {
1207
1407
  const state = {
1208
1408
  isMounted: false,
@@ -1240,7 +1440,7 @@ const BaseTransitionPropsValidators = {
1240
1440
  onAppearCancelled: TransitionHookValidator
1241
1441
  };
1242
1442
  const recursiveGetSubtree = (instance) => {
1243
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1443
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
1244
1444
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1245
1445
  };
1246
1446
  const BaseTransitionImpl = {
@@ -1548,7 +1748,7 @@ function getInnerChild$1(vnode) {
1548
1748
  }
1549
1749
  function setTransitionHooks(vnode, hooks) {
1550
1750
  if (vnode.shapeFlag & 6 && vnode.component) {
1551
- if (vnode.type.__vapor) {
1751
+ if (isVaporComponent(vnode.type)) {
1552
1752
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
1553
1753
  vnode.component,
1554
1754
  hooks
@@ -2839,7 +3039,9 @@ const KeepAliveImpl = {
2839
3039
  }
2840
3040
  function pruneCache(filter) {
2841
3041
  cache.forEach((vnode, key) => {
2842
- const name = getComponentName(vnode.type);
3042
+ const name = getComponentName(
3043
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
3044
+ );
2843
3045
  if (name && !filter(name)) {
2844
3046
  pruneCacheEntry(key);
2845
3047
  }
@@ -3141,7 +3343,7 @@ const DIRECTIVES = "directives";
3141
3343
  function resolveComponent(name, maybeSelfReference) {
3142
3344
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
3143
3345
  }
3144
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
3346
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
3145
3347
  function resolveDynamicComponent(component) {
3146
3348
  if (isString(component)) {
3147
3349
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -3332,14 +3534,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
3332
3534
  }
3333
3535
  }
3334
3536
 
3335
- function toHandlers(obj, preserveCaseIfNecessary) {
3537
+ function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
3336
3538
  const ret = {};
3337
3539
  if (!!(process.env.NODE_ENV !== "production") && !isObject(obj)) {
3338
3540
  warn$1(`v-on with no argument expects an object value.`);
3339
3541
  return ret;
3340
3542
  }
3341
3543
  for (const key in obj) {
3342
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
3544
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
3343
3545
  }
3344
3546
  return ret;
3345
3547
  }
@@ -4315,202 +4517,6 @@ If you want to remount the same app, move your app creation logic into a factory
4315
4517
  }
4316
4518
  let currentApp = null;
4317
4519
 
4318
- function provide(key, value) {
4319
- if (!!(process.env.NODE_ENV !== "production")) {
4320
- if (!currentInstance || currentInstance.isMounted) {
4321
- warn$1(`provide() can only be used inside setup().`);
4322
- }
4323
- }
4324
- if (currentInstance) {
4325
- let provides = currentInstance.provides;
4326
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
4327
- if (parentProvides === provides) {
4328
- provides = currentInstance.provides = Object.create(parentProvides);
4329
- }
4330
- provides[key] = value;
4331
- }
4332
- }
4333
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
4334
- const instance = getCurrentGenericInstance();
4335
- if (instance || currentApp) {
4336
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
4337
- if (provides && key in provides) {
4338
- return provides[key];
4339
- } else if (arguments.length > 1) {
4340
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
4341
- } else if (!!(process.env.NODE_ENV !== "production")) {
4342
- warn$1(`injection "${String(key)}" not found.`);
4343
- }
4344
- } else if (!!(process.env.NODE_ENV !== "production")) {
4345
- warn$1(`inject() can only be used inside setup() or functional components.`);
4346
- }
4347
- }
4348
- function hasInjectionContext() {
4349
- return !!(getCurrentGenericInstance() || currentApp);
4350
- }
4351
-
4352
- const ssrContextKey = Symbol.for("v-scx");
4353
- const useSSRContext = () => {
4354
- {
4355
- const ctx = inject(ssrContextKey);
4356
- if (!ctx) {
4357
- !!(process.env.NODE_ENV !== "production") && warn$1(
4358
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
4359
- );
4360
- }
4361
- return ctx;
4362
- }
4363
- };
4364
-
4365
- function watchEffect(effect, options) {
4366
- return doWatch(effect, null, options);
4367
- }
4368
- function watchPostEffect(effect, options) {
4369
- return doWatch(
4370
- effect,
4371
- null,
4372
- !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
4373
- );
4374
- }
4375
- function watchSyncEffect(effect, options) {
4376
- return doWatch(
4377
- effect,
4378
- null,
4379
- !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
4380
- );
4381
- }
4382
- function watch(source, cb, options) {
4383
- if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
4384
- warn$1(
4385
- `\`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.`
4386
- );
4387
- }
4388
- return doWatch(source, cb, options);
4389
- }
4390
- class RenderWatcherEffect extends WatcherEffect {
4391
- constructor(instance, source, cb, options, flush) {
4392
- super(source, cb, options);
4393
- this.flush = flush;
4394
- const job = () => {
4395
- if (this.dirty) {
4396
- this.run();
4397
- }
4398
- };
4399
- if (cb) {
4400
- this.flags |= 128;
4401
- job.flags |= 2;
4402
- }
4403
- if (instance) {
4404
- job.i = instance;
4405
- }
4406
- this.job = job;
4407
- }
4408
- notify() {
4409
- const flags = this.flags;
4410
- if (!(flags & 256)) {
4411
- const flush = this.flush;
4412
- const job = this.job;
4413
- if (flush === "post") {
4414
- queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
4415
- } else if (flush === "pre") {
4416
- queueJob(job, job.i ? job.i.uid : void 0, true);
4417
- } else {
4418
- job();
4419
- }
4420
- }
4421
- }
4422
- }
4423
- function doWatch(source, cb, options = EMPTY_OBJ) {
4424
- const { immediate, deep, flush = "pre", once } = options;
4425
- if (!!(process.env.NODE_ENV !== "production") && !cb) {
4426
- if (immediate !== void 0) {
4427
- warn$1(
4428
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
4429
- );
4430
- }
4431
- if (deep !== void 0) {
4432
- warn$1(
4433
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
4434
- );
4435
- }
4436
- if (once !== void 0) {
4437
- warn$1(
4438
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
4439
- );
4440
- }
4441
- }
4442
- const baseWatchOptions = extend({}, options);
4443
- if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
4444
- const runsImmediately = cb && immediate || !cb && flush !== "post";
4445
- let ssrCleanup;
4446
- if (isInSSRComponentSetup) {
4447
- if (flush === "sync") {
4448
- const ctx = useSSRContext();
4449
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4450
- } else if (!runsImmediately) {
4451
- const watchStopHandle = () => {
4452
- };
4453
- watchStopHandle.stop = NOOP;
4454
- watchStopHandle.resume = NOOP;
4455
- watchStopHandle.pause = NOOP;
4456
- return watchStopHandle;
4457
- }
4458
- }
4459
- const instance = currentInstance;
4460
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4461
- const effect = new RenderWatcherEffect(
4462
- instance,
4463
- source,
4464
- cb,
4465
- baseWatchOptions,
4466
- flush
4467
- );
4468
- if (cb) {
4469
- effect.run(true);
4470
- } else if (flush === "post") {
4471
- queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
4472
- } else {
4473
- effect.run(true);
4474
- }
4475
- const stop = effect.stop.bind(effect);
4476
- stop.pause = effect.pause.bind(effect);
4477
- stop.resume = effect.resume.bind(effect);
4478
- stop.stop = stop;
4479
- if (isInSSRComponentSetup) {
4480
- if (ssrCleanup) {
4481
- ssrCleanup.push(stop);
4482
- } else if (runsImmediately) {
4483
- stop();
4484
- }
4485
- }
4486
- return stop;
4487
- }
4488
- function instanceWatch(source, value, options) {
4489
- const publicThis = this.proxy;
4490
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
4491
- let cb;
4492
- if (isFunction(value)) {
4493
- cb = value;
4494
- } else {
4495
- cb = value.handler;
4496
- options = value;
4497
- }
4498
- const prev = setCurrentInstance(this);
4499
- const res = doWatch(getter, cb.bind(publicThis), options);
4500
- setCurrentInstance(...prev);
4501
- return res;
4502
- }
4503
- function createPathGetter(ctx, path) {
4504
- const segments = path.split(".");
4505
- return () => {
4506
- let cur = ctx;
4507
- for (let i = 0; i < segments.length && cur; i++) {
4508
- cur = cur[segments[i]];
4509
- }
4510
- return cur;
4511
- };
4512
- }
4513
-
4514
4520
  function useModel(props, name, options = EMPTY_OBJ) {
4515
4521
  const i = getCurrentGenericInstance();
4516
4522
  if (!!(process.env.NODE_ENV !== "production") && !i) {
@@ -5702,7 +5708,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5702
5708
  );
5703
5709
  break;
5704
5710
  case VaporSlot:
5705
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
5711
+ getVaporInterface(parentComponent, n2).slot(
5712
+ n1,
5713
+ n2,
5714
+ container,
5715
+ anchor,
5716
+ parentComponent
5717
+ );
5706
5718
  break;
5707
5719
  default:
5708
5720
  if (shapeFlag & 1) {
@@ -5775,7 +5787,15 @@ function baseCreateRenderer(options, createHydrationFns) {
5775
5787
  } else {
5776
5788
  const el = n2.el = n1.el;
5777
5789
  if (n2.children !== n1.children) {
5778
- hostSetText(el, n2.children);
5790
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
5791
+ const childNodes = container.childNodes;
5792
+ const newChild = hostCreateText(n2.children);
5793
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
5794
+ hostInsert(newChild, container, oldChild);
5795
+ hostRemove(oldChild);
5796
+ } else {
5797
+ hostSetText(el, n2.children);
5798
+ }
5779
5799
  }
5780
5800
  }
5781
5801
  };
@@ -6159,7 +6179,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6159
6179
  } else {
6160
6180
  if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
6161
6181
  // of renderSlot() with no valid children
6162
- n1.dynamicChildren) {
6182
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
6163
6183
  patchBlockChildren(
6164
6184
  n1.dynamicChildren,
6165
6185
  dynamicChildren,
@@ -6860,8 +6880,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6860
6880
  const nextChild = c2[nextIndex];
6861
6881
  const anchorVNode = c2[nextIndex + 1];
6862
6882
  const anchor = nextIndex + 1 < l2 ? (
6863
- // #13559, fallback to el placeholder for unresolved async component
6864
- anchorVNode.el || anchorVNode.placeholder
6883
+ // #13559, #14173 fallback to el placeholder for unresolved async component
6884
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
6865
6885
  ) : parentAnchor;
6866
6886
  if (newIndexToOldIndexMap[i] === 0) {
6867
6887
  patch(
@@ -6894,7 +6914,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6894
6914
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6895
6915
  const { el, type, transition, children, shapeFlag } = vnode;
6896
6916
  if (shapeFlag & 6) {
6897
- if (type.__vapor) {
6917
+ if (isVaporComponent(type)) {
6898
6918
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
6899
6919
  } else {
6900
6920
  move(
@@ -7004,7 +7024,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7004
7024
  parentComponent.renderCache[cacheIndex] = void 0;
7005
7025
  }
7006
7026
  if (shapeFlag & 256) {
7007
- if (vnode.type.__vapor) {
7027
+ if (isVaporComponent(vnode.type)) {
7008
7028
  getVaporInterface(parentComponent, vnode).deactivate(
7009
7029
  vnode,
7010
7030
  parentComponent.ctx.getStorageContainer()
@@ -7021,7 +7041,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7021
7041
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
7022
7042
  }
7023
7043
  if (shapeFlag & 6) {
7024
- if (type.__vapor) {
7044
+ if (isVaporComponent(type)) {
7025
7045
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7026
7046
  return;
7027
7047
  } else {
@@ -7153,7 +7173,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7153
7173
  };
7154
7174
  const getNextHostNode = (vnode) => {
7155
7175
  if (vnode.shapeFlag & 6) {
7156
- if (vnode.type.__vapor) {
7176
+ if (isVaporComponent(vnode.type)) {
7157
7177
  return hostNextSibling(vnode.anchor);
7158
7178
  }
7159
7179
  return getNextHostNode(vnode.component.subTree);
@@ -7166,9 +7186,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7166
7186
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7167
7187
  };
7168
7188
  const render = (vnode, container, namespace) => {
7189
+ let instance;
7169
7190
  if (vnode == null) {
7170
7191
  if (container._vnode) {
7171
7192
  unmount(container._vnode, null, null, true);
7193
+ instance = container._vnode.component;
7172
7194
  }
7173
7195
  } else {
7174
7196
  patch(
@@ -7182,7 +7204,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7182
7204
  );
7183
7205
  }
7184
7206
  container._vnode = vnode;
7185
- flushOnAppMount();
7207
+ flushOnAppMount(instance);
7186
7208
  };
7187
7209
  const internals = {
7188
7210
  p: patch,
@@ -7272,9 +7294,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7272
7294
  if (!shallow && c2.patchFlag !== -2)
7273
7295
  traverseStaticChildren(c1, c2);
7274
7296
  }
7275
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
7276
- c2.patchFlag !== -1) {
7277
- c2.el = c1.el;
7297
+ if (c2.type === Text) {
7298
+ if (c2.patchFlag !== -1) {
7299
+ c2.el = c1.el;
7300
+ } else {
7301
+ c2.__elIndex = i + // take fragment start anchor into account
7302
+ (n1.type === Fragment ? 1 : 0);
7303
+ }
7278
7304
  }
7279
7305
  if (c2.type === Comment && !c2.el) {
7280
7306
  c2.el = c1.el;
@@ -7310,16 +7336,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
7310
7336
  insert();
7311
7337
  }
7312
7338
  }
7313
- function performTransitionLeave(el, transition, remove, isElement = true) {
7339
+ function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
7314
7340
  const performRemove = () => {
7315
7341
  remove();
7316
7342
  if (transition && !transition.persisted && transition.afterLeave) {
7317
7343
  transition.afterLeave();
7318
7344
  }
7319
7345
  };
7320
- if (isElement && transition && !transition.persisted) {
7346
+ if (force || isElement && transition && !transition.persisted) {
7321
7347
  const { leave, delayLeave } = transition;
7322
- const performLeave = () => leave(el, performRemove);
7348
+ const performLeave = () => {
7349
+ if (el._isLeaving && force) {
7350
+ el[leaveCbKey](
7351
+ true
7352
+ /* cancelled */
7353
+ );
7354
+ }
7355
+ leave(el, performRemove);
7356
+ };
7323
7357
  if (delayLeave) {
7324
7358
  delayLeave(el, performRemove, performLeave);
7325
7359
  } else {
@@ -7343,6 +7377,12 @@ app.use(vaporInteropPlugin)
7343
7377
  }
7344
7378
  return res;
7345
7379
  }
7380
+ function isVaporComponent(type) {
7381
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
7382
+ return hmrDirtyComponentsMode.get(type);
7383
+ }
7384
+ return type.__vapor;
7385
+ }
7346
7386
  function getInheritedScopeIds(vnode, parentComponent) {
7347
7387
  const inheritedScopeIds = [];
7348
7388
  let currentParent = parentComponent;
@@ -7369,6 +7409,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
7369
7409
  }
7370
7410
  return inheritedScopeIds;
7371
7411
  }
7412
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
7413
+ if (anchorVnode.placeholder) {
7414
+ return anchorVnode.placeholder;
7415
+ }
7416
+ const instance = anchorVnode.component;
7417
+ if (instance) {
7418
+ return resolveAsyncComponentPlaceholder(instance.subTree);
7419
+ }
7420
+ return null;
7421
+ }
7372
7422
 
7373
7423
  const isSuspense = (type) => type.__isSuspense;
7374
7424
  let suspenseId = 0;
@@ -7951,11 +8001,11 @@ function isVNodeSuspensible(vnode) {
7951
8001
  return suspensible != null && suspensible !== false;
7952
8002
  }
7953
8003
 
7954
- const Fragment = Symbol.for("v-fgt");
7955
- const Text = Symbol.for("v-txt");
7956
- const Comment = Symbol.for("v-cmt");
7957
- const Static = Symbol.for("v-stc");
7958
- const VaporSlot = Symbol.for("v-vps");
8004
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
8005
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
8006
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
8007
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
8008
+ const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
7959
8009
  const blockStack = [];
7960
8010
  let currentBlock = null;
7961
8011
  function openBlock(disableTracking = false) {
@@ -9028,7 +9078,7 @@ function isMemoSame(cached, memo) {
9028
9078
  return true;
9029
9079
  }
9030
9080
 
9031
- const version = "3.6.0-alpha.6";
9081
+ const version = "3.6.0-beta.1";
9032
9082
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
9033
9083
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9034
9084
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;