@vue/runtime-core 3.6.0-alpha.7 → 3.6.0-beta.2

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.7
2
+ * @vue/runtime-core v3.6.0-beta.2
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 = [];
@@ -30,7 +30,6 @@ function warn$1(msg, ...args) {
30
30
  instance,
31
31
  11,
32
32
  [
33
- // eslint-disable-next-line no-restricted-syntax
34
33
  msg + args.map((a) => {
35
34
  var _a, _b;
36
35
  return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
@@ -415,10 +414,10 @@ function flushPostFlushCbs(seen) {
415
414
  }
416
415
  }
417
416
  let isFlushing = false;
418
- function flushOnAppMount() {
417
+ function flushOnAppMount(instance) {
419
418
  if (!isFlushing) {
420
419
  isFlushing = true;
421
- flushPreFlushCbs();
420
+ flushPreFlushCbs(instance);
422
421
  flushPostFlushCbs();
423
422
  isFlushing = false;
424
423
  }
@@ -660,7 +659,6 @@ function setDevtoolsHook$1(hook, target) {
660
659
  // (#4815)
661
660
  typeof window !== "undefined" && // some envs mock window but not fully
662
661
  window.HTMLElement && // also exclude jsdom
663
- // eslint-disable-next-line no-restricted-syntax
664
662
  !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
665
663
  ) {
666
664
  const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
@@ -833,7 +831,203 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
833
831
  }
834
832
  }
835
833
 
836
- const TeleportEndKey = Symbol("_vte");
834
+ function provide(key, value) {
835
+ if (!!(process.env.NODE_ENV !== "production")) {
836
+ if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
837
+ warn$1(`provide() can only be used inside setup().`);
838
+ }
839
+ }
840
+ if (currentInstance) {
841
+ let provides = currentInstance.provides;
842
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
843
+ if (parentProvides === provides) {
844
+ provides = currentInstance.provides = Object.create(parentProvides);
845
+ }
846
+ provides[key] = value;
847
+ }
848
+ }
849
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
850
+ const instance = getCurrentGenericInstance();
851
+ if (instance || currentApp) {
852
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
853
+ if (provides && key in provides) {
854
+ return provides[key];
855
+ } else if (arguments.length > 1) {
856
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
857
+ } else if (!!(process.env.NODE_ENV !== "production")) {
858
+ warn$1(`injection "${String(key)}" not found.`);
859
+ }
860
+ } else if (!!(process.env.NODE_ENV !== "production")) {
861
+ warn$1(`inject() can only be used inside setup() or functional components.`);
862
+ }
863
+ }
864
+ function hasInjectionContext() {
865
+ return !!(getCurrentGenericInstance() || currentApp);
866
+ }
867
+
868
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
869
+ const useSSRContext = () => {
870
+ {
871
+ const ctx = inject(ssrContextKey);
872
+ if (!ctx) {
873
+ !!(process.env.NODE_ENV !== "production") && warn$1(
874
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
875
+ );
876
+ }
877
+ return ctx;
878
+ }
879
+ };
880
+
881
+ function watchEffect(effect, options) {
882
+ return doWatch(effect, null, options);
883
+ }
884
+ function watchPostEffect(effect, options) {
885
+ return doWatch(
886
+ effect,
887
+ null,
888
+ !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
889
+ );
890
+ }
891
+ function watchSyncEffect(effect, options) {
892
+ return doWatch(
893
+ effect,
894
+ null,
895
+ !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
896
+ );
897
+ }
898
+ function watch(source, cb, options) {
899
+ if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
900
+ warn$1(
901
+ `\`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.`
902
+ );
903
+ }
904
+ return doWatch(source, cb, options);
905
+ }
906
+ class RenderWatcherEffect extends WatcherEffect {
907
+ constructor(instance, source, cb, options, flush) {
908
+ super(source, cb, options);
909
+ this.flush = flush;
910
+ const job = () => {
911
+ if (this.dirty) {
912
+ this.run();
913
+ }
914
+ };
915
+ if (cb) {
916
+ this.flags |= 128;
917
+ job.flags |= 2;
918
+ }
919
+ if (instance) {
920
+ job.i = instance;
921
+ }
922
+ this.job = job;
923
+ }
924
+ notify() {
925
+ const flags = this.flags;
926
+ if (!(flags & 256)) {
927
+ const flush = this.flush;
928
+ const job = this.job;
929
+ if (flush === "post") {
930
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
931
+ } else if (flush === "pre") {
932
+ queueJob(job, job.i ? job.i.uid : void 0, true);
933
+ } else {
934
+ job();
935
+ }
936
+ }
937
+ }
938
+ }
939
+ function doWatch(source, cb, options = EMPTY_OBJ) {
940
+ const { immediate, deep, flush = "pre", once } = options;
941
+ if (!!(process.env.NODE_ENV !== "production") && !cb) {
942
+ if (immediate !== void 0) {
943
+ warn$1(
944
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
945
+ );
946
+ }
947
+ if (deep !== void 0) {
948
+ warn$1(
949
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
950
+ );
951
+ }
952
+ if (once !== void 0) {
953
+ warn$1(
954
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
955
+ );
956
+ }
957
+ }
958
+ const baseWatchOptions = extend({}, options);
959
+ if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
960
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
961
+ let ssrCleanup;
962
+ if (isInSSRComponentSetup) {
963
+ if (flush === "sync") {
964
+ const ctx = useSSRContext();
965
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
966
+ } else if (!runsImmediately) {
967
+ const watchStopHandle = () => {
968
+ };
969
+ watchStopHandle.stop = NOOP;
970
+ watchStopHandle.resume = NOOP;
971
+ watchStopHandle.pause = NOOP;
972
+ return watchStopHandle;
973
+ }
974
+ }
975
+ const instance = currentInstance;
976
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
977
+ const effect = new RenderWatcherEffect(
978
+ instance,
979
+ source,
980
+ cb,
981
+ baseWatchOptions,
982
+ flush
983
+ );
984
+ if (cb) {
985
+ effect.run(true);
986
+ } else if (flush === "post") {
987
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
988
+ } else {
989
+ effect.run(true);
990
+ }
991
+ const stop = effect.stop.bind(effect);
992
+ stop.pause = effect.pause.bind(effect);
993
+ stop.resume = effect.resume.bind(effect);
994
+ stop.stop = stop;
995
+ if (isInSSRComponentSetup) {
996
+ if (ssrCleanup) {
997
+ ssrCleanup.push(stop);
998
+ } else if (runsImmediately) {
999
+ stop();
1000
+ }
1001
+ }
1002
+ return stop;
1003
+ }
1004
+ function instanceWatch(source, value, options) {
1005
+ const publicThis = this.proxy;
1006
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
1007
+ let cb;
1008
+ if (isFunction(value)) {
1009
+ cb = value;
1010
+ } else {
1011
+ cb = value.handler;
1012
+ options = value;
1013
+ }
1014
+ const prev = setCurrentInstance(this);
1015
+ const res = doWatch(getter, cb.bind(publicThis), options);
1016
+ setCurrentInstance(...prev);
1017
+ return res;
1018
+ }
1019
+ function createPathGetter(ctx, path) {
1020
+ const segments = path.split(".");
1021
+ return () => {
1022
+ let cur = ctx;
1023
+ for (let i = 0; i < segments.length && cur; i++) {
1024
+ cur = cur[segments[i]];
1025
+ }
1026
+ return cur;
1027
+ };
1028
+ }
1029
+
1030
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
837
1031
  const isTeleport = (type) => type.__isTeleport;
838
1032
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
839
1033
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -1205,8 +1399,8 @@ function prepareAnchor(target, vnode, createText, insert) {
1205
1399
  return targetAnchor;
1206
1400
  }
1207
1401
 
1208
- const leaveCbKey = Symbol("_leaveCb");
1209
- const enterCbKey = Symbol("_enterCb");
1402
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
1403
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
1210
1404
  function useTransitionState() {
1211
1405
  const state = {
1212
1406
  isMounted: false,
@@ -2483,9 +2677,17 @@ function isMismatchAllowed(el, allowedType) {
2483
2677
  }
2484
2678
  }
2485
2679
 
2486
- const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
2487
- const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
2680
+ let requestIdleCallback;
2681
+ let cancelIdleCallback;
2682
+ function ensureIdleCallbacks() {
2683
+ if (!requestIdleCallback) {
2684
+ const g = getGlobalThis();
2685
+ requestIdleCallback = g.requestIdleCallback || ((cb) => setTimeout(cb, 1));
2686
+ cancelIdleCallback = g.cancelIdleCallback || ((id) => clearTimeout(id));
2687
+ }
2688
+ }
2488
2689
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
2690
+ ensureIdleCallbacks();
2489
2691
  const id = requestIdleCallback(hydrate, { timeout });
2490
2692
  return () => cancelIdleCallback(id);
2491
2693
  };
@@ -2843,7 +3045,9 @@ const KeepAliveImpl = {
2843
3045
  }
2844
3046
  function pruneCache(filter) {
2845
3047
  cache.forEach((vnode, key) => {
2846
- const name = getComponentName(vnode.type);
3048
+ const name = getComponentName(
3049
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
3050
+ );
2847
3051
  if (name && !filter(name)) {
2848
3052
  pruneCacheEntry(key);
2849
3053
  }
@@ -3145,7 +3349,7 @@ const DIRECTIVES = "directives";
3145
3349
  function resolveComponent(name, maybeSelfReference) {
3146
3350
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
3147
3351
  }
3148
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
3352
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
3149
3353
  function resolveDynamicComponent(component) {
3150
3354
  if (isString(component)) {
3151
3355
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -3336,14 +3540,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
3336
3540
  }
3337
3541
  }
3338
3542
 
3339
- function toHandlers(obj, preserveCaseIfNecessary) {
3543
+ function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
3340
3544
  const ret = {};
3341
3545
  if (!!(process.env.NODE_ENV !== "production") && !isObject(obj)) {
3342
3546
  warn$1(`v-on with no argument expects an object value.`);
3343
3547
  return ret;
3344
3548
  }
3345
3549
  for (const key in obj) {
3346
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
3550
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
3347
3551
  }
3348
3552
  return ret;
3349
3553
  }
@@ -4319,202 +4523,6 @@ If you want to remount the same app, move your app creation logic into a factory
4319
4523
  }
4320
4524
  let currentApp = null;
4321
4525
 
4322
- function provide(key, value) {
4323
- if (!!(process.env.NODE_ENV !== "production")) {
4324
- if (!currentInstance || currentInstance.isMounted) {
4325
- warn$1(`provide() can only be used inside setup().`);
4326
- }
4327
- }
4328
- if (currentInstance) {
4329
- let provides = currentInstance.provides;
4330
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
4331
- if (parentProvides === provides) {
4332
- provides = currentInstance.provides = Object.create(parentProvides);
4333
- }
4334
- provides[key] = value;
4335
- }
4336
- }
4337
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
4338
- const instance = getCurrentGenericInstance();
4339
- if (instance || currentApp) {
4340
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
4341
- if (provides && key in provides) {
4342
- return provides[key];
4343
- } else if (arguments.length > 1) {
4344
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
4345
- } else if (!!(process.env.NODE_ENV !== "production")) {
4346
- warn$1(`injection "${String(key)}" not found.`);
4347
- }
4348
- } else if (!!(process.env.NODE_ENV !== "production")) {
4349
- warn$1(`inject() can only be used inside setup() or functional components.`);
4350
- }
4351
- }
4352
- function hasInjectionContext() {
4353
- return !!(getCurrentGenericInstance() || currentApp);
4354
- }
4355
-
4356
- const ssrContextKey = Symbol.for("v-scx");
4357
- const useSSRContext = () => {
4358
- {
4359
- const ctx = inject(ssrContextKey);
4360
- if (!ctx) {
4361
- !!(process.env.NODE_ENV !== "production") && warn$1(
4362
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
4363
- );
4364
- }
4365
- return ctx;
4366
- }
4367
- };
4368
-
4369
- function watchEffect(effect, options) {
4370
- return doWatch(effect, null, options);
4371
- }
4372
- function watchPostEffect(effect, options) {
4373
- return doWatch(
4374
- effect,
4375
- null,
4376
- !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
4377
- );
4378
- }
4379
- function watchSyncEffect(effect, options) {
4380
- return doWatch(
4381
- effect,
4382
- null,
4383
- !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
4384
- );
4385
- }
4386
- function watch(source, cb, options) {
4387
- if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
4388
- warn$1(
4389
- `\`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.`
4390
- );
4391
- }
4392
- return doWatch(source, cb, options);
4393
- }
4394
- class RenderWatcherEffect extends WatcherEffect {
4395
- constructor(instance, source, cb, options, flush) {
4396
- super(source, cb, options);
4397
- this.flush = flush;
4398
- const job = () => {
4399
- if (this.dirty) {
4400
- this.run();
4401
- }
4402
- };
4403
- if (cb) {
4404
- this.flags |= 128;
4405
- job.flags |= 2;
4406
- }
4407
- if (instance) {
4408
- job.i = instance;
4409
- }
4410
- this.job = job;
4411
- }
4412
- notify() {
4413
- const flags = this.flags;
4414
- if (!(flags & 256)) {
4415
- const flush = this.flush;
4416
- const job = this.job;
4417
- if (flush === "post") {
4418
- queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
4419
- } else if (flush === "pre") {
4420
- queueJob(job, job.i ? job.i.uid : void 0, true);
4421
- } else {
4422
- job();
4423
- }
4424
- }
4425
- }
4426
- }
4427
- function doWatch(source, cb, options = EMPTY_OBJ) {
4428
- const { immediate, deep, flush = "pre", once } = options;
4429
- if (!!(process.env.NODE_ENV !== "production") && !cb) {
4430
- if (immediate !== void 0) {
4431
- warn$1(
4432
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
4433
- );
4434
- }
4435
- if (deep !== void 0) {
4436
- warn$1(
4437
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
4438
- );
4439
- }
4440
- if (once !== void 0) {
4441
- warn$1(
4442
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
4443
- );
4444
- }
4445
- }
4446
- const baseWatchOptions = extend({}, options);
4447
- if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
4448
- const runsImmediately = cb && immediate || !cb && flush !== "post";
4449
- let ssrCleanup;
4450
- if (isInSSRComponentSetup) {
4451
- if (flush === "sync") {
4452
- const ctx = useSSRContext();
4453
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4454
- } else if (!runsImmediately) {
4455
- const watchStopHandle = () => {
4456
- };
4457
- watchStopHandle.stop = NOOP;
4458
- watchStopHandle.resume = NOOP;
4459
- watchStopHandle.pause = NOOP;
4460
- return watchStopHandle;
4461
- }
4462
- }
4463
- const instance = currentInstance;
4464
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4465
- const effect = new RenderWatcherEffect(
4466
- instance,
4467
- source,
4468
- cb,
4469
- baseWatchOptions,
4470
- flush
4471
- );
4472
- if (cb) {
4473
- effect.run(true);
4474
- } else if (flush === "post") {
4475
- queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
4476
- } else {
4477
- effect.run(true);
4478
- }
4479
- const stop = effect.stop.bind(effect);
4480
- stop.pause = effect.pause.bind(effect);
4481
- stop.resume = effect.resume.bind(effect);
4482
- stop.stop = stop;
4483
- if (isInSSRComponentSetup) {
4484
- if (ssrCleanup) {
4485
- ssrCleanup.push(stop);
4486
- } else if (runsImmediately) {
4487
- stop();
4488
- }
4489
- }
4490
- return stop;
4491
- }
4492
- function instanceWatch(source, value, options) {
4493
- const publicThis = this.proxy;
4494
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
4495
- let cb;
4496
- if (isFunction(value)) {
4497
- cb = value;
4498
- } else {
4499
- cb = value.handler;
4500
- options = value;
4501
- }
4502
- const prev = setCurrentInstance(this);
4503
- const res = doWatch(getter, cb.bind(publicThis), options);
4504
- setCurrentInstance(...prev);
4505
- return res;
4506
- }
4507
- function createPathGetter(ctx, path) {
4508
- const segments = path.split(".");
4509
- return () => {
4510
- let cur = ctx;
4511
- for (let i = 0; i < segments.length && cur; i++) {
4512
- cur = cur[segments[i]];
4513
- }
4514
- return cur;
4515
- };
4516
- }
4517
-
4518
4526
  function useModel(props, name, options = EMPTY_OBJ) {
4519
4527
  const i = getCurrentGenericInstance();
4520
4528
  if (!!(process.env.NODE_ENV !== "production") && !i) {
@@ -5785,7 +5793,15 @@ function baseCreateRenderer(options, createHydrationFns) {
5785
5793
  } else {
5786
5794
  const el = n2.el = n1.el;
5787
5795
  if (n2.children !== n1.children) {
5788
- hostSetText(el, n2.children);
5796
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
5797
+ const childNodes = container.childNodes;
5798
+ const newChild = hostCreateText(n2.children);
5799
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
5800
+ hostInsert(newChild, container, oldChild);
5801
+ hostRemove(oldChild);
5802
+ } else {
5803
+ hostSetText(el, n2.children);
5804
+ }
5789
5805
  }
5790
5806
  }
5791
5807
  };
@@ -6169,7 +6185,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6169
6185
  } else {
6170
6186
  if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
6171
6187
  // of renderSlot() with no valid children
6172
- n1.dynamicChildren) {
6188
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
6173
6189
  patchBlockChildren(
6174
6190
  n1.dynamicChildren,
6175
6191
  dynamicChildren,
@@ -6870,8 +6886,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6870
6886
  const nextChild = c2[nextIndex];
6871
6887
  const anchorVNode = c2[nextIndex + 1];
6872
6888
  const anchor = nextIndex + 1 < l2 ? (
6873
- // #13559, fallback to el placeholder for unresolved async component
6874
- anchorVNode.el || anchorVNode.placeholder
6889
+ // #13559, #14173 fallback to el placeholder for unresolved async component
6890
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
6875
6891
  ) : parentAnchor;
6876
6892
  if (newIndexToOldIndexMap[i] === 0) {
6877
6893
  patch(
@@ -7176,9 +7192,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7176
7192
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7177
7193
  };
7178
7194
  const render = (vnode, container, namespace) => {
7195
+ let instance;
7179
7196
  if (vnode == null) {
7180
7197
  if (container._vnode) {
7181
7198
  unmount(container._vnode, null, null, true);
7199
+ instance = container._vnode.component;
7182
7200
  }
7183
7201
  } else {
7184
7202
  patch(
@@ -7192,7 +7210,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7192
7210
  );
7193
7211
  }
7194
7212
  container._vnode = vnode;
7195
- flushOnAppMount();
7213
+ flushOnAppMount(instance);
7196
7214
  };
7197
7215
  const internals = {
7198
7216
  p: patch,
@@ -7282,9 +7300,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7282
7300
  if (!shallow && c2.patchFlag !== -2)
7283
7301
  traverseStaticChildren(c1, c2);
7284
7302
  }
7285
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
7286
- c2.patchFlag !== -1) {
7287
- c2.el = c1.el;
7303
+ if (c2.type === Text) {
7304
+ if (c2.patchFlag !== -1) {
7305
+ c2.el = c1.el;
7306
+ } else {
7307
+ c2.__elIndex = i + // take fragment start anchor into account
7308
+ (n1.type === Fragment ? 1 : 0);
7309
+ }
7288
7310
  }
7289
7311
  if (c2.type === Comment && !c2.el) {
7290
7312
  c2.el = c1.el;
@@ -7320,16 +7342,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
7320
7342
  insert();
7321
7343
  }
7322
7344
  }
7323
- function performTransitionLeave(el, transition, remove, isElement = true) {
7345
+ function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
7324
7346
  const performRemove = () => {
7325
7347
  remove();
7326
7348
  if (transition && !transition.persisted && transition.afterLeave) {
7327
7349
  transition.afterLeave();
7328
7350
  }
7329
7351
  };
7330
- if (isElement && transition && !transition.persisted) {
7352
+ if (force || isElement && transition && !transition.persisted) {
7331
7353
  const { leave, delayLeave } = transition;
7332
- const performLeave = () => leave(el, performRemove);
7354
+ const performLeave = () => {
7355
+ if (el._isLeaving && force) {
7356
+ el[leaveCbKey](
7357
+ true
7358
+ /* cancelled */
7359
+ );
7360
+ }
7361
+ leave(el, performRemove);
7362
+ };
7333
7363
  if (delayLeave) {
7334
7364
  delayLeave(el, performRemove, performLeave);
7335
7365
  } else {
@@ -7385,6 +7415,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
7385
7415
  }
7386
7416
  return inheritedScopeIds;
7387
7417
  }
7418
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
7419
+ if (anchorVnode.placeholder) {
7420
+ return anchorVnode.placeholder;
7421
+ }
7422
+ const instance = anchorVnode.component;
7423
+ if (instance) {
7424
+ return resolveAsyncComponentPlaceholder(instance.subTree);
7425
+ }
7426
+ return null;
7427
+ }
7388
7428
 
7389
7429
  const isSuspense = (type) => type.__isSuspense;
7390
7430
  let suspenseId = 0;
@@ -7879,7 +7919,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
7879
7919
  parentSuspense,
7880
7920
  parentComponent,
7881
7921
  node.parentNode,
7882
- // eslint-disable-next-line no-restricted-globals
7922
+ // oxlint-disable-next-line no-restricted-globals
7883
7923
  document.createElement("div"),
7884
7924
  null,
7885
7925
  namespace,
@@ -7967,11 +8007,11 @@ function isVNodeSuspensible(vnode) {
7967
8007
  return suspensible != null && suspensible !== false;
7968
8008
  }
7969
8009
 
7970
- const Fragment = Symbol.for("v-fgt");
7971
- const Text = Symbol.for("v-txt");
7972
- const Comment = Symbol.for("v-cmt");
7973
- const Static = Symbol.for("v-stc");
7974
- const VaporSlot = Symbol.for("v-vps");
8010
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
8011
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
8012
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
8013
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
8014
+ const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
7975
8015
  const blockStack = [];
7976
8016
  let currentBlock = null;
7977
8017
  function openBlock(disableTracking = false) {
@@ -8375,7 +8415,7 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
8375
8415
  simpleSetCurrentInstance(instance);
8376
8416
  }
8377
8417
  };
8378
- const internalOptions = ["ce", "type"];
8418
+ const internalOptions = ["ce", "type", "uid"];
8379
8419
  const useInstanceOption = (key, silent = false) => {
8380
8420
  const instance = getCurrentGenericInstance();
8381
8421
  if (!instance) {
@@ -8395,7 +8435,7 @@ const useInstanceOption = (key, silent = false) => {
8395
8435
  return { hasInstance: true, value: instance[key] };
8396
8436
  };
8397
8437
 
8398
- const emptyAppContext = createAppContext();
8438
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
8399
8439
  let uid = 0;
8400
8440
  function nextUid() {
8401
8441
  return uid++;
@@ -9044,7 +9084,7 @@ function isMemoSame(cached, memo) {
9044
9084
  return true;
9045
9085
  }
9046
9086
 
9047
- const version = "3.6.0-alpha.7";
9087
+ const version = "3.6.0-beta.2";
9048
9088
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
9049
9089
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9050
9090
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;