@vue/runtime-core 3.4.5 → 3.4.6
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 +87 -19
- package/dist/runtime-core.cjs.prod.js +25 -12
- package/dist/runtime-core.d.ts +0 -1
- package/dist/runtime-core.esm-bundler.js +87 -19
- package/package.json +3 -16
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -343,7 +343,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
343
343
|
}
|
|
344
344
|
function flushPostFlushCbs(seen) {
|
|
345
345
|
if (pendingPostFlushCbs.length) {
|
|
346
|
-
const deduped = [...new Set(pendingPostFlushCbs)]
|
|
346
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
347
|
+
(a, b) => getId(a) - getId(b)
|
|
348
|
+
);
|
|
347
349
|
pendingPostFlushCbs.length = 0;
|
|
348
350
|
if (activePostFlushCbs) {
|
|
349
351
|
activePostFlushCbs.push(...deduped);
|
|
@@ -353,7 +355,6 @@ function flushPostFlushCbs(seen) {
|
|
|
353
355
|
{
|
|
354
356
|
seen = seen || /* @__PURE__ */ new Map();
|
|
355
357
|
}
|
|
356
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
357
358
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
358
359
|
if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
|
|
359
360
|
continue;
|
|
@@ -1446,6 +1447,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1446
1447
|
{
|
|
1447
1448
|
assertNumber(timeout, `Suspense timeout`);
|
|
1448
1449
|
}
|
|
1450
|
+
const initialAnchor = anchor;
|
|
1449
1451
|
const suspense = {
|
|
1450
1452
|
vnode,
|
|
1451
1453
|
parent: parentSuspense,
|
|
@@ -1453,7 +1455,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1453
1455
|
namespace,
|
|
1454
1456
|
container,
|
|
1455
1457
|
hiddenContainer,
|
|
1456
|
-
anchor,
|
|
1457
1458
|
deps: 0,
|
|
1458
1459
|
pendingId: suspenseId++,
|
|
1459
1460
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
@@ -1496,20 +1497,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1496
1497
|
move(
|
|
1497
1498
|
pendingBranch,
|
|
1498
1499
|
container2,
|
|
1499
|
-
next(activeBranch),
|
|
1500
|
+
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
1500
1501
|
0
|
|
1501
1502
|
);
|
|
1502
1503
|
queuePostFlushCb(effects);
|
|
1503
1504
|
}
|
|
1504
1505
|
};
|
|
1505
1506
|
}
|
|
1506
|
-
let { anchor: anchor2 } = suspense;
|
|
1507
1507
|
if (activeBranch) {
|
|
1508
|
-
|
|
1508
|
+
if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
|
|
1509
|
+
anchor = next(activeBranch);
|
|
1510
|
+
}
|
|
1509
1511
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
1510
1512
|
}
|
|
1511
1513
|
if (!delayEnter) {
|
|
1512
|
-
move(pendingBranch, container2,
|
|
1514
|
+
move(pendingBranch, container2, anchor, 0);
|
|
1513
1515
|
}
|
|
1514
1516
|
}
|
|
1515
1517
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -4920,7 +4922,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4920
4922
|
if (props) {
|
|
4921
4923
|
{
|
|
4922
4924
|
for (const key in props) {
|
|
4923
|
-
if (propHasMismatch(el, key, props[key])) {
|
|
4925
|
+
if (propHasMismatch(el, key, props[key], vnode)) {
|
|
4924
4926
|
hasMismatch = true;
|
|
4925
4927
|
}
|
|
4926
4928
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
@@ -5095,7 +5097,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5095
5097
|
};
|
|
5096
5098
|
return [hydrate, hydrateNode];
|
|
5097
5099
|
}
|
|
5098
|
-
function propHasMismatch(el, key, clientValue) {
|
|
5100
|
+
function propHasMismatch(el, key, clientValue, vnode) {
|
|
5099
5101
|
let mismatchType;
|
|
5100
5102
|
let mismatchKey;
|
|
5101
5103
|
let actual;
|
|
@@ -5107,14 +5109,23 @@ function propHasMismatch(el, key, clientValue) {
|
|
|
5107
5109
|
mismatchType = mismatchKey = `class`;
|
|
5108
5110
|
}
|
|
5109
5111
|
} else if (key === "style") {
|
|
5110
|
-
actual = el.getAttribute("style");
|
|
5111
|
-
expected =
|
|
5112
|
-
|
|
5112
|
+
actual = toStyleMap(el.getAttribute("style") || "");
|
|
5113
|
+
expected = toStyleMap(
|
|
5114
|
+
shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue))
|
|
5115
|
+
);
|
|
5116
|
+
if (vnode.dirs) {
|
|
5117
|
+
for (const { dir, value } of vnode.dirs) {
|
|
5118
|
+
if (dir.name === "show" && !value) {
|
|
5119
|
+
expected.set("display", "none");
|
|
5120
|
+
}
|
|
5121
|
+
}
|
|
5122
|
+
}
|
|
5123
|
+
if (!isMapEqual(actual, expected)) {
|
|
5113
5124
|
mismatchType = mismatchKey = "style";
|
|
5114
5125
|
}
|
|
5115
5126
|
} else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) {
|
|
5116
|
-
actual = el.hasAttribute(key)
|
|
5117
|
-
expected = shared.isBooleanAttr(key) ? shared.includeBooleanAttr(clientValue) ? "" : false : clientValue == null ?
|
|
5127
|
+
actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
|
|
5128
|
+
expected = shared.isBooleanAttr(key) ? shared.includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
|
|
5118
5129
|
if (actual !== expected) {
|
|
5119
5130
|
mismatchType = `attribute`;
|
|
5120
5131
|
mismatchKey = key;
|
|
@@ -5149,6 +5160,29 @@ function isSetEqual(a, b) {
|
|
|
5149
5160
|
}
|
|
5150
5161
|
return true;
|
|
5151
5162
|
}
|
|
5163
|
+
function toStyleMap(str) {
|
|
5164
|
+
const styleMap = /* @__PURE__ */ new Map();
|
|
5165
|
+
for (const item of str.split(";")) {
|
|
5166
|
+
let [key, value] = item.split(":");
|
|
5167
|
+
key = key == null ? void 0 : key.trim();
|
|
5168
|
+
value = value == null ? void 0 : value.trim();
|
|
5169
|
+
if (key && value) {
|
|
5170
|
+
styleMap.set(key, value);
|
|
5171
|
+
}
|
|
5172
|
+
}
|
|
5173
|
+
return styleMap;
|
|
5174
|
+
}
|
|
5175
|
+
function isMapEqual(a, b) {
|
|
5176
|
+
if (a.size !== b.size) {
|
|
5177
|
+
return false;
|
|
5178
|
+
}
|
|
5179
|
+
for (const [key, value] of a) {
|
|
5180
|
+
if (value !== b.get(key)) {
|
|
5181
|
+
return false;
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
return true;
|
|
5185
|
+
}
|
|
5152
5186
|
|
|
5153
5187
|
let supported;
|
|
5154
5188
|
let perf;
|
|
@@ -5737,7 +5771,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5737
5771
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
5738
5772
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
5739
5773
|
mountChildren(
|
|
5740
|
-
|
|
5774
|
+
// #10007
|
|
5775
|
+
// such fragment like `<></>` will be compiled into
|
|
5776
|
+
// a fragment which doesn't have a children.
|
|
5777
|
+
// In this case fallback to an empty array
|
|
5778
|
+
n2.children || [],
|
|
5741
5779
|
container,
|
|
5742
5780
|
fragmentEndAnchor,
|
|
5743
5781
|
parentComponent,
|
|
@@ -6571,6 +6609,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6571
6609
|
}
|
|
6572
6610
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
6573
6611
|
};
|
|
6612
|
+
let isFlushing = false;
|
|
6574
6613
|
const render = (vnode, container, namespace) => {
|
|
6575
6614
|
if (vnode == null) {
|
|
6576
6615
|
if (container._vnode) {
|
|
@@ -6587,8 +6626,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6587
6626
|
namespace
|
|
6588
6627
|
);
|
|
6589
6628
|
}
|
|
6590
|
-
|
|
6591
|
-
|
|
6629
|
+
if (!isFlushing) {
|
|
6630
|
+
isFlushing = true;
|
|
6631
|
+
flushPreFlushCbs();
|
|
6632
|
+
flushPostFlushCbs();
|
|
6633
|
+
isFlushing = false;
|
|
6634
|
+
}
|
|
6592
6635
|
container._vnode = vnode;
|
|
6593
6636
|
};
|
|
6594
6637
|
const internals = {
|
|
@@ -7431,7 +7474,14 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7431
7474
|
return instance;
|
|
7432
7475
|
}
|
|
7433
7476
|
let currentInstance = null;
|
|
7434
|
-
const getCurrentInstance = () =>
|
|
7477
|
+
const getCurrentInstance = () => {
|
|
7478
|
+
if (isInComputedGetter) {
|
|
7479
|
+
warn$1(
|
|
7480
|
+
`getCurrentInstance() called inside a computed getter. This is incorrect usage as computed getters are not guaranteed to be executed with an active component instance. If you are using a composable inside a computed getter, move it ouside to the setup scope.`
|
|
7481
|
+
);
|
|
7482
|
+
}
|
|
7483
|
+
return currentInstance || currentRenderingInstance;
|
|
7484
|
+
};
|
|
7435
7485
|
let internalSetCurrentInstance;
|
|
7436
7486
|
let setInSSRSetupState;
|
|
7437
7487
|
{
|
|
@@ -7762,7 +7812,25 @@ function isClassComponent(value) {
|
|
|
7762
7812
|
return shared.isFunction(value) && "__vccOpts" in value;
|
|
7763
7813
|
}
|
|
7764
7814
|
|
|
7815
|
+
let isInComputedGetter = false;
|
|
7816
|
+
function wrapComputedGetter(getter) {
|
|
7817
|
+
return () => {
|
|
7818
|
+
isInComputedGetter = true;
|
|
7819
|
+
try {
|
|
7820
|
+
return getter();
|
|
7821
|
+
} finally {
|
|
7822
|
+
isInComputedGetter = false;
|
|
7823
|
+
}
|
|
7824
|
+
};
|
|
7825
|
+
}
|
|
7765
7826
|
const computed = (getterOrOptions, debugOptions) => {
|
|
7827
|
+
{
|
|
7828
|
+
if (shared.isFunction(getterOrOptions)) {
|
|
7829
|
+
getterOrOptions = wrapComputedGetter(getterOrOptions);
|
|
7830
|
+
} else {
|
|
7831
|
+
getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
|
|
7832
|
+
}
|
|
7833
|
+
}
|
|
7766
7834
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7767
7835
|
};
|
|
7768
7836
|
|
|
@@ -7992,7 +8060,7 @@ function isMemoSame(cached, memo) {
|
|
|
7992
8060
|
return true;
|
|
7993
8061
|
}
|
|
7994
8062
|
|
|
7995
|
-
const version = "3.4.
|
|
8063
|
+
const version = "3.4.6";
|
|
7996
8064
|
const warn = warn$1 ;
|
|
7997
8065
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
7998
8066
|
const devtools = devtools$1 ;
|
|
@@ -214,14 +214,15 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
214
214
|
}
|
|
215
215
|
function flushPostFlushCbs(seen) {
|
|
216
216
|
if (pendingPostFlushCbs.length) {
|
|
217
|
-
const deduped = [...new Set(pendingPostFlushCbs)]
|
|
217
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
218
|
+
(a, b) => getId(a) - getId(b)
|
|
219
|
+
);
|
|
218
220
|
pendingPostFlushCbs.length = 0;
|
|
219
221
|
if (activePostFlushCbs) {
|
|
220
222
|
activePostFlushCbs.push(...deduped);
|
|
221
223
|
return;
|
|
222
224
|
}
|
|
223
225
|
activePostFlushCbs = deduped;
|
|
224
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
225
226
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
226
227
|
activePostFlushCbs[postFlushIndex]();
|
|
227
228
|
}
|
|
@@ -935,6 +936,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
935
936
|
}
|
|
936
937
|
}
|
|
937
938
|
const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
|
|
939
|
+
const initialAnchor = anchor;
|
|
938
940
|
const suspense = {
|
|
939
941
|
vnode,
|
|
940
942
|
parent: parentSuspense,
|
|
@@ -942,7 +944,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
942
944
|
namespace,
|
|
943
945
|
container,
|
|
944
946
|
hiddenContainer,
|
|
945
|
-
anchor,
|
|
946
947
|
deps: 0,
|
|
947
948
|
pendingId: suspenseId++,
|
|
948
949
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
@@ -973,20 +974,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
973
974
|
move(
|
|
974
975
|
pendingBranch,
|
|
975
976
|
container2,
|
|
976
|
-
next(activeBranch),
|
|
977
|
+
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
977
978
|
0
|
|
978
979
|
);
|
|
979
980
|
queuePostFlushCb(effects);
|
|
980
981
|
}
|
|
981
982
|
};
|
|
982
983
|
}
|
|
983
|
-
let { anchor: anchor2 } = suspense;
|
|
984
984
|
if (activeBranch) {
|
|
985
|
-
|
|
985
|
+
if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
|
|
986
|
+
anchor = next(activeBranch);
|
|
987
|
+
}
|
|
986
988
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
987
989
|
}
|
|
988
990
|
if (!delayEnter) {
|
|
989
|
-
move(pendingBranch, container2,
|
|
991
|
+
move(pendingBranch, container2, anchor, 0);
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -4456,7 +4458,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4456
4458
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
4457
4459
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
4458
4460
|
mountChildren(
|
|
4459
|
-
|
|
4461
|
+
// #10007
|
|
4462
|
+
// such fragment like `<></>` will be compiled into
|
|
4463
|
+
// a fragment which doesn't have a children.
|
|
4464
|
+
// In this case fallback to an empty array
|
|
4465
|
+
n2.children || [],
|
|
4460
4466
|
container,
|
|
4461
4467
|
fragmentEndAnchor,
|
|
4462
4468
|
parentComponent,
|
|
@@ -5204,6 +5210,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5204
5210
|
}
|
|
5205
5211
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
5206
5212
|
};
|
|
5213
|
+
let isFlushing = false;
|
|
5207
5214
|
const render = (vnode, container, namespace) => {
|
|
5208
5215
|
if (vnode == null) {
|
|
5209
5216
|
if (container._vnode) {
|
|
@@ -5220,8 +5227,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5220
5227
|
namespace
|
|
5221
5228
|
);
|
|
5222
5229
|
}
|
|
5223
|
-
|
|
5224
|
-
|
|
5230
|
+
if (!isFlushing) {
|
|
5231
|
+
isFlushing = true;
|
|
5232
|
+
flushPreFlushCbs();
|
|
5233
|
+
flushPostFlushCbs();
|
|
5234
|
+
isFlushing = false;
|
|
5235
|
+
}
|
|
5225
5236
|
container._vnode = vnode;
|
|
5226
5237
|
};
|
|
5227
5238
|
const internals = {
|
|
@@ -6004,7 +6015,9 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
6004
6015
|
return instance;
|
|
6005
6016
|
}
|
|
6006
6017
|
let currentInstance = null;
|
|
6007
|
-
const getCurrentInstance = () =>
|
|
6018
|
+
const getCurrentInstance = () => {
|
|
6019
|
+
return currentInstance || currentRenderingInstance;
|
|
6020
|
+
};
|
|
6008
6021
|
let internalSetCurrentInstance;
|
|
6009
6022
|
let setInSSRSetupState;
|
|
6010
6023
|
{
|
|
@@ -6255,7 +6268,7 @@ function isMemoSame(cached, memo) {
|
|
|
6255
6268
|
return true;
|
|
6256
6269
|
}
|
|
6257
6270
|
|
|
6258
|
-
const version = "3.4.
|
|
6271
|
+
const version = "3.4.6";
|
|
6259
6272
|
const warn$1 = shared.NOOP;
|
|
6260
6273
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6261
6274
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -185,7 +185,6 @@ export interface SuspenseBoundary {
|
|
|
185
185
|
namespace: ElementNamespace;
|
|
186
186
|
container: RendererElement;
|
|
187
187
|
hiddenContainer: RendererElement;
|
|
188
|
-
anchor: RendererNode | null;
|
|
189
188
|
activeBranch: VNode | null;
|
|
190
189
|
pendingBranch: VNode | null;
|
|
191
190
|
deps: number;
|
|
@@ -345,7 +345,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
|
345
345
|
}
|
|
346
346
|
function flushPostFlushCbs(seen) {
|
|
347
347
|
if (pendingPostFlushCbs.length) {
|
|
348
|
-
const deduped = [...new Set(pendingPostFlushCbs)]
|
|
348
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
349
|
+
(a, b) => getId(a) - getId(b)
|
|
350
|
+
);
|
|
349
351
|
pendingPostFlushCbs.length = 0;
|
|
350
352
|
if (activePostFlushCbs) {
|
|
351
353
|
activePostFlushCbs.push(...deduped);
|
|
@@ -355,7 +357,6 @@ function flushPostFlushCbs(seen) {
|
|
|
355
357
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
356
358
|
seen = seen || /* @__PURE__ */ new Map();
|
|
357
359
|
}
|
|
358
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
359
360
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
360
361
|
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
|
|
361
362
|
continue;
|
|
@@ -1448,6 +1449,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1448
1449
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1449
1450
|
assertNumber(timeout, `Suspense timeout`);
|
|
1450
1451
|
}
|
|
1452
|
+
const initialAnchor = anchor;
|
|
1451
1453
|
const suspense = {
|
|
1452
1454
|
vnode,
|
|
1453
1455
|
parent: parentSuspense,
|
|
@@ -1455,7 +1457,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1455
1457
|
namespace,
|
|
1456
1458
|
container,
|
|
1457
1459
|
hiddenContainer,
|
|
1458
|
-
anchor,
|
|
1459
1460
|
deps: 0,
|
|
1460
1461
|
pendingId: suspenseId++,
|
|
1461
1462
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
@@ -1498,20 +1499,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
1498
1499
|
move(
|
|
1499
1500
|
pendingBranch,
|
|
1500
1501
|
container2,
|
|
1501
|
-
next(activeBranch),
|
|
1502
|
+
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
1502
1503
|
0
|
|
1503
1504
|
);
|
|
1504
1505
|
queuePostFlushCb(effects);
|
|
1505
1506
|
}
|
|
1506
1507
|
};
|
|
1507
1508
|
}
|
|
1508
|
-
let { anchor: anchor2 } = suspense;
|
|
1509
1509
|
if (activeBranch) {
|
|
1510
|
-
|
|
1510
|
+
if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
|
|
1511
|
+
anchor = next(activeBranch);
|
|
1512
|
+
}
|
|
1511
1513
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
1512
1514
|
}
|
|
1513
1515
|
if (!delayEnter) {
|
|
1514
|
-
move(pendingBranch, container2,
|
|
1516
|
+
move(pendingBranch, container2, anchor, 0);
|
|
1515
1517
|
}
|
|
1516
1518
|
}
|
|
1517
1519
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -4928,7 +4930,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
4928
4930
|
if (props) {
|
|
4929
4931
|
if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
4930
4932
|
for (const key in props) {
|
|
4931
|
-
if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key])) {
|
|
4933
|
+
if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode)) {
|
|
4932
4934
|
hasMismatch = true;
|
|
4933
4935
|
}
|
|
4934
4936
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
@@ -5113,7 +5115,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
5113
5115
|
};
|
|
5114
5116
|
return [hydrate, hydrateNode];
|
|
5115
5117
|
}
|
|
5116
|
-
function propHasMismatch(el, key, clientValue) {
|
|
5118
|
+
function propHasMismatch(el, key, clientValue, vnode) {
|
|
5117
5119
|
let mismatchType;
|
|
5118
5120
|
let mismatchKey;
|
|
5119
5121
|
let actual;
|
|
@@ -5125,14 +5127,23 @@ function propHasMismatch(el, key, clientValue) {
|
|
|
5125
5127
|
mismatchType = mismatchKey = `class`;
|
|
5126
5128
|
}
|
|
5127
5129
|
} else if (key === "style") {
|
|
5128
|
-
actual = el.getAttribute("style");
|
|
5129
|
-
expected =
|
|
5130
|
-
|
|
5130
|
+
actual = toStyleMap(el.getAttribute("style") || "");
|
|
5131
|
+
expected = toStyleMap(
|
|
5132
|
+
isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue))
|
|
5133
|
+
);
|
|
5134
|
+
if (vnode.dirs) {
|
|
5135
|
+
for (const { dir, value } of vnode.dirs) {
|
|
5136
|
+
if (dir.name === "show" && !value) {
|
|
5137
|
+
expected.set("display", "none");
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
5140
|
+
}
|
|
5141
|
+
if (!isMapEqual(actual, expected)) {
|
|
5131
5142
|
mismatchType = mismatchKey = "style";
|
|
5132
5143
|
}
|
|
5133
5144
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
5134
|
-
actual = el.hasAttribute(key)
|
|
5135
|
-
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ?
|
|
5145
|
+
actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
|
|
5146
|
+
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
|
|
5136
5147
|
if (actual !== expected) {
|
|
5137
5148
|
mismatchType = `attribute`;
|
|
5138
5149
|
mismatchKey = key;
|
|
@@ -5167,6 +5178,29 @@ function isSetEqual(a, b) {
|
|
|
5167
5178
|
}
|
|
5168
5179
|
return true;
|
|
5169
5180
|
}
|
|
5181
|
+
function toStyleMap(str) {
|
|
5182
|
+
const styleMap = /* @__PURE__ */ new Map();
|
|
5183
|
+
for (const item of str.split(";")) {
|
|
5184
|
+
let [key, value] = item.split(":");
|
|
5185
|
+
key = key == null ? void 0 : key.trim();
|
|
5186
|
+
value = value == null ? void 0 : value.trim();
|
|
5187
|
+
if (key && value) {
|
|
5188
|
+
styleMap.set(key, value);
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
return styleMap;
|
|
5192
|
+
}
|
|
5193
|
+
function isMapEqual(a, b) {
|
|
5194
|
+
if (a.size !== b.size) {
|
|
5195
|
+
return false;
|
|
5196
|
+
}
|
|
5197
|
+
for (const [key, value] of a) {
|
|
5198
|
+
if (value !== b.get(key)) {
|
|
5199
|
+
return false;
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
return true;
|
|
5203
|
+
}
|
|
5170
5204
|
|
|
5171
5205
|
let supported;
|
|
5172
5206
|
let perf;
|
|
@@ -5780,7 +5814,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5780
5814
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
5781
5815
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
5782
5816
|
mountChildren(
|
|
5783
|
-
|
|
5817
|
+
// #10007
|
|
5818
|
+
// such fragment like `<></>` will be compiled into
|
|
5819
|
+
// a fragment which doesn't have a children.
|
|
5820
|
+
// In this case fallback to an empty array
|
|
5821
|
+
n2.children || [],
|
|
5784
5822
|
container,
|
|
5785
5823
|
fragmentEndAnchor,
|
|
5786
5824
|
parentComponent,
|
|
@@ -6627,6 +6665,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6627
6665
|
}
|
|
6628
6666
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
6629
6667
|
};
|
|
6668
|
+
let isFlushing = false;
|
|
6630
6669
|
const render = (vnode, container, namespace) => {
|
|
6631
6670
|
if (vnode == null) {
|
|
6632
6671
|
if (container._vnode) {
|
|
@@ -6643,8 +6682,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6643
6682
|
namespace
|
|
6644
6683
|
);
|
|
6645
6684
|
}
|
|
6646
|
-
|
|
6647
|
-
|
|
6685
|
+
if (!isFlushing) {
|
|
6686
|
+
isFlushing = true;
|
|
6687
|
+
flushPreFlushCbs();
|
|
6688
|
+
flushPostFlushCbs();
|
|
6689
|
+
isFlushing = false;
|
|
6690
|
+
}
|
|
6648
6691
|
container._vnode = vnode;
|
|
6649
6692
|
};
|
|
6650
6693
|
const internals = {
|
|
@@ -7489,7 +7532,14 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
7489
7532
|
return instance;
|
|
7490
7533
|
}
|
|
7491
7534
|
let currentInstance = null;
|
|
7492
|
-
const getCurrentInstance = () =>
|
|
7535
|
+
const getCurrentInstance = () => {
|
|
7536
|
+
if (!!(process.env.NODE_ENV !== "production") && isInComputedGetter) {
|
|
7537
|
+
warn$1(
|
|
7538
|
+
`getCurrentInstance() called inside a computed getter. This is incorrect usage as computed getters are not guaranteed to be executed with an active component instance. If you are using a composable inside a computed getter, move it ouside to the setup scope.`
|
|
7539
|
+
);
|
|
7540
|
+
}
|
|
7541
|
+
return currentInstance || currentRenderingInstance;
|
|
7542
|
+
};
|
|
7493
7543
|
let internalSetCurrentInstance;
|
|
7494
7544
|
let setInSSRSetupState;
|
|
7495
7545
|
{
|
|
@@ -7834,7 +7884,25 @@ function isClassComponent(value) {
|
|
|
7834
7884
|
return isFunction(value) && "__vccOpts" in value;
|
|
7835
7885
|
}
|
|
7836
7886
|
|
|
7887
|
+
let isInComputedGetter = false;
|
|
7888
|
+
function wrapComputedGetter(getter) {
|
|
7889
|
+
return () => {
|
|
7890
|
+
isInComputedGetter = true;
|
|
7891
|
+
try {
|
|
7892
|
+
return getter();
|
|
7893
|
+
} finally {
|
|
7894
|
+
isInComputedGetter = false;
|
|
7895
|
+
}
|
|
7896
|
+
};
|
|
7897
|
+
}
|
|
7837
7898
|
const computed = (getterOrOptions, debugOptions) => {
|
|
7899
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7900
|
+
if (isFunction(getterOrOptions)) {
|
|
7901
|
+
getterOrOptions = wrapComputedGetter(getterOrOptions);
|
|
7902
|
+
} else {
|
|
7903
|
+
getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
|
|
7904
|
+
}
|
|
7905
|
+
}
|
|
7838
7906
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7839
7907
|
};
|
|
7840
7908
|
|
|
@@ -8064,7 +8132,7 @@ function isMemoSame(cached, memo) {
|
|
|
8064
8132
|
return true;
|
|
8065
8133
|
}
|
|
8066
8134
|
|
|
8067
|
-
const version = "3.4.
|
|
8135
|
+
const version = "3.4.6";
|
|
8068
8136
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8069
8137
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8070
8138
|
const devtools = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -9,19 +9,6 @@
|
|
|
9
9
|
"index.js",
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./dist/runtime-core.d.ts",
|
|
15
|
-
"node": {
|
|
16
|
-
"production": "./dist/runtime-core.cjs.prod.js",
|
|
17
|
-
"development": "./dist/runtime-core.cjs.js",
|
|
18
|
-
"default": "./index.js"
|
|
19
|
-
},
|
|
20
|
-
"import": "./dist/runtime-core.esm-bundler.js",
|
|
21
|
-
"require": "./index.js"
|
|
22
|
-
},
|
|
23
|
-
"./*": "./*"
|
|
24
|
-
},
|
|
25
12
|
"buildOptions": {
|
|
26
13
|
"name": "VueRuntimeCore",
|
|
27
14
|
"formats": [
|
|
@@ -45,7 +32,7 @@
|
|
|
45
32
|
},
|
|
46
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
47
34
|
"dependencies": {
|
|
48
|
-
"@vue/
|
|
49
|
-
"@vue/
|
|
35
|
+
"@vue/reactivity": "3.4.6",
|
|
36
|
+
"@vue/shared": "3.4.6"
|
|
50
37
|
}
|
|
51
38
|
}
|