@vue/runtime-core 3.1.4 → 3.1.5
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 +41 -38
- package/dist/runtime-core.cjs.prod.js +37 -32
- package/dist/runtime-core.d.ts +4 -8
- package/dist/runtime-core.esm-bundler.js +41 -38
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -828,9 +828,10 @@ const deprecationData = {
|
|
|
828
828
|
message: (comp) => {
|
|
829
829
|
const configMsg = `opt-in to ` +
|
|
830
830
|
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
831
|
-
if (comp.props &&
|
|
832
|
-
|
|
833
|
-
|
|
831
|
+
if (comp.props &&
|
|
832
|
+
(shared.isArray(comp.props)
|
|
833
|
+
? comp.props.includes('modelValue')
|
|
834
|
+
: shared.hasOwn(comp.props, 'modelValue'))) {
|
|
834
835
|
return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
|
|
835
836
|
`is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
|
|
836
837
|
}
|
|
@@ -2135,9 +2136,11 @@ function createPathGetter(ctx, path) {
|
|
|
2135
2136
|
};
|
|
2136
2137
|
}
|
|
2137
2138
|
function traverse(value, seen = new Set()) {
|
|
2138
|
-
if (!shared.isObject(value) ||
|
|
2139
|
-
|
|
2140
|
-
|
|
2139
|
+
if (!shared.isObject(value) || value["__v_skip" /* SKIP */]) {
|
|
2140
|
+
return value;
|
|
2141
|
+
}
|
|
2142
|
+
seen = seen || new Set();
|
|
2143
|
+
if (seen.has(value)) {
|
|
2141
2144
|
return value;
|
|
2142
2145
|
}
|
|
2143
2146
|
seen.add(value);
|
|
@@ -3926,6 +3929,9 @@ function withDirectives(vnode, directives) {
|
|
|
3926
3929
|
updated: dir
|
|
3927
3930
|
};
|
|
3928
3931
|
}
|
|
3932
|
+
if (dir.deep) {
|
|
3933
|
+
traverse(value);
|
|
3934
|
+
}
|
|
3929
3935
|
bindings.push({
|
|
3930
3936
|
dir,
|
|
3931
3937
|
instance,
|
|
@@ -4606,7 +4612,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4606
4612
|
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = shared.NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
|
|
4607
4613
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
4608
4614
|
// style in order to prevent being inlined by minifiers.
|
|
4609
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false) => {
|
|
4615
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
4610
4616
|
// patching & not same type, unmount old tree
|
|
4611
4617
|
if (n1 && !isSameVNodeType(n1, n2)) {
|
|
4612
4618
|
anchor = getNextHostNode(n1);
|
|
@@ -4679,19 +4685,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4679
4685
|
}
|
|
4680
4686
|
};
|
|
4681
4687
|
const mountStaticNode = (n2, container, anchor, isSVG) => {
|
|
4682
|
-
|
|
4683
|
-
// which guarantees presence of hostInsertStaticContent.
|
|
4684
|
-
const nodes = hostInsertStaticContent(n2.children, container, anchor, isSVG,
|
|
4685
|
-
// pass cached nodes if the static node is being mounted multiple times
|
|
4686
|
-
// so that runtime-dom can simply cloneNode() instead of inserting new
|
|
4687
|
-
// HTML
|
|
4688
|
-
n2.staticCache);
|
|
4689
|
-
// first mount - this is the orignal hoisted vnode. cache nodes.
|
|
4690
|
-
if (!n2.el) {
|
|
4691
|
-
n2.staticCache = nodes;
|
|
4692
|
-
}
|
|
4693
|
-
n2.el = nodes[0];
|
|
4694
|
-
n2.anchor = nodes[nodes.length - 1];
|
|
4688
|
+
[n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);
|
|
4695
4689
|
};
|
|
4696
4690
|
/**
|
|
4697
4691
|
* Dev / HMR only
|
|
@@ -4748,7 +4742,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4748
4742
|
hostSetElementText(el, vnode.children);
|
|
4749
4743
|
}
|
|
4750
4744
|
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
4751
|
-
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized
|
|
4745
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
4752
4746
|
}
|
|
4753
4747
|
if (dirs) {
|
|
4754
4748
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
@@ -6384,7 +6378,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6384
6378
|
target: vnode.target,
|
|
6385
6379
|
targetAnchor: vnode.targetAnchor,
|
|
6386
6380
|
staticCount: vnode.staticCount,
|
|
6387
|
-
staticCache: vnode.staticCache,
|
|
6388
6381
|
shapeFlag: vnode.shapeFlag,
|
|
6389
6382
|
// if the vnode is cloned with extra props, we can no longer assume its
|
|
6390
6383
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
@@ -7451,24 +7444,34 @@ props, defaults) {
|
|
|
7451
7444
|
return props;
|
|
7452
7445
|
}
|
|
7453
7446
|
/**
|
|
7454
|
-
*
|
|
7455
|
-
* async
|
|
7447
|
+
* `<script setup>` helper for persisting the current instance context over
|
|
7448
|
+
* async/await flows.
|
|
7449
|
+
*
|
|
7450
|
+
* `@vue/compiler-sfc` converts the following:
|
|
7451
|
+
*
|
|
7452
|
+
* ```ts
|
|
7453
|
+
* const x = await foo()
|
|
7454
|
+
* ```
|
|
7455
|
+
*
|
|
7456
|
+
* into:
|
|
7457
|
+
*
|
|
7458
|
+
* ```ts
|
|
7459
|
+
* let __temp, __restore
|
|
7460
|
+
* const x = (([__temp, __restore] = withAsyncContext(() => foo())),__temp=await __temp,__restore(),__temp)
|
|
7461
|
+
* ```
|
|
7462
|
+
* @internal
|
|
7456
7463
|
*/
|
|
7457
|
-
function withAsyncContext(
|
|
7464
|
+
function withAsyncContext(getAwaitable) {
|
|
7458
7465
|
const ctx = getCurrentInstance();
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
return isPromise(awaitable)
|
|
7464
|
-
? awaitable.then(res => {
|
|
7466
|
+
let awaitable = getAwaitable();
|
|
7467
|
+
setCurrentInstance(null);
|
|
7468
|
+
if (isPromise(awaitable)) {
|
|
7469
|
+
awaitable = awaitable.catch(e => {
|
|
7465
7470
|
setCurrentInstance(ctx);
|
|
7466
|
-
|
|
7467
|
-
}
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
})
|
|
7471
|
-
: awaitable;
|
|
7471
|
+
throw e;
|
|
7472
|
+
});
|
|
7473
|
+
}
|
|
7474
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
7472
7475
|
}
|
|
7473
7476
|
|
|
7474
7477
|
// Actual implementation
|
|
@@ -7701,7 +7704,7 @@ function initCustomFormatter() {
|
|
|
7701
7704
|
}
|
|
7702
7705
|
|
|
7703
7706
|
// Core API ------------------------------------------------------------------
|
|
7704
|
-
const version = "3.1.
|
|
7707
|
+
const version = "3.1.5";
|
|
7705
7708
|
const _ssrUtils = {
|
|
7706
7709
|
createComponentInstance,
|
|
7707
7710
|
setupComponent,
|
|
@@ -1458,9 +1458,11 @@ function createPathGetter(ctx, path) {
|
|
|
1458
1458
|
};
|
|
1459
1459
|
}
|
|
1460
1460
|
function traverse(value, seen = new Set()) {
|
|
1461
|
-
if (!shared.isObject(value) ||
|
|
1462
|
-
|
|
1463
|
-
|
|
1461
|
+
if (!shared.isObject(value) || value["__v_skip" /* SKIP */]) {
|
|
1462
|
+
return value;
|
|
1463
|
+
}
|
|
1464
|
+
seen = seen || new Set();
|
|
1465
|
+
if (seen.has(value)) {
|
|
1464
1466
|
return value;
|
|
1465
1467
|
}
|
|
1466
1468
|
seen.add(value);
|
|
@@ -2960,6 +2962,9 @@ function withDirectives(vnode, directives) {
|
|
|
2960
2962
|
updated: dir
|
|
2961
2963
|
};
|
|
2962
2964
|
}
|
|
2965
|
+
if (dir.deep) {
|
|
2966
|
+
traverse(value);
|
|
2967
|
+
}
|
|
2963
2968
|
bindings.push({
|
|
2964
2969
|
dir,
|
|
2965
2970
|
instance,
|
|
@@ -3507,7 +3512,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3507
3512
|
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = shared.NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
|
|
3508
3513
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
3509
3514
|
// style in order to prevent being inlined by minifiers.
|
|
3510
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized =
|
|
3515
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
|
|
3511
3516
|
// patching & not same type, unmount old tree
|
|
3512
3517
|
if (n1 && !isSameVNodeType(n1, n2)) {
|
|
3513
3518
|
anchor = getNextHostNode(n1);
|
|
@@ -3575,19 +3580,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3575
3580
|
}
|
|
3576
3581
|
};
|
|
3577
3582
|
const mountStaticNode = (n2, container, anchor, isSVG) => {
|
|
3578
|
-
|
|
3579
|
-
// which guarantees presence of hostInsertStaticContent.
|
|
3580
|
-
const nodes = hostInsertStaticContent(n2.children, container, anchor, isSVG,
|
|
3581
|
-
// pass cached nodes if the static node is being mounted multiple times
|
|
3582
|
-
// so that runtime-dom can simply cloneNode() instead of inserting new
|
|
3583
|
-
// HTML
|
|
3584
|
-
n2.staticCache);
|
|
3585
|
-
// first mount - this is the orignal hoisted vnode. cache nodes.
|
|
3586
|
-
if (!n2.el) {
|
|
3587
|
-
n2.staticCache = nodes;
|
|
3588
|
-
}
|
|
3589
|
-
n2.el = nodes[0];
|
|
3590
|
-
n2.anchor = nodes[nodes.length - 1];
|
|
3583
|
+
[n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);
|
|
3591
3584
|
};
|
|
3592
3585
|
const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
|
|
3593
3586
|
let next;
|
|
@@ -3637,7 +3630,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3637
3630
|
hostSetElementText(el, vnode.children);
|
|
3638
3631
|
}
|
|
3639
3632
|
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
3640
|
-
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized
|
|
3633
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
3641
3634
|
}
|
|
3642
3635
|
if (dirs) {
|
|
3643
3636
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
@@ -5087,7 +5080,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
5087
5080
|
target: vnode.target,
|
|
5088
5081
|
targetAnchor: vnode.targetAnchor,
|
|
5089
5082
|
staticCount: vnode.staticCount,
|
|
5090
|
-
staticCache: vnode.staticCache,
|
|
5091
5083
|
shapeFlag: vnode.shapeFlag,
|
|
5092
5084
|
// if the vnode is cloned with extra props, we can no longer assume its
|
|
5093
5085
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
@@ -5906,21 +5898,34 @@ props, defaults) {
|
|
|
5906
5898
|
return props;
|
|
5907
5899
|
}
|
|
5908
5900
|
/**
|
|
5909
|
-
*
|
|
5910
|
-
* async
|
|
5901
|
+
* `<script setup>` helper for persisting the current instance context over
|
|
5902
|
+
* async/await flows.
|
|
5903
|
+
*
|
|
5904
|
+
* `@vue/compiler-sfc` converts the following:
|
|
5905
|
+
*
|
|
5906
|
+
* ```ts
|
|
5907
|
+
* const x = await foo()
|
|
5908
|
+
* ```
|
|
5909
|
+
*
|
|
5910
|
+
* into:
|
|
5911
|
+
*
|
|
5912
|
+
* ```ts
|
|
5913
|
+
* let __temp, __restore
|
|
5914
|
+
* const x = (([__temp, __restore] = withAsyncContext(() => foo())),__temp=await __temp,__restore(),__temp)
|
|
5915
|
+
* ```
|
|
5916
|
+
* @internal
|
|
5911
5917
|
*/
|
|
5912
|
-
function withAsyncContext(
|
|
5918
|
+
function withAsyncContext(getAwaitable) {
|
|
5913
5919
|
const ctx = getCurrentInstance();
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5920
|
+
let awaitable = getAwaitable();
|
|
5921
|
+
setCurrentInstance(null);
|
|
5922
|
+
if (isPromise(awaitable)) {
|
|
5923
|
+
awaitable = awaitable.catch(e => {
|
|
5917
5924
|
setCurrentInstance(ctx);
|
|
5918
|
-
|
|
5919
|
-
}
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
})
|
|
5923
|
-
: awaitable;
|
|
5925
|
+
throw e;
|
|
5926
|
+
});
|
|
5927
|
+
}
|
|
5928
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
5924
5929
|
}
|
|
5925
5930
|
|
|
5926
5931
|
// Actual implementation
|
|
@@ -5971,7 +5976,7 @@ function initCustomFormatter() {
|
|
|
5971
5976
|
}
|
|
5972
5977
|
|
|
5973
5978
|
// Core API ------------------------------------------------------------------
|
|
5974
|
-
const version = "3.1.
|
|
5979
|
+
const version = "3.1.5";
|
|
5975
5980
|
const _ssrUtils = {
|
|
5976
5981
|
createComponentInstance,
|
|
5977
5982
|
setupComponent,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1106,7 +1106,7 @@ declare type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
|
1106
1106
|
|
|
1107
1107
|
declare type NextFn = (vnode: VNode) => RendererNode | null;
|
|
1108
1108
|
|
|
1109
|
-
export declare function nextTick(this:
|
|
1109
|
+
export declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
|
|
1110
1110
|
|
|
1111
1111
|
declare type NormalizedProp = null | (PropOptions & {
|
|
1112
1112
|
[BooleanFlags.shouldCast]?: boolean;
|
|
@@ -1134,6 +1134,7 @@ export declare interface ObjectDirective<T = any, V = any> {
|
|
|
1134
1134
|
beforeUnmount?: DirectiveHook<T, null, V>;
|
|
1135
1135
|
unmounted?: DirectiveHook<T, null, V>;
|
|
1136
1136
|
getSSRProps?: SSRDirectiveHook;
|
|
1137
|
+
deep?: boolean;
|
|
1137
1138
|
}
|
|
1138
1139
|
|
|
1139
1140
|
export declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
@@ -1341,7 +1342,7 @@ export declare interface RendererOptions<HostNode = RendererNode, HostElement =
|
|
|
1341
1342
|
querySelector?(selector: string): HostElement | null;
|
|
1342
1343
|
setScopeId?(el: HostElement, id: string): void;
|
|
1343
1344
|
cloneNode?(node: HostNode): HostNode;
|
|
1344
|
-
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, isSVG: boolean
|
|
1345
|
+
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, isSVG: boolean): [HostNode, HostNode];
|
|
1345
1346
|
}
|
|
1346
1347
|
|
|
1347
1348
|
export declare type RenderFunction = () => VNodeChild;
|
|
@@ -1677,7 +1678,6 @@ export declare interface VNode<HostNode = RendererNode, HostElement = RendererEl
|
|
|
1677
1678
|
target: HostElement | null;
|
|
1678
1679
|
targetAnchor: HostNode | null;
|
|
1679
1680
|
staticCount?: number;
|
|
1680
|
-
staticCache?: HostNode[];
|
|
1681
1681
|
suspense: SuspenseBoundary | null;
|
|
1682
1682
|
ssContent: VNode | null;
|
|
1683
1683
|
ssFallback: VNode | null;
|
|
@@ -1760,11 +1760,7 @@ export declare type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
|
1760
1760
|
|
|
1761
1761
|
export declare type WatchStopHandle = () => void;
|
|
1762
1762
|
|
|
1763
|
-
|
|
1764
|
-
* Runtime helper for storing and resuming current instance context in
|
|
1765
|
-
* async setup().
|
|
1766
|
-
*/
|
|
1767
|
-
export declare function withAsyncContext<T>(awaitable: T | Promise<T>): Promise<T>;
|
|
1763
|
+
/* Excluded from this release type: withAsyncContext */
|
|
1768
1764
|
|
|
1769
1765
|
/**
|
|
1770
1766
|
* Wrap a slot function to memoize current rendering instance
|
|
@@ -833,9 +833,10 @@ const deprecationData = {
|
|
|
833
833
|
message: (comp) => {
|
|
834
834
|
const configMsg = `opt-in to ` +
|
|
835
835
|
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
836
|
-
if (comp.props &&
|
|
837
|
-
|
|
838
|
-
|
|
836
|
+
if (comp.props &&
|
|
837
|
+
(isArray(comp.props)
|
|
838
|
+
? comp.props.includes('modelValue')
|
|
839
|
+
: hasOwn(comp.props, 'modelValue'))) {
|
|
839
840
|
return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
|
|
840
841
|
`is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
|
|
841
842
|
}
|
|
@@ -2126,9 +2127,11 @@ function createPathGetter(ctx, path) {
|
|
|
2126
2127
|
};
|
|
2127
2128
|
}
|
|
2128
2129
|
function traverse(value, seen = new Set()) {
|
|
2129
|
-
if (!isObject$1(value) ||
|
|
2130
|
-
|
|
2131
|
-
|
|
2130
|
+
if (!isObject$1(value) || value["__v_skip" /* SKIP */]) {
|
|
2131
|
+
return value;
|
|
2132
|
+
}
|
|
2133
|
+
seen = seen || new Set();
|
|
2134
|
+
if (seen.has(value)) {
|
|
2132
2135
|
return value;
|
|
2133
2136
|
}
|
|
2134
2137
|
seen.add(value);
|
|
@@ -3925,6 +3928,9 @@ function withDirectives(vnode, directives) {
|
|
|
3925
3928
|
updated: dir
|
|
3926
3929
|
};
|
|
3927
3930
|
}
|
|
3931
|
+
if (dir.deep) {
|
|
3932
|
+
traverse(value);
|
|
3933
|
+
}
|
|
3928
3934
|
bindings.push({
|
|
3929
3935
|
dir,
|
|
3930
3936
|
instance,
|
|
@@ -4646,7 +4652,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4646
4652
|
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
|
|
4647
4653
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
4648
4654
|
// style in order to prevent being inlined by minifiers.
|
|
4649
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false) => {
|
|
4655
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = (process.env.NODE_ENV !== 'production') && isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
4650
4656
|
// patching & not same type, unmount old tree
|
|
4651
4657
|
if (n1 && !isSameVNodeType(n1, n2)) {
|
|
4652
4658
|
anchor = getNextHostNode(n1);
|
|
@@ -4719,19 +4725,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4719
4725
|
}
|
|
4720
4726
|
};
|
|
4721
4727
|
const mountStaticNode = (n2, container, anchor, isSVG) => {
|
|
4722
|
-
|
|
4723
|
-
// which guarantees presence of hostInsertStaticContent.
|
|
4724
|
-
const nodes = hostInsertStaticContent(n2.children, container, anchor, isSVG,
|
|
4725
|
-
// pass cached nodes if the static node is being mounted multiple times
|
|
4726
|
-
// so that runtime-dom can simply cloneNode() instead of inserting new
|
|
4727
|
-
// HTML
|
|
4728
|
-
n2.staticCache);
|
|
4729
|
-
// first mount - this is the orignal hoisted vnode. cache nodes.
|
|
4730
|
-
if (!n2.el) {
|
|
4731
|
-
n2.staticCache = nodes;
|
|
4732
|
-
}
|
|
4733
|
-
n2.el = nodes[0];
|
|
4734
|
-
n2.anchor = nodes[nodes.length - 1];
|
|
4728
|
+
[n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);
|
|
4735
4729
|
};
|
|
4736
4730
|
/**
|
|
4737
4731
|
* Dev / HMR only
|
|
@@ -4798,7 +4792,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4798
4792
|
hostSetElementText(el, vnode.children);
|
|
4799
4793
|
}
|
|
4800
4794
|
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
4801
|
-
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized
|
|
4795
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
4802
4796
|
}
|
|
4803
4797
|
if (dirs) {
|
|
4804
4798
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
@@ -6441,7 +6435,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6441
6435
|
target: vnode.target,
|
|
6442
6436
|
targetAnchor: vnode.targetAnchor,
|
|
6443
6437
|
staticCount: vnode.staticCount,
|
|
6444
|
-
staticCache: vnode.staticCache,
|
|
6445
6438
|
shapeFlag: vnode.shapeFlag,
|
|
6446
6439
|
// if the vnode is cloned with extra props, we can no longer assume its
|
|
6447
6440
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
@@ -7510,24 +7503,34 @@ props, defaults) {
|
|
|
7510
7503
|
return props;
|
|
7511
7504
|
}
|
|
7512
7505
|
/**
|
|
7513
|
-
*
|
|
7514
|
-
* async
|
|
7506
|
+
* `<script setup>` helper for persisting the current instance context over
|
|
7507
|
+
* async/await flows.
|
|
7508
|
+
*
|
|
7509
|
+
* `@vue/compiler-sfc` converts the following:
|
|
7510
|
+
*
|
|
7511
|
+
* ```ts
|
|
7512
|
+
* const x = await foo()
|
|
7513
|
+
* ```
|
|
7514
|
+
*
|
|
7515
|
+
* into:
|
|
7516
|
+
*
|
|
7517
|
+
* ```ts
|
|
7518
|
+
* let __temp, __restore
|
|
7519
|
+
* const x = (([__temp, __restore] = withAsyncContext(() => foo())),__temp=await __temp,__restore(),__temp)
|
|
7520
|
+
* ```
|
|
7521
|
+
* @internal
|
|
7515
7522
|
*/
|
|
7516
|
-
function withAsyncContext(
|
|
7523
|
+
function withAsyncContext(getAwaitable) {
|
|
7517
7524
|
const ctx = getCurrentInstance();
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
return isPromise(awaitable)
|
|
7523
|
-
? awaitable.then(res => {
|
|
7525
|
+
let awaitable = getAwaitable();
|
|
7526
|
+
setCurrentInstance(null);
|
|
7527
|
+
if (isPromise(awaitable)) {
|
|
7528
|
+
awaitable = awaitable.catch(e => {
|
|
7524
7529
|
setCurrentInstance(ctx);
|
|
7525
|
-
|
|
7526
|
-
}
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
})
|
|
7530
|
-
: awaitable;
|
|
7530
|
+
throw e;
|
|
7531
|
+
});
|
|
7532
|
+
}
|
|
7533
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
7531
7534
|
}
|
|
7532
7535
|
|
|
7533
7536
|
// Actual implementation
|
|
@@ -7760,7 +7763,7 @@ function initCustomFormatter() {
|
|
|
7760
7763
|
}
|
|
7761
7764
|
|
|
7762
7765
|
// Core API ------------------------------------------------------------------
|
|
7763
|
-
const version = "3.1.
|
|
7766
|
+
const version = "3.1.5";
|
|
7764
7767
|
/**
|
|
7765
7768
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
7766
7769
|
* @internal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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/vue-next/tree/master/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.1.
|
|
36
|
-
"@vue/reactivity": "3.1.
|
|
35
|
+
"@vue/shared": "3.1.5",
|
|
36
|
+
"@vue/reactivity": "3.1.5"
|
|
37
37
|
}
|
|
38
38
|
}
|