@vue/runtime-core 3.6.0-alpha.7 → 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.
- package/dist/runtime-core.cjs.js +266 -223
- package/dist/runtime-core.cjs.prod.js +223 -186
- package/dist/runtime-core.d.ts +9 -9
- package/dist/runtime-core.esm-bundler.js +259 -225
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-
|
|
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
|
**/
|
|
@@ -379,10 +379,10 @@ function flushPostFlushCbs(seen) {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
let isFlushing = false;
|
|
382
|
-
function flushOnAppMount() {
|
|
382
|
+
function flushOnAppMount(instance) {
|
|
383
383
|
if (!isFlushing) {
|
|
384
384
|
isFlushing = true;
|
|
385
|
-
flushPreFlushCbs();
|
|
385
|
+
flushPreFlushCbs(instance);
|
|
386
386
|
flushPostFlushCbs();
|
|
387
387
|
isFlushing = false;
|
|
388
388
|
}
|
|
@@ -521,7 +521,166 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
|
|
524
|
+
function provide(key, value) {
|
|
525
|
+
if (currentInstance) {
|
|
526
|
+
let provides = currentInstance.provides;
|
|
527
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
528
|
+
if (parentProvides === provides) {
|
|
529
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
530
|
+
}
|
|
531
|
+
provides[key] = value;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
535
|
+
const instance = getCurrentGenericInstance();
|
|
536
|
+
if (instance || currentApp) {
|
|
537
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
538
|
+
if (provides && key in provides) {
|
|
539
|
+
return provides[key];
|
|
540
|
+
} else if (arguments.length > 1) {
|
|
541
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
542
|
+
} else ;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function hasInjectionContext() {
|
|
546
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
550
|
+
const useSSRContext = () => {
|
|
551
|
+
{
|
|
552
|
+
const ctx = inject(ssrContextKey);
|
|
553
|
+
return ctx;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
function watchEffect(effect, options) {
|
|
558
|
+
return doWatch(effect, null, options);
|
|
559
|
+
}
|
|
560
|
+
function watchPostEffect(effect, options) {
|
|
561
|
+
return doWatch(
|
|
562
|
+
effect,
|
|
563
|
+
null,
|
|
564
|
+
{ flush: "post" }
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
function watchSyncEffect(effect, options) {
|
|
568
|
+
return doWatch(
|
|
569
|
+
effect,
|
|
570
|
+
null,
|
|
571
|
+
{ flush: "sync" }
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
function watch(source, cb, options) {
|
|
575
|
+
return doWatch(source, cb, options);
|
|
576
|
+
}
|
|
577
|
+
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
578
|
+
constructor(instance, source, cb, options, flush) {
|
|
579
|
+
super(source, cb, options);
|
|
580
|
+
this.flush = flush;
|
|
581
|
+
const job = () => {
|
|
582
|
+
if (this.dirty) {
|
|
583
|
+
this.run();
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
if (cb) {
|
|
587
|
+
this.flags |= 128;
|
|
588
|
+
job.flags |= 2;
|
|
589
|
+
}
|
|
590
|
+
if (instance) {
|
|
591
|
+
job.i = instance;
|
|
592
|
+
}
|
|
593
|
+
this.job = job;
|
|
594
|
+
}
|
|
595
|
+
notify() {
|
|
596
|
+
const flags = this.flags;
|
|
597
|
+
if (!(flags & 256)) {
|
|
598
|
+
const flush = this.flush;
|
|
599
|
+
const job = this.job;
|
|
600
|
+
if (flush === "post") {
|
|
601
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
602
|
+
} else if (flush === "pre") {
|
|
603
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
604
|
+
} else {
|
|
605
|
+
job();
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
611
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
612
|
+
const baseWatchOptions = shared.extend({}, options);
|
|
613
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
614
|
+
let ssrCleanup;
|
|
615
|
+
if (isInSSRComponentSetup) {
|
|
616
|
+
if (flush === "sync") {
|
|
617
|
+
const ctx = useSSRContext();
|
|
618
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
619
|
+
} else if (!runsImmediately) {
|
|
620
|
+
const watchStopHandle = () => {
|
|
621
|
+
};
|
|
622
|
+
watchStopHandle.stop = shared.NOOP;
|
|
623
|
+
watchStopHandle.resume = shared.NOOP;
|
|
624
|
+
watchStopHandle.pause = shared.NOOP;
|
|
625
|
+
return watchStopHandle;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
const instance = currentInstance;
|
|
629
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
630
|
+
const effect = new RenderWatcherEffect(
|
|
631
|
+
instance,
|
|
632
|
+
source,
|
|
633
|
+
cb,
|
|
634
|
+
baseWatchOptions,
|
|
635
|
+
flush
|
|
636
|
+
);
|
|
637
|
+
if (cb) {
|
|
638
|
+
effect.run(true);
|
|
639
|
+
} else if (flush === "post") {
|
|
640
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
641
|
+
} else {
|
|
642
|
+
effect.run(true);
|
|
643
|
+
}
|
|
644
|
+
const stop = effect.stop.bind(effect);
|
|
645
|
+
stop.pause = effect.pause.bind(effect);
|
|
646
|
+
stop.resume = effect.resume.bind(effect);
|
|
647
|
+
stop.stop = stop;
|
|
648
|
+
if (isInSSRComponentSetup) {
|
|
649
|
+
if (ssrCleanup) {
|
|
650
|
+
ssrCleanup.push(stop);
|
|
651
|
+
} else if (runsImmediately) {
|
|
652
|
+
stop();
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return stop;
|
|
656
|
+
}
|
|
657
|
+
function instanceWatch(source, value, options) {
|
|
658
|
+
const publicThis = this.proxy;
|
|
659
|
+
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
660
|
+
let cb;
|
|
661
|
+
if (shared.isFunction(value)) {
|
|
662
|
+
cb = value;
|
|
663
|
+
} else {
|
|
664
|
+
cb = value.handler;
|
|
665
|
+
options = value;
|
|
666
|
+
}
|
|
667
|
+
const prev = setCurrentInstance(this);
|
|
668
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
669
|
+
setCurrentInstance(...prev);
|
|
670
|
+
return res;
|
|
671
|
+
}
|
|
672
|
+
function createPathGetter(ctx, path) {
|
|
673
|
+
const segments = path.split(".");
|
|
674
|
+
return () => {
|
|
675
|
+
let cur = ctx;
|
|
676
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
677
|
+
cur = cur[segments[i]];
|
|
678
|
+
}
|
|
679
|
+
return cur;
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
525
684
|
const isTeleport = (type) => type.__isTeleport;
|
|
526
685
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
527
686
|
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
|
|
@@ -866,8 +1025,8 @@ function prepareAnchor(target, vnode, createText, insert) {
|
|
|
866
1025
|
return targetAnchor;
|
|
867
1026
|
}
|
|
868
1027
|
|
|
869
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
870
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1028
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
1029
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
871
1030
|
function useTransitionState() {
|
|
872
1031
|
const state = {
|
|
873
1032
|
isMounted: false,
|
|
@@ -2225,7 +2384,9 @@ const KeepAliveImpl = {
|
|
|
2225
2384
|
}
|
|
2226
2385
|
function pruneCache(filter) {
|
|
2227
2386
|
cache.forEach((vnode, key) => {
|
|
2228
|
-
const name = getComponentName(
|
|
2387
|
+
const name = getComponentName(
|
|
2388
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
|
|
2389
|
+
);
|
|
2229
2390
|
if (name && !filter(name)) {
|
|
2230
2391
|
pruneCacheEntry(key);
|
|
2231
2392
|
}
|
|
@@ -2510,7 +2671,7 @@ const DIRECTIVES = "directives";
|
|
|
2510
2671
|
function resolveComponent(name, maybeSelfReference) {
|
|
2511
2672
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2512
2673
|
}
|
|
2513
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2674
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
2514
2675
|
function resolveDynamicComponent(component) {
|
|
2515
2676
|
if (shared.isString(component)) {
|
|
2516
2677
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -2683,10 +2844,10 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
2683
2844
|
}
|
|
2684
2845
|
}
|
|
2685
2846
|
|
|
2686
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
2847
|
+
function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
|
|
2687
2848
|
const ret = {};
|
|
2688
2849
|
for (const key in obj) {
|
|
2689
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
2850
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
|
|
2690
2851
|
}
|
|
2691
2852
|
return ret;
|
|
2692
2853
|
}
|
|
@@ -3376,165 +3537,6 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3376
3537
|
}
|
|
3377
3538
|
let currentApp = null;
|
|
3378
3539
|
|
|
3379
|
-
function provide(key, value) {
|
|
3380
|
-
if (currentInstance) {
|
|
3381
|
-
let provides = currentInstance.provides;
|
|
3382
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
3383
|
-
if (parentProvides === provides) {
|
|
3384
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
3385
|
-
}
|
|
3386
|
-
provides[key] = value;
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
3390
|
-
const instance = getCurrentGenericInstance();
|
|
3391
|
-
if (instance || currentApp) {
|
|
3392
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
3393
|
-
if (provides && key in provides) {
|
|
3394
|
-
return provides[key];
|
|
3395
|
-
} else if (arguments.length > 1) {
|
|
3396
|
-
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
3397
|
-
} else ;
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
function hasInjectionContext() {
|
|
3401
|
-
return !!(getCurrentGenericInstance() || currentApp);
|
|
3402
|
-
}
|
|
3403
|
-
|
|
3404
|
-
const ssrContextKey = Symbol.for("v-scx");
|
|
3405
|
-
const useSSRContext = () => {
|
|
3406
|
-
{
|
|
3407
|
-
const ctx = inject(ssrContextKey);
|
|
3408
|
-
return ctx;
|
|
3409
|
-
}
|
|
3410
|
-
};
|
|
3411
|
-
|
|
3412
|
-
function watchEffect(effect, options) {
|
|
3413
|
-
return doWatch(effect, null, options);
|
|
3414
|
-
}
|
|
3415
|
-
function watchPostEffect(effect, options) {
|
|
3416
|
-
return doWatch(
|
|
3417
|
-
effect,
|
|
3418
|
-
null,
|
|
3419
|
-
{ flush: "post" }
|
|
3420
|
-
);
|
|
3421
|
-
}
|
|
3422
|
-
function watchSyncEffect(effect, options) {
|
|
3423
|
-
return doWatch(
|
|
3424
|
-
effect,
|
|
3425
|
-
null,
|
|
3426
|
-
{ flush: "sync" }
|
|
3427
|
-
);
|
|
3428
|
-
}
|
|
3429
|
-
function watch(source, cb, options) {
|
|
3430
|
-
return doWatch(source, cb, options);
|
|
3431
|
-
}
|
|
3432
|
-
class RenderWatcherEffect extends reactivity.WatcherEffect {
|
|
3433
|
-
constructor(instance, source, cb, options, flush) {
|
|
3434
|
-
super(source, cb, options);
|
|
3435
|
-
this.flush = flush;
|
|
3436
|
-
const job = () => {
|
|
3437
|
-
if (this.dirty) {
|
|
3438
|
-
this.run();
|
|
3439
|
-
}
|
|
3440
|
-
};
|
|
3441
|
-
if (cb) {
|
|
3442
|
-
this.flags |= 128;
|
|
3443
|
-
job.flags |= 2;
|
|
3444
|
-
}
|
|
3445
|
-
if (instance) {
|
|
3446
|
-
job.i = instance;
|
|
3447
|
-
}
|
|
3448
|
-
this.job = job;
|
|
3449
|
-
}
|
|
3450
|
-
notify() {
|
|
3451
|
-
const flags = this.flags;
|
|
3452
|
-
if (!(flags & 256)) {
|
|
3453
|
-
const flush = this.flush;
|
|
3454
|
-
const job = this.job;
|
|
3455
|
-
if (flush === "post") {
|
|
3456
|
-
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
3457
|
-
} else if (flush === "pre") {
|
|
3458
|
-
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
3459
|
-
} else {
|
|
3460
|
-
job();
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
3466
|
-
const { immediate, deep, flush = "pre", once } = options;
|
|
3467
|
-
const baseWatchOptions = shared.extend({}, options);
|
|
3468
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
3469
|
-
let ssrCleanup;
|
|
3470
|
-
if (isInSSRComponentSetup) {
|
|
3471
|
-
if (flush === "sync") {
|
|
3472
|
-
const ctx = useSSRContext();
|
|
3473
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
3474
|
-
} else if (!runsImmediately) {
|
|
3475
|
-
const watchStopHandle = () => {
|
|
3476
|
-
};
|
|
3477
|
-
watchStopHandle.stop = shared.NOOP;
|
|
3478
|
-
watchStopHandle.resume = shared.NOOP;
|
|
3479
|
-
watchStopHandle.pause = shared.NOOP;
|
|
3480
|
-
return watchStopHandle;
|
|
3481
|
-
}
|
|
3482
|
-
}
|
|
3483
|
-
const instance = currentInstance;
|
|
3484
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
3485
|
-
const effect = new RenderWatcherEffect(
|
|
3486
|
-
instance,
|
|
3487
|
-
source,
|
|
3488
|
-
cb,
|
|
3489
|
-
baseWatchOptions,
|
|
3490
|
-
flush
|
|
3491
|
-
);
|
|
3492
|
-
if (cb) {
|
|
3493
|
-
effect.run(true);
|
|
3494
|
-
} else if (flush === "post") {
|
|
3495
|
-
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
3496
|
-
} else {
|
|
3497
|
-
effect.run(true);
|
|
3498
|
-
}
|
|
3499
|
-
const stop = effect.stop.bind(effect);
|
|
3500
|
-
stop.pause = effect.pause.bind(effect);
|
|
3501
|
-
stop.resume = effect.resume.bind(effect);
|
|
3502
|
-
stop.stop = stop;
|
|
3503
|
-
if (isInSSRComponentSetup) {
|
|
3504
|
-
if (ssrCleanup) {
|
|
3505
|
-
ssrCleanup.push(stop);
|
|
3506
|
-
} else if (runsImmediately) {
|
|
3507
|
-
stop();
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
return stop;
|
|
3511
|
-
}
|
|
3512
|
-
function instanceWatch(source, value, options) {
|
|
3513
|
-
const publicThis = this.proxy;
|
|
3514
|
-
const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
3515
|
-
let cb;
|
|
3516
|
-
if (shared.isFunction(value)) {
|
|
3517
|
-
cb = value;
|
|
3518
|
-
} else {
|
|
3519
|
-
cb = value.handler;
|
|
3520
|
-
options = value;
|
|
3521
|
-
}
|
|
3522
|
-
const prev = setCurrentInstance(this);
|
|
3523
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3524
|
-
setCurrentInstance(...prev);
|
|
3525
|
-
return res;
|
|
3526
|
-
}
|
|
3527
|
-
function createPathGetter(ctx, path) {
|
|
3528
|
-
const segments = path.split(".");
|
|
3529
|
-
return () => {
|
|
3530
|
-
let cur = ctx;
|
|
3531
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
3532
|
-
cur = cur[segments[i]];
|
|
3533
|
-
}
|
|
3534
|
-
return cur;
|
|
3535
|
-
};
|
|
3536
|
-
}
|
|
3537
|
-
|
|
3538
3540
|
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
3539
3541
|
const i = getCurrentGenericInstance();
|
|
3540
3542
|
const camelizedName = shared.camelize(name);
|
|
@@ -4298,6 +4300,14 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4298
4300
|
}
|
|
4299
4301
|
};
|
|
4300
4302
|
|
|
4303
|
+
const MoveType = {
|
|
4304
|
+
"ENTER": 0,
|
|
4305
|
+
"0": "ENTER",
|
|
4306
|
+
"LEAVE": 1,
|
|
4307
|
+
"1": "LEAVE",
|
|
4308
|
+
"REORDER": 2,
|
|
4309
|
+
"2": "REORDER"
|
|
4310
|
+
};
|
|
4301
4311
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
4302
4312
|
function createRenderer(options) {
|
|
4303
4313
|
return baseCreateRenderer(options);
|
|
@@ -4439,7 +4449,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4439
4449
|
} else {
|
|
4440
4450
|
const el = n2.el = n1.el;
|
|
4441
4451
|
if (n2.children !== n1.children) {
|
|
4442
|
-
|
|
4452
|
+
{
|
|
4453
|
+
hostSetText(el, n2.children);
|
|
4454
|
+
}
|
|
4443
4455
|
}
|
|
4444
4456
|
}
|
|
4445
4457
|
};
|
|
@@ -4787,7 +4799,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4787
4799
|
} else {
|
|
4788
4800
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
4789
4801
|
// of renderSlot() with no valid children
|
|
4790
|
-
n1.dynamicChildren) {
|
|
4802
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
4791
4803
|
patchBlockChildren(
|
|
4792
4804
|
n1.dynamicChildren,
|
|
4793
4805
|
dynamicChildren,
|
|
@@ -5397,8 +5409,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5397
5409
|
const nextChild = c2[nextIndex];
|
|
5398
5410
|
const anchorVNode = c2[nextIndex + 1];
|
|
5399
5411
|
const anchor = nextIndex + 1 < l2 ? (
|
|
5400
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
5401
|
-
anchorVNode.el || anchorVNode
|
|
5412
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
5413
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
5402
5414
|
) : parentAnchor;
|
|
5403
5415
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
5404
5416
|
patch(
|
|
@@ -5689,9 +5701,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5689
5701
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5690
5702
|
};
|
|
5691
5703
|
const render = (vnode, container, namespace) => {
|
|
5704
|
+
let instance;
|
|
5692
5705
|
if (vnode == null) {
|
|
5693
5706
|
if (container._vnode) {
|
|
5694
5707
|
unmount(container._vnode, null, null, true);
|
|
5708
|
+
instance = container._vnode.component;
|
|
5695
5709
|
}
|
|
5696
5710
|
} else {
|
|
5697
5711
|
patch(
|
|
@@ -5705,7 +5719,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5705
5719
|
);
|
|
5706
5720
|
}
|
|
5707
5721
|
container._vnode = vnode;
|
|
5708
|
-
flushOnAppMount();
|
|
5722
|
+
flushOnAppMount(instance);
|
|
5709
5723
|
};
|
|
5710
5724
|
const internals = {
|
|
5711
5725
|
p: patch,
|
|
@@ -5788,9 +5802,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5788
5802
|
if (!shallow && c2.patchFlag !== -2)
|
|
5789
5803
|
traverseStaticChildren(c1, c2);
|
|
5790
5804
|
}
|
|
5791
|
-
if (c2.type === Text
|
|
5792
|
-
|
|
5793
|
-
|
|
5805
|
+
if (c2.type === Text) {
|
|
5806
|
+
if (c2.patchFlag !== -1) {
|
|
5807
|
+
c2.el = c1.el;
|
|
5808
|
+
} else {
|
|
5809
|
+
c2.__elIndex = i + // take fragment start anchor into account
|
|
5810
|
+
(n1.type === Fragment ? 1 : 0);
|
|
5811
|
+
}
|
|
5794
5812
|
}
|
|
5795
5813
|
if (c2.type === Comment && !c2.el) {
|
|
5796
5814
|
c2.el = c1.el;
|
|
@@ -5823,16 +5841,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
5823
5841
|
insert();
|
|
5824
5842
|
}
|
|
5825
5843
|
}
|
|
5826
|
-
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
5844
|
+
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
5827
5845
|
const performRemove = () => {
|
|
5828
5846
|
remove();
|
|
5829
5847
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
5830
5848
|
transition.afterLeave();
|
|
5831
5849
|
}
|
|
5832
5850
|
};
|
|
5833
|
-
if (isElement && transition && !transition.persisted) {
|
|
5851
|
+
if (force || isElement && transition && !transition.persisted) {
|
|
5834
5852
|
const { leave, delayLeave } = transition;
|
|
5835
|
-
const performLeave = () =>
|
|
5853
|
+
const performLeave = () => {
|
|
5854
|
+
if (el._isLeaving && force) {
|
|
5855
|
+
el[leaveCbKey](
|
|
5856
|
+
true
|
|
5857
|
+
/* cancelled */
|
|
5858
|
+
);
|
|
5859
|
+
}
|
|
5860
|
+
leave(el, performRemove);
|
|
5861
|
+
};
|
|
5836
5862
|
if (delayLeave) {
|
|
5837
5863
|
delayLeave(el, performRemove, performLeave);
|
|
5838
5864
|
} else {
|
|
@@ -5873,6 +5899,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
5873
5899
|
}
|
|
5874
5900
|
return inheritedScopeIds;
|
|
5875
5901
|
}
|
|
5902
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
5903
|
+
if (anchorVnode.placeholder) {
|
|
5904
|
+
return anchorVnode.placeholder;
|
|
5905
|
+
}
|
|
5906
|
+
const instance = anchorVnode.component;
|
|
5907
|
+
if (instance) {
|
|
5908
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5909
|
+
}
|
|
5910
|
+
return null;
|
|
5911
|
+
}
|
|
5876
5912
|
|
|
5877
5913
|
const isSuspense = (type) => type.__isSuspense;
|
|
5878
5914
|
let suspenseId = 0;
|
|
@@ -6430,11 +6466,11 @@ function isVNodeSuspensible(vnode) {
|
|
|
6430
6466
|
return suspensible != null && suspensible !== false;
|
|
6431
6467
|
}
|
|
6432
6468
|
|
|
6433
|
-
const Fragment = Symbol.for("v-fgt");
|
|
6434
|
-
const Text = Symbol.for("v-txt");
|
|
6435
|
-
const Comment = Symbol.for("v-cmt");
|
|
6436
|
-
const Static = Symbol.for("v-stc");
|
|
6437
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
6469
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
6470
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
6471
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
6472
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
6473
|
+
const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
|
|
6438
6474
|
const blockStack = [];
|
|
6439
6475
|
let currentBlock = null;
|
|
6440
6476
|
function openBlock(disableTracking = false) {
|
|
@@ -7158,7 +7194,7 @@ function isMemoSame(cached, memo) {
|
|
|
7158
7194
|
return true;
|
|
7159
7195
|
}
|
|
7160
7196
|
|
|
7161
|
-
const version = "3.6.0-
|
|
7197
|
+
const version = "3.6.0-beta.1";
|
|
7162
7198
|
const warn$1 = shared.NOOP;
|
|
7163
7199
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
7164
7200
|
const devtools = void 0;
|
|
@@ -7226,6 +7262,7 @@ exports.ErrorCodes = ErrorCodes;
|
|
|
7226
7262
|
exports.ErrorTypeStrings = ErrorTypeStrings;
|
|
7227
7263
|
exports.Fragment = Fragment;
|
|
7228
7264
|
exports.KeepAlive = KeepAlive;
|
|
7265
|
+
exports.MoveType = MoveType;
|
|
7229
7266
|
exports.Static = Static;
|
|
7230
7267
|
exports.Suspense = Suspense;
|
|
7231
7268
|
exports.Teleport = Teleport;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<Type
|
|
|
209
209
|
export type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
210
210
|
readonly [K in BKeys]-?: boolean;
|
|
211
211
|
};
|
|
212
|
-
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ?
|
|
212
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? T[K] extends boolean | undefined ? T[K] extends never | undefined ? never : K : never : never;
|
|
213
213
|
/**
|
|
214
214
|
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
215
215
|
* events. The expected argument is the same as the component `emits` option.
|
|
@@ -479,7 +479,7 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
|
|
|
479
479
|
__isFragment?: never;
|
|
480
480
|
__isTeleport?: never;
|
|
481
481
|
__isSuspense?: never;
|
|
482
|
-
new (
|
|
482
|
+
new (...args: any[]): T;
|
|
483
483
|
};
|
|
484
484
|
/**
|
|
485
485
|
* @deprecated This is no longer used internally, but exported and relied on by
|
|
@@ -558,7 +558,7 @@ declare const SuspenseImpl: {
|
|
|
558
558
|
};
|
|
559
559
|
export declare const Suspense: {
|
|
560
560
|
__isSuspense: true;
|
|
561
|
-
new (
|
|
561
|
+
new (): {
|
|
562
562
|
$props: VNodeProps & SuspenseProps;
|
|
563
563
|
$slots: {
|
|
564
564
|
default(): VNode[];
|
|
@@ -720,7 +720,7 @@ type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | nul
|
|
|
720
720
|
type RemoveFn = (vnode: VNode) => void;
|
|
721
721
|
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
722
722
|
type UnmountComponentFn = (instance: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null, doRemove?: boolean) => void;
|
|
723
|
-
declare enum MoveType {
|
|
723
|
+
export declare enum MoveType {
|
|
724
724
|
ENTER = 0,
|
|
725
725
|
LEAVE = 1,
|
|
726
726
|
REORDER = 2
|
|
@@ -758,7 +758,7 @@ export interface KeepAliveContext extends ComponentRenderContext {
|
|
|
758
758
|
}
|
|
759
759
|
export declare const KeepAlive: {
|
|
760
760
|
__isKeepAlive: true;
|
|
761
|
-
new (
|
|
761
|
+
new (): {
|
|
762
762
|
$props: VNodeProps & KeepAliveProps;
|
|
763
763
|
$slots: {
|
|
764
764
|
default(): VNode[];
|
|
@@ -1187,7 +1187,7 @@ declare function moveTeleport(vnode: VNode, container: RendererElement, parentAn
|
|
|
1187
1187
|
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
|
1188
1188
|
export declare const Teleport: {
|
|
1189
1189
|
__isTeleport: true;
|
|
1190
|
-
new (
|
|
1190
|
+
new (): {
|
|
1191
1191
|
$props: VNodeProps & TeleportProps;
|
|
1192
1192
|
$slots: {
|
|
1193
1193
|
default(): VNode[];
|
|
@@ -1376,7 +1376,7 @@ type Data = Record<string, unknown>;
|
|
|
1376
1376
|
* ```
|
|
1377
1377
|
*/
|
|
1378
1378
|
export type ComponentInstance<T> = T extends {
|
|
1379
|
-
new (
|
|
1379
|
+
new (): ComponentPublicInstance;
|
|
1380
1380
|
} ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer PropsOrInstance, infer RawBindings, infer D, infer C, infer M> ? PropsOrInstance extends {
|
|
1381
1381
|
$props: unknown;
|
|
1382
1382
|
} ? PropsOrInstance : ComponentPublicInstance<unknown extends PropsOrInstance ? {} : PropsOrInstance, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
|
|
@@ -1644,7 +1644,7 @@ interface Constructor<P = any> {
|
|
|
1644
1644
|
__isFragment?: never;
|
|
1645
1645
|
__isTeleport?: never;
|
|
1646
1646
|
__isSuspense?: never;
|
|
1647
|
-
new (
|
|
1647
|
+
new (...args: any[]): {
|
|
1648
1648
|
$props: P;
|
|
1649
1649
|
};
|
|
1650
1650
|
}
|
|
@@ -1782,7 +1782,7 @@ export declare function renderList<T>(source: T, renderItem: <K extends keyof T>
|
|
|
1782
1782
|
* For prefixing keys in v-on="obj" with "on"
|
|
1783
1783
|
* @private
|
|
1784
1784
|
*/
|
|
1785
|
-
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1785
|
+
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean, needWrap?: boolean): Record<string, any>;
|
|
1786
1786
|
|
|
1787
1787
|
/**
|
|
1788
1788
|
* Compiler runtime helper for rendering `<slot/>`
|