@vue/runtime-core 3.2.45 → 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 +66 -33
- package/dist/runtime-core.cjs.prod.js +29 -21
- package/dist/runtime-core.d.ts +16 -9
- package/dist/runtime-core.esm-bundler.js +69 -34
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
> This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
|
|
4
4
|
|
|
5
|
-
For full exposed APIs, see `src/index.ts`. You can also run `
|
|
5
|
+
For full exposed APIs, see `src/index.ts`. You can also run `pnpm build runtime-core --types` from repo root, which will generate an API report at `temp/runtime-core.api.md`.
|
|
6
6
|
|
|
7
7
|
## Building a Custom Renderer
|
|
8
8
|
|
|
9
|
-
```
|
|
9
|
+
```ts
|
|
10
10
|
import { createRenderer } from '@vue/runtime-core'
|
|
11
11
|
|
|
12
12
|
const { render, createApp } = createRenderer({
|
|
13
13
|
patchProp,
|
|
14
14
|
insert,
|
|
15
15
|
remove,
|
|
16
|
-
createElement
|
|
16
|
+
createElement
|
|
17
17
|
// ...
|
|
18
18
|
})
|
|
19
19
|
|
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var reactivity = require('@vue/reactivity');
|
|
6
4
|
var shared = require('@vue/shared');
|
|
7
5
|
|
|
@@ -118,6 +116,20 @@ function formatProp(key, value, raw) {
|
|
|
118
116
|
return raw ? value : [`${key}=`, value];
|
|
119
117
|
}
|
|
120
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
function assertNumber(val, type) {
|
|
123
|
+
if (val === undefined) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
else if (typeof val !== 'number') {
|
|
127
|
+
warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
|
|
128
|
+
}
|
|
129
|
+
else if (isNaN(val)) {
|
|
130
|
+
warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
121
133
|
|
|
122
134
|
const ErrorTypeStrings = {
|
|
123
135
|
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
@@ -555,9 +567,10 @@ function tryWrap(fn) {
|
|
|
555
567
|
};
|
|
556
568
|
}
|
|
557
569
|
|
|
570
|
+
exports.devtools = void 0;
|
|
558
571
|
let buffer = [];
|
|
559
572
|
let devtoolsNotInstalled = false;
|
|
560
|
-
function emit(event, ...args) {
|
|
573
|
+
function emit$1(event, ...args) {
|
|
561
574
|
if (exports.devtools) {
|
|
562
575
|
exports.devtools.emit(event, ...args);
|
|
563
576
|
}
|
|
@@ -604,7 +617,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
604
617
|
}
|
|
605
618
|
}
|
|
606
619
|
function devtoolsInitApp(app, version) {
|
|
607
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
620
|
+
emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
608
621
|
Fragment,
|
|
609
622
|
Text,
|
|
610
623
|
Comment,
|
|
@@ -612,7 +625,7 @@ function devtoolsInitApp(app, version) {
|
|
|
612
625
|
});
|
|
613
626
|
}
|
|
614
627
|
function devtoolsUnmountApp(app) {
|
|
615
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
628
|
+
emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
616
629
|
}
|
|
617
630
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
618
631
|
const devtoolsComponentUpdated =
|
|
@@ -628,21 +641,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
628
641
|
};
|
|
629
642
|
function createDevtoolsComponentHook(hook) {
|
|
630
643
|
return (component) => {
|
|
631
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
644
|
+
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
632
645
|
};
|
|
633
646
|
}
|
|
634
647
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
635
648
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
636
649
|
function createDevtoolsPerformanceHook(hook) {
|
|
637
650
|
return (component, type, time) => {
|
|
638
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
651
|
+
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
639
652
|
};
|
|
640
653
|
}
|
|
641
654
|
function devtoolsComponentEmit(component, event, params) {
|
|
642
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
655
|
+
emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
643
656
|
}
|
|
644
657
|
|
|
645
|
-
function emit
|
|
658
|
+
function emit(instance, event, ...rawArgs) {
|
|
646
659
|
if (instance.isUnmounted)
|
|
647
660
|
return;
|
|
648
661
|
const props = instance.vnode.props || shared.EMPTY_OBJ;
|
|
@@ -678,7 +691,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
678
691
|
args = rawArgs.map(a => (shared.isString(a) ? a.trim() : a));
|
|
679
692
|
}
|
|
680
693
|
if (number) {
|
|
681
|
-
args = rawArgs.map(shared.
|
|
694
|
+
args = rawArgs.map(shared.looseToNumber);
|
|
682
695
|
}
|
|
683
696
|
}
|
|
684
697
|
{
|
|
@@ -1326,7 +1339,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1326
1339
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
1327
1340
|
}
|
|
1328
1341
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
1329
|
-
const timeout =
|
|
1342
|
+
const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : undefined;
|
|
1343
|
+
{
|
|
1344
|
+
assertNumber(timeout, `Suspense timeout`);
|
|
1345
|
+
}
|
|
1330
1346
|
const suspense = {
|
|
1331
1347
|
vnode,
|
|
1332
1348
|
parent,
|
|
@@ -1644,12 +1660,10 @@ function watchEffect(effect, options) {
|
|
|
1644
1660
|
return doWatch(effect, null, options);
|
|
1645
1661
|
}
|
|
1646
1662
|
function watchPostEffect(effect, options) {
|
|
1647
|
-
return doWatch(effect, null,
|
|
1648
|
-
));
|
|
1663
|
+
return doWatch(effect, null, { ...options, flush: 'post' } );
|
|
1649
1664
|
}
|
|
1650
1665
|
function watchSyncEffect(effect, options) {
|
|
1651
|
-
return doWatch(effect, null,
|
|
1652
|
-
));
|
|
1666
|
+
return doWatch(effect, null, { ...options, flush: 'sync' } );
|
|
1653
1667
|
}
|
|
1654
1668
|
// initial value for watchers to trigger on undefined initial values
|
|
1655
1669
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -1677,7 +1691,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
|
|
|
1677
1691
|
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
1678
1692
|
`a reactive object, or an array of these types.`);
|
|
1679
1693
|
};
|
|
1680
|
-
const instance = currentInstance;
|
|
1694
|
+
const instance = reactivity.getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
1695
|
+
// const instance = currentInstance
|
|
1681
1696
|
let getter;
|
|
1682
1697
|
let forceTrigger = false;
|
|
1683
1698
|
let isMultiSource = false;
|
|
@@ -1788,7 +1803,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
|
|
|
1788
1803
|
// pass undefined as the old value when it's changed for the first time
|
|
1789
1804
|
oldValue === INITIAL_WATCHER_VALUE
|
|
1790
1805
|
? undefined
|
|
1791
|
-
:
|
|
1806
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
1792
1807
|
? []
|
|
1793
1808
|
: oldValue,
|
|
1794
1809
|
onCleanup
|
|
@@ -2491,7 +2506,7 @@ const KeepAliveImpl = {
|
|
|
2491
2506
|
}
|
|
2492
2507
|
function pruneCacheEntry(key) {
|
|
2493
2508
|
const cached = cache.get(key);
|
|
2494
|
-
if (!current || cached
|
|
2509
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
2495
2510
|
unmount(cached);
|
|
2496
2511
|
}
|
|
2497
2512
|
else if (current) {
|
|
@@ -2523,7 +2538,7 @@ const KeepAliveImpl = {
|
|
|
2523
2538
|
cache.forEach(cached => {
|
|
2524
2539
|
const { subTree, suspense } = instance;
|
|
2525
2540
|
const vnode = getInnerChild(subTree);
|
|
2526
|
-
if (cached.type === vnode.type) {
|
|
2541
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2527
2542
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
2528
2543
|
resetShapeFlag(vnode);
|
|
2529
2544
|
// but invoke its deactivated hook here
|
|
@@ -2620,7 +2635,7 @@ function matches(pattern, name) {
|
|
|
2620
2635
|
else if (shared.isString(pattern)) {
|
|
2621
2636
|
return pattern.split(',').includes(name);
|
|
2622
2637
|
}
|
|
2623
|
-
else if (pattern
|
|
2638
|
+
else if (shared.isRegExp(pattern)) {
|
|
2624
2639
|
return pattern.test(name);
|
|
2625
2640
|
}
|
|
2626
2641
|
/* istanbul ignore next */
|
|
@@ -4033,8 +4048,8 @@ function validatePropName(key) {
|
|
|
4033
4048
|
// use function string name to check type constructors
|
|
4034
4049
|
// so that it works across vms / iframes.
|
|
4035
4050
|
function getType(ctor) {
|
|
4036
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
4037
|
-
return match ? match[
|
|
4051
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
4052
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
4038
4053
|
}
|
|
4039
4054
|
function isSameType(a, b) {
|
|
4040
4055
|
return getType(a) === getType(b);
|
|
@@ -4322,7 +4337,7 @@ function createAppContext() {
|
|
|
4322
4337
|
emitsCache: new WeakMap()
|
|
4323
4338
|
};
|
|
4324
4339
|
}
|
|
4325
|
-
let uid = 0;
|
|
4340
|
+
let uid$1 = 0;
|
|
4326
4341
|
function createAppAPI(render, hydrate) {
|
|
4327
4342
|
return function createApp(rootComponent, rootProps = null) {
|
|
4328
4343
|
if (!shared.isFunction(rootComponent)) {
|
|
@@ -4336,7 +4351,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4336
4351
|
const installedPlugins = new Set();
|
|
4337
4352
|
let isMounted = false;
|
|
4338
4353
|
const app = (context.app = {
|
|
4339
|
-
_uid: uid++,
|
|
4354
|
+
_uid: uid$1++,
|
|
4340
4355
|
_component: rootComponent,
|
|
4341
4356
|
_props: rootProps,
|
|
4342
4357
|
_container: null,
|
|
@@ -5138,6 +5153,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5138
5153
|
if (dirs) {
|
|
5139
5154
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
5140
5155
|
}
|
|
5156
|
+
// scopeId
|
|
5157
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5141
5158
|
// props
|
|
5142
5159
|
if (props) {
|
|
5143
5160
|
for (const key in props) {
|
|
@@ -5161,8 +5178,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5161
5178
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5162
5179
|
}
|
|
5163
5180
|
}
|
|
5164
|
-
// scopeId
|
|
5165
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5166
5181
|
{
|
|
5167
5182
|
Object.defineProperty(el, '__vnode', {
|
|
5168
5183
|
value: vnode,
|
|
@@ -6850,7 +6865,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6850
6865
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
6851
6866
|
el: vnode.el,
|
|
6852
6867
|
anchor: vnode.anchor,
|
|
6853
|
-
ctx: vnode.ctx
|
|
6868
|
+
ctx: vnode.ctx,
|
|
6869
|
+
ce: vnode.ce
|
|
6854
6870
|
};
|
|
6855
6871
|
return cloned;
|
|
6856
6872
|
}
|
|
@@ -7017,13 +7033,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7017
7033
|
}
|
|
7018
7034
|
|
|
7019
7035
|
const emptyAppContext = createAppContext();
|
|
7020
|
-
let uid
|
|
7036
|
+
let uid = 0;
|
|
7021
7037
|
function createComponentInstance(vnode, parent, suspense) {
|
|
7022
7038
|
const type = vnode.type;
|
|
7023
7039
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
7024
7040
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
7025
7041
|
const instance = {
|
|
7026
|
-
uid: uid
|
|
7042
|
+
uid: uid++,
|
|
7027
7043
|
vnode,
|
|
7028
7044
|
type,
|
|
7029
7045
|
parent,
|
|
@@ -7093,7 +7109,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7093
7109
|
instance.ctx = createDevRenderContext(instance);
|
|
7094
7110
|
}
|
|
7095
7111
|
instance.root = parent ? parent.root : instance;
|
|
7096
|
-
instance.emit = emit
|
|
7112
|
+
instance.emit = emit.bind(null, instance);
|
|
7097
7113
|
// apply custom element special handling
|
|
7098
7114
|
if (vnode.ce) {
|
|
7099
7115
|
vnode.ce(instance);
|
|
@@ -7333,8 +7349,24 @@ function createAttrsProxy(instance) {
|
|
|
7333
7349
|
}
|
|
7334
7350
|
function createSetupContext(instance) {
|
|
7335
7351
|
const expose = exposed => {
|
|
7336
|
-
|
|
7337
|
-
|
|
7352
|
+
{
|
|
7353
|
+
if (instance.exposed) {
|
|
7354
|
+
warn(`expose() should be called only once per setup().`);
|
|
7355
|
+
}
|
|
7356
|
+
if (exposed != null) {
|
|
7357
|
+
let exposedType = typeof exposed;
|
|
7358
|
+
if (exposedType === 'object') {
|
|
7359
|
+
if (shared.isArray(exposed)) {
|
|
7360
|
+
exposedType = 'array';
|
|
7361
|
+
}
|
|
7362
|
+
else if (reactivity.isRef(exposed)) {
|
|
7363
|
+
exposedType = 'ref';
|
|
7364
|
+
}
|
|
7365
|
+
}
|
|
7366
|
+
if (exposedType !== 'object') {
|
|
7367
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
7368
|
+
}
|
|
7369
|
+
}
|
|
7338
7370
|
}
|
|
7339
7371
|
instance.exposed = exposed || {};
|
|
7340
7372
|
};
|
|
@@ -7827,7 +7859,7 @@ function isMemoSame(cached, memo) {
|
|
|
7827
7859
|
}
|
|
7828
7860
|
|
|
7829
7861
|
// Core API ------------------------------------------------------------------
|
|
7830
|
-
const version = "3.2.
|
|
7862
|
+
const version = "3.2.46";
|
|
7831
7863
|
const _ssrUtils = {
|
|
7832
7864
|
createComponentInstance,
|
|
7833
7865
|
setupComponent,
|
|
@@ -7891,6 +7923,7 @@ exports.Static = Static;
|
|
|
7891
7923
|
exports.Suspense = Suspense;
|
|
7892
7924
|
exports.Teleport = Teleport;
|
|
7893
7925
|
exports.Text = Text;
|
|
7926
|
+
exports.assertNumber = assertNumber;
|
|
7894
7927
|
exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
|
|
7895
7928
|
exports.callWithErrorHandling = callWithErrorHandling;
|
|
7896
7929
|
exports.cloneVNode = cloneVNode;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var reactivity = require('@vue/reactivity');
|
|
6
4
|
var shared = require('@vue/shared');
|
|
7
5
|
|
|
8
6
|
function warn(msg, ...args) {
|
|
9
7
|
return;
|
|
10
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
function assertNumber(val, type) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
|
|
12
16
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
13
17
|
let res;
|
|
@@ -225,6 +229,7 @@ function flushJobs(seen) {
|
|
|
225
229
|
}
|
|
226
230
|
}
|
|
227
231
|
|
|
232
|
+
exports.devtools = void 0;
|
|
228
233
|
let buffer = [];
|
|
229
234
|
function setDevtoolsHook(hook, target) {
|
|
230
235
|
var _a, _b;
|
|
@@ -277,7 +282,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
277
282
|
args = rawArgs.map(a => (shared.isString(a) ? a.trim() : a));
|
|
278
283
|
}
|
|
279
284
|
if (number) {
|
|
280
|
-
args = rawArgs.map(shared.
|
|
285
|
+
args = rawArgs.map(shared.looseToNumber);
|
|
281
286
|
}
|
|
282
287
|
}
|
|
283
288
|
let handlerName;
|
|
@@ -802,7 +807,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
802
807
|
}
|
|
803
808
|
function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
804
809
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
805
|
-
const timeout =
|
|
810
|
+
const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : undefined;
|
|
806
811
|
const suspense = {
|
|
807
812
|
vnode,
|
|
808
813
|
parent,
|
|
@@ -1094,10 +1099,10 @@ function watchEffect(effect, options) {
|
|
|
1094
1099
|
return doWatch(effect, null, options);
|
|
1095
1100
|
}
|
|
1096
1101
|
function watchPostEffect(effect, options) {
|
|
1097
|
-
return doWatch(effect, null,
|
|
1102
|
+
return doWatch(effect, null, { flush: 'post' });
|
|
1098
1103
|
}
|
|
1099
1104
|
function watchSyncEffect(effect, options) {
|
|
1100
|
-
return doWatch(effect, null,
|
|
1105
|
+
return doWatch(effect, null, { flush: 'sync' });
|
|
1101
1106
|
}
|
|
1102
1107
|
// initial value for watchers to trigger on undefined initial values
|
|
1103
1108
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -1106,7 +1111,8 @@ function watch(source, cb, options) {
|
|
|
1106
1111
|
return doWatch(source, cb, options);
|
|
1107
1112
|
}
|
|
1108
1113
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = shared.EMPTY_OBJ) {
|
|
1109
|
-
const instance = currentInstance;
|
|
1114
|
+
const instance = reactivity.getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
1115
|
+
// const instance = currentInstance
|
|
1110
1116
|
let getter;
|
|
1111
1117
|
let forceTrigger = false;
|
|
1112
1118
|
let isMultiSource = false;
|
|
@@ -1214,7 +1220,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
|
|
|
1214
1220
|
// pass undefined as the old value when it's changed for the first time
|
|
1215
1221
|
oldValue === INITIAL_WATCHER_VALUE
|
|
1216
1222
|
? undefined
|
|
1217
|
-
:
|
|
1223
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
1218
1224
|
? []
|
|
1219
1225
|
: oldValue,
|
|
1220
1226
|
onCleanup
|
|
@@ -1881,7 +1887,7 @@ const KeepAliveImpl = {
|
|
|
1881
1887
|
}
|
|
1882
1888
|
function pruneCacheEntry(key) {
|
|
1883
1889
|
const cached = cache.get(key);
|
|
1884
|
-
if (!current || cached
|
|
1890
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
1885
1891
|
unmount(cached);
|
|
1886
1892
|
}
|
|
1887
1893
|
else if (current) {
|
|
@@ -1913,7 +1919,7 @@ const KeepAliveImpl = {
|
|
|
1913
1919
|
cache.forEach(cached => {
|
|
1914
1920
|
const { subTree, suspense } = instance;
|
|
1915
1921
|
const vnode = getInnerChild(subTree);
|
|
1916
|
-
if (cached.type === vnode.type) {
|
|
1922
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
1917
1923
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
1918
1924
|
resetShapeFlag(vnode);
|
|
1919
1925
|
// but invoke its deactivated hook here
|
|
@@ -2007,7 +2013,7 @@ function matches(pattern, name) {
|
|
|
2007
2013
|
else if (shared.isString(pattern)) {
|
|
2008
2014
|
return pattern.split(',').includes(name);
|
|
2009
2015
|
}
|
|
2010
|
-
else if (pattern
|
|
2016
|
+
else if (shared.isRegExp(pattern)) {
|
|
2011
2017
|
return pattern.test(name);
|
|
2012
2018
|
}
|
|
2013
2019
|
/* istanbul ignore next */
|
|
@@ -3169,8 +3175,8 @@ function validatePropName(key) {
|
|
|
3169
3175
|
// use function string name to check type constructors
|
|
3170
3176
|
// so that it works across vms / iframes.
|
|
3171
3177
|
function getType(ctor) {
|
|
3172
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
3173
|
-
return match ? match[
|
|
3178
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
3179
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
3174
3180
|
}
|
|
3175
3181
|
function isSameType(a, b) {
|
|
3176
3182
|
return getType(a) === getType(b);
|
|
@@ -3310,7 +3316,7 @@ function createAppContext() {
|
|
|
3310
3316
|
emitsCache: new WeakMap()
|
|
3311
3317
|
};
|
|
3312
3318
|
}
|
|
3313
|
-
let uid = 0;
|
|
3319
|
+
let uid$1 = 0;
|
|
3314
3320
|
function createAppAPI(render, hydrate) {
|
|
3315
3321
|
return function createApp(rootComponent, rootProps = null) {
|
|
3316
3322
|
if (!shared.isFunction(rootComponent)) {
|
|
@@ -3323,7 +3329,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3323
3329
|
const installedPlugins = new Set();
|
|
3324
3330
|
let isMounted = false;
|
|
3325
3331
|
const app = (context.app = {
|
|
3326
|
-
_uid: uid++,
|
|
3332
|
+
_uid: uid$1++,
|
|
3327
3333
|
_component: rootComponent,
|
|
3328
3334
|
_props: rootProps,
|
|
3329
3335
|
_container: null,
|
|
@@ -3969,6 +3975,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3969
3975
|
if (dirs) {
|
|
3970
3976
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
3971
3977
|
}
|
|
3978
|
+
// scopeId
|
|
3979
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
3972
3980
|
// props
|
|
3973
3981
|
if (props) {
|
|
3974
3982
|
for (const key in props) {
|
|
@@ -3992,8 +4000,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3992
4000
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3993
4001
|
}
|
|
3994
4002
|
}
|
|
3995
|
-
// scopeId
|
|
3996
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
3997
4003
|
if (dirs) {
|
|
3998
4004
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');
|
|
3999
4005
|
}
|
|
@@ -5480,7 +5486,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
5480
5486
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
5481
5487
|
el: vnode.el,
|
|
5482
5488
|
anchor: vnode.anchor,
|
|
5483
|
-
ctx: vnode.ctx
|
|
5489
|
+
ctx: vnode.ctx,
|
|
5490
|
+
ce: vnode.ce
|
|
5484
5491
|
};
|
|
5485
5492
|
return cloned;
|
|
5486
5493
|
}
|
|
@@ -5636,13 +5643,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
5636
5643
|
}
|
|
5637
5644
|
|
|
5638
5645
|
const emptyAppContext = createAppContext();
|
|
5639
|
-
let uid
|
|
5646
|
+
let uid = 0;
|
|
5640
5647
|
function createComponentInstance(vnode, parent, suspense) {
|
|
5641
5648
|
const type = vnode.type;
|
|
5642
5649
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
5643
5650
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
5644
5651
|
const instance = {
|
|
5645
|
-
uid: uid
|
|
5652
|
+
uid: uid++,
|
|
5646
5653
|
vnode,
|
|
5647
5654
|
type,
|
|
5648
5655
|
parent,
|
|
@@ -6113,7 +6120,7 @@ function isMemoSame(cached, memo) {
|
|
|
6113
6120
|
}
|
|
6114
6121
|
|
|
6115
6122
|
// Core API ------------------------------------------------------------------
|
|
6116
|
-
const version = "3.2.
|
|
6123
|
+
const version = "3.2.46";
|
|
6117
6124
|
const _ssrUtils = {
|
|
6118
6125
|
createComponentInstance,
|
|
6119
6126
|
setupComponent,
|
|
@@ -6177,6 +6184,7 @@ exports.Static = Static;
|
|
|
6177
6184
|
exports.Suspense = Suspense;
|
|
6178
6185
|
exports.Teleport = Teleport;
|
|
6179
6186
|
exports.Text = Text;
|
|
6187
|
+
exports.assertNumber = assertNumber;
|
|
6180
6188
|
exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
|
|
6181
6189
|
exports.callWithErrorHandling = callWithErrorHandling;
|
|
6182
6190
|
exports.cloneVNode = cloneVNode;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -75,7 +75,8 @@ export declare interface AllowedComponentProps {
|
|
|
75
75
|
export declare interface App<HostElement = any> {
|
|
76
76
|
version: string;
|
|
77
77
|
config: AppConfig;
|
|
78
|
-
use(plugin: Plugin_2
|
|
78
|
+
use<Options extends unknown[]>(plugin: Plugin_2<Options>, ...options: Options): this;
|
|
79
|
+
use<Options>(plugin: Plugin_2<Options>, options: Options): this;
|
|
79
80
|
mixin(mixin: ComponentOptions): this;
|
|
80
81
|
component(name: string): Component | undefined;
|
|
81
82
|
component(name: string, component: Component): this;
|
|
@@ -142,6 +143,8 @@ declare interface AppRecord {
|
|
|
142
143
|
types: Record<string, string | Symbol>;
|
|
143
144
|
}
|
|
144
145
|
|
|
146
|
+
/* Excluded from this release type: assertNumber */
|
|
147
|
+
|
|
145
148
|
export declare type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
|
|
146
149
|
|
|
147
150
|
export declare interface AsyncComponentOptions<T = any> {
|
|
@@ -185,6 +188,8 @@ declare const enum BooleanFlags {
|
|
|
185
188
|
shouldCastTrue = 1
|
|
186
189
|
}
|
|
187
190
|
|
|
191
|
+
declare type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
192
|
+
|
|
188
193
|
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
|
|
189
194
|
|
|
190
195
|
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
@@ -444,7 +449,7 @@ export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends C
|
|
|
444
449
|
inheritAttrs?: boolean;
|
|
445
450
|
emits?: (E | EE[]) & ThisType<void>;
|
|
446
451
|
expose?: string[];
|
|
447
|
-
serverPrefetch?(): Promise<any>;
|
|
452
|
+
serverPrefetch?(): void | Promise<any>;
|
|
448
453
|
compilerOptions?: RuntimeCompilerOptions;
|
|
449
454
|
/* Excluded from this release type: ssrRender */
|
|
450
455
|
/* Excluded from this release type: __ssrInlineRender */
|
|
@@ -739,7 +744,9 @@ export declare function defineProps<PropNames extends string = string>(props: Pr
|
|
|
739
744
|
|
|
740
745
|
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Readonly<ExtractPropTypes<PP>>;
|
|
741
746
|
|
|
742
|
-
export declare function defineProps<TypeProps>(): Readonly<TypeProps
|
|
747
|
+
export declare function defineProps<TypeProps>(): Readonly<Omit<TypeProps, BooleanKey<TypeProps>> & {
|
|
748
|
+
[K in keyof Pick<TypeProps, BooleanKey<TypeProps>>]-?: NotUndefined<TypeProps[K]>;
|
|
749
|
+
}>;
|
|
743
750
|
|
|
744
751
|
export declare const enum DeprecationTypes {
|
|
745
752
|
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
@@ -1336,14 +1343,14 @@ declare type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: Renderer
|
|
|
1336
1343
|
declare type PatchFn = (n1: VNode | null, // null means this is a mount
|
|
1337
1344
|
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, isSVG?: boolean, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
|
1338
1345
|
|
|
1339
|
-
declare type Plugin_2 = (PluginInstallFunction & {
|
|
1340
|
-
install?: PluginInstallFunction
|
|
1346
|
+
declare type Plugin_2<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
1347
|
+
install?: PluginInstallFunction<Options>;
|
|
1341
1348
|
}) | {
|
|
1342
|
-
install: PluginInstallFunction
|
|
1349
|
+
install: PluginInstallFunction<Options>;
|
|
1343
1350
|
};
|
|
1344
1351
|
export { Plugin_2 as Plugin }
|
|
1345
1352
|
|
|
1346
|
-
declare type PluginInstallFunction = (app: App, ...options: any
|
|
1353
|
+
declare type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
1347
1354
|
|
|
1348
1355
|
/**
|
|
1349
1356
|
* Technically we no longer need this after 3.0.8 but we need to keep the same
|
|
@@ -1635,12 +1642,12 @@ export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks)
|
|
|
1635
1642
|
|
|
1636
1643
|
declare function setupComponent(instance: ComponentInternalInstance, isSSR?: boolean): Promise<void> | undefined;
|
|
1637
1644
|
|
|
1638
|
-
export declare
|
|
1645
|
+
export declare type SetupContext<E = EmitsOptions> = E extends any ? {
|
|
1639
1646
|
attrs: Data;
|
|
1640
1647
|
slots: Slots;
|
|
1641
1648
|
emit: EmitFn<E>;
|
|
1642
1649
|
expose: (exposed?: Record<string, any>) => void;
|
|
1643
|
-
}
|
|
1650
|
+
} : never;
|
|
1644
1651
|
|
|
1645
1652
|
declare type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
|
|
1646
1653
|
|
|
@@ -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',
|
|
@@ -564,7 +580,7 @@ function tryWrap(fn) {
|
|
|
564
580
|
let devtools;
|
|
565
581
|
let buffer = [];
|
|
566
582
|
let devtoolsNotInstalled = false;
|
|
567
|
-
function emit(event, ...args) {
|
|
583
|
+
function emit$1(event, ...args) {
|
|
568
584
|
if (devtools) {
|
|
569
585
|
devtools.emit(event, ...args);
|
|
570
586
|
}
|
|
@@ -611,7 +627,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
611
627
|
}
|
|
612
628
|
}
|
|
613
629
|
function devtoolsInitApp(app, version) {
|
|
614
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
630
|
+
emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
615
631
|
Fragment,
|
|
616
632
|
Text,
|
|
617
633
|
Comment,
|
|
@@ -619,7 +635,7 @@ function devtoolsInitApp(app, version) {
|
|
|
619
635
|
});
|
|
620
636
|
}
|
|
621
637
|
function devtoolsUnmountApp(app) {
|
|
622
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
638
|
+
emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
623
639
|
}
|
|
624
640
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
625
641
|
const devtoolsComponentUpdated =
|
|
@@ -635,21 +651,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
635
651
|
};
|
|
636
652
|
function createDevtoolsComponentHook(hook) {
|
|
637
653
|
return (component) => {
|
|
638
|
-
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);
|
|
639
655
|
};
|
|
640
656
|
}
|
|
641
657
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
642
658
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
643
659
|
function createDevtoolsPerformanceHook(hook) {
|
|
644
660
|
return (component, type, time) => {
|
|
645
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
661
|
+
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
646
662
|
};
|
|
647
663
|
}
|
|
648
664
|
function devtoolsComponentEmit(component, event, params) {
|
|
649
|
-
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);
|
|
650
666
|
}
|
|
651
667
|
|
|
652
|
-
function emit
|
|
668
|
+
function emit(instance, event, ...rawArgs) {
|
|
653
669
|
if (instance.isUnmounted)
|
|
654
670
|
return;
|
|
655
671
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -685,7 +701,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
685
701
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
686
702
|
}
|
|
687
703
|
if (number) {
|
|
688
|
-
args = rawArgs.map(
|
|
704
|
+
args = rawArgs.map(looseToNumber);
|
|
689
705
|
}
|
|
690
706
|
}
|
|
691
707
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -1334,7 +1350,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1334
1350
|
console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
|
|
1335
1351
|
}
|
|
1336
1352
|
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
|
|
1337
|
-
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
|
+
}
|
|
1338
1357
|
const suspense = {
|
|
1339
1358
|
vnode,
|
|
1340
1359
|
parent,
|
|
@@ -1652,12 +1671,10 @@ function watchEffect(effect, options) {
|
|
|
1652
1671
|
return doWatch(effect, null, options);
|
|
1653
1672
|
}
|
|
1654
1673
|
function watchPostEffect(effect, options) {
|
|
1655
|
-
return doWatch(effect, null, (
|
|
1656
|
-
? 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' });
|
|
1657
1675
|
}
|
|
1658
1676
|
function watchSyncEffect(effect, options) {
|
|
1659
|
-
return doWatch(effect, null, (
|
|
1660
|
-
? 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' });
|
|
1661
1678
|
}
|
|
1662
1679
|
// initial value for watchers to trigger on undefined initial values
|
|
1663
1680
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -1685,7 +1702,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
1685
1702
|
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
1686
1703
|
`a reactive object, or an array of these types.`);
|
|
1687
1704
|
};
|
|
1688
|
-
const instance = currentInstance;
|
|
1705
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
1706
|
+
// const instance = currentInstance
|
|
1689
1707
|
let getter;
|
|
1690
1708
|
let forceTrigger = false;
|
|
1691
1709
|
let isMultiSource = false;
|
|
@@ -1796,7 +1814,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
1796
1814
|
// pass undefined as the old value when it's changed for the first time
|
|
1797
1815
|
oldValue === INITIAL_WATCHER_VALUE
|
|
1798
1816
|
? undefined
|
|
1799
|
-
:
|
|
1817
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
1800
1818
|
? []
|
|
1801
1819
|
: oldValue,
|
|
1802
1820
|
onCleanup
|
|
@@ -2502,7 +2520,7 @@ const KeepAliveImpl = {
|
|
|
2502
2520
|
}
|
|
2503
2521
|
function pruneCacheEntry(key) {
|
|
2504
2522
|
const cached = cache.get(key);
|
|
2505
|
-
if (!current || cached
|
|
2523
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
2506
2524
|
unmount(cached);
|
|
2507
2525
|
}
|
|
2508
2526
|
else if (current) {
|
|
@@ -2534,7 +2552,7 @@ const KeepAliveImpl = {
|
|
|
2534
2552
|
cache.forEach(cached => {
|
|
2535
2553
|
const { subTree, suspense } = instance;
|
|
2536
2554
|
const vnode = getInnerChild(subTree);
|
|
2537
|
-
if (cached.type === vnode.type) {
|
|
2555
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2538
2556
|
// current instance will be unmounted as part of keep-alive's unmount
|
|
2539
2557
|
resetShapeFlag(vnode);
|
|
2540
2558
|
// but invoke its deactivated hook here
|
|
@@ -2631,7 +2649,7 @@ function matches(pattern, name) {
|
|
|
2631
2649
|
else if (isString(pattern)) {
|
|
2632
2650
|
return pattern.split(',').includes(name);
|
|
2633
2651
|
}
|
|
2634
|
-
else if (pattern
|
|
2652
|
+
else if (isRegExp(pattern)) {
|
|
2635
2653
|
return pattern.test(name);
|
|
2636
2654
|
}
|
|
2637
2655
|
/* istanbul ignore next */
|
|
@@ -4052,8 +4070,8 @@ function validatePropName(key) {
|
|
|
4052
4070
|
// use function string name to check type constructors
|
|
4053
4071
|
// so that it works across vms / iframes.
|
|
4054
4072
|
function getType(ctor) {
|
|
4055
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
4056
|
-
return match ? match[
|
|
4073
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
4074
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
4057
4075
|
}
|
|
4058
4076
|
function isSameType(a, b) {
|
|
4059
4077
|
return getType(a) === getType(b);
|
|
@@ -4343,7 +4361,7 @@ function createAppContext() {
|
|
|
4343
4361
|
emitsCache: new WeakMap()
|
|
4344
4362
|
};
|
|
4345
4363
|
}
|
|
4346
|
-
let uid = 0;
|
|
4364
|
+
let uid$1 = 0;
|
|
4347
4365
|
function createAppAPI(render, hydrate) {
|
|
4348
4366
|
return function createApp(rootComponent, rootProps = null) {
|
|
4349
4367
|
if (!isFunction(rootComponent)) {
|
|
@@ -4357,7 +4375,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4357
4375
|
const installedPlugins = new Set();
|
|
4358
4376
|
let isMounted = false;
|
|
4359
4377
|
const app = (context.app = {
|
|
4360
|
-
_uid: uid++,
|
|
4378
|
+
_uid: uid$1++,
|
|
4361
4379
|
_component: rootComponent,
|
|
4362
4380
|
_props: rootProps,
|
|
4363
4381
|
_container: null,
|
|
@@ -5197,6 +5215,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5197
5215
|
if (dirs) {
|
|
5198
5216
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
5199
5217
|
}
|
|
5218
|
+
// scopeId
|
|
5219
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5200
5220
|
// props
|
|
5201
5221
|
if (props) {
|
|
5202
5222
|
for (const key in props) {
|
|
@@ -5220,8 +5240,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5220
5240
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5221
5241
|
}
|
|
5222
5242
|
}
|
|
5223
|
-
// scopeId
|
|
5224
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
5225
5243
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
5226
5244
|
Object.defineProperty(el, '__vnode', {
|
|
5227
5245
|
value: vnode,
|
|
@@ -6917,7 +6935,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6917
6935
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
6918
6936
|
el: vnode.el,
|
|
6919
6937
|
anchor: vnode.anchor,
|
|
6920
|
-
ctx: vnode.ctx
|
|
6938
|
+
ctx: vnode.ctx,
|
|
6939
|
+
ce: vnode.ce
|
|
6921
6940
|
};
|
|
6922
6941
|
return cloned;
|
|
6923
6942
|
}
|
|
@@ -7084,13 +7103,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7084
7103
|
}
|
|
7085
7104
|
|
|
7086
7105
|
const emptyAppContext = createAppContext();
|
|
7087
|
-
let uid
|
|
7106
|
+
let uid = 0;
|
|
7088
7107
|
function createComponentInstance(vnode, parent, suspense) {
|
|
7089
7108
|
const type = vnode.type;
|
|
7090
7109
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
7091
7110
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
7092
7111
|
const instance = {
|
|
7093
|
-
uid: uid
|
|
7112
|
+
uid: uid++,
|
|
7094
7113
|
vnode,
|
|
7095
7114
|
type,
|
|
7096
7115
|
parent,
|
|
@@ -7163,7 +7182,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7163
7182
|
instance.ctx = { _: instance };
|
|
7164
7183
|
}
|
|
7165
7184
|
instance.root = parent ? parent.root : instance;
|
|
7166
|
-
instance.emit = emit
|
|
7185
|
+
instance.emit = emit.bind(null, instance);
|
|
7167
7186
|
// apply custom element special handling
|
|
7168
7187
|
if (vnode.ce) {
|
|
7169
7188
|
vnode.ce(instance);
|
|
@@ -7410,8 +7429,24 @@ function createAttrsProxy(instance) {
|
|
|
7410
7429
|
}
|
|
7411
7430
|
function createSetupContext(instance) {
|
|
7412
7431
|
const expose = exposed => {
|
|
7413
|
-
if ((process.env.NODE_ENV !== 'production')
|
|
7414
|
-
|
|
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
|
+
}
|
|
7415
7450
|
}
|
|
7416
7451
|
instance.exposed = exposed || {};
|
|
7417
7452
|
};
|
|
@@ -7915,7 +7950,7 @@ function isMemoSame(cached, memo) {
|
|
|
7915
7950
|
}
|
|
7916
7951
|
|
|
7917
7952
|
// Core API ------------------------------------------------------------------
|
|
7918
|
-
const version = "3.2.
|
|
7953
|
+
const version = "3.2.46";
|
|
7919
7954
|
const _ssrUtils = {
|
|
7920
7955
|
createComponentInstance,
|
|
7921
7956
|
setupComponent,
|
|
@@ -7938,4 +7973,4 @@ const resolveFilter = null;
|
|
|
7938
7973
|
*/
|
|
7939
7974
|
const compatUtils = (null);
|
|
7940
7975
|
|
|
7941
|
-
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
|
}
|