@vue/runtime-core 3.2.44 → 3.2.46
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/README.md +3 -3
- package/dist/runtime-core.cjs.js +117 -66
- package/dist/runtime-core.cjs.prod.js +69 -37
- package/dist/runtime-core.d.ts +22 -25
- package/dist/runtime-core.esm-bundler.js +121 -69
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy,
|
|
1
|
+
import { pauseTracking, resetTracking, isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
|
|
2
2
|
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey,
|
|
3
|
+
import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, invokeArrayFns, isRegExp, isBuiltInDirective, capitalize, isGloballyWhitelisted, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, NO, normalizeClass, normalizeStyle } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
const stack = [];
|
|
@@ -118,6 +118,22 @@ function formatProp(key, value, raw) {
|
|
|
118
118
|
return raw ? value : [`${key}=`, value];
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
function assertNumber(val, type) {
|
|
125
|
+
if (!(process.env.NODE_ENV !== 'production'))
|
|
126
|
+
return;
|
|
127
|
+
if (val === undefined) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
else if (typeof val !== 'number') {
|
|
131
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
132
|
+
}
|
|
133
|
+
else if (isNaN(val)) {
|
|
134
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
121
137
|
|
|
122
138
|
const ErrorTypeStrings = {
|
|
123
139
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -520,12 +536,6 @@ function reload(id, newComp) {
|
|
|
520
536
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
521
537
|
// don't end up forcing the same parent to re-render multiple times.
|
|
522
538
|
queueJob(instance.parent.update);
|
|
523
|
-
// instance is the inner component of an async custom element
|
|
524
|
-
// invoke to reset styles
|
|
525
|
-
if (instance.parent.type.__asyncLoader &&
|
|
526
|
-
instance.parent.ceReload) {
|
|
527
|
-
instance.parent.ceReload(newComp.styles);
|
|
528
|
-
}
|
|
529
539
|
}
|
|
530
540
|
else if (instance.appContext.reload) {
|
|
531
541
|
// root instance mounted via createApp() has a reload method
|
|
@@ -570,7 +580,7 @@ function tryWrap(fn) {
|
|
|
570
580
|
let devtools;
|
|
571
581
|
let buffer = [];
|
|
572
582
|
let devtoolsNotInstalled = false;
|
|
573
|
-
function emit(event, ...args) {
|
|
583
|
+
function emit$1(event, ...args) {
|
|
574
584
|
if (devtools) {
|
|
575
585
|
devtools.emit(event, ...args);
|
|
576
586
|
}
|
|
@@ -617,7 +627,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
617
627
|
}
|
|
618
628
|
}
|
|
619
629
|
function devtoolsInitApp(app, version) {
|
|
620
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
630
|
+
emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
621
631
|
Fragment,
|
|
622
632
|
Text,
|
|
623
633
|
Comment,
|
|
@@ -625,7 +635,7 @@ function devtoolsInitApp(app, version) {
|
|
|
625
635
|
});
|
|
626
636
|
}
|
|
627
637
|
function devtoolsUnmountApp(app) {
|
|
628
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
638
|
+
emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
629
639
|
}
|
|
630
640
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
631
641
|
const devtoolsComponentUpdated =
|
|
@@ -641,21 +651,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
641
651
|
};
|
|
642
652
|
function createDevtoolsComponentHook(hook) {
|
|
643
653
|
return (component) => {
|
|
644
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
654
|
+
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
645
655
|
};
|
|
646
656
|
}
|
|
647
657
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
648
658
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
649
659
|
function createDevtoolsPerformanceHook(hook) {
|
|
650
660
|
return (component, type, time) => {
|
|
651
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
661
|
+
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
652
662
|
};
|
|
653
663
|
}
|
|
654
664
|
function devtoolsComponentEmit(component, event, params) {
|
|
655
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
665
|
+
emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
656
666
|
}
|
|
657
667
|
|
|
658
|
-
function emit
|
|
668
|
+
function emit(instance, event, ...rawArgs) {
|
|
659
669
|
if (instance.isUnmounted)
|
|
660
670
|
return;
|
|
661
671
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -691,7 +701,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
691
701
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
692
702
|
}
|
|
693
703
|
if (number) {
|
|
694
|
-
args = rawArgs.map(
|
|
704
|
+
args = rawArgs.map(looseToNumber);
|
|
695
705
|
}
|
|
696
706
|
}
|
|
697
707
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -1340,7 +1350,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1340
1350
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
1341
1351
|
}
|
|
1342
1352
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
1343
|
-
const timeout =
|
|
1353
|
+
const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
|
|
1354
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
1355
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
1356
|
+
}
|
|
1344
1357
|
const suspense = {
|
|
1345
1358
|
vnode,
|
|
1346
1359
|
parent,
|
|
@@ -1658,12 +1671,10 @@ function watchEffect(effect, options) {
|
|
|
1658
1671
|
return doWatch(effect, null, options);
|
|
1659
1672
|
}
|
|
1660
1673
|
function watchPostEffect(effect, options) {
|
|
1661
|
-
return doWatch(effect, null, (
|
|
1662
|
-
? Object.assign(Object.assign({}, options), { flush: 'post' }) : { flush: 'post' }));
|
|
1674
|
+
return doWatch(effect, null, (process.env.NODE_ENV !== 'production') ? Object.assign(Object.assign({}, options), { flush: 'post' }) : { flush: 'post' });
|
|
1663
1675
|
}
|
|
1664
1676
|
function watchSyncEffect(effect, options) {
|
|
1665
|
-
return doWatch(effect, null, (
|
|
1666
|
-
? Object.assign(Object.assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
|
|
1677
|
+
return doWatch(effect, null, (process.env.NODE_ENV !== 'production') ? Object.assign(Object.assign({}, options), { flush: 'sync' }) : { flush: 'sync' });
|
|
1667
1678
|
}
|
|
1668
1679
|
// initial value for watchers to trigger on undefined initial values
|
|
1669
1680
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -1691,7 +1702,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
1691
1702
|
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
1692
1703
|
`a reactive object, or an array of these types.`);
|
|
1693
1704
|
};
|
|
1694
|
-
const instance = currentInstance;
|
|
1705
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
1706
|
+
// const instance = currentInstance
|
|
1695
1707
|
let getter;
|
|
1696
1708
|
let forceTrigger = false;
|
|
1697
1709
|
let isMultiSource = false;
|
|
@@ -1802,7 +1814,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
1802
1814
|
// pass undefined as the old value when it's changed for the first time
|
|
1803
1815
|
oldValue === INITIAL_WATCHER_VALUE
|
|
1804
1816
|
? undefined
|
|
1805
|
-
:
|
|
1817
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
1806
1818
|
? []
|
|
1807
1819
|
: oldValue,
|
|
1808
1820
|
onCleanup
|
|
@@ -2406,10 +2418,15 @@ function defineAsyncComponent(source) {
|
|
|
2406
2418
|
}
|
|
2407
2419
|
});
|
|
2408
2420
|
}
|
|
2409
|
-
function createInnerComp(comp,
|
|
2421
|
+
function createInnerComp(comp, parent) {
|
|
2422
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
2410
2423
|
const vnode = createVNode(comp, props, children);
|
|
2411
2424
|
// ensure inner component inherits the async wrapper's ref owner
|
|
2412
2425
|
vnode.ref = ref;
|
|
2426
|
+
// pass the custom element callback on to the inner comp
|
|
2427
|
+
// and remove it from the async wrapper
|
|
2428
|
+
vnode.ce = ce;
|
|
2429
|
+
delete parent.vnode.ce;
|
|
2413
2430
|
return vnode;
|
|
2414
2431
|
}
|
|
2415
2432
|
|
|
@@ -2503,7 +2520,7 @@ const KeepAliveImpl = {
|
|
|
2503
2520
|
}
|
|
2504
2521
|
function pruneCacheEntry(key) {
|
|
2505
2522
|
const cached = cache.get(key);
|
|
2506
|
-
if (!current || cached
|
|
2523
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
2507
2524
|
unmount(cached);
|
|
2508
2525
|
}
|
|
2509
2526
|
else if (current) {
|
|
@@ -2535,7 +2552,7 @@ const KeepAliveImpl = {
|
|
|
2535
2552
|
cache.forEach(cached => {
|
|
2536
2553
|
const { subTree, suspense } = instance;
|
|
2537
2554
|
const vnode = getInnerChild(subTree);
|
|
2538
|
-
if (cached.type === vnode.type) {
|
|
2555
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2539
2556
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
2540
2557
|
resetShapeFlag(vnode);
|
|
2541
2558
|
// but invoke its deactivated hook here
|
|
@@ -2575,8 +2592,7 @@ const KeepAliveImpl = {
|
|
|
2575
2592
|
: comp);
|
|
2576
2593
|
const { include, exclude, max } = props;
|
|
2577
2594
|
if ((include && (!name || !matches(include, name))) ||
|
|
2578
|
-
(exclude && name && matches(exclude, name))
|
|
2579
|
-
((process.env.NODE_ENV !== 'production') && hmrDirtyComponents.has(comp))) {
|
|
2595
|
+
(exclude && name && matches(exclude, name))) {
|
|
2580
2596
|
current = vnode;
|
|
2581
2597
|
return rawVNode;
|
|
2582
2598
|
}
|
|
@@ -2633,7 +2649,7 @@ function matches(pattern, name) {
|
|
|
2633
2649
|
else if (isString(pattern)) {
|
|
2634
2650
|
return pattern.split(',').includes(name);
|
|
2635
2651
|
}
|
|
2636
|
-
else if (pattern
|
|
2652
|
+
else if (isRegExp(pattern)) {
|
|
2637
2653
|
return pattern.test(name);
|
|
2638
2654
|
}
|
|
2639
2655
|
/* istanbul ignore next */
|
|
@@ -2686,14 +2702,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
2686
2702
|
}, target);
|
|
2687
2703
|
}
|
|
2688
2704
|
function resetShapeFlag(vnode) {
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
}
|
|
2693
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
2694
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
2695
|
-
}
|
|
2696
|
-
vnode.shapeFlag = shapeFlag;
|
|
2705
|
+
// bitwise operations to remove keep alive flags
|
|
2706
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
2707
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
2697
2708
|
}
|
|
2698
2709
|
function getInnerChild(vnode) {
|
|
2699
2710
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -2992,7 +3003,9 @@ fallback, noSlotted) {
|
|
|
2992
3003
|
(currentRenderingInstance.parent &&
|
|
2993
3004
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
2994
3005
|
currentRenderingInstance.parent.isCE)) {
|
|
2995
|
-
|
|
3006
|
+
if (name !== 'default')
|
|
3007
|
+
props.name = name;
|
|
3008
|
+
return createVNode('slot', props, fallback && fallback());
|
|
2996
3009
|
}
|
|
2997
3010
|
let slot = slots[name];
|
|
2998
3011
|
if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {
|
|
@@ -3092,6 +3105,7 @@ const publicPropertiesMap =
|
|
|
3092
3105
|
$watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
|
|
3093
3106
|
});
|
|
3094
3107
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
3108
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
3095
3109
|
const PublicInstanceProxyHandlers = {
|
|
3096
3110
|
get({ _: instance }, key) {
|
|
3097
3111
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -3099,16 +3113,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
3099
3113
|
if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {
|
|
3100
3114
|
return true;
|
|
3101
3115
|
}
|
|
3102
|
-
// prioritize <script setup> bindings during dev.
|
|
3103
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
3104
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
3105
|
-
// indeed has access to all declared variables.
|
|
3106
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
3107
|
-
setupState !== EMPTY_OBJ &&
|
|
3108
|
-
setupState.__isScriptSetup &&
|
|
3109
|
-
hasOwn(setupState, key)) {
|
|
3110
|
-
return setupState[key];
|
|
3111
|
-
}
|
|
3112
3116
|
// data / props / ctx
|
|
3113
3117
|
// This getter gets called for every property access on the render context
|
|
3114
3118
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -3131,7 +3135,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3131
3135
|
// default: just fallthrough
|
|
3132
3136
|
}
|
|
3133
3137
|
}
|
|
3134
|
-
else if (
|
|
3138
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
3135
3139
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
3136
3140
|
return setupState[key];
|
|
3137
3141
|
}
|
|
@@ -3202,23 +3206,28 @@ const PublicInstanceProxyHandlers = {
|
|
|
3202
3206
|
},
|
|
3203
3207
|
set({ _: instance }, key, value) {
|
|
3204
3208
|
const { data, setupState, ctx } = instance;
|
|
3205
|
-
if (
|
|
3209
|
+
if (hasSetupBinding(setupState, key)) {
|
|
3206
3210
|
setupState[key] = value;
|
|
3207
3211
|
return true;
|
|
3208
3212
|
}
|
|
3213
|
+
else if ((process.env.NODE_ENV !== 'production') &&
|
|
3214
|
+
setupState.__isScriptSetup &&
|
|
3215
|
+
hasOwn(setupState, key)) {
|
|
3216
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3217
|
+
return false;
|
|
3218
|
+
}
|
|
3209
3219
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3210
3220
|
data[key] = value;
|
|
3211
3221
|
return true;
|
|
3212
3222
|
}
|
|
3213
3223
|
else if (hasOwn(instance.props, key)) {
|
|
3214
|
-
(process.env.NODE_ENV !== 'production') &&
|
|
3215
|
-
warn(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
3224
|
+
(process.env.NODE_ENV !== 'production') && warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
3216
3225
|
return false;
|
|
3217
3226
|
}
|
|
3218
3227
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
3219
3228
|
(process.env.NODE_ENV !== 'production') &&
|
|
3220
3229
|
warn(`Attempting to mutate public property "${key}". ` +
|
|
3221
|
-
`Properties starting with $ are reserved and readonly
|
|
3230
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
3222
3231
|
return false;
|
|
3223
3232
|
}
|
|
3224
3233
|
else {
|
|
@@ -3239,7 +3248,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3239
3248
|
let normalizedProps;
|
|
3240
3249
|
return (!!accessCache[key] ||
|
|
3241
3250
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
3242
|
-
(setupState
|
|
3251
|
+
hasSetupBinding(setupState, key) ||
|
|
3243
3252
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
3244
3253
|
hasOwn(ctx, key) ||
|
|
3245
3254
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -4061,8 +4070,8 @@ function validatePropName(key) {
|
|
|
4061
4070
|
// use function string name to check type constructors
|
|
4062
4071
|
// so that it works across vms / iframes.
|
|
4063
4072
|
function getType(ctor) {
|
|
4064
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
4065
|
-
return match ? match[
|
|
4073
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
4074
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
4066
4075
|
}
|
|
4067
4076
|
function isSameType(a, b) {
|
|
4068
4077
|
return getType(a) === getType(b);
|
|
@@ -4352,7 +4361,7 @@ function createAppContext() {
|
|
|
4352
4361
|
emitsCache: new WeakMap()
|
|
4353
4362
|
};
|
|
4354
4363
|
}
|
|
4355
|
-
let uid = 0;
|
|
4364
|
+
let uid$1 = 0;
|
|
4356
4365
|
function createAppAPI(render, hydrate) {
|
|
4357
4366
|
return function createApp(rootComponent, rootProps = null) {
|
|
4358
4367
|
if (!isFunction(rootComponent)) {
|
|
@@ -4366,7 +4375,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4366
4375
|
const installedPlugins = new Set();
|
|
4367
4376
|
let isMounted = false;
|
|
4368
4377
|
const app = (context.app = {
|
|
4369
|
-
_uid: uid++,
|
|
4378
|
+
_uid: uid$1++,
|
|
4370
4379
|
_component: rootComponent,
|
|
4371
4380
|
_props: rootProps,
|
|
4372
4381
|
_container: null,
|
|
@@ -5206,6 +5215,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5206
5215
|
if (dirs) {
|
|
5207
5216
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
5208
5217
|
}
|
|
5218
|
+
// scopeId
|
|
5219
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5209
5220
|
// props
|
|
5210
5221
|
if (props) {
|
|
5211
5222
|
for (const key in props) {
|
|
@@ -5229,8 +5240,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5229
5240
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5230
5241
|
}
|
|
5231
5242
|
}
|
|
5232
|
-
// scopeId
|
|
5233
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5234
5243
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
5235
5244
|
Object.defineProperty(el, '__vnode', {
|
|
5236
5245
|
value: vnode,
|
|
@@ -6326,6 +6335,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6326
6335
|
if (!shallow)
|
|
6327
6336
|
traverseStaticChildren(c1, c2);
|
|
6328
6337
|
}
|
|
6338
|
+
// #6852 also inherit for text nodes
|
|
6339
|
+
if (c2.type === Text) {
|
|
6340
|
+
c2.el = c1.el;
|
|
6341
|
+
}
|
|
6329
6342
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
6330
6343
|
// would have received .el during block patch)
|
|
6331
6344
|
if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {
|
|
@@ -6500,6 +6513,7 @@ const TeleportImpl = {
|
|
|
6500
6513
|
}
|
|
6501
6514
|
}
|
|
6502
6515
|
}
|
|
6516
|
+
updateCssVars(n2);
|
|
6503
6517
|
},
|
|
6504
6518
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
6505
6519
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -6578,11 +6592,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
6578
6592
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
6579
6593
|
}
|
|
6580
6594
|
}
|
|
6595
|
+
updateCssVars(vnode);
|
|
6581
6596
|
}
|
|
6582
6597
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
6583
6598
|
}
|
|
6584
6599
|
// Force-casted public typing for h and TSX props inference
|
|
6585
6600
|
const Teleport = TeleportImpl;
|
|
6601
|
+
function updateCssVars(vnode) {
|
|
6602
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
6603
|
+
// code path here can assume browser environment.
|
|
6604
|
+
const ctx = vnode.ctx;
|
|
6605
|
+
if (ctx && ctx.ut) {
|
|
6606
|
+
let node = vnode.children[0].el;
|
|
6607
|
+
while (node !== vnode.targetAnchor) {
|
|
6608
|
+
if (node.nodeType === 1)
|
|
6609
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
6610
|
+
node = node.nextSibling;
|
|
6611
|
+
}
|
|
6612
|
+
ctx.ut();
|
|
6613
|
+
}
|
|
6614
|
+
}
|
|
6586
6615
|
|
|
6587
6616
|
const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined);
|
|
6588
6617
|
const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined);
|
|
@@ -6678,6 +6707,10 @@ function isSameVNodeType(n1, n2) {
|
|
|
6678
6707
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
6679
6708
|
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
6680
6709
|
hmrDirtyComponents.has(n2.type)) {
|
|
6710
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
6711
|
+
// bitwise operations to remove keep alive flags
|
|
6712
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
6713
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
6681
6714
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
6682
6715
|
return false;
|
|
6683
6716
|
}
|
|
@@ -6733,7 +6766,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
6733
6766
|
patchFlag,
|
|
6734
6767
|
dynamicProps,
|
|
6735
6768
|
dynamicChildren: null,
|
|
6736
|
-
appContext: null
|
|
6769
|
+
appContext: null,
|
|
6770
|
+
ctx: currentRenderingInstance
|
|
6737
6771
|
};
|
|
6738
6772
|
if (needFullChildrenNormalization) {
|
|
6739
6773
|
normalizeChildren(vnode, children);
|
|
@@ -6900,7 +6934,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6900
6934
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
6901
6935
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
6902
6936
|
el: vnode.el,
|
|
6903
|
-
anchor: vnode.anchor
|
|
6937
|
+
anchor: vnode.anchor,
|
|
6938
|
+
ctx: vnode.ctx,
|
|
6939
|
+
ce: vnode.ce
|
|
6904
6940
|
};
|
|
6905
6941
|
return cloned;
|
|
6906
6942
|
}
|
|
@@ -7067,13 +7103,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7067
7103
|
}
|
|
7068
7104
|
|
|
7069
7105
|
const emptyAppContext = createAppContext();
|
|
7070
|
-
let uid
|
|
7106
|
+
let uid = 0;
|
|
7071
7107
|
function createComponentInstance(vnode, parent, suspense) {
|
|
7072
7108
|
const type = vnode.type;
|
|
7073
7109
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
7074
7110
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
7075
7111
|
const instance = {
|
|
7076
|
-
uid: uid
|
|
7112
|
+
uid: uid++,
|
|
7077
7113
|
vnode,
|
|
7078
7114
|
type,
|
|
7079
7115
|
parent,
|
|
@@ -7146,7 +7182,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7146
7182
|
instance.ctx = { _: instance };
|
|
7147
7183
|
}
|
|
7148
7184
|
instance.root = parent ? parent.root : instance;
|
|
7149
|
-
instance.emit = emit
|
|
7185
|
+
instance.emit = emit.bind(null, instance);
|
|
7150
7186
|
// apply custom element special handling
|
|
7151
7187
|
if (vnode.ce) {
|
|
7152
7188
|
vnode.ce(instance);
|
|
@@ -7393,8 +7429,24 @@ function createAttrsProxy(instance) {
|
|
|
7393
7429
|
}
|
|
7394
7430
|
function createSetupContext(instance) {
|
|
7395
7431
|
const expose = exposed => {
|
|
7396
|
-
if ((process.env.NODE_ENV !== 'production')
|
|
7397
|
-
|
|
7432
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
7433
|
+
if (instance.exposed) {
|
|
7434
|
+
warn(`expose() should be called only once per setup().`);
|
|
7435
|
+
}
|
|
7436
|
+
if (exposed != null) {
|
|
7437
|
+
let exposedType = typeof exposed;
|
|
7438
|
+
if (exposedType === 'object') {
|
|
7439
|
+
if (isArray(exposed)) {
|
|
7440
|
+
exposedType = 'array';
|
|
7441
|
+
}
|
|
7442
|
+
else if (isRef(exposed)) {
|
|
7443
|
+
exposedType = 'ref';
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
if (exposedType !== 'object') {
|
|
7447
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
7448
|
+
}
|
|
7449
|
+
}
|
|
7398
7450
|
}
|
|
7399
7451
|
instance.exposed = exposed || {};
|
|
7400
7452
|
};
|
|
@@ -7898,7 +7950,7 @@ function isMemoSame(cached, memo) {
|
|
|
7898
7950
|
}
|
|
7899
7951
|
|
|
7900
7952
|
// Core API ------------------------------------------------------------------
|
|
7901
|
-
const version = "3.2.
|
|
7953
|
+
const version = "3.2.46";
|
|
7902
7954
|
const _ssrUtils = {
|
|
7903
7955
|
createComponentInstance,
|
|
7904
7956
|
setupComponent,
|
|
@@ -7921,4 +7973,4 @@ const resolveFilter = null;
|
|
|
7921
7973
|
*/
|
|
7922
7974
|
const compatUtils = (null);
|
|
7923
7975
|
|
|
7924
|
-
export { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
7976
|
+
export { BaseTransition, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.46",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.2.
|
|
36
|
-
"@vue/reactivity": "3.2.
|
|
35
|
+
"@vue/shared": "3.2.46",
|
|
36
|
+
"@vue/reactivity": "3.2.46"
|
|
37
37
|
}
|
|
38
38
|
}
|