@vue/runtime-dom 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-dom.cjs.js +3 -0
- package/dist/runtime-dom.d.ts +4 -2
- package/dist/runtime-dom.esm-browser.js +90 -19
- package/dist/runtime-dom.esm-browser.prod.js +2 -2
- package/dist/runtime-dom.esm-bundler.js +3 -0
- package/dist/runtime-dom.global.js +90 -19
- package/dist/runtime-dom.global.prod.js +2 -2
- package/package.json +3 -16
|
@@ -1827,7 +1827,9 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1827
1827
|
}
|
|
1828
1828
|
function flushPostFlushCbs(seen) {
|
|
1829
1829
|
if (pendingPostFlushCbs.length) {
|
|
1830
|
-
const deduped = [...new Set(pendingPostFlushCbs)]
|
|
1830
|
+
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
1831
|
+
(a, b) => getId(a) - getId(b)
|
|
1832
|
+
);
|
|
1831
1833
|
pendingPostFlushCbs.length = 0;
|
|
1832
1834
|
if (activePostFlushCbs) {
|
|
1833
1835
|
activePostFlushCbs.push(...deduped);
|
|
@@ -1837,7 +1839,6 @@ var VueRuntimeDOM = (function (exports) {
|
|
|
1837
1839
|
{
|
|
1838
1840
|
seen = seen || /* @__PURE__ */ new Map();
|
|
1839
1841
|
}
|
|
1840
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
1841
1842
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
1842
1843
|
if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
|
|
1843
1844
|
continue;
|
|
@@ -2930,6 +2931,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
2930
2931
|
{
|
|
2931
2932
|
assertNumber(timeout, `Suspense timeout`);
|
|
2932
2933
|
}
|
|
2934
|
+
const initialAnchor = anchor;
|
|
2933
2935
|
const suspense = {
|
|
2934
2936
|
vnode,
|
|
2935
2937
|
parent: parentSuspense,
|
|
@@ -2937,7 +2939,6 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
2937
2939
|
namespace,
|
|
2938
2940
|
container,
|
|
2939
2941
|
hiddenContainer,
|
|
2940
|
-
anchor,
|
|
2941
2942
|
deps: 0,
|
|
2942
2943
|
pendingId: suspenseId++,
|
|
2943
2944
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
@@ -2980,20 +2981,21 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
2980
2981
|
move(
|
|
2981
2982
|
pendingBranch,
|
|
2982
2983
|
container2,
|
|
2983
|
-
next(activeBranch),
|
|
2984
|
+
anchor === initialAnchor ? next(activeBranch) : anchor,
|
|
2984
2985
|
0
|
|
2985
2986
|
);
|
|
2986
2987
|
queuePostFlushCb(effects);
|
|
2987
2988
|
}
|
|
2988
2989
|
};
|
|
2989
2990
|
}
|
|
2990
|
-
let { anchor: anchor2 } = suspense;
|
|
2991
2991
|
if (activeBranch) {
|
|
2992
|
-
|
|
2992
|
+
if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
|
|
2993
|
+
anchor = next(activeBranch);
|
|
2994
|
+
}
|
|
2993
2995
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
2994
2996
|
}
|
|
2995
2997
|
if (!delayEnter) {
|
|
2996
|
-
move(pendingBranch, container2,
|
|
2998
|
+
move(pendingBranch, container2, anchor, 0);
|
|
2997
2999
|
}
|
|
2998
3000
|
}
|
|
2999
3001
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -6371,7 +6373,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
6371
6373
|
if (props) {
|
|
6372
6374
|
{
|
|
6373
6375
|
for (const key in props) {
|
|
6374
|
-
if (propHasMismatch(el, key, props[key])) {
|
|
6376
|
+
if (propHasMismatch(el, key, props[key], vnode)) {
|
|
6375
6377
|
hasMismatch = true;
|
|
6376
6378
|
}
|
|
6377
6379
|
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
@@ -6546,7 +6548,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
6546
6548
|
};
|
|
6547
6549
|
return [hydrate, hydrateNode];
|
|
6548
6550
|
}
|
|
6549
|
-
function propHasMismatch(el, key, clientValue) {
|
|
6551
|
+
function propHasMismatch(el, key, clientValue, vnode) {
|
|
6550
6552
|
let mismatchType;
|
|
6551
6553
|
let mismatchKey;
|
|
6552
6554
|
let actual;
|
|
@@ -6558,14 +6560,23 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
6558
6560
|
mismatchType = mismatchKey = `class`;
|
|
6559
6561
|
}
|
|
6560
6562
|
} else if (key === "style") {
|
|
6561
|
-
actual = el.getAttribute("style");
|
|
6562
|
-
expected =
|
|
6563
|
-
|
|
6563
|
+
actual = toStyleMap(el.getAttribute("style") || "");
|
|
6564
|
+
expected = toStyleMap(
|
|
6565
|
+
isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue))
|
|
6566
|
+
);
|
|
6567
|
+
if (vnode.dirs) {
|
|
6568
|
+
for (const { dir, value } of vnode.dirs) {
|
|
6569
|
+
if (dir.name === "show" && !value) {
|
|
6570
|
+
expected.set("display", "none");
|
|
6571
|
+
}
|
|
6572
|
+
}
|
|
6573
|
+
}
|
|
6574
|
+
if (!isMapEqual(actual, expected)) {
|
|
6564
6575
|
mismatchType = mismatchKey = "style";
|
|
6565
6576
|
}
|
|
6566
6577
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
6567
|
-
actual = el.hasAttribute(key)
|
|
6568
|
-
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ?
|
|
6578
|
+
actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
|
|
6579
|
+
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
|
|
6569
6580
|
if (actual !== expected) {
|
|
6570
6581
|
mismatchType = `attribute`;
|
|
6571
6582
|
mismatchKey = key;
|
|
@@ -6600,6 +6611,29 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
6600
6611
|
}
|
|
6601
6612
|
return true;
|
|
6602
6613
|
}
|
|
6614
|
+
function toStyleMap(str) {
|
|
6615
|
+
const styleMap = /* @__PURE__ */ new Map();
|
|
6616
|
+
for (const item of str.split(";")) {
|
|
6617
|
+
let [key, value] = item.split(":");
|
|
6618
|
+
key = key == null ? void 0 : key.trim();
|
|
6619
|
+
value = value == null ? void 0 : value.trim();
|
|
6620
|
+
if (key && value) {
|
|
6621
|
+
styleMap.set(key, value);
|
|
6622
|
+
}
|
|
6623
|
+
}
|
|
6624
|
+
return styleMap;
|
|
6625
|
+
}
|
|
6626
|
+
function isMapEqual(a, b) {
|
|
6627
|
+
if (a.size !== b.size) {
|
|
6628
|
+
return false;
|
|
6629
|
+
}
|
|
6630
|
+
for (const [key, value] of a) {
|
|
6631
|
+
if (value !== b.get(key)) {
|
|
6632
|
+
return false;
|
|
6633
|
+
}
|
|
6634
|
+
}
|
|
6635
|
+
return true;
|
|
6636
|
+
}
|
|
6603
6637
|
|
|
6604
6638
|
let supported;
|
|
6605
6639
|
let perf;
|
|
@@ -7188,7 +7222,11 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
7188
7222
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
7189
7223
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
7190
7224
|
mountChildren(
|
|
7191
|
-
|
|
7225
|
+
// #10007
|
|
7226
|
+
// such fragment like `<></>` will be compiled into
|
|
7227
|
+
// a fragment which doesn't have a children.
|
|
7228
|
+
// In this case fallback to an empty array
|
|
7229
|
+
n2.children || [],
|
|
7192
7230
|
container,
|
|
7193
7231
|
fragmentEndAnchor,
|
|
7194
7232
|
parentComponent,
|
|
@@ -8022,6 +8060,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8022
8060
|
}
|
|
8023
8061
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
8024
8062
|
};
|
|
8063
|
+
let isFlushing = false;
|
|
8025
8064
|
const render = (vnode, container, namespace) => {
|
|
8026
8065
|
if (vnode == null) {
|
|
8027
8066
|
if (container._vnode) {
|
|
@@ -8038,8 +8077,12 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8038
8077
|
namespace
|
|
8039
8078
|
);
|
|
8040
8079
|
}
|
|
8041
|
-
|
|
8042
|
-
|
|
8080
|
+
if (!isFlushing) {
|
|
8081
|
+
isFlushing = true;
|
|
8082
|
+
flushPreFlushCbs();
|
|
8083
|
+
flushPostFlushCbs();
|
|
8084
|
+
isFlushing = false;
|
|
8085
|
+
}
|
|
8043
8086
|
container._vnode = vnode;
|
|
8044
8087
|
};
|
|
8045
8088
|
const internals = {
|
|
@@ -8882,7 +8925,14 @@ Component that was made reactive: `,
|
|
|
8882
8925
|
return instance;
|
|
8883
8926
|
}
|
|
8884
8927
|
let currentInstance = null;
|
|
8885
|
-
const getCurrentInstance = () =>
|
|
8928
|
+
const getCurrentInstance = () => {
|
|
8929
|
+
if (isInComputedGetter) {
|
|
8930
|
+
warn$1(
|
|
8931
|
+
`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.`
|
|
8932
|
+
);
|
|
8933
|
+
}
|
|
8934
|
+
return currentInstance || currentRenderingInstance;
|
|
8935
|
+
};
|
|
8886
8936
|
let internalSetCurrentInstance;
|
|
8887
8937
|
let setInSSRSetupState;
|
|
8888
8938
|
{
|
|
@@ -9196,7 +9246,25 @@ Component that was made reactive: `,
|
|
|
9196
9246
|
return isFunction(value) && "__vccOpts" in value;
|
|
9197
9247
|
}
|
|
9198
9248
|
|
|
9249
|
+
let isInComputedGetter = false;
|
|
9250
|
+
function wrapComputedGetter(getter) {
|
|
9251
|
+
return () => {
|
|
9252
|
+
isInComputedGetter = true;
|
|
9253
|
+
try {
|
|
9254
|
+
return getter();
|
|
9255
|
+
} finally {
|
|
9256
|
+
isInComputedGetter = false;
|
|
9257
|
+
}
|
|
9258
|
+
};
|
|
9259
|
+
}
|
|
9199
9260
|
const computed = (getterOrOptions, debugOptions) => {
|
|
9261
|
+
{
|
|
9262
|
+
if (isFunction(getterOrOptions)) {
|
|
9263
|
+
getterOrOptions = wrapComputedGetter(getterOrOptions);
|
|
9264
|
+
} else {
|
|
9265
|
+
getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
|
|
9266
|
+
}
|
|
9267
|
+
}
|
|
9200
9268
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
9201
9269
|
};
|
|
9202
9270
|
|
|
@@ -9422,7 +9490,7 @@ Component that was made reactive: `,
|
|
|
9422
9490
|
return true;
|
|
9423
9491
|
}
|
|
9424
9492
|
|
|
9425
|
-
const version = "3.4.
|
|
9493
|
+
const version = "3.4.6";
|
|
9426
9494
|
const warn = warn$1 ;
|
|
9427
9495
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9428
9496
|
const devtools = devtools$1 ;
|
|
@@ -9819,6 +9887,9 @@ Component that was made reactive: `,
|
|
|
9819
9887
|
setDisplay(el, value);
|
|
9820
9888
|
}
|
|
9821
9889
|
};
|
|
9890
|
+
{
|
|
9891
|
+
vShow.name = "show";
|
|
9892
|
+
}
|
|
9822
9893
|
function setDisplay(el, value) {
|
|
9823
9894
|
el.style.display = value ? el[vShowOldKey] : "none";
|
|
9824
9895
|
}
|