@vue/compat 3.6.0-rc.8 → 3.6.0-rc.9
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/vue-compat.d.ts +4 -3
- package/dist/vue.cjs.js +70 -33
- package/dist/vue.cjs.prod.js +70 -33
- package/dist/vue.esm-browser.js +102 -67
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +104 -69
- package/dist/vue.global.js +102 -67
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +102 -67
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +104 -69
- package/dist/vue.runtime.global.js +102 -67
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +2 -2
package/dist/vue-compat.d.ts
CHANGED
|
@@ -375,11 +375,11 @@ type PropConstructor<T = any> = {
|
|
|
375
375
|
} | {
|
|
376
376
|
(): T;
|
|
377
377
|
} | PropMethod<T>;
|
|
378
|
-
type PropMethod<T, TConstructor = any> =
|
|
378
|
+
type PropMethod<T, TConstructor = any> = {
|
|
379
379
|
new (): TConstructor;
|
|
380
380
|
(): T;
|
|
381
381
|
readonly prototype: TConstructor;
|
|
382
|
-
}
|
|
382
|
+
};
|
|
383
383
|
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
384
384
|
required: true;
|
|
385
385
|
} | {
|
|
@@ -408,7 +408,7 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
|
|
|
408
408
|
type: DateConstructor;
|
|
409
409
|
}] ? Date : [T] extends [(infer U)[] | {
|
|
410
410
|
type: (infer U)[];
|
|
411
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
411
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, unknown extends D ? V : D> : V : V : T;
|
|
412
412
|
/**
|
|
413
413
|
* Extract prop types from a runtime props options object.
|
|
414
414
|
* The extracted types are **internal** - i.e. the resolved props received by
|
|
@@ -1048,6 +1048,7 @@ interface VaporInVdomInterface {
|
|
|
1048
1048
|
activate(vnode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null): void;
|
|
1049
1049
|
deactivate(vnode: VNode, container: RendererElement, parentSuspense: SuspenseBoundary | null): void;
|
|
1050
1050
|
setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
|
|
1051
|
+
applyCssVars(vnode: VNode, vars: Record<string, string>): void;
|
|
1051
1052
|
}
|
|
1052
1053
|
/**
|
|
1053
1054
|
* Options for rendering a VDOM slot inside vapor. `flags` carries the
|
package/dist/vue.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -238,10 +238,10 @@ function normalizeStyle(value) {
|
|
|
238
238
|
}
|
|
239
239
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
240
240
|
const propertyDelimiterRE = /:([^]+)/;
|
|
241
|
-
const styleCommentRE =
|
|
241
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
242
242
|
function parseStringStyle(cssText) {
|
|
243
243
|
const ret = {};
|
|
244
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
244
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
245
245
|
if (item) {
|
|
246
246
|
const tmp = item.split(propertyDelimiterRE);
|
|
247
247
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -407,19 +407,19 @@ function getEscapedCssVarName(key, doubleEscape) {
|
|
|
407
407
|
}
|
|
408
408
|
//#endregion
|
|
409
409
|
//#region packages/shared/src/looseEqual.ts
|
|
410
|
-
function looseCompareArrays(a, b) {
|
|
410
|
+
function looseCompareArrays(a, b, seen) {
|
|
411
411
|
if (a.length !== b.length) return false;
|
|
412
412
|
let equal = true;
|
|
413
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
413
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
414
414
|
return equal;
|
|
415
415
|
}
|
|
416
|
-
function looseCompareCollections(a, b) {
|
|
416
|
+
function looseCompareCollections(a, b, seen) {
|
|
417
417
|
if (a.size !== b.size) return false;
|
|
418
418
|
const candidates = Array.from(b);
|
|
419
419
|
const matched = new Uint8Array(candidates.length);
|
|
420
420
|
for (const item of a) {
|
|
421
421
|
let index = -1;
|
|
422
|
-
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
422
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
423
423
|
index = i;
|
|
424
424
|
break;
|
|
425
425
|
}
|
|
@@ -428,7 +428,33 @@ function looseCompareCollections(a, b) {
|
|
|
428
428
|
}
|
|
429
429
|
return true;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function looseCompareObjects(a, b, seen) {
|
|
432
|
+
let aValidType = isMap(a);
|
|
433
|
+
let bValidType = isMap(b);
|
|
434
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
435
|
+
aValidType = isSet(a);
|
|
436
|
+
bValidType = isSet(b);
|
|
437
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
438
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
439
|
+
for (const key in a) {
|
|
440
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
441
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
442
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
443
|
+
}
|
|
444
|
+
return String(a) === String(b);
|
|
445
|
+
}
|
|
446
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
447
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
448
|
+
const [seenA, seenB] = seen;
|
|
449
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
450
|
+
seenA.set(a, b);
|
|
451
|
+
seenB.set(b, a);
|
|
452
|
+
const equal = compare(a, b, seen);
|
|
453
|
+
seenA.delete(a);
|
|
454
|
+
seenB.delete(b);
|
|
455
|
+
return equal;
|
|
456
|
+
}
|
|
457
|
+
function looseEqual(a, b, seen) {
|
|
432
458
|
if (a === b) return true;
|
|
433
459
|
let aValidType = isDate(a);
|
|
434
460
|
let bValidType = isDate(b);
|
|
@@ -438,23 +464,12 @@ function looseEqual(a, b) {
|
|
|
438
464
|
if (aValidType || bValidType) return a === b;
|
|
439
465
|
aValidType = isArray(a);
|
|
440
466
|
bValidType = isArray(b);
|
|
441
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
467
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
442
468
|
aValidType = isObject(a);
|
|
443
469
|
bValidType = isObject(b);
|
|
444
470
|
if (aValidType || bValidType) {
|
|
445
471
|
if (!aValidType || !bValidType) return false;
|
|
446
|
-
|
|
447
|
-
bValidType = isMap(b);
|
|
448
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
449
|
-
aValidType = isSet(a);
|
|
450
|
-
bValidType = isSet(b);
|
|
451
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
452
|
-
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
453
|
-
for (const key in a) {
|
|
454
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
455
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
456
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
457
|
-
}
|
|
472
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
458
473
|
}
|
|
459
474
|
return String(a) === String(b);
|
|
460
475
|
}
|
|
@@ -912,13 +927,17 @@ function getDepFromReactive(object, key) {
|
|
|
912
927
|
/**
|
|
913
928
|
* Track array iteration and return:
|
|
914
929
|
* - if input is reactive: a cloned raw array with reactive values
|
|
915
|
-
* - if input is
|
|
930
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
931
|
+
* reactivity
|
|
932
|
+
* - if input is raw or shallow: the original raw array
|
|
916
933
|
*/
|
|
917
934
|
function reactiveReadArray(array) {
|
|
918
935
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
919
936
|
if (raw === array) return raw;
|
|
920
937
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
921
|
-
|
|
938
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
939
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
940
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
922
941
|
}
|
|
923
942
|
/**
|
|
924
943
|
* Track array iteration and return raw array
|
|
@@ -4450,12 +4469,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4450
4469
|
} else {
|
|
4451
4470
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4452
4471
|
const component = vnode.component;
|
|
4453
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
4472
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
4454
4473
|
let subTree;
|
|
4455
4474
|
if (isFragmentStart) {
|
|
4456
4475
|
subTree = createVNode(Static);
|
|
4457
4476
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4458
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4477
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
4459
4478
|
subTree.el = node;
|
|
4460
4479
|
component.subTree = subTree;
|
|
4461
4480
|
}
|
|
@@ -6604,7 +6623,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6604
6623
|
if (options.el) return vm.$mount(options.el);
|
|
6605
6624
|
else return vm;
|
|
6606
6625
|
}
|
|
6607
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6626
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.9`;
|
|
6608
6627
|
Vue.config = singletonApp.config;
|
|
6609
6628
|
Vue.use = (plugin, ...options) => {
|
|
6610
6629
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -7944,6 +7963,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7944
7963
|
optimized = false;
|
|
7945
7964
|
n2.dynamicChildren = null;
|
|
7946
7965
|
}
|
|
7966
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
7967
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
7968
|
+
n2.dynamicChildren.hasOnce = true;
|
|
7969
|
+
}
|
|
7947
7970
|
const { type, ref, shapeFlag } = n2;
|
|
7948
7971
|
switch (type) {
|
|
7949
7972
|
case Text:
|
|
@@ -8263,6 +8286,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8263
8286
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
8264
8287
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
8265
8288
|
pushWarningContext(n2);
|
|
8289
|
+
n2.el = n1.el;
|
|
8266
8290
|
updateComponentPreRender(instance, n2, optimized);
|
|
8267
8291
|
popWarningContext();
|
|
8268
8292
|
return;
|
|
@@ -8578,13 +8602,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8578
8602
|
};
|
|
8579
8603
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8580
8604
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8581
|
-
if (patchFlag === -2) optimized = false;
|
|
8605
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
8582
8606
|
if (ref != null) {
|
|
8583
8607
|
const prevSub = setActiveSub();
|
|
8584
8608
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
8585
8609
|
setActiveSub(prevSub);
|
|
8586
8610
|
}
|
|
8587
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8611
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8588
8612
|
if (shapeFlag & 256) {
|
|
8589
8613
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8590
8614
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -8638,6 +8662,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8638
8662
|
}
|
|
8639
8663
|
if (type === Static) {
|
|
8640
8664
|
removeStaticNode(vnode);
|
|
8665
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8641
8666
|
return;
|
|
8642
8667
|
}
|
|
8643
8668
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -8663,7 +8688,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8663
8688
|
if (effect) {
|
|
8664
8689
|
effect.stop();
|
|
8665
8690
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8666
|
-
} else if (
|
|
8691
|
+
} else if (instance.vnode.el && subTree) {
|
|
8692
|
+
subTree.transition = instance.vnode.transition;
|
|
8693
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8694
|
+
}
|
|
8667
8695
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8668
8696
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8669
8697
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8870,7 +8898,7 @@ const Suspense = {
|
|
|
8870
8898
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8871
8899
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8872
8900
|
else {
|
|
8873
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
8901
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
8874
8902
|
n2.suspense = n1.suspense;
|
|
8875
8903
|
n2.suspense.vnode = n2;
|
|
8876
8904
|
n2.el = n1.el;
|
|
@@ -8908,7 +8936,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8908
8936
|
if (pendingBranch) {
|
|
8909
8937
|
suspense.pendingBranch = newBranch;
|
|
8910
8938
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
8911
|
-
|
|
8939
|
+
suspense.deps++;
|
|
8940
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
8941
|
+
suspense.deps--;
|
|
8912
8942
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8913
8943
|
else if (isInFallback) {
|
|
8914
8944
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -9044,6 +9074,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9044
9074
|
suspense.effects = [];
|
|
9045
9075
|
if (isSuspensible) {
|
|
9046
9076
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
9077
|
+
parentSuspenseId = void 0;
|
|
9047
9078
|
parentSuspense.deps--;
|
|
9048
9079
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
9049
9080
|
}
|
|
@@ -9081,11 +9112,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9081
9112
|
registerDep(instance, onResolve) {
|
|
9082
9113
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
9083
9114
|
if (isInPendingSuspense) suspense.deps++;
|
|
9115
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
9084
9116
|
instance.asyncDep.catch((err) => {
|
|
9085
9117
|
handleError(err, instance, 0);
|
|
9086
9118
|
}).then((asyncSetupResult) => {
|
|
9087
9119
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
9088
9120
|
setCurrentInstance(null, void 0);
|
|
9121
|
+
if (hydratedEl && !instance.scope.active) {
|
|
9122
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
9123
|
+
return;
|
|
9124
|
+
}
|
|
9089
9125
|
instance.asyncResolved = true;
|
|
9090
9126
|
onResolve(asyncSetupResult);
|
|
9091
9127
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -9441,7 +9477,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
9441
9477
|
vs: cloneVaporSlotMeta(vnode),
|
|
9442
9478
|
vb: vnode.vb,
|
|
9443
9479
|
ibu: vnode.ibu,
|
|
9444
|
-
iu: vnode.iu
|
|
9480
|
+
iu: vnode.iu,
|
|
9481
|
+
cacheIndex: vnode.cacheIndex
|
|
9445
9482
|
};
|
|
9446
9483
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9447
9484
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10157,7 +10194,7 @@ function isMemoSame(cached, memo) {
|
|
|
10157
10194
|
}
|
|
10158
10195
|
//#endregion
|
|
10159
10196
|
//#region packages/runtime-core/src/index.ts
|
|
10160
|
-
const version = "3.6.0-rc.
|
|
10197
|
+
const version = "3.6.0-rc.9";
|
|
10161
10198
|
const warn = warn$1;
|
|
10162
10199
|
/**
|
|
10163
10200
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -168,10 +168,10 @@ function normalizeStyle(value) {
|
|
|
168
168
|
}
|
|
169
169
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
170
170
|
const propertyDelimiterRE = /:([^]+)/;
|
|
171
|
-
const styleCommentRE =
|
|
171
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
172
172
|
function parseStringStyle(cssText) {
|
|
173
173
|
const ret = {};
|
|
174
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
174
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
175
175
|
if (item) {
|
|
176
176
|
const tmp = item.split(propertyDelimiterRE);
|
|
177
177
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -325,19 +325,19 @@ function escapeHtml(string) {
|
|
|
325
325
|
}
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region packages/shared/src/looseEqual.ts
|
|
328
|
-
function looseCompareArrays(a, b) {
|
|
328
|
+
function looseCompareArrays(a, b, seen) {
|
|
329
329
|
if (a.length !== b.length) return false;
|
|
330
330
|
let equal = true;
|
|
331
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
331
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
332
332
|
return equal;
|
|
333
333
|
}
|
|
334
|
-
function looseCompareCollections(a, b) {
|
|
334
|
+
function looseCompareCollections(a, b, seen) {
|
|
335
335
|
if (a.size !== b.size) return false;
|
|
336
336
|
const candidates = Array.from(b);
|
|
337
337
|
const matched = new Uint8Array(candidates.length);
|
|
338
338
|
for (const item of a) {
|
|
339
339
|
let index = -1;
|
|
340
|
-
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
340
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
341
341
|
index = i;
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
@@ -346,7 +346,33 @@ function looseCompareCollections(a, b) {
|
|
|
346
346
|
}
|
|
347
347
|
return true;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function looseCompareObjects(a, b, seen) {
|
|
350
|
+
let aValidType = isMap(a);
|
|
351
|
+
let bValidType = isMap(b);
|
|
352
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
353
|
+
aValidType = isSet(a);
|
|
354
|
+
bValidType = isSet(b);
|
|
355
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
356
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
357
|
+
for (const key in a) {
|
|
358
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
359
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
360
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
361
|
+
}
|
|
362
|
+
return String(a) === String(b);
|
|
363
|
+
}
|
|
364
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
365
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
366
|
+
const [seenA, seenB] = seen;
|
|
367
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
368
|
+
seenA.set(a, b);
|
|
369
|
+
seenB.set(b, a);
|
|
370
|
+
const equal = compare(a, b, seen);
|
|
371
|
+
seenA.delete(a);
|
|
372
|
+
seenB.delete(b);
|
|
373
|
+
return equal;
|
|
374
|
+
}
|
|
375
|
+
function looseEqual(a, b, seen) {
|
|
350
376
|
if (a === b) return true;
|
|
351
377
|
let aValidType = isDate(a);
|
|
352
378
|
let bValidType = isDate(b);
|
|
@@ -356,23 +382,12 @@ function looseEqual(a, b) {
|
|
|
356
382
|
if (aValidType || bValidType) return a === b;
|
|
357
383
|
aValidType = isArray(a);
|
|
358
384
|
bValidType = isArray(b);
|
|
359
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
385
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
360
386
|
aValidType = isObject(a);
|
|
361
387
|
bValidType = isObject(b);
|
|
362
388
|
if (aValidType || bValidType) {
|
|
363
389
|
if (!aValidType || !bValidType) return false;
|
|
364
|
-
|
|
365
|
-
bValidType = isMap(b);
|
|
366
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
367
|
-
aValidType = isSet(a);
|
|
368
|
-
bValidType = isSet(b);
|
|
369
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
370
|
-
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
371
|
-
for (const key in a) {
|
|
372
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
373
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
374
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
375
|
-
}
|
|
390
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
376
391
|
}
|
|
377
392
|
return String(a) === String(b);
|
|
378
393
|
}
|
|
@@ -763,13 +778,17 @@ function getDepFromReactive(object, key) {
|
|
|
763
778
|
/**
|
|
764
779
|
* Track array iteration and return:
|
|
765
780
|
* - if input is reactive: a cloned raw array with reactive values
|
|
766
|
-
* - if input is
|
|
781
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
782
|
+
* reactivity
|
|
783
|
+
* - if input is raw or shallow: the original raw array
|
|
767
784
|
*/
|
|
768
785
|
function reactiveReadArray(array) {
|
|
769
786
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
770
787
|
if (raw === array) return raw;
|
|
771
788
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
772
|
-
|
|
789
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
790
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
791
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
773
792
|
}
|
|
774
793
|
/**
|
|
775
794
|
* Track array iteration and return raw array
|
|
@@ -3635,12 +3654,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3635
3654
|
} else {
|
|
3636
3655
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3637
3656
|
const component = vnode.component;
|
|
3638
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
3657
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
3639
3658
|
let subTree;
|
|
3640
3659
|
if (isFragmentStart) {
|
|
3641
3660
|
subTree = createVNode(Static);
|
|
3642
3661
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3643
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3662
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
3644
3663
|
subTree.el = node;
|
|
3645
3664
|
component.subTree = subTree;
|
|
3646
3665
|
}
|
|
@@ -5455,7 +5474,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5455
5474
|
if (options.el) return vm.$mount(options.el);
|
|
5456
5475
|
else return vm;
|
|
5457
5476
|
}
|
|
5458
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
5477
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.9`;
|
|
5459
5478
|
Vue.config = singletonApp.config;
|
|
5460
5479
|
Vue.use = (plugin, ...options) => {
|
|
5461
5480
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6468,6 +6487,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6468
6487
|
optimized = false;
|
|
6469
6488
|
n2.dynamicChildren = null;
|
|
6470
6489
|
}
|
|
6490
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
6491
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
6492
|
+
n2.dynamicChildren.hasOnce = true;
|
|
6493
|
+
}
|
|
6471
6494
|
const { type, ref, shapeFlag } = n2;
|
|
6472
6495
|
switch (type) {
|
|
6473
6496
|
case Text:
|
|
@@ -6742,6 +6765,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6742
6765
|
const instance = n2.component = n1.component;
|
|
6743
6766
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
6744
6767
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
6768
|
+
n2.el = n1.el;
|
|
6745
6769
|
updateComponentPreRender(instance, n2, optimized);
|
|
6746
6770
|
return;
|
|
6747
6771
|
} else {
|
|
@@ -7035,13 +7059,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7035
7059
|
};
|
|
7036
7060
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
7037
7061
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
7038
|
-
if (patchFlag === -2) optimized = false;
|
|
7062
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
7039
7063
|
if (ref != null) {
|
|
7040
7064
|
const prevSub = setActiveSub();
|
|
7041
7065
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
7042
7066
|
setActiveSub(prevSub);
|
|
7043
7067
|
}
|
|
7044
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7068
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7045
7069
|
if (shapeFlag & 256) {
|
|
7046
7070
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
7047
7071
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -7091,6 +7115,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7091
7115
|
}
|
|
7092
7116
|
if (type === Static) {
|
|
7093
7117
|
removeStaticNode(vnode);
|
|
7118
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
7094
7119
|
return;
|
|
7095
7120
|
}
|
|
7096
7121
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -7115,7 +7140,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7115
7140
|
if (effect) {
|
|
7116
7141
|
effect.stop();
|
|
7117
7142
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7118
|
-
} else if (
|
|
7143
|
+
} else if (instance.vnode.el && subTree) {
|
|
7144
|
+
subTree.transition = instance.vnode.transition;
|
|
7145
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7146
|
+
}
|
|
7119
7147
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7120
7148
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
7121
7149
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -7311,7 +7339,7 @@ const Suspense = {
|
|
|
7311
7339
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7312
7340
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7313
7341
|
else {
|
|
7314
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
7342
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
7315
7343
|
n2.suspense = n1.suspense;
|
|
7316
7344
|
n2.suspense.vnode = n2;
|
|
7317
7345
|
n2.el = n1.el;
|
|
@@ -7349,7 +7377,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7349
7377
|
if (pendingBranch) {
|
|
7350
7378
|
suspense.pendingBranch = newBranch;
|
|
7351
7379
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
7352
|
-
|
|
7380
|
+
suspense.deps++;
|
|
7381
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7382
|
+
suspense.deps--;
|
|
7353
7383
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7354
7384
|
else if (isInFallback) {
|
|
7355
7385
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -7476,6 +7506,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7476
7506
|
suspense.effects = [];
|
|
7477
7507
|
if (isSuspensible) {
|
|
7478
7508
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
7509
|
+
parentSuspenseId = void 0;
|
|
7479
7510
|
parentSuspense.deps--;
|
|
7480
7511
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
7481
7512
|
}
|
|
@@ -7513,11 +7544,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7513
7544
|
registerDep(instance, onResolve) {
|
|
7514
7545
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7515
7546
|
if (isInPendingSuspense) suspense.deps++;
|
|
7547
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
7516
7548
|
instance.asyncDep.catch((err) => {
|
|
7517
7549
|
handleError(err, instance, 0);
|
|
7518
7550
|
}).then((asyncSetupResult) => {
|
|
7519
7551
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7520
7552
|
setCurrentInstance(null, void 0);
|
|
7553
|
+
if (hydratedEl && !instance.scope.active) {
|
|
7554
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
7555
|
+
return;
|
|
7556
|
+
}
|
|
7521
7557
|
instance.asyncResolved = true;
|
|
7522
7558
|
onResolve(asyncSetupResult);
|
|
7523
7559
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -7832,7 +7868,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7832
7868
|
vs: cloneVaporSlotMeta(vnode),
|
|
7833
7869
|
vb: vnode.vb,
|
|
7834
7870
|
ibu: vnode.ibu,
|
|
7835
|
-
iu: vnode.iu
|
|
7871
|
+
iu: vnode.iu,
|
|
7872
|
+
cacheIndex: vnode.cacheIndex
|
|
7836
7873
|
};
|
|
7837
7874
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7838
7875
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -8283,7 +8320,7 @@ function isMemoSame(cached, memo) {
|
|
|
8283
8320
|
}
|
|
8284
8321
|
//#endregion
|
|
8285
8322
|
//#region packages/runtime-core/src/index.ts
|
|
8286
|
-
const version = "3.6.0-rc.
|
|
8323
|
+
const version = "3.6.0-rc.9";
|
|
8287
8324
|
const warn = NOOP;
|
|
8288
8325
|
/**
|
|
8289
8326
|
* Runtime error messages. Only exposed in dev or esm builds.
|