@vue/compat 3.2.36 → 3.2.39
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.cjs.js +1178 -1128
- package/dist/vue.cjs.prod.js +987 -943
- package/dist/vue.esm-browser.js +1120 -1070
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +1124 -1076
- package/dist/vue.global.js +1120 -1070
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +545 -508
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +549 -514
- package/dist/vue.runtime.global.js +545 -508
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
|
@@ -638,7 +638,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
640
|
let deps = [];
|
|
641
|
-
if (type === "clear" /* CLEAR */) {
|
|
641
|
+
if (type === "clear" /* TriggerOpTypes.CLEAR */) {
|
|
642
642
|
// collection being cleared
|
|
643
643
|
// trigger all effects for target
|
|
644
644
|
deps = [...depsMap.values()];
|
|
@@ -657,7 +657,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
657
657
|
}
|
|
658
658
|
// also run for iteration key on ADD | DELETE | Map.SET
|
|
659
659
|
switch (type) {
|
|
660
|
-
case "add" /* ADD */:
|
|
660
|
+
case "add" /* TriggerOpTypes.ADD */:
|
|
661
661
|
if (!isArray(target)) {
|
|
662
662
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
663
663
|
if (isMap(target)) {
|
|
@@ -669,7 +669,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
669
669
|
deps.push(depsMap.get('length'));
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
|
-
case "delete" /* DELETE */:
|
|
672
|
+
case "delete" /* TriggerOpTypes.DELETE */:
|
|
673
673
|
if (!isArray(target)) {
|
|
674
674
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
675
675
|
if (isMap(target)) {
|
|
@@ -677,7 +677,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
break;
|
|
680
|
-
case "set" /* SET */:
|
|
680
|
+
case "set" /* TriggerOpTypes.SET */:
|
|
681
681
|
if (isMap(target)) {
|
|
682
682
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
683
683
|
}
|
|
@@ -754,7 +754,7 @@ function createArrayInstrumentations() {
|
|
|
754
754
|
instrumentations[key] = function (...args) {
|
|
755
755
|
const arr = toRaw(this);
|
|
756
756
|
for (let i = 0, l = this.length; i < l; i++) {
|
|
757
|
-
track(arr, "get" /* GET */, i + '');
|
|
757
|
+
track(arr, "get" /* TrackOpTypes.GET */, i + '');
|
|
758
758
|
}
|
|
759
759
|
// we run the method using the original args first (which may be reactive)
|
|
760
760
|
const res = arr[key](...args);
|
|
@@ -779,16 +779,16 @@ function createArrayInstrumentations() {
|
|
|
779
779
|
}
|
|
780
780
|
function createGetter(isReadonly = false, shallow = false) {
|
|
781
781
|
return function get(target, key, receiver) {
|
|
782
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
782
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
783
783
|
return !isReadonly;
|
|
784
784
|
}
|
|
785
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
785
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
786
786
|
return isReadonly;
|
|
787
787
|
}
|
|
788
|
-
else if (key === "__v_isShallow" /* IS_SHALLOW */) {
|
|
788
|
+
else if (key === "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */) {
|
|
789
789
|
return shallow;
|
|
790
790
|
}
|
|
791
|
-
else if (key === "__v_raw" /* RAW */ &&
|
|
791
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */ &&
|
|
792
792
|
receiver ===
|
|
793
793
|
(isReadonly
|
|
794
794
|
? shallow
|
|
@@ -808,7 +808,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
808
808
|
return res;
|
|
809
809
|
}
|
|
810
810
|
if (!isReadonly) {
|
|
811
|
-
track(target, "get" /* GET */, key);
|
|
811
|
+
track(target, "get" /* TrackOpTypes.GET */, key);
|
|
812
812
|
}
|
|
813
813
|
if (shallow) {
|
|
814
814
|
return res;
|
|
@@ -834,10 +834,10 @@ function createSetter(shallow = false) {
|
|
|
834
834
|
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
835
835
|
return false;
|
|
836
836
|
}
|
|
837
|
-
if (!shallow
|
|
838
|
-
if (!isShallow(value)) {
|
|
839
|
-
value = toRaw(value);
|
|
837
|
+
if (!shallow) {
|
|
838
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
840
839
|
oldValue = toRaw(oldValue);
|
|
840
|
+
value = toRaw(value);
|
|
841
841
|
}
|
|
842
842
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
843
843
|
oldValue.value = value;
|
|
@@ -851,10 +851,10 @@ function createSetter(shallow = false) {
|
|
|
851
851
|
// don't trigger if target is something up in the prototype chain of original
|
|
852
852
|
if (target === toRaw(receiver)) {
|
|
853
853
|
if (!hadKey) {
|
|
854
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
854
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
855
855
|
}
|
|
856
856
|
else if (hasChanged(value, oldValue)) {
|
|
857
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
857
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
return result;
|
|
@@ -865,19 +865,19 @@ function deleteProperty(target, key) {
|
|
|
865
865
|
const oldValue = target[key];
|
|
866
866
|
const result = Reflect.deleteProperty(target, key);
|
|
867
867
|
if (result && hadKey) {
|
|
868
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
868
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
869
869
|
}
|
|
870
870
|
return result;
|
|
871
871
|
}
|
|
872
872
|
function has(target, key) {
|
|
873
873
|
const result = Reflect.has(target, key);
|
|
874
874
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
875
|
-
track(target, "has" /* HAS */, key);
|
|
875
|
+
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
876
876
|
}
|
|
877
877
|
return result;
|
|
878
878
|
}
|
|
879
879
|
function ownKeys(target) {
|
|
880
|
-
track(target, "iterate" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
880
|
+
track(target, "iterate" /* TrackOpTypes.ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
881
881
|
return Reflect.ownKeys(target);
|
|
882
882
|
}
|
|
883
883
|
const mutableHandlers = {
|
|
@@ -918,14 +918,14 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
|
918
918
|
function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
919
919
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
920
920
|
// of the value
|
|
921
|
-
target = target["__v_raw" /* RAW */];
|
|
921
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
922
922
|
const rawTarget = toRaw(target);
|
|
923
923
|
const rawKey = toRaw(key);
|
|
924
924
|
if (!isReadonly) {
|
|
925
925
|
if (key !== rawKey) {
|
|
926
|
-
track(rawTarget, "get" /* GET */, key);
|
|
926
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, key);
|
|
927
927
|
}
|
|
928
|
-
track(rawTarget, "get" /* GET */, rawKey);
|
|
928
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, rawKey);
|
|
929
929
|
}
|
|
930
930
|
const { has } = getProto(rawTarget);
|
|
931
931
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
@@ -942,22 +942,22 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
function has$1(key, isReadonly = false) {
|
|
945
|
-
const target = this["__v_raw" /* RAW */];
|
|
945
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
946
946
|
const rawTarget = toRaw(target);
|
|
947
947
|
const rawKey = toRaw(key);
|
|
948
948
|
if (!isReadonly) {
|
|
949
949
|
if (key !== rawKey) {
|
|
950
|
-
track(rawTarget, "has" /* HAS */, key);
|
|
950
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, key);
|
|
951
951
|
}
|
|
952
|
-
track(rawTarget, "has" /* HAS */, rawKey);
|
|
952
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, rawKey);
|
|
953
953
|
}
|
|
954
954
|
return key === rawKey
|
|
955
955
|
? target.has(key)
|
|
956
956
|
: target.has(key) || target.has(rawKey);
|
|
957
957
|
}
|
|
958
958
|
function size(target, isReadonly = false) {
|
|
959
|
-
target = target["__v_raw" /* RAW */];
|
|
960
|
-
!isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
|
|
959
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
960
|
+
!isReadonly && track(toRaw(target), "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
961
961
|
return Reflect.get(target, 'size', target);
|
|
962
962
|
}
|
|
963
963
|
function add(value) {
|
|
@@ -967,7 +967,7 @@ function add(value) {
|
|
|
967
967
|
const hadKey = proto.has.call(target, value);
|
|
968
968
|
if (!hadKey) {
|
|
969
969
|
target.add(value);
|
|
970
|
-
trigger(target, "add" /* ADD */, value, value);
|
|
970
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, value, value);
|
|
971
971
|
}
|
|
972
972
|
return this;
|
|
973
973
|
}
|
|
@@ -986,10 +986,10 @@ function set$1(key, value) {
|
|
|
986
986
|
const oldValue = get.call(target, key);
|
|
987
987
|
target.set(key, value);
|
|
988
988
|
if (!hadKey) {
|
|
989
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
989
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
990
990
|
}
|
|
991
991
|
else if (hasChanged(value, oldValue)) {
|
|
992
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
992
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
993
993
|
}
|
|
994
994
|
return this;
|
|
995
995
|
}
|
|
@@ -1008,7 +1008,7 @@ function deleteEntry(key) {
|
|
|
1008
1008
|
// forward the operation before queueing reactions
|
|
1009
1009
|
const result = target.delete(key);
|
|
1010
1010
|
if (hadKey) {
|
|
1011
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
1011
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
1012
1012
|
}
|
|
1013
1013
|
return result;
|
|
1014
1014
|
}
|
|
@@ -1022,17 +1022,17 @@ function clear() {
|
|
|
1022
1022
|
// forward the operation before queueing reactions
|
|
1023
1023
|
const result = target.clear();
|
|
1024
1024
|
if (hadItems) {
|
|
1025
|
-
trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
|
|
1025
|
+
trigger(target, "clear" /* TriggerOpTypes.CLEAR */, undefined, undefined, oldTarget);
|
|
1026
1026
|
}
|
|
1027
1027
|
return result;
|
|
1028
1028
|
}
|
|
1029
1029
|
function createForEach(isReadonly, isShallow) {
|
|
1030
1030
|
return function forEach(callback, thisArg) {
|
|
1031
1031
|
const observed = this;
|
|
1032
|
-
const target = observed["__v_raw" /* RAW */];
|
|
1032
|
+
const target = observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1033
1033
|
const rawTarget = toRaw(target);
|
|
1034
1034
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1035
|
-
!isReadonly && track(rawTarget, "iterate" /* ITERATE */, ITERATE_KEY);
|
|
1035
|
+
!isReadonly && track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
1036
1036
|
return target.forEach((value, key) => {
|
|
1037
1037
|
// important: make sure the callback is
|
|
1038
1038
|
// 1. invoked with the reactive map as `this` and 3rd arg
|
|
@@ -1043,7 +1043,7 @@ function createForEach(isReadonly, isShallow) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
function createIterableMethod(method, isReadonly, isShallow) {
|
|
1045
1045
|
return function (...args) {
|
|
1046
|
-
const target = this["__v_raw" /* RAW */];
|
|
1046
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1047
1047
|
const rawTarget = toRaw(target);
|
|
1048
1048
|
const targetIsMap = isMap(rawTarget);
|
|
1049
1049
|
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
|
|
@@ -1051,7 +1051,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
|
|
|
1051
1051
|
const innerIterator = target[method](...args);
|
|
1052
1052
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1053
1053
|
!isReadonly &&
|
|
1054
|
-
track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1054
|
+
track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1055
1055
|
// return a wrapped iterator which returns observed versions of the
|
|
1056
1056
|
// values emitted from the real iterator
|
|
1057
1057
|
return {
|
|
@@ -1078,7 +1078,7 @@ function createReadonlyMethod(type) {
|
|
|
1078
1078
|
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
1079
1079
|
console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
1080
1080
|
}
|
|
1081
|
-
return type === "delete" /* DELETE */ ? false : this;
|
|
1081
|
+
return type === "delete" /* TriggerOpTypes.DELETE */ ? false : this;
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
1084
|
function createInstrumentations() {
|
|
@@ -1120,10 +1120,10 @@ function createInstrumentations() {
|
|
|
1120
1120
|
has(key) {
|
|
1121
1121
|
return has$1.call(this, key, true);
|
|
1122
1122
|
},
|
|
1123
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1124
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1125
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1126
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1123
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1124
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1125
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1126
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1127
1127
|
forEach: createForEach(true, false)
|
|
1128
1128
|
};
|
|
1129
1129
|
const shallowReadonlyInstrumentations = {
|
|
@@ -1136,10 +1136,10 @@ function createInstrumentations() {
|
|
|
1136
1136
|
has(key) {
|
|
1137
1137
|
return has$1.call(this, key, true);
|
|
1138
1138
|
},
|
|
1139
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1140
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1141
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1142
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1139
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1140
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1141
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1142
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1143
1143
|
forEach: createForEach(true, true)
|
|
1144
1144
|
};
|
|
1145
1145
|
const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
|
|
@@ -1166,13 +1166,13 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1166
1166
|
? readonlyInstrumentations
|
|
1167
1167
|
: mutableInstrumentations;
|
|
1168
1168
|
return (target, key, receiver) => {
|
|
1169
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
1169
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
1170
1170
|
return !isReadonly;
|
|
1171
1171
|
}
|
|
1172
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
1172
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
1173
1173
|
return isReadonly;
|
|
1174
1174
|
}
|
|
1175
|
-
else if (key === "__v_raw" /* RAW */) {
|
|
1175
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */) {
|
|
1176
1176
|
return target;
|
|
1177
1177
|
}
|
|
1178
1178
|
return Reflect.get(hasOwn(instrumentations, key) && key in target
|
|
@@ -1212,19 +1212,19 @@ function targetTypeMap(rawType) {
|
|
|
1212
1212
|
switch (rawType) {
|
|
1213
1213
|
case 'Object':
|
|
1214
1214
|
case 'Array':
|
|
1215
|
-
return 1 /* COMMON */;
|
|
1215
|
+
return 1 /* TargetType.COMMON */;
|
|
1216
1216
|
case 'Map':
|
|
1217
1217
|
case 'Set':
|
|
1218
1218
|
case 'WeakMap':
|
|
1219
1219
|
case 'WeakSet':
|
|
1220
|
-
return 2 /* COLLECTION */;
|
|
1220
|
+
return 2 /* TargetType.COLLECTION */;
|
|
1221
1221
|
default:
|
|
1222
|
-
return 0 /* INVALID */;
|
|
1222
|
+
return 0 /* TargetType.INVALID */;
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
function getTargetType(value) {
|
|
1226
|
-
return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
|
|
1227
|
-
? 0 /* INVALID */
|
|
1226
|
+
return value["__v_skip" /* ReactiveFlags.SKIP */] || !Object.isExtensible(value)
|
|
1227
|
+
? 0 /* TargetType.INVALID */
|
|
1228
1228
|
: targetTypeMap(toRawType(value));
|
|
1229
1229
|
}
|
|
1230
1230
|
function reactive(target) {
|
|
@@ -1267,8 +1267,8 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1267
1267
|
}
|
|
1268
1268
|
// target is already a Proxy, return it.
|
|
1269
1269
|
// exception: calling readonly() on a reactive object
|
|
1270
|
-
if (target["__v_raw" /* RAW */] &&
|
|
1271
|
-
!(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
|
|
1270
|
+
if (target["__v_raw" /* ReactiveFlags.RAW */] &&
|
|
1271
|
+
!(isReadonly && target["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */])) {
|
|
1272
1272
|
return target;
|
|
1273
1273
|
}
|
|
1274
1274
|
// target already has corresponding Proxy
|
|
@@ -1278,34 +1278,34 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1278
1278
|
}
|
|
1279
1279
|
// only specific value types can be observed.
|
|
1280
1280
|
const targetType = getTargetType(target);
|
|
1281
|
-
if (targetType === 0 /* INVALID */) {
|
|
1281
|
+
if (targetType === 0 /* TargetType.INVALID */) {
|
|
1282
1282
|
return target;
|
|
1283
1283
|
}
|
|
1284
|
-
const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1284
|
+
const proxy = new Proxy(target, targetType === 2 /* TargetType.COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1285
1285
|
proxyMap.set(target, proxy);
|
|
1286
1286
|
return proxy;
|
|
1287
1287
|
}
|
|
1288
1288
|
function isReactive(value) {
|
|
1289
1289
|
if (isReadonly(value)) {
|
|
1290
|
-
return isReactive(value["__v_raw" /* RAW */]);
|
|
1290
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1291
1291
|
}
|
|
1292
|
-
return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
|
|
1292
|
+
return !!(value && value["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */]);
|
|
1293
1293
|
}
|
|
1294
1294
|
function isReadonly(value) {
|
|
1295
|
-
return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
|
|
1295
|
+
return !!(value && value["__v_isReadonly" /* ReactiveFlags.IS_READONLY */]);
|
|
1296
1296
|
}
|
|
1297
1297
|
function isShallow(value) {
|
|
1298
|
-
return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
|
|
1298
|
+
return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
|
|
1299
1299
|
}
|
|
1300
1300
|
function isProxy(value) {
|
|
1301
1301
|
return isReactive(value) || isReadonly(value);
|
|
1302
1302
|
}
|
|
1303
1303
|
function toRaw(observed) {
|
|
1304
|
-
const raw = observed && observed["__v_raw" /* RAW */];
|
|
1304
|
+
const raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1305
1305
|
return raw ? toRaw(raw) : observed;
|
|
1306
1306
|
}
|
|
1307
1307
|
function markRaw(value) {
|
|
1308
|
-
def(value, "__v_skip" /* SKIP */, true);
|
|
1308
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1309
1309
|
return value;
|
|
1310
1310
|
}
|
|
1311
1311
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
@@ -1317,7 +1317,7 @@ function trackRefValue(ref) {
|
|
|
1317
1317
|
{
|
|
1318
1318
|
trackEffects(ref.dep || (ref.dep = createDep()), {
|
|
1319
1319
|
target: ref,
|
|
1320
|
-
type: "get" /* GET */,
|
|
1320
|
+
type: "get" /* TrackOpTypes.GET */,
|
|
1321
1321
|
key: 'value'
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
@@ -1329,7 +1329,7 @@ function triggerRefValue(ref, newVal) {
|
|
|
1329
1329
|
{
|
|
1330
1330
|
triggerEffects(ref.dep, {
|
|
1331
1331
|
target: ref,
|
|
1332
|
-
type: "set" /* SET */,
|
|
1332
|
+
type: "set" /* TriggerOpTypes.SET */,
|
|
1333
1333
|
key: 'value',
|
|
1334
1334
|
newValue: newVal
|
|
1335
1335
|
});
|
|
@@ -1364,10 +1364,11 @@ class RefImpl {
|
|
|
1364
1364
|
return this._value;
|
|
1365
1365
|
}
|
|
1366
1366
|
set value(newVal) {
|
|
1367
|
-
|
|
1367
|
+
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1368
|
+
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1368
1369
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1369
1370
|
this._rawValue = newVal;
|
|
1370
|
-
this._value =
|
|
1371
|
+
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1371
1372
|
triggerRefValue(this, newVal);
|
|
1372
1373
|
}
|
|
1373
1374
|
}
|
|
@@ -1446,11 +1447,13 @@ function toRef(object, key, defaultValue) {
|
|
|
1446
1447
|
: new ObjectRefImpl(object, key, defaultValue);
|
|
1447
1448
|
}
|
|
1448
1449
|
|
|
1450
|
+
var _a;
|
|
1449
1451
|
class ComputedRefImpl {
|
|
1450
1452
|
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1451
1453
|
this._setter = _setter;
|
|
1452
1454
|
this.dep = undefined;
|
|
1453
1455
|
this.__v_isRef = true;
|
|
1456
|
+
this[_a] = false;
|
|
1454
1457
|
this._dirty = true;
|
|
1455
1458
|
this.effect = new ReactiveEffect(getter, () => {
|
|
1456
1459
|
if (!this._dirty) {
|
|
@@ -1460,7 +1463,7 @@ class ComputedRefImpl {
|
|
|
1460
1463
|
});
|
|
1461
1464
|
this.effect.computed = this;
|
|
1462
1465
|
this.effect.active = this._cacheable = !isSSR;
|
|
1463
|
-
this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
|
|
1466
|
+
this["__v_isReadonly" /* ReactiveFlags.IS_READONLY */] = isReadonly;
|
|
1464
1467
|
}
|
|
1465
1468
|
get value() {
|
|
1466
1469
|
// the computed ref may get wrapped by other proxies e.g. readonly() #3376
|
|
@@ -1476,6 +1479,7 @@ class ComputedRefImpl {
|
|
|
1476
1479
|
this._setter(newValue);
|
|
1477
1480
|
}
|
|
1478
1481
|
}
|
|
1482
|
+
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1479
1483
|
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1480
1484
|
let getter;
|
|
1481
1485
|
let setter;
|
|
@@ -1514,7 +1518,7 @@ function warn$1(msg, ...args) {
|
|
|
1514
1518
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1515
1519
|
const trace = getComponentTrace();
|
|
1516
1520
|
if (appWarnHandler) {
|
|
1517
|
-
callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
|
|
1521
|
+
callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
|
|
1518
1522
|
msg + args.join(''),
|
|
1519
1523
|
instance && instance.proxy,
|
|
1520
1524
|
trace
|
|
@@ -1614,35 +1618,35 @@ function formatProp(key, value, raw) {
|
|
|
1614
1618
|
}
|
|
1615
1619
|
|
|
1616
1620
|
const ErrorTypeStrings = {
|
|
1617
|
-
["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1618
|
-
["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1619
|
-
["c" /* CREATED */]: 'created hook',
|
|
1620
|
-
["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1621
|
-
["m" /* MOUNTED */]: 'mounted hook',
|
|
1622
|
-
["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1623
|
-
["u" /* UPDATED */]: 'updated',
|
|
1624
|
-
["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1625
|
-
["um" /* UNMOUNTED */]: 'unmounted hook',
|
|
1626
|
-
["a" /* ACTIVATED */]: 'activated hook',
|
|
1627
|
-
["da" /* DEACTIVATED */]: 'deactivated hook',
|
|
1628
|
-
["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1629
|
-
["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
|
|
1630
|
-
["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1631
|
-
[0 /* SETUP_FUNCTION */]: 'setup function',
|
|
1632
|
-
[1 /* RENDER_FUNCTION */]: 'render function',
|
|
1633
|
-
[2 /* WATCH_GETTER */]: 'watcher getter',
|
|
1634
|
-
[3 /* WATCH_CALLBACK */]: 'watcher callback',
|
|
1635
|
-
[4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1636
|
-
[5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1637
|
-
[6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1638
|
-
[7 /* VNODE_HOOK */]: 'vnode hook',
|
|
1639
|
-
[8 /* DIRECTIVE_HOOK */]: 'directive hook',
|
|
1640
|
-
[9 /* TRANSITION_HOOK */]: 'transition hook',
|
|
1641
|
-
[10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1642
|
-
[11 /* APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1643
|
-
[12 /* FUNCTION_REF */]: 'ref function',
|
|
1644
|
-
[13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1645
|
-
[14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1621
|
+
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1622
|
+
["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1623
|
+
["c" /* LifecycleHooks.CREATED */]: 'created hook',
|
|
1624
|
+
["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1625
|
+
["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
|
|
1626
|
+
["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1627
|
+
["u" /* LifecycleHooks.UPDATED */]: 'updated',
|
|
1628
|
+
["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1629
|
+
["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
|
|
1630
|
+
["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
|
|
1631
|
+
["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
|
|
1632
|
+
["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1633
|
+
["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
|
|
1634
|
+
["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1635
|
+
[0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
|
|
1636
|
+
[1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
|
|
1637
|
+
[2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
|
|
1638
|
+
[3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
|
|
1639
|
+
[4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1640
|
+
[5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1641
|
+
[6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1642
|
+
[7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
|
|
1643
|
+
[8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
|
|
1644
|
+
[9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
|
|
1645
|
+
[10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1646
|
+
[11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1647
|
+
[12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
|
|
1648
|
+
[13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1649
|
+
[14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1646
1650
|
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
|
|
1647
1651
|
};
|
|
1648
1652
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
@@ -1693,7 +1697,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1693
1697
|
// app-level handling
|
|
1694
1698
|
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
1695
1699
|
if (appErrorHandler) {
|
|
1696
|
-
callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1700
|
+
callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1697
1701
|
return;
|
|
1698
1702
|
}
|
|
1699
1703
|
}
|
|
@@ -1723,15 +1727,11 @@ let isFlushing = false;
|
|
|
1723
1727
|
let isFlushPending = false;
|
|
1724
1728
|
const queue = [];
|
|
1725
1729
|
let flushIndex = 0;
|
|
1726
|
-
const pendingPreFlushCbs = [];
|
|
1727
|
-
let activePreFlushCbs = null;
|
|
1728
|
-
let preFlushIndex = 0;
|
|
1729
1730
|
const pendingPostFlushCbs = [];
|
|
1730
1731
|
let activePostFlushCbs = null;
|
|
1731
1732
|
let postFlushIndex = 0;
|
|
1732
1733
|
const resolvedPromise = /*#__PURE__*/ Promise.resolve();
|
|
1733
1734
|
let currentFlushPromise = null;
|
|
1734
|
-
let currentPreFlushParentJob = null;
|
|
1735
1735
|
const RECURSION_LIMIT = 100;
|
|
1736
1736
|
function nextTick(fn) {
|
|
1737
1737
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -1759,9 +1759,8 @@ function queueJob(job) {
|
|
|
1759
1759
|
// if the job is a watch() callback, the search will start with a +1 index to
|
|
1760
1760
|
// allow it recursively trigger itself - it is the user's responsibility to
|
|
1761
1761
|
// ensure it doesn't end up in an infinite loop.
|
|
1762
|
-
if (
|
|
1763
|
-
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex))
|
|
1764
|
-
job !== currentPreFlushParentJob) {
|
|
1762
|
+
if (!queue.length ||
|
|
1763
|
+
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
|
|
1765
1764
|
if (job.id == null) {
|
|
1766
1765
|
queue.push(job);
|
|
1767
1766
|
}
|
|
@@ -1783,51 +1782,40 @@ function invalidateJob(job) {
|
|
|
1783
1782
|
queue.splice(i, 1);
|
|
1784
1783
|
}
|
|
1785
1784
|
}
|
|
1786
|
-
function
|
|
1785
|
+
function queuePostFlushCb(cb) {
|
|
1787
1786
|
if (!isArray(cb)) {
|
|
1788
|
-
if (!
|
|
1789
|
-
!
|
|
1790
|
-
|
|
1787
|
+
if (!activePostFlushCbs ||
|
|
1788
|
+
!activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
|
|
1789
|
+
pendingPostFlushCbs.push(cb);
|
|
1791
1790
|
}
|
|
1792
1791
|
}
|
|
1793
1792
|
else {
|
|
1794
1793
|
// if cb is an array, it is a component lifecycle hook which can only be
|
|
1795
1794
|
// triggered by a job, which is already deduped in the main queue, so
|
|
1796
1795
|
// we can skip duplicate check here to improve perf
|
|
1797
|
-
|
|
1796
|
+
pendingPostFlushCbs.push(...cb);
|
|
1798
1797
|
}
|
|
1799
1798
|
queueFlush();
|
|
1800
1799
|
}
|
|
1801
|
-
function
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
pendingPreFlushCbs.length = 0;
|
|
1812
|
-
{
|
|
1813
|
-
seen = seen || new Map();
|
|
1814
|
-
}
|
|
1815
|
-
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
1816
|
-
if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
|
|
1800
|
+
function flushPreFlushCbs(seen,
|
|
1801
|
+
// if currently flushing, skip the current job itself
|
|
1802
|
+
i = isFlushing ? flushIndex + 1 : 0) {
|
|
1803
|
+
{
|
|
1804
|
+
seen = seen || new Map();
|
|
1805
|
+
}
|
|
1806
|
+
for (; i < queue.length; i++) {
|
|
1807
|
+
const cb = queue[i];
|
|
1808
|
+
if (cb && cb.pre) {
|
|
1809
|
+
if (checkRecursiveUpdates(seen, cb)) {
|
|
1817
1810
|
continue;
|
|
1818
1811
|
}
|
|
1819
|
-
|
|
1812
|
+
queue.splice(i, 1);
|
|
1813
|
+
i--;
|
|
1814
|
+
cb();
|
|
1820
1815
|
}
|
|
1821
|
-
activePreFlushCbs = null;
|
|
1822
|
-
preFlushIndex = 0;
|
|
1823
|
-
currentPreFlushParentJob = null;
|
|
1824
|
-
// recursively flush until it drains
|
|
1825
|
-
flushPreFlushCbs(seen, parentJob);
|
|
1826
1816
|
}
|
|
1827
1817
|
}
|
|
1828
1818
|
function flushPostFlushCbs(seen) {
|
|
1829
|
-
// flush any pre cbs queued during the flush (e.g. pre watchers)
|
|
1830
|
-
flushPreFlushCbs();
|
|
1831
1819
|
if (pendingPostFlushCbs.length) {
|
|
1832
1820
|
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
1833
1821
|
pendingPostFlushCbs.length = 0;
|
|
@@ -1852,13 +1840,22 @@ function flushPostFlushCbs(seen) {
|
|
|
1852
1840
|
}
|
|
1853
1841
|
}
|
|
1854
1842
|
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
1843
|
+
const comparator = (a, b) => {
|
|
1844
|
+
const diff = getId(a) - getId(b);
|
|
1845
|
+
if (diff === 0) {
|
|
1846
|
+
if (a.pre && !b.pre)
|
|
1847
|
+
return -1;
|
|
1848
|
+
if (b.pre && !a.pre)
|
|
1849
|
+
return 1;
|
|
1850
|
+
}
|
|
1851
|
+
return diff;
|
|
1852
|
+
};
|
|
1855
1853
|
function flushJobs(seen) {
|
|
1856
1854
|
isFlushPending = false;
|
|
1857
1855
|
isFlushing = true;
|
|
1858
1856
|
{
|
|
1859
1857
|
seen = seen || new Map();
|
|
1860
1858
|
}
|
|
1861
|
-
flushPreFlushCbs(seen);
|
|
1862
1859
|
// Sort queue before flush.
|
|
1863
1860
|
// This ensures that:
|
|
1864
1861
|
// 1. Components are updated from parent to child. (because parent is always
|
|
@@ -1866,7 +1863,7 @@ function flushJobs(seen) {
|
|
|
1866
1863
|
// priority number)
|
|
1867
1864
|
// 2. If a component is unmounted during a parent component's update,
|
|
1868
1865
|
// its update can be skipped.
|
|
1869
|
-
queue.sort(
|
|
1866
|
+
queue.sort(comparator);
|
|
1870
1867
|
// conditional usage of checkRecursiveUpdate must be determined out of
|
|
1871
1868
|
// try ... catch block since Rollup by default de-optimizes treeshaking
|
|
1872
1869
|
// inside try-catch. This can leave all warning code unshaked. Although
|
|
@@ -1882,7 +1879,7 @@ function flushJobs(seen) {
|
|
|
1882
1879
|
continue;
|
|
1883
1880
|
}
|
|
1884
1881
|
// console.log(`running:`, job.id)
|
|
1885
|
-
callWithErrorHandling(job, null, 14 /* SCHEDULER */);
|
|
1882
|
+
callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
|
|
1886
1883
|
}
|
|
1887
1884
|
}
|
|
1888
1885
|
}
|
|
@@ -1894,9 +1891,7 @@ function flushJobs(seen) {
|
|
|
1894
1891
|
currentFlushPromise = null;
|
|
1895
1892
|
// some postFlushCb queued jobs!
|
|
1896
1893
|
// keep flushing until it drains.
|
|
1897
|
-
if (queue.length ||
|
|
1898
|
-
pendingPreFlushCbs.length ||
|
|
1899
|
-
pendingPostFlushCbs.length) {
|
|
1894
|
+
if (queue.length || pendingPostFlushCbs.length) {
|
|
1900
1895
|
flushJobs(seen);
|
|
1901
1896
|
}
|
|
1902
1897
|
}
|
|
@@ -2114,7 +2109,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2114
2109
|
}
|
|
2115
2110
|
}
|
|
2116
2111
|
function devtoolsInitApp(app, version) {
|
|
2117
|
-
emit("app:init" /* APP_INIT */, app, version, {
|
|
2112
|
+
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2118
2113
|
Fragment,
|
|
2119
2114
|
Text,
|
|
2120
2115
|
Comment,
|
|
@@ -2122,88 +2117,88 @@ function devtoolsInitApp(app, version) {
|
|
|
2122
2117
|
});
|
|
2123
2118
|
}
|
|
2124
2119
|
function devtoolsUnmountApp(app) {
|
|
2125
|
-
emit("app:unmount" /* APP_UNMOUNT */, app);
|
|
2120
|
+
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2126
2121
|
}
|
|
2127
|
-
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
|
|
2122
|
+
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2128
2123
|
const devtoolsComponentUpdated =
|
|
2129
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
|
|
2124
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
|
|
2130
2125
|
const devtoolsComponentRemoved =
|
|
2131
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
|
|
2126
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
|
|
2132
2127
|
function createDevtoolsComponentHook(hook) {
|
|
2133
2128
|
return (component) => {
|
|
2134
2129
|
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2135
2130
|
};
|
|
2136
2131
|
}
|
|
2137
|
-
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
|
|
2138
|
-
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
|
|
2132
|
+
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2133
|
+
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2139
2134
|
function createDevtoolsPerformanceHook(hook) {
|
|
2140
2135
|
return (component, type, time) => {
|
|
2141
2136
|
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2142
2137
|
};
|
|
2143
2138
|
}
|
|
2144
2139
|
function devtoolsComponentEmit(component, event, params) {
|
|
2145
|
-
emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2140
|
+
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2146
2141
|
}
|
|
2147
2142
|
|
|
2148
2143
|
const deprecationData = {
|
|
2149
|
-
["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
|
|
2144
|
+
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2150
2145
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2151
2146
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
2152
2147
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
|
|
2153
2148
|
},
|
|
2154
|
-
["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
|
|
2149
|
+
["GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */]: {
|
|
2155
2150
|
message: `Vue detected directives on the mount container. ` +
|
|
2156
2151
|
`In Vue 3, the container is no longer considered part of the template ` +
|
|
2157
2152
|
`and will not be processed/replaced.`,
|
|
2158
2153
|
link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
|
|
2159
2154
|
},
|
|
2160
|
-
["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
|
|
2155
|
+
["GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */]: {
|
|
2161
2156
|
message: `Vue.extend() has been removed in Vue 3. ` +
|
|
2162
2157
|
`Use defineComponent() instead.`,
|
|
2163
2158
|
link: `https://vuejs.org/api/general.html#definecomponent`
|
|
2164
2159
|
},
|
|
2165
|
-
["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
|
|
2160
|
+
["GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */]: {
|
|
2166
2161
|
message: `Vue.prototype is no longer available in Vue 3. ` +
|
|
2167
2162
|
`Use app.config.globalProperties instead.`,
|
|
2168
2163
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
|
|
2169
2164
|
},
|
|
2170
|
-
["GLOBAL_SET" /* GLOBAL_SET */]: {
|
|
2165
|
+
["GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */]: {
|
|
2171
2166
|
message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2172
2167
|
`Simply use native JavaScript mutations.`
|
|
2173
2168
|
},
|
|
2174
|
-
["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
|
|
2169
|
+
["GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */]: {
|
|
2175
2170
|
message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2176
2171
|
`Simply use native JavaScript mutations.`
|
|
2177
2172
|
},
|
|
2178
|
-
["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
|
|
2173
|
+
["GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */]: {
|
|
2179
2174
|
message: `Vue.observable() has been removed. ` +
|
|
2180
2175
|
`Use \`import { reactive } from "vue"\` from Composition API instead.`,
|
|
2181
2176
|
link: `https://vuejs.org/api/reactivity-core.html#reactive`
|
|
2182
2177
|
},
|
|
2183
|
-
["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
|
|
2178
|
+
["GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */]: {
|
|
2184
2179
|
message: `Vue.util has been removed. Please refactor to avoid its usage ` +
|
|
2185
2180
|
`since it was an internal API even in Vue 2.`
|
|
2186
2181
|
},
|
|
2187
|
-
["CONFIG_SILENT" /* CONFIG_SILENT */]: {
|
|
2182
|
+
["CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */]: {
|
|
2188
2183
|
message: `config.silent has been removed because it is not good practice to ` +
|
|
2189
2184
|
`intentionally suppress warnings. You can use your browser console's ` +
|
|
2190
2185
|
`filter features to focus on relevant messages.`
|
|
2191
2186
|
},
|
|
2192
|
-
["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
|
|
2187
|
+
["CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */]: {
|
|
2193
2188
|
message: `config.devtools has been removed. To enable devtools for ` +
|
|
2194
2189
|
`production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
|
|
2195
2190
|
link: `https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags`
|
|
2196
2191
|
},
|
|
2197
|
-
["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
|
|
2192
|
+
["CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */]: {
|
|
2198
2193
|
message: `config.keyCodes has been removed. ` +
|
|
2199
2194
|
`In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
|
|
2200
2195
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2201
2196
|
},
|
|
2202
|
-
["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
|
|
2197
|
+
["CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */]: {
|
|
2203
2198
|
message: `config.productionTip has been removed.`,
|
|
2204
2199
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
|
|
2205
2200
|
},
|
|
2206
|
-
["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
|
|
2201
|
+
["CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */]: {
|
|
2207
2202
|
message: () => {
|
|
2208
2203
|
let msg = `config.ignoredElements has been removed.`;
|
|
2209
2204
|
if (isRuntimeOnly()) {
|
|
@@ -2216,35 +2211,35 @@ const deprecationData = {
|
|
|
2216
2211
|
},
|
|
2217
2212
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
|
|
2218
2213
|
},
|
|
2219
|
-
["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
|
|
2214
|
+
["CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */]: {
|
|
2220
2215
|
// this warning is only relevant in the full build when using runtime
|
|
2221
2216
|
// compilation, so it's put in the runtime compatConfig list.
|
|
2222
2217
|
message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
|
|
2223
2218
|
`"preserve". To suppress this warning, provide an explicit value for ` +
|
|
2224
2219
|
`\`config.compilerOptions.whitespace\`.`
|
|
2225
2220
|
},
|
|
2226
|
-
["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2221
|
+
["CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2227
2222
|
message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
|
|
2228
2223
|
`Use custom merge functions instead.`
|
|
2229
2224
|
},
|
|
2230
|
-
["INSTANCE_SET" /* INSTANCE_SET */]: {
|
|
2225
|
+
["INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */]: {
|
|
2231
2226
|
message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2232
2227
|
`Simply use native JavaScript mutations.`
|
|
2233
2228
|
},
|
|
2234
|
-
["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
|
|
2229
|
+
["INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */]: {
|
|
2235
2230
|
message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2236
2231
|
`Simply use native JavaScript mutations.`
|
|
2237
2232
|
},
|
|
2238
|
-
["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
|
|
2233
|
+
["INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */]: {
|
|
2239
2234
|
message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
|
|
2240
2235
|
link: `https://vuejs.org/api/application.html#app-unmount`
|
|
2241
2236
|
},
|
|
2242
|
-
["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
|
|
2237
|
+
["INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */]: {
|
|
2243
2238
|
message: `vm.$on/$once/$off() have been removed. ` +
|
|
2244
2239
|
`Use an external event emitter library instead.`,
|
|
2245
2240
|
link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
|
|
2246
2241
|
},
|
|
2247
|
-
["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
|
|
2242
|
+
["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
|
|
2248
2243
|
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
2249
2244
|
`use the "vnode" prefix instead of "hook:". For example, @${event} ` +
|
|
2250
2245
|
`should be changed to @vnode-${event.slice(5)}. ` +
|
|
@@ -2252,23 +2247,23 @@ const deprecationData = {
|
|
|
2252
2247
|
`hooks.`,
|
|
2253
2248
|
link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
|
|
2254
2249
|
},
|
|
2255
|
-
["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
|
|
2250
|
+
["INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */]: {
|
|
2256
2251
|
message: `vm.$children has been removed. Consider refactoring your logic ` +
|
|
2257
2252
|
`to avoid relying on direct access to child components.`,
|
|
2258
2253
|
link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
|
|
2259
2254
|
},
|
|
2260
|
-
["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
|
|
2255
|
+
["INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */]: {
|
|
2261
2256
|
message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
|
|
2262
2257
|
`included in vm.$attrs and it is no longer necessary to separately use ` +
|
|
2263
2258
|
`v-on="$listeners" if you are already using v-bind="$attrs". ` +
|
|
2264
2259
|
`(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
|
|
2265
2260
|
link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
|
|
2266
2261
|
},
|
|
2267
|
-
["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
|
|
2262
|
+
["INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */]: {
|
|
2268
2263
|
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
|
2269
2264
|
link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
|
|
2270
2265
|
},
|
|
2271
|
-
["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2266
|
+
["INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2272
2267
|
message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
|
|
2273
2268
|
`relying on class/style fallthrough from parent. In Vue 3, class/style ` +
|
|
2274
2269
|
`are now included in $attrs and will no longer fallthrough when ` +
|
|
@@ -2279,75 +2274,75 @@ const deprecationData = {
|
|
|
2279
2274
|
`them on root via :class="$attrs.class".`,
|
|
2280
2275
|
link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
|
|
2281
2276
|
},
|
|
2282
|
-
["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
|
|
2277
|
+
["OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */]: {
|
|
2283
2278
|
message: `The "data" option can no longer be a plain object. ` +
|
|
2284
2279
|
`Always use a function.`,
|
|
2285
2280
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
|
|
2286
2281
|
},
|
|
2287
|
-
["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
|
|
2282
|
+
["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */]: {
|
|
2288
2283
|
message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
|
|
2289
2284
|
`In Vue 3, data keys are merged shallowly and will override one another.`,
|
|
2290
2285
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
|
|
2291
2286
|
},
|
|
2292
|
-
["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
|
|
2287
|
+
["OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */]: {
|
|
2293
2288
|
message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
|
2294
2289
|
},
|
|
2295
|
-
["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
|
|
2290
|
+
["OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */]: {
|
|
2296
2291
|
message: `\`destroyed\` has been renamed to \`unmounted\`.`
|
|
2297
2292
|
},
|
|
2298
|
-
["WATCH_ARRAY" /* WATCH_ARRAY */]: {
|
|
2293
|
+
["WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */]: {
|
|
2299
2294
|
message: `"watch" option or vm.$watch on an array value will no longer ` +
|
|
2300
2295
|
`trigger on array mutation unless the "deep" option is specified. ` +
|
|
2301
2296
|
`If current usage is intended, you can disable the compat behavior and ` +
|
|
2302
2297
|
`suppress this warning with:` +
|
|
2303
|
-
`\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
|
|
2298
|
+
`\n\n configureCompat({ ${"WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */}: false })\n`,
|
|
2304
2299
|
link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
|
|
2305
2300
|
},
|
|
2306
|
-
["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
|
|
2301
|
+
["PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */]: {
|
|
2307
2302
|
message: (key) => `props default value function no longer has access to "this". The compat ` +
|
|
2308
2303
|
`build only offers access to this.$options.` +
|
|
2309
2304
|
`(found in prop "${key}")`,
|
|
2310
2305
|
link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
|
|
2311
2306
|
},
|
|
2312
|
-
["CUSTOM_DIR" /* CUSTOM_DIR */]: {
|
|
2307
|
+
["CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */]: {
|
|
2313
2308
|
message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
|
|
2314
2309
|
`Use "${newHook}" instead.`,
|
|
2315
2310
|
link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
|
|
2316
2311
|
},
|
|
2317
|
-
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
2312
|
+
["V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */]: {
|
|
2318
2313
|
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
2319
2314
|
`Use kebab-case key name modifiers instead.`,
|
|
2320
2315
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2321
2316
|
},
|
|
2322
|
-
["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
|
|
2317
|
+
["ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */]: {
|
|
2323
2318
|
message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
|
|
2324
2319
|
`${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
|
|
2325
2320
|
`use \`null\` or \`undefined\` instead. If the usage is intended, ` +
|
|
2326
2321
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2327
|
-
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
|
|
2322
|
+
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */}: false })\n`,
|
|
2328
2323
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2329
2324
|
},
|
|
2330
|
-
["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
|
|
2325
|
+
["ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */]: {
|
|
2331
2326
|
message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
|
|
2332
2327
|
`${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
|
|
2333
2328
|
`Always use explicit "true" or "false" values for enumerated attributes. ` +
|
|
2334
2329
|
`If the usage is intended, ` +
|
|
2335
2330
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2336
|
-
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2331
|
+
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2337
2332
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2338
2333
|
},
|
|
2339
|
-
["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
|
|
2334
|
+
["TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */]: {
|
|
2340
2335
|
message: `` // this feature cannot be runtime-detected
|
|
2341
2336
|
},
|
|
2342
|
-
["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
|
|
2337
|
+
["TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */]: {
|
|
2343
2338
|
message: `<TransitionGroup> no longer renders a root <span> element by ` +
|
|
2344
2339
|
`default if no "tag" prop is specified. If you do not rely on the span ` +
|
|
2345
2340
|
`for styling, you can disable the compat behavior and suppress this ` +
|
|
2346
2341
|
`warning with:` +
|
|
2347
|
-
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2342
|
+
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2348
2343
|
link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
|
|
2349
2344
|
},
|
|
2350
|
-
["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
|
|
2345
|
+
["COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */]: {
|
|
2351
2346
|
message: (comp) => {
|
|
2352
2347
|
const name = getComponentName(comp);
|
|
2353
2348
|
return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
|
|
@@ -2356,11 +2351,11 @@ const deprecationData = {
|
|
|
2356
2351
|
`usage and intend to use plain functions for functional components, ` +
|
|
2357
2352
|
`you can disable the compat behavior and suppress this ` +
|
|
2358
2353
|
`warning with:` +
|
|
2359
|
-
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
|
|
2354
|
+
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */}: false })\n`);
|
|
2360
2355
|
},
|
|
2361
2356
|
link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
|
|
2362
2357
|
},
|
|
2363
|
-
["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
|
|
2358
|
+
["COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */]: {
|
|
2364
2359
|
message: (comp) => {
|
|
2365
2360
|
const name = getComponentName(comp);
|
|
2366
2361
|
return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
|
|
@@ -2371,10 +2366,10 @@ const deprecationData = {
|
|
|
2371
2366
|
},
|
|
2372
2367
|
link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
|
|
2373
2368
|
},
|
|
2374
|
-
["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
|
|
2369
|
+
["COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */]: {
|
|
2375
2370
|
message: (comp) => {
|
|
2376
2371
|
const configMsg = `opt-in to ` +
|
|
2377
|
-
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
2372
|
+
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */}: false }\`.`;
|
|
2378
2373
|
if (comp.props &&
|
|
2379
2374
|
(isArray(comp.props)
|
|
2380
2375
|
? comp.props.includes('modelValue')
|
|
@@ -2388,20 +2383,20 @@ const deprecationData = {
|
|
|
2388
2383
|
},
|
|
2389
2384
|
link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
|
|
2390
2385
|
},
|
|
2391
|
-
["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
|
|
2386
|
+
["RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */]: {
|
|
2392
2387
|
message: `Vue 3's render function API has changed. ` +
|
|
2393
2388
|
`You can opt-in to the new API with:` +
|
|
2394
|
-
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
|
|
2389
|
+
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */}: false })\n` +
|
|
2395
2390
|
`\n (This can also be done per-component via the "compatConfig" option.)`,
|
|
2396
2391
|
link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
|
|
2397
2392
|
},
|
|
2398
|
-
["FILTERS" /* FILTERS */]: {
|
|
2393
|
+
["FILTERS" /* DeprecationTypes.FILTERS */]: {
|
|
2399
2394
|
message: `filters have been removed in Vue 3. ` +
|
|
2400
2395
|
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
|
2401
2396
|
`Use method calls or computed properties instead.`,
|
|
2402
2397
|
link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
|
|
2403
2398
|
},
|
|
2404
|
-
["PRIVATE_APIS" /* PRIVATE_APIS */]: {
|
|
2399
|
+
["PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */]: {
|
|
2405
2400
|
message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
|
|
2406
2401
|
`If you are seeing this warning only due to a dependency, you can ` +
|
|
2407
2402
|
`suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
|
|
@@ -2476,8 +2471,8 @@ function validateCompatConfig(config, instance) {
|
|
|
2476
2471
|
warnedInvalidKeys[key] = true;
|
|
2477
2472
|
}
|
|
2478
2473
|
}
|
|
2479
|
-
if (instance && config["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */] != null) {
|
|
2480
|
-
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2474
|
+
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2475
|
+
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2481
2476
|
}
|
|
2482
2477
|
}
|
|
2483
2478
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2552,10 +2547,10 @@ function on(instance, event, fn) {
|
|
|
2552
2547
|
}
|
|
2553
2548
|
else {
|
|
2554
2549
|
if (event.startsWith('hook:')) {
|
|
2555
|
-
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2550
|
+
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2556
2551
|
}
|
|
2557
2552
|
else {
|
|
2558
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2553
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2559
2554
|
}
|
|
2560
2555
|
const events = getRegistry(instance);
|
|
2561
2556
|
(events[event] || (events[event] = [])).push(fn);
|
|
@@ -2572,7 +2567,7 @@ function once(instance, event, fn) {
|
|
|
2572
2567
|
return instance.proxy;
|
|
2573
2568
|
}
|
|
2574
2569
|
function off(instance, event, fn) {
|
|
2575
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2570
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2576
2571
|
const vm = instance.proxy;
|
|
2577
2572
|
// all
|
|
2578
2573
|
if (!event) {
|
|
@@ -2600,7 +2595,7 @@ function off(instance, event, fn) {
|
|
|
2600
2595
|
function emit$1(instance, event, args) {
|
|
2601
2596
|
const cbs = getRegistry(instance)[event];
|
|
2602
2597
|
if (cbs) {
|
|
2603
|
-
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2598
|
+
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2604
2599
|
}
|
|
2605
2600
|
return instance.proxy;
|
|
2606
2601
|
}
|
|
@@ -2610,8 +2605,8 @@ const warnedTypes = new WeakSet();
|
|
|
2610
2605
|
function convertLegacyVModelProps(vnode) {
|
|
2611
2606
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2612
2607
|
const comp = type;
|
|
2613
|
-
if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
|
|
2614
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
|
|
2608
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2609
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2615
2610
|
// this is a special case where we want to use the vnode component's
|
|
2616
2611
|
// compat config instead of the current rendering instance (which is the
|
|
2617
2612
|
// parent of the component that exposes v-model)
|
|
@@ -2620,7 +2615,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2620
2615
|
}
|
|
2621
2616
|
if (!warnedTypes.has(comp)) {
|
|
2622
2617
|
pushWarningContext(vnode);
|
|
2623
|
-
warnDeprecation("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, { type }, comp);
|
|
2618
|
+
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2624
2619
|
popWarningContext();
|
|
2625
2620
|
warnedTypes.add(comp);
|
|
2626
2621
|
}
|
|
@@ -2653,13 +2648,13 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2653
2648
|
}
|
|
2654
2649
|
}
|
|
2655
2650
|
function compatModelEmit(instance, event, args) {
|
|
2656
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
|
|
2651
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2657
2652
|
return;
|
|
2658
2653
|
}
|
|
2659
2654
|
const props = instance.vnode.props;
|
|
2660
2655
|
const modelHandler = props && props[compatModelEventPrefix + event];
|
|
2661
2656
|
if (modelHandler) {
|
|
2662
|
-
callWithErrorHandling(modelHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2657
|
+
callWithErrorHandling(modelHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2663
2658
|
}
|
|
2664
2659
|
}
|
|
2665
2660
|
|
|
@@ -2726,7 +2721,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2726
2721
|
handler = props[(handlerName = toHandlerKey(hyphenate(event)))];
|
|
2727
2722
|
}
|
|
2728
2723
|
if (handler) {
|
|
2729
|
-
callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2724
|
+
callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2730
2725
|
}
|
|
2731
2726
|
const onceHandler = props[handlerName + `Once`];
|
|
2732
2727
|
if (onceHandler) {
|
|
@@ -2737,7 +2732,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2737
2732
|
return;
|
|
2738
2733
|
}
|
|
2739
2734
|
instance.emitted[handlerName] = true;
|
|
2740
|
-
callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2735
|
+
callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2741
2736
|
}
|
|
2742
2737
|
{
|
|
2743
2738
|
compatModelEmit(instance, event, args);
|
|
@@ -2773,7 +2768,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2773
2768
|
}
|
|
2774
2769
|
}
|
|
2775
2770
|
if (!raw && !hasExtends) {
|
|
2776
|
-
|
|
2771
|
+
if (isObject(comp)) {
|
|
2772
|
+
cache.set(comp, null);
|
|
2773
|
+
}
|
|
2777
2774
|
return null;
|
|
2778
2775
|
}
|
|
2779
2776
|
if (isArray(raw)) {
|
|
@@ -2782,7 +2779,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2782
2779
|
else {
|
|
2783
2780
|
extend(normalized, raw);
|
|
2784
2781
|
}
|
|
2785
|
-
|
|
2782
|
+
if (isObject(comp)) {
|
|
2783
|
+
cache.set(comp, normalized);
|
|
2784
|
+
}
|
|
2786
2785
|
return normalized;
|
|
2787
2786
|
}
|
|
2788
2787
|
// Check if an incoming prop key is a declared emit event listener.
|
|
@@ -2912,7 +2911,7 @@ function renderComponentRoot(instance) {
|
|
|
2912
2911
|
accessedAttrs = false;
|
|
2913
2912
|
}
|
|
2914
2913
|
try {
|
|
2915
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
2914
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
2916
2915
|
// withProxy is a proxy with a different `has` trap only for
|
|
2917
2916
|
// runtime-compiled render functions using `with` block.
|
|
2918
2917
|
const proxyToUse = withProxy || proxy;
|
|
@@ -2945,7 +2944,7 @@ function renderComponentRoot(instance) {
|
|
|
2945
2944
|
}
|
|
2946
2945
|
catch (err) {
|
|
2947
2946
|
blockStack.length = 0;
|
|
2948
|
-
handleError(err, instance, 1 /* RENDER_FUNCTION */);
|
|
2947
|
+
handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
|
|
2949
2948
|
result = createVNode(Comment);
|
|
2950
2949
|
}
|
|
2951
2950
|
// attr merging
|
|
@@ -2954,14 +2953,14 @@ function renderComponentRoot(instance) {
|
|
|
2954
2953
|
let root = result;
|
|
2955
2954
|
let setRoot = undefined;
|
|
2956
2955
|
if (result.patchFlag > 0 &&
|
|
2957
|
-
result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
2956
|
+
result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
2958
2957
|
[root, setRoot] = getChildRoot(result);
|
|
2959
2958
|
}
|
|
2960
2959
|
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
2961
2960
|
const keys = Object.keys(fallthroughAttrs);
|
|
2962
2961
|
const { shapeFlag } = root;
|
|
2963
2962
|
if (keys.length) {
|
|
2964
|
-
if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
2963
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
2965
2964
|
if (propsOptions && keys.some(isModelListener)) {
|
|
2966
2965
|
// If a v-model listener (onUpdate:xxx) has a corresponding declared
|
|
2967
2966
|
// prop, it indicates this component expects to handle v-model and
|
|
@@ -3006,13 +3005,13 @@ function renderComponentRoot(instance) {
|
|
|
3006
3005
|
}
|
|
3007
3006
|
}
|
|
3008
3007
|
}
|
|
3009
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3010
|
-
vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
|
|
3011
|
-
root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
3008
|
+
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3009
|
+
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3010
|
+
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3012
3011
|
const { class: cls, style } = vnode.props || {};
|
|
3013
3012
|
if (cls || style) {
|
|
3014
3013
|
if (inheritAttrs === false) {
|
|
3015
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3014
|
+
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3016
3015
|
}
|
|
3017
3016
|
root = cloneVNode(root, {
|
|
3018
3017
|
class: cls,
|
|
@@ -3116,7 +3115,7 @@ const filterModelListeners = (attrs, props) => {
|
|
|
3116
3115
|
return res;
|
|
3117
3116
|
};
|
|
3118
3117
|
const isElementRoot = (vnode) => {
|
|
3119
|
-
return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
|
|
3118
|
+
return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
|
|
3120
3119
|
vnode.type === Comment // potential v-if branch switch
|
|
3121
3120
|
);
|
|
3122
3121
|
};
|
|
@@ -3135,19 +3134,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
|
3135
3134
|
return true;
|
|
3136
3135
|
}
|
|
3137
3136
|
if (optimized && patchFlag >= 0) {
|
|
3138
|
-
if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
|
|
3137
|
+
if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
|
|
3139
3138
|
// slot content that references values that might have changed,
|
|
3140
3139
|
// e.g. in a v-for
|
|
3141
3140
|
return true;
|
|
3142
3141
|
}
|
|
3143
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
3142
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
3144
3143
|
if (!prevProps) {
|
|
3145
3144
|
return !!nextProps;
|
|
3146
3145
|
}
|
|
3147
3146
|
// presence of this flag indicates props are always non-null
|
|
3148
3147
|
return hasPropsChanged(prevProps, nextProps, emits);
|
|
3149
3148
|
}
|
|
3150
|
-
else if (patchFlag & 8 /* PROPS */) {
|
|
3149
|
+
else if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
3151
3150
|
const dynamicProps = nextVNode.dynamicProps;
|
|
3152
3151
|
for (let i = 0; i < dynamicProps.length; i++) {
|
|
3153
3152
|
const key = dynamicProps[i];
|
|
@@ -3405,7 +3404,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3405
3404
|
if (delayEnter) {
|
|
3406
3405
|
activeBranch.transition.afterLeave = () => {
|
|
3407
3406
|
if (pendingId === suspense.pendingId) {
|
|
3408
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3407
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3409
3408
|
}
|
|
3410
3409
|
};
|
|
3411
3410
|
}
|
|
@@ -3420,7 +3419,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3420
3419
|
}
|
|
3421
3420
|
if (!delayEnter) {
|
|
3422
3421
|
// move content from off-dom container to actual container
|
|
3423
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3422
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3424
3423
|
}
|
|
3425
3424
|
}
|
|
3426
3425
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3494,7 +3493,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3494
3493
|
const hydratedEl = instance.vnode.el;
|
|
3495
3494
|
instance
|
|
3496
3495
|
.asyncDep.catch(err => {
|
|
3497
|
-
handleError(err, instance, 0 /* SETUP_FUNCTION */);
|
|
3496
|
+
handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
3498
3497
|
})
|
|
3499
3498
|
.then(asyncSetupResult => {
|
|
3500
3499
|
// retry when the setup() promise resolves.
|
|
@@ -3568,7 +3567,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
3568
3567
|
}
|
|
3569
3568
|
function normalizeSuspenseChildren(vnode) {
|
|
3570
3569
|
const { shapeFlag, children } = vnode;
|
|
3571
|
-
const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
|
|
3570
|
+
const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
3572
3571
|
vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
|
|
3573
3572
|
vnode.ssFallback = isSlotChildren
|
|
3574
3573
|
? normalizeSuspenseSlot(children.fallback)
|
|
@@ -3739,7 +3738,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3739
3738
|
return traverse(s);
|
|
3740
3739
|
}
|
|
3741
3740
|
else if (isFunction(s)) {
|
|
3742
|
-
return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
|
|
3741
|
+
return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3743
3742
|
}
|
|
3744
3743
|
else {
|
|
3745
3744
|
warnInvalidSource(s);
|
|
@@ -3749,7 +3748,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3749
3748
|
else if (isFunction(source)) {
|
|
3750
3749
|
if (cb) {
|
|
3751
3750
|
// getter with cb
|
|
3752
|
-
getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
|
|
3751
|
+
getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3753
3752
|
}
|
|
3754
3753
|
else {
|
|
3755
3754
|
// no cb -> simple effect
|
|
@@ -3760,7 +3759,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3760
3759
|
if (cleanup) {
|
|
3761
3760
|
cleanup();
|
|
3762
3761
|
}
|
|
3763
|
-
return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
|
|
3762
|
+
return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
|
|
3764
3763
|
};
|
|
3765
3764
|
}
|
|
3766
3765
|
}
|
|
@@ -3774,7 +3773,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3774
3773
|
getter = () => {
|
|
3775
3774
|
const val = baseGetter();
|
|
3776
3775
|
if (isArray(val) &&
|
|
3777
|
-
checkCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance)) {
|
|
3776
|
+
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3778
3777
|
traverse(val);
|
|
3779
3778
|
}
|
|
3780
3779
|
return val;
|
|
@@ -3787,7 +3786,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3787
3786
|
let cleanup;
|
|
3788
3787
|
let onCleanup = (fn) => {
|
|
3789
3788
|
cleanup = effect.onStop = () => {
|
|
3790
|
-
callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
|
|
3789
|
+
callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
|
|
3791
3790
|
};
|
|
3792
3791
|
};
|
|
3793
3792
|
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
@@ -3804,12 +3803,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3804
3803
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
3805
3804
|
: hasChanged(newValue, oldValue)) ||
|
|
3806
3805
|
(isArray(newValue) &&
|
|
3807
|
-
isCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance))) {
|
|
3806
|
+
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3808
3807
|
// cleanup before running cb again
|
|
3809
3808
|
if (cleanup) {
|
|
3810
3809
|
cleanup();
|
|
3811
3810
|
}
|
|
3812
|
-
callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
|
|
3811
|
+
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3813
3812
|
newValue,
|
|
3814
3813
|
// pass undefined as the old value when it's changed for the first time
|
|
3815
3814
|
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
|
|
@@ -3835,7 +3834,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3835
3834
|
}
|
|
3836
3835
|
else {
|
|
3837
3836
|
// default: 'pre'
|
|
3838
|
-
|
|
3837
|
+
job.pre = true;
|
|
3838
|
+
if (instance)
|
|
3839
|
+
job.id = instance.uid;
|
|
3840
|
+
scheduler = () => queueJob(job);
|
|
3839
3841
|
}
|
|
3840
3842
|
const effect = new ReactiveEffect(getter, scheduler);
|
|
3841
3843
|
{
|
|
@@ -3902,7 +3904,7 @@ function createPathGetter(ctx, path) {
|
|
|
3902
3904
|
};
|
|
3903
3905
|
}
|
|
3904
3906
|
function traverse(value, seen) {
|
|
3905
|
-
if (!isObject(value) || value["__v_skip" /* SKIP */]) {
|
|
3907
|
+
if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
|
|
3906
3908
|
return value;
|
|
3907
3909
|
}
|
|
3908
3910
|
seen = seen || new Set();
|
|
@@ -4089,7 +4091,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
4089
4091
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4090
4092
|
const callHook = (hook, args) => {
|
|
4091
4093
|
hook &&
|
|
4092
|
-
callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
|
|
4094
|
+
callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
|
|
4093
4095
|
};
|
|
4094
4096
|
const callAsyncHook = (hook, args) => {
|
|
4095
4097
|
const done = args[1];
|
|
@@ -4225,10 +4227,10 @@ function getKeepAliveChild(vnode) {
|
|
|
4225
4227
|
: vnode;
|
|
4226
4228
|
}
|
|
4227
4229
|
function setTransitionHooks(vnode, hooks) {
|
|
4228
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
|
|
4230
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
|
|
4229
4231
|
setTransitionHooks(vnode.component.subTree, hooks);
|
|
4230
4232
|
}
|
|
4231
|
-
else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4233
|
+
else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4232
4234
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4233
4235
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4234
4236
|
}
|
|
@@ -4247,7 +4249,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4247
4249
|
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
4248
4250
|
// handle fragment children case, e.g. v-for
|
|
4249
4251
|
if (child.type === Fragment) {
|
|
4250
|
-
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
4252
|
+
if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
|
|
4251
4253
|
keyedFragmentCount++;
|
|
4252
4254
|
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
4253
4255
|
}
|
|
@@ -4262,7 +4264,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4262
4264
|
// these children to force full diffs to ensure correct behavior.
|
|
4263
4265
|
if (keyedFragmentCount > 1) {
|
|
4264
4266
|
for (let i = 0; i < ret.length; i++) {
|
|
4265
|
-
ret[i].patchFlag = -2 /* BAIL */;
|
|
4267
|
+
ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
|
|
4266
4268
|
}
|
|
4267
4269
|
}
|
|
4268
4270
|
return ret;
|
|
@@ -4340,7 +4342,7 @@ function defineAsyncComponent(source) {
|
|
|
4340
4342
|
}
|
|
4341
4343
|
const onError = (err) => {
|
|
4342
4344
|
pendingRequest = null;
|
|
4343
|
-
handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4345
|
+
handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4344
4346
|
};
|
|
4345
4347
|
// suspense-controlled or SSR.
|
|
4346
4348
|
if ((suspensible && instance.suspense) ||
|
|
@@ -4442,7 +4444,7 @@ const KeepAliveImpl = {
|
|
|
4442
4444
|
const storageContainer = createElement('div');
|
|
4443
4445
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4444
4446
|
const instance = vnode.component;
|
|
4445
|
-
move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
|
|
4447
|
+
move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
|
|
4446
4448
|
// in case props have changed
|
|
4447
4449
|
patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
|
|
4448
4450
|
queuePostRenderEffect(() => {
|
|
@@ -4462,7 +4464,7 @@ const KeepAliveImpl = {
|
|
|
4462
4464
|
};
|
|
4463
4465
|
sharedContext.deactivate = (vnode) => {
|
|
4464
4466
|
const instance = vnode.component;
|
|
4465
|
-
move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
|
|
4467
|
+
move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
|
|
4466
4468
|
queuePostRenderEffect(() => {
|
|
4467
4469
|
if (instance.da) {
|
|
4468
4470
|
invokeArrayFns(instance.da);
|
|
@@ -4551,8 +4553,8 @@ const KeepAliveImpl = {
|
|
|
4551
4553
|
return children;
|
|
4552
4554
|
}
|
|
4553
4555
|
else if (!isVNode(rawVNode) ||
|
|
4554
|
-
(!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
|
|
4555
|
-
!(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
|
|
4556
|
+
(!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
|
|
4557
|
+
!(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
|
|
4556
4558
|
current = null;
|
|
4557
4559
|
return rawVNode;
|
|
4558
4560
|
}
|
|
@@ -4574,7 +4576,7 @@ const KeepAliveImpl = {
|
|
|
4574
4576
|
// clone vnode if it's reused because we are going to mutate it
|
|
4575
4577
|
if (vnode.el) {
|
|
4576
4578
|
vnode = cloneVNode(vnode);
|
|
4577
|
-
if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4579
|
+
if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4578
4580
|
rawVNode.ssContent = vnode;
|
|
4579
4581
|
}
|
|
4580
4582
|
}
|
|
@@ -4593,7 +4595,7 @@ const KeepAliveImpl = {
|
|
|
4593
4595
|
setTransitionHooks(vnode, vnode.transition);
|
|
4594
4596
|
}
|
|
4595
4597
|
// avoid vnode being mounted as fresh
|
|
4596
|
-
vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4598
|
+
vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4597
4599
|
// make this key the freshest
|
|
4598
4600
|
keys.delete(key);
|
|
4599
4601
|
keys.add(key);
|
|
@@ -4606,7 +4608,7 @@ const KeepAliveImpl = {
|
|
|
4606
4608
|
}
|
|
4607
4609
|
}
|
|
4608
4610
|
// avoid vnode being unmounted
|
|
4609
|
-
vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4611
|
+
vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4610
4612
|
current = vnode;
|
|
4611
4613
|
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
4612
4614
|
};
|
|
@@ -4632,10 +4634,10 @@ function matches(pattern, name) {
|
|
|
4632
4634
|
return false;
|
|
4633
4635
|
}
|
|
4634
4636
|
function onActivated(hook, target) {
|
|
4635
|
-
registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
|
|
4637
|
+
registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
|
|
4636
4638
|
}
|
|
4637
4639
|
function onDeactivated(hook, target) {
|
|
4638
|
-
registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
|
|
4640
|
+
registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
|
|
4639
4641
|
}
|
|
4640
4642
|
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
4641
4643
|
// cache the deactivate branch check wrapper for injected hooks so the same
|
|
@@ -4679,16 +4681,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4679
4681
|
}
|
|
4680
4682
|
function resetShapeFlag(vnode) {
|
|
4681
4683
|
let shapeFlag = vnode.shapeFlag;
|
|
4682
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4683
|
-
shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4684
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4685
|
+
shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4684
4686
|
}
|
|
4685
|
-
if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
4686
|
-
shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4687
|
+
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4688
|
+
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4687
4689
|
}
|
|
4688
4690
|
vnode.shapeFlag = shapeFlag;
|
|
4689
4691
|
}
|
|
4690
4692
|
function getInnerChild(vnode) {
|
|
4691
|
-
return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4693
|
+
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4692
4694
|
}
|
|
4693
4695
|
|
|
4694
4696
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
@@ -4734,23 +4736,23 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4734
4736
|
}
|
|
4735
4737
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4736
4738
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4737
|
-
(!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
|
|
4739
|
+
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4738
4740
|
injectHook(lifecycle, hook, target);
|
|
4739
|
-
const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
|
|
4740
|
-
const onMounted = createHook("m" /* MOUNTED */);
|
|
4741
|
-
const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
|
|
4742
|
-
const onUpdated = createHook("u" /* UPDATED */);
|
|
4743
|
-
const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
|
|
4744
|
-
const onUnmounted = createHook("um" /* UNMOUNTED */);
|
|
4745
|
-
const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
|
|
4746
|
-
const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
|
|
4747
|
-
const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
|
|
4741
|
+
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4742
|
+
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4743
|
+
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
4744
|
+
const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
|
|
4745
|
+
const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
|
|
4746
|
+
const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
|
|
4747
|
+
const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
|
|
4748
|
+
const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
|
|
4749
|
+
const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
|
|
4748
4750
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
4749
|
-
injectHook("ec" /* ERROR_CAPTURED */, hook, target);
|
|
4751
|
+
injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
|
|
4750
4752
|
}
|
|
4751
4753
|
|
|
4752
4754
|
function getCompatChildren(instance) {
|
|
4753
|
-
assertCompatEnabled("INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */, instance);
|
|
4755
|
+
assertCompatEnabled("INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */, instance);
|
|
4754
4756
|
const root = instance.subTree;
|
|
4755
4757
|
const children = [];
|
|
4756
4758
|
if (root) {
|
|
@@ -4762,7 +4764,7 @@ function walk(vnode, children) {
|
|
|
4762
4764
|
if (vnode.component) {
|
|
4763
4765
|
children.push(vnode.component.proxy);
|
|
4764
4766
|
}
|
|
4765
|
-
else if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
4767
|
+
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
4766
4768
|
const vnodes = vnode.children;
|
|
4767
4769
|
for (let i = 0; i < vnodes.length; i++) {
|
|
4768
4770
|
walk(vnodes[i], children);
|
|
@@ -4771,7 +4773,7 @@ function walk(vnode, children) {
|
|
|
4771
4773
|
}
|
|
4772
4774
|
|
|
4773
4775
|
function getCompatListeners(instance) {
|
|
4774
|
-
assertCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance);
|
|
4776
|
+
assertCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance);
|
|
4775
4777
|
const listeners = {};
|
|
4776
4778
|
const rawProps = instance.vnode.props;
|
|
4777
4779
|
if (!rawProps) {
|
|
@@ -4799,7 +4801,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4799
4801
|
mappedName.forEach(mapped => {
|
|
4800
4802
|
const mappedHook = dir[mapped];
|
|
4801
4803
|
if (mappedHook) {
|
|
4802
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mapped, name);
|
|
4804
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mapped, name);
|
|
4803
4805
|
hook.push(mappedHook);
|
|
4804
4806
|
}
|
|
4805
4807
|
});
|
|
@@ -4807,7 +4809,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4807
4809
|
}
|
|
4808
4810
|
else {
|
|
4809
4811
|
if (dir[mappedName]) {
|
|
4810
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mappedName, name);
|
|
4812
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mappedName, name);
|
|
4811
4813
|
}
|
|
4812
4814
|
return dir[mappedName];
|
|
4813
4815
|
}
|
|
@@ -4881,7 +4883,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4881
4883
|
// disable tracking inside all lifecycle hooks
|
|
4882
4884
|
// since they can potentially be called inside effects.
|
|
4883
4885
|
pauseTracking();
|
|
4884
|
-
callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
|
|
4886
|
+
callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
|
|
4885
4887
|
vnode.el,
|
|
4886
4888
|
binding,
|
|
4887
4889
|
vnode,
|
|
@@ -4934,7 +4936,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
4934
4936
|
const Component = instance.type;
|
|
4935
4937
|
// explicit self name has highest priority
|
|
4936
4938
|
if (type === COMPONENTS) {
|
|
4937
|
-
const selfName = getComponentName(Component);
|
|
4939
|
+
const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
|
|
4938
4940
|
if (selfName &&
|
|
4939
4941
|
(selfName === name ||
|
|
4940
4942
|
selfName === camelize(name) ||
|
|
@@ -4988,7 +4990,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
4988
4990
|
return;
|
|
4989
4991
|
}
|
|
4990
4992
|
// v2 render function, try to provide compat
|
|
4991
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance)) {
|
|
4993
|
+
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
4992
4994
|
const wrapped = (Component.render = function compatRender() {
|
|
4993
4995
|
// @ts-ignore
|
|
4994
4996
|
return render.call(this, compatH);
|
|
@@ -5110,7 +5112,7 @@ function convertLegacyDirectives(vnode, props) {
|
|
|
5110
5112
|
function convertLegacySlots(vnode) {
|
|
5111
5113
|
const { props, children } = vnode;
|
|
5112
5114
|
let slots;
|
|
5113
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && isArray(children)) {
|
|
5115
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && isArray(children)) {
|
|
5114
5116
|
slots = {};
|
|
5115
5117
|
// check "slot" property on vnodes and turn them into v3 function slots
|
|
5116
5118
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -5149,8 +5151,8 @@ function convertLegacySlots(vnode) {
|
|
|
5149
5151
|
}
|
|
5150
5152
|
function defineLegacyVNodeProperties(vnode) {
|
|
5151
5153
|
/* istanbul ignore if */
|
|
5152
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5153
|
-
isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5154
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5155
|
+
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5154
5156
|
const context = currentRenderingInstance;
|
|
5155
5157
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5156
5158
|
let componentOptions;
|
|
@@ -5164,7 +5166,7 @@ function defineLegacyVNodeProperties(vnode) {
|
|
|
5164
5166
|
context: { get: () => context && context.proxy },
|
|
5165
5167
|
componentOptions: {
|
|
5166
5168
|
get: () => {
|
|
5167
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
5169
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
5168
5170
|
if (componentOptions) {
|
|
5169
5171
|
return componentOptions;
|
|
5170
5172
|
}
|
|
@@ -5284,7 +5286,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5284
5286
|
}
|
|
5285
5287
|
else if (slot) {
|
|
5286
5288
|
// conditional single slot generated by <template v-if="..." #foo>
|
|
5287
|
-
slots[slot.name] = slot.
|
|
5289
|
+
slots[slot.name] = slot.key
|
|
5290
|
+
? (...args) => {
|
|
5291
|
+
const res = slot.fn(...args);
|
|
5292
|
+
res.key = slot.key;
|
|
5293
|
+
return res;
|
|
5294
|
+
}
|
|
5295
|
+
: slot.fn;
|
|
5288
5296
|
}
|
|
5289
5297
|
}
|
|
5290
5298
|
return slots;
|
|
@@ -5320,9 +5328,15 @@ fallback, noSlotted) {
|
|
|
5320
5328
|
}
|
|
5321
5329
|
openBlock();
|
|
5322
5330
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5323
|
-
const rendered = createBlock(Fragment, {
|
|
5324
|
-
|
|
5325
|
-
|
|
5331
|
+
const rendered = createBlock(Fragment, {
|
|
5332
|
+
key: props.key ||
|
|
5333
|
+
// slot content array of a dynamic conditional slot may have a branch
|
|
5334
|
+
// key attached in the `createSlots` helper, respect that
|
|
5335
|
+
(validSlotContent && validSlotContent.key) ||
|
|
5336
|
+
`_${name}`
|
|
5337
|
+
}, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
|
|
5338
|
+
? 64 /* PatchFlags.STABLE_FRAGMENT */
|
|
5339
|
+
: -2 /* PatchFlags.BAIL */);
|
|
5326
5340
|
if (!noSlotted && rendered.scopeId) {
|
|
5327
5341
|
rendered.slotScopeIds = [rendered.scopeId + '-s'];
|
|
5328
5342
|
}
|
|
@@ -5350,14 +5364,16 @@ function ensureValidVNode(vnodes) {
|
|
|
5350
5364
|
* For prefixing keys in v-on="obj" with "on"
|
|
5351
5365
|
* @private
|
|
5352
5366
|
*/
|
|
5353
|
-
function toHandlers(obj) {
|
|
5367
|
+
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5354
5368
|
const ret = {};
|
|
5355
5369
|
if (!isObject(obj)) {
|
|
5356
5370
|
warn$1(`v-on with no argument expects an object value.`);
|
|
5357
5371
|
return ret;
|
|
5358
5372
|
}
|
|
5359
5373
|
for (const key in obj) {
|
|
5360
|
-
ret[
|
|
5374
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
|
|
5375
|
+
? `on:${key}`
|
|
5376
|
+
: toHandlerKey(key)] = obj[key];
|
|
5361
5377
|
}
|
|
5362
5378
|
return ret;
|
|
5363
5379
|
}
|
|
@@ -5493,26 +5509,26 @@ function installCompatInstanceProperties(map) {
|
|
|
5493
5509
|
};
|
|
5494
5510
|
extend(map, {
|
|
5495
5511
|
$set: i => {
|
|
5496
|
-
assertCompatEnabled("INSTANCE_SET" /* INSTANCE_SET */, i);
|
|
5512
|
+
assertCompatEnabled("INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */, i);
|
|
5497
5513
|
return set;
|
|
5498
5514
|
},
|
|
5499
5515
|
$delete: i => {
|
|
5500
|
-
assertCompatEnabled("INSTANCE_DELETE" /* INSTANCE_DELETE */, i);
|
|
5516
|
+
assertCompatEnabled("INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */, i);
|
|
5501
5517
|
return del;
|
|
5502
5518
|
},
|
|
5503
5519
|
$mount: i => {
|
|
5504
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5520
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5505
5521
|
// root mount override from ./global.ts in installCompatMount
|
|
5506
5522
|
return i.ctx._compat_mount || NOOP;
|
|
5507
5523
|
},
|
|
5508
5524
|
$destroy: i => {
|
|
5509
|
-
assertCompatEnabled("INSTANCE_DESTROY" /* INSTANCE_DESTROY */, i);
|
|
5525
|
+
assertCompatEnabled("INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */, i);
|
|
5510
5526
|
// root destroy override from ./global.ts in installCompatMount
|
|
5511
5527
|
return i.ctx._compat_destroy || NOOP;
|
|
5512
5528
|
},
|
|
5513
5529
|
// overrides existing accessor
|
|
5514
5530
|
$slots: i => {
|
|
5515
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, i) &&
|
|
5531
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5516
5532
|
i.render &&
|
|
5517
5533
|
i.render._compatWrapped) {
|
|
5518
5534
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5520,7 +5536,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5520
5536
|
return shallowReadonly(i.slots) ;
|
|
5521
5537
|
},
|
|
5522
5538
|
$scopedSlots: i => {
|
|
5523
|
-
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */, i);
|
|
5539
|
+
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */, i);
|
|
5524
5540
|
const res = {};
|
|
5525
5541
|
for (const key in i.slots) {
|
|
5526
5542
|
const fn = i.slots[key];
|
|
@@ -5537,7 +5553,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5537
5553
|
$listeners: getCompatListeners
|
|
5538
5554
|
});
|
|
5539
5555
|
/* istanbul ignore if */
|
|
5540
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, null)) {
|
|
5556
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5541
5557
|
extend(map, {
|
|
5542
5558
|
// needed by many libs / render fns
|
|
5543
5559
|
$vnode: i => i.vnode,
|
|
@@ -5641,23 +5657,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
5641
5657
|
const n = accessCache[key];
|
|
5642
5658
|
if (n !== undefined) {
|
|
5643
5659
|
switch (n) {
|
|
5644
|
-
case 1 /* SETUP */:
|
|
5660
|
+
case 1 /* AccessTypes.SETUP */:
|
|
5645
5661
|
return setupState[key];
|
|
5646
|
-
case 2 /* DATA */:
|
|
5662
|
+
case 2 /* AccessTypes.DATA */:
|
|
5647
5663
|
return data[key];
|
|
5648
|
-
case 4 /* CONTEXT */:
|
|
5664
|
+
case 4 /* AccessTypes.CONTEXT */:
|
|
5649
5665
|
return ctx[key];
|
|
5650
|
-
case 3 /* PROPS */:
|
|
5666
|
+
case 3 /* AccessTypes.PROPS */:
|
|
5651
5667
|
return props[key];
|
|
5652
5668
|
// default: just fallthrough
|
|
5653
5669
|
}
|
|
5654
5670
|
}
|
|
5655
5671
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
5656
|
-
accessCache[key] = 1 /* SETUP */;
|
|
5672
|
+
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5657
5673
|
return setupState[key];
|
|
5658
5674
|
}
|
|
5659
5675
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5660
|
-
accessCache[key] = 2 /* DATA */;
|
|
5676
|
+
accessCache[key] = 2 /* AccessTypes.DATA */;
|
|
5661
5677
|
return data[key];
|
|
5662
5678
|
}
|
|
5663
5679
|
else if (
|
|
@@ -5665,15 +5681,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
5665
5681
|
// props
|
|
5666
5682
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
5667
5683
|
hasOwn(normalizedProps, key)) {
|
|
5668
|
-
accessCache[key] = 3 /* PROPS */;
|
|
5684
|
+
accessCache[key] = 3 /* AccessTypes.PROPS */;
|
|
5669
5685
|
return props[key];
|
|
5670
5686
|
}
|
|
5671
5687
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5672
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5688
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5673
5689
|
return ctx[key];
|
|
5674
5690
|
}
|
|
5675
5691
|
else if (shouldCacheAccess) {
|
|
5676
|
-
accessCache[key] = 0 /* OTHER */;
|
|
5692
|
+
accessCache[key] = 0 /* AccessTypes.OTHER */;
|
|
5677
5693
|
}
|
|
5678
5694
|
}
|
|
5679
5695
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -5681,7 +5697,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5681
5697
|
// public $xxx properties
|
|
5682
5698
|
if (publicGetter) {
|
|
5683
5699
|
if (key === '$attrs') {
|
|
5684
|
-
track(instance, "get" /* GET */, key);
|
|
5700
|
+
track(instance, "get" /* TrackOpTypes.GET */, key);
|
|
5685
5701
|
markAttrsAccessed();
|
|
5686
5702
|
}
|
|
5687
5703
|
return publicGetter(instance);
|
|
@@ -5694,7 +5710,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5694
5710
|
}
|
|
5695
5711
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5696
5712
|
// user may set custom properties to `this` that start with `$`
|
|
5697
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5713
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5698
5714
|
return ctx[key];
|
|
5699
5715
|
}
|
|
5700
5716
|
else if (
|
|
@@ -5870,7 +5886,7 @@ function deepMergeData(to, from) {
|
|
|
5870
5886
|
const toVal = to[key];
|
|
5871
5887
|
const fromVal = from[key];
|
|
5872
5888
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
5873
|
-
warnDeprecation("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null, key);
|
|
5889
|
+
warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
5874
5890
|
deepMergeData(toVal, fromVal);
|
|
5875
5891
|
}
|
|
5876
5892
|
else {
|
|
@@ -5901,7 +5917,7 @@ function applyOptions(instance) {
|
|
|
5901
5917
|
// call beforeCreate first before accessing other options since
|
|
5902
5918
|
// the hook may mutate resolved options (#2791)
|
|
5903
5919
|
if (options.beforeCreate) {
|
|
5904
|
-
callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
|
|
5920
|
+
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
5905
5921
|
}
|
|
5906
5922
|
const {
|
|
5907
5923
|
// state
|
|
@@ -5917,7 +5933,7 @@ function applyOptions(instance) {
|
|
|
5917
5933
|
const [propsOptions] = instance.propsOptions;
|
|
5918
5934
|
if (propsOptions) {
|
|
5919
5935
|
for (const key in propsOptions) {
|
|
5920
|
-
checkDuplicateProperties("Props" /* PROPS */, key);
|
|
5936
|
+
checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
|
|
5921
5937
|
}
|
|
5922
5938
|
}
|
|
5923
5939
|
}
|
|
@@ -5947,7 +5963,7 @@ function applyOptions(instance) {
|
|
|
5947
5963
|
});
|
|
5948
5964
|
}
|
|
5949
5965
|
{
|
|
5950
|
-
checkDuplicateProperties("Methods" /* METHODS */, key);
|
|
5966
|
+
checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
|
|
5951
5967
|
}
|
|
5952
5968
|
}
|
|
5953
5969
|
else {
|
|
@@ -5974,7 +5990,7 @@ function applyOptions(instance) {
|
|
|
5974
5990
|
instance.data = reactive(data);
|
|
5975
5991
|
{
|
|
5976
5992
|
for (const key in data) {
|
|
5977
|
-
checkDuplicateProperties("Data" /* DATA */, key);
|
|
5993
|
+
checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
|
|
5978
5994
|
// expose data on ctx during dev
|
|
5979
5995
|
if (!isReservedPrefix(key[0])) {
|
|
5980
5996
|
Object.defineProperty(ctx, key, {
|
|
@@ -6018,7 +6034,7 @@ function applyOptions(instance) {
|
|
|
6018
6034
|
set: v => (c.value = v)
|
|
6019
6035
|
});
|
|
6020
6036
|
{
|
|
6021
|
-
checkDuplicateProperties("Computed" /* COMPUTED */, key);
|
|
6037
|
+
checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
|
|
6022
6038
|
}
|
|
6023
6039
|
}
|
|
6024
6040
|
}
|
|
@@ -6036,7 +6052,7 @@ function applyOptions(instance) {
|
|
|
6036
6052
|
});
|
|
6037
6053
|
}
|
|
6038
6054
|
if (created) {
|
|
6039
|
-
callHook(created, instance, "c" /* CREATED */);
|
|
6055
|
+
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6040
6056
|
}
|
|
6041
6057
|
function registerLifecycleHook(register, hook) {
|
|
6042
6058
|
if (isArray(hook)) {
|
|
@@ -6060,11 +6076,11 @@ function applyOptions(instance) {
|
|
|
6060
6076
|
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
6061
6077
|
{
|
|
6062
6078
|
if (beforeDestroy &&
|
|
6063
|
-
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6079
|
+
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6064
6080
|
registerLifecycleHook(onBeforeUnmount, beforeDestroy);
|
|
6065
6081
|
}
|
|
6066
6082
|
if (destroyed &&
|
|
6067
|
-
softAssertCompatEnabled("OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */, instance)) {
|
|
6083
|
+
softAssertCompatEnabled("OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */, instance)) {
|
|
6068
6084
|
registerLifecycleHook(onUnmounted, destroyed);
|
|
6069
6085
|
}
|
|
6070
6086
|
}
|
|
@@ -6096,7 +6112,7 @@ function applyOptions(instance) {
|
|
|
6096
6112
|
if (directives)
|
|
6097
6113
|
instance.directives = directives;
|
|
6098
6114
|
if (filters &&
|
|
6099
|
-
isCompatEnabled("FILTERS" /* FILTERS */, instance)) {
|
|
6115
|
+
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6100
6116
|
instance.filters = filters;
|
|
6101
6117
|
}
|
|
6102
6118
|
}
|
|
@@ -6143,7 +6159,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6143
6159
|
ctx[key] = injected;
|
|
6144
6160
|
}
|
|
6145
6161
|
{
|
|
6146
|
-
checkDuplicateProperties("Inject" /* INJECT */, key);
|
|
6162
|
+
checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
|
|
6147
6163
|
}
|
|
6148
6164
|
}
|
|
6149
6165
|
}
|
|
@@ -6203,7 +6219,7 @@ function resolveMergedOptions(instance) {
|
|
|
6203
6219
|
resolved = cached;
|
|
6204
6220
|
}
|
|
6205
6221
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6206
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, instance)) {
|
|
6222
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6207
6223
|
resolved = extend({}, base);
|
|
6208
6224
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6209
6225
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6219,7 +6235,9 @@ function resolveMergedOptions(instance) {
|
|
|
6219
6235
|
}
|
|
6220
6236
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
6221
6237
|
}
|
|
6222
|
-
|
|
6238
|
+
if (isObject(base)) {
|
|
6239
|
+
cache.set(base, resolved);
|
|
6240
|
+
}
|
|
6223
6241
|
return resolved;
|
|
6224
6242
|
}
|
|
6225
6243
|
function mergeOptions(to, from, strats, asMixin = false) {
|
|
@@ -6287,7 +6305,7 @@ function mergeDataFn(to, from) {
|
|
|
6287
6305
|
return from;
|
|
6288
6306
|
}
|
|
6289
6307
|
return function mergedDataFn() {
|
|
6290
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null)
|
|
6308
|
+
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6291
6309
|
? deepMergeData
|
|
6292
6310
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6293
6311
|
};
|
|
@@ -6326,7 +6344,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6326
6344
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6327
6345
|
return new Proxy({}, {
|
|
6328
6346
|
get(_, key) {
|
|
6329
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, null, propKey);
|
|
6347
|
+
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6330
6348
|
// $options
|
|
6331
6349
|
if (key === '$options') {
|
|
6332
6350
|
return resolveMergedOptions(instance);
|
|
@@ -6356,11 +6374,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6356
6374
|
return true;
|
|
6357
6375
|
}
|
|
6358
6376
|
if ((key === 'class' || key === 'style') &&
|
|
6359
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6377
|
+
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6360
6378
|
return true;
|
|
6361
6379
|
}
|
|
6362
6380
|
if (isOn(key) &&
|
|
6363
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance)) {
|
|
6381
|
+
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6364
6382
|
return true;
|
|
6365
6383
|
}
|
|
6366
6384
|
// vue-router
|
|
@@ -6403,6 +6421,13 @@ isSSR = false) {
|
|
|
6403
6421
|
}
|
|
6404
6422
|
instance.attrs = attrs;
|
|
6405
6423
|
}
|
|
6424
|
+
function isInHmrContext(instance) {
|
|
6425
|
+
while (instance) {
|
|
6426
|
+
if (instance.type.__hmrId)
|
|
6427
|
+
return true;
|
|
6428
|
+
instance = instance.parent;
|
|
6429
|
+
}
|
|
6430
|
+
}
|
|
6406
6431
|
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
6407
6432
|
const { props, attrs, vnode: { patchFlag } } = instance;
|
|
6408
6433
|
const rawCurrentProps = toRaw(props);
|
|
@@ -6412,11 +6437,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6412
6437
|
// always force full diff in dev
|
|
6413
6438
|
// - #1942 if hmr is enabled with sfc component
|
|
6414
6439
|
// - vite#872 non-sfc component used by sfc component
|
|
6415
|
-
!((instance
|
|
6416
|
-
(instance.parent && instance.parent.type.__hmrId))) &&
|
|
6440
|
+
!(isInHmrContext(instance)) &&
|
|
6417
6441
|
(optimized || patchFlag > 0) &&
|
|
6418
|
-
!(patchFlag & 16 /* FULL_PROPS */)) {
|
|
6419
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
6442
|
+
!(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
|
|
6443
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
6420
6444
|
// Compiler-generated props & no keys change, just set the updated
|
|
6421
6445
|
// the props.
|
|
6422
6446
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
@@ -6503,7 +6527,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6503
6527
|
}
|
|
6504
6528
|
// trigger updates for $attrs in case it's used in component slots
|
|
6505
6529
|
if (hasAttrsChanged) {
|
|
6506
|
-
trigger(instance, "set" /* SET */, '$attrs');
|
|
6530
|
+
trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
|
|
6507
6531
|
}
|
|
6508
6532
|
{
|
|
6509
6533
|
validateProps(rawProps || {}, props, instance);
|
|
@@ -6521,7 +6545,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
6521
6545
|
}
|
|
6522
6546
|
{
|
|
6523
6547
|
if (key.startsWith('onHook:')) {
|
|
6524
|
-
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6548
|
+
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6525
6549
|
}
|
|
6526
6550
|
if (key === 'inline-template') {
|
|
6527
6551
|
continue;
|
|
@@ -6582,7 +6606,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6582
6606
|
}
|
|
6583
6607
|
else {
|
|
6584
6608
|
setCurrentInstance(instance);
|
|
6585
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, instance)
|
|
6609
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6586
6610
|
? createPropsDefaultThis(instance, props, key)
|
|
6587
6611
|
: null, props);
|
|
6588
6612
|
unsetCurrentInstance();
|
|
@@ -6593,11 +6617,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6593
6617
|
}
|
|
6594
6618
|
}
|
|
6595
6619
|
// boolean casting
|
|
6596
|
-
if (opt[0 /* shouldCast */]) {
|
|
6620
|
+
if (opt[0 /* BooleanFlags.shouldCast */]) {
|
|
6597
6621
|
if (isAbsent && !hasDefault) {
|
|
6598
6622
|
value = false;
|
|
6599
6623
|
}
|
|
6600
|
-
else if (opt[1 /* shouldCastTrue */] &&
|
|
6624
|
+
else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
|
|
6601
6625
|
(value === '' || value === hyphenate(key))) {
|
|
6602
6626
|
value = true;
|
|
6603
6627
|
}
|
|
@@ -6638,7 +6662,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6638
6662
|
}
|
|
6639
6663
|
}
|
|
6640
6664
|
if (!raw && !hasExtends) {
|
|
6641
|
-
|
|
6665
|
+
if (isObject(comp)) {
|
|
6666
|
+
cache.set(comp, EMPTY_ARR);
|
|
6667
|
+
}
|
|
6642
6668
|
return EMPTY_ARR;
|
|
6643
6669
|
}
|
|
6644
6670
|
if (isArray(raw)) {
|
|
@@ -6665,8 +6691,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6665
6691
|
if (prop) {
|
|
6666
6692
|
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
6667
6693
|
const stringIndex = getTypeIndex(String, prop.type);
|
|
6668
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
6669
|
-
prop[1 /* shouldCastTrue */] =
|
|
6694
|
+
prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
|
|
6695
|
+
prop[1 /* BooleanFlags.shouldCastTrue */] =
|
|
6670
6696
|
stringIndex < 0 || booleanIndex < stringIndex;
|
|
6671
6697
|
// if the prop needs boolean casting or default value
|
|
6672
6698
|
if (booleanIndex > -1 || hasOwn(prop, 'default')) {
|
|
@@ -6677,7 +6703,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6677
6703
|
}
|
|
6678
6704
|
}
|
|
6679
6705
|
const res = [normalized, needCastKeys];
|
|
6680
|
-
|
|
6706
|
+
if (isObject(comp)) {
|
|
6707
|
+
cache.set(comp, res);
|
|
6708
|
+
}
|
|
6681
6709
|
return res;
|
|
6682
6710
|
}
|
|
6683
6711
|
function validatePropName(key) {
|
|
@@ -6868,7 +6896,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6868
6896
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
6869
6897
|
}
|
|
6870
6898
|
else if (value != null) {
|
|
6871
|
-
if (!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6899
|
+
if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6872
6900
|
warn$1(`Non-function value encountered for slot "${key}". ` +
|
|
6873
6901
|
`Prefer function slots for better performance.`);
|
|
6874
6902
|
}
|
|
@@ -6879,7 +6907,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6879
6907
|
};
|
|
6880
6908
|
const normalizeVNodeSlots = (instance, children) => {
|
|
6881
6909
|
if (!isKeepAlive(instance.vnode) &&
|
|
6882
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6910
|
+
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6883
6911
|
warn$1(`Non-function value encountered for default slot. ` +
|
|
6884
6912
|
`Prefer function slots for better performance.`);
|
|
6885
6913
|
}
|
|
@@ -6887,7 +6915,7 @@ const normalizeVNodeSlots = (instance, children) => {
|
|
|
6887
6915
|
instance.slots.default = () => normalized;
|
|
6888
6916
|
};
|
|
6889
6917
|
const initSlots = (instance, children) => {
|
|
6890
|
-
if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
6918
|
+
if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6891
6919
|
const type = children._;
|
|
6892
6920
|
if (type) {
|
|
6893
6921
|
// users can get the shallow readonly version of the slots object through `this.$slots`,
|
|
@@ -6912,7 +6940,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6912
6940
|
const { vnode, slots } = instance;
|
|
6913
6941
|
let needDeletionCheck = true;
|
|
6914
6942
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
6915
|
-
if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
6943
|
+
if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6916
6944
|
const type = children._;
|
|
6917
6945
|
if (type) {
|
|
6918
6946
|
// compiled slots.
|
|
@@ -6921,7 +6949,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6921
6949
|
// force update slots and mark instance for hmr as well
|
|
6922
6950
|
extend(slots, children);
|
|
6923
6951
|
}
|
|
6924
|
-
else if (optimized && type === 1 /* STABLE */) {
|
|
6952
|
+
else if (optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
6925
6953
|
// compiled AND stable.
|
|
6926
6954
|
// no need to update, and skip stale slots removal.
|
|
6927
6955
|
needDeletionCheck = false;
|
|
@@ -6934,7 +6962,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6934
6962
|
// when rendering the optimized slots by manually written render function,
|
|
6935
6963
|
// we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
|
|
6936
6964
|
// i.e. let the `renderSlot` create the bailed Fragment
|
|
6937
|
-
if (!optimized && type === 1 /* STABLE */) {
|
|
6965
|
+
if (!optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
6938
6966
|
delete slots._;
|
|
6939
6967
|
}
|
|
6940
6968
|
}
|
|
@@ -6963,11 +6991,11 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6963
6991
|
// dev only
|
|
6964
6992
|
function installLegacyConfigWarnings(config) {
|
|
6965
6993
|
const legacyConfigOptions = {
|
|
6966
|
-
silent: "CONFIG_SILENT" /* CONFIG_SILENT */,
|
|
6967
|
-
devtools: "CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */,
|
|
6968
|
-
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */,
|
|
6969
|
-
keyCodes: "CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */,
|
|
6970
|
-
productionTip: "CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */
|
|
6994
|
+
silent: "CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */,
|
|
6995
|
+
devtools: "CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */,
|
|
6996
|
+
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */,
|
|
6997
|
+
keyCodes: "CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */,
|
|
6998
|
+
productionTip: "CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */
|
|
6971
6999
|
};
|
|
6972
7000
|
Object.keys(legacyConfigOptions).forEach(key => {
|
|
6973
7001
|
let val = config[key];
|
|
@@ -6992,7 +7020,7 @@ function installLegacyOptionMergeStrats(config) {
|
|
|
6992
7020
|
return target[key];
|
|
6993
7021
|
}
|
|
6994
7022
|
if (key in internalOptionMergeStrats &&
|
|
6995
|
-
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
7023
|
+
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
6996
7024
|
return internalOptionMergeStrats[key];
|
|
6997
7025
|
}
|
|
6998
7026
|
}
|
|
@@ -7010,11 +7038,11 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7010
7038
|
return createCompatApp(options, Vue);
|
|
7011
7039
|
});
|
|
7012
7040
|
function createCompatApp(options = {}, Ctor) {
|
|
7013
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null);
|
|
7041
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null);
|
|
7014
7042
|
const { data } = options;
|
|
7015
7043
|
if (data &&
|
|
7016
7044
|
!isFunction(data) &&
|
|
7017
|
-
softAssertCompatEnabled("OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */, null)) {
|
|
7045
|
+
softAssertCompatEnabled("OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */, null)) {
|
|
7018
7046
|
options.data = () => data;
|
|
7019
7047
|
}
|
|
7020
7048
|
const app = createApp(options);
|
|
@@ -7029,7 +7057,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7029
7057
|
return vm;
|
|
7030
7058
|
}
|
|
7031
7059
|
}
|
|
7032
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7060
|
+
Vue.version = `2.6.14-compat:${"3.2.39"}`;
|
|
7033
7061
|
Vue.config = singletonApp.config;
|
|
7034
7062
|
Vue.use = (p, ...options) => {
|
|
7035
7063
|
if (p && isFunction(p.install)) {
|
|
@@ -7068,7 +7096,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7068
7096
|
Vue.nextTick = nextTick;
|
|
7069
7097
|
const extendCache = new WeakMap();
|
|
7070
7098
|
function extendCtor(extendOptions = {}) {
|
|
7071
|
-
assertCompatEnabled("GLOBAL_EXTEND" /* GLOBAL_EXTEND */, null);
|
|
7099
|
+
assertCompatEnabled("GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */, null);
|
|
7072
7100
|
if (isFunction(extendOptions)) {
|
|
7073
7101
|
extendOptions = extendOptions.options;
|
|
7074
7102
|
}
|
|
@@ -7109,15 +7137,15 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7109
7137
|
}
|
|
7110
7138
|
Vue.extend = extendCtor.bind(Vue);
|
|
7111
7139
|
Vue.set = (target, key, value) => {
|
|
7112
|
-
assertCompatEnabled("GLOBAL_SET" /* GLOBAL_SET */, null);
|
|
7140
|
+
assertCompatEnabled("GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */, null);
|
|
7113
7141
|
target[key] = value;
|
|
7114
7142
|
};
|
|
7115
7143
|
Vue.delete = (target, key) => {
|
|
7116
|
-
assertCompatEnabled("GLOBAL_DELETE" /* GLOBAL_DELETE */, null);
|
|
7144
|
+
assertCompatEnabled("GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */, null);
|
|
7117
7145
|
delete target[key];
|
|
7118
7146
|
};
|
|
7119
7147
|
Vue.observable = (target) => {
|
|
7120
|
-
assertCompatEnabled("GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */, null);
|
|
7148
|
+
assertCompatEnabled("GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */, null);
|
|
7121
7149
|
return reactive(target);
|
|
7122
7150
|
};
|
|
7123
7151
|
Vue.filter = ((name, filter) => {
|
|
@@ -7138,7 +7166,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7138
7166
|
};
|
|
7139
7167
|
Object.defineProperty(Vue, 'util', {
|
|
7140
7168
|
get() {
|
|
7141
|
-
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */, null);
|
|
7169
|
+
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */, null);
|
|
7142
7170
|
return util;
|
|
7143
7171
|
}
|
|
7144
7172
|
});
|
|
@@ -7161,7 +7189,7 @@ function installAppCompatProperties(app, context, render) {
|
|
|
7161
7189
|
function installFilterMethod(app, context) {
|
|
7162
7190
|
context.filters = {};
|
|
7163
7191
|
app.filter = (name, filter) => {
|
|
7164
|
-
assertCompatEnabled("FILTERS" /* FILTERS */, null);
|
|
7192
|
+
assertCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, null);
|
|
7165
7193
|
if (!filter) {
|
|
7166
7194
|
return context.filters[name];
|
|
7167
7195
|
}
|
|
@@ -7178,7 +7206,7 @@ function installLegacyAPIs(app) {
|
|
|
7178
7206
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7179
7207
|
prototype: {
|
|
7180
7208
|
get() {
|
|
7181
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7209
|
+
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7182
7210
|
return app.config.globalProperties;
|
|
7183
7211
|
}
|
|
7184
7212
|
},
|
|
@@ -7215,7 +7243,7 @@ function applySingletonAppMutations(app) {
|
|
|
7215
7243
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7216
7244
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7217
7245
|
if (key === 'ignoredElements' &&
|
|
7218
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7246
|
+
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7219
7247
|
!isRuntimeOnly() &&
|
|
7220
7248
|
isArray(val)) {
|
|
7221
7249
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7228,7 +7256,7 @@ function applySingletonAppMutations(app) {
|
|
|
7228
7256
|
}
|
|
7229
7257
|
function applySingletonPrototype(app, Ctor) {
|
|
7230
7258
|
// copy prototype augmentations as config.globalProperties
|
|
7231
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7259
|
+
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7232
7260
|
if (enabled) {
|
|
7233
7261
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7234
7262
|
}
|
|
@@ -7243,7 +7271,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7243
7271
|
}
|
|
7244
7272
|
}
|
|
7245
7273
|
if (hasPrototypeAugmentations) {
|
|
7246
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7274
|
+
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7247
7275
|
}
|
|
7248
7276
|
}
|
|
7249
7277
|
function installCompatMount(app, context, render) {
|
|
@@ -7313,7 +7341,7 @@ function installCompatMount(app, context, render) {
|
|
|
7313
7341
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7314
7342
|
const attr = container.attributes[i];
|
|
7315
7343
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7316
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
7344
|
+
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7317
7345
|
break;
|
|
7318
7346
|
}
|
|
7319
7347
|
}
|
|
@@ -7352,7 +7380,7 @@ function installCompatMount(app, context, render) {
|
|
|
7352
7380
|
if (bum) {
|
|
7353
7381
|
invokeArrayFns(bum);
|
|
7354
7382
|
}
|
|
7355
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7383
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7356
7384
|
instance.emit('hook:beforeDestroy');
|
|
7357
7385
|
}
|
|
7358
7386
|
// stop effects
|
|
@@ -7363,7 +7391,7 @@ function installCompatMount(app, context, render) {
|
|
|
7363
7391
|
if (um) {
|
|
7364
7392
|
invokeArrayFns(um);
|
|
7365
7393
|
}
|
|
7366
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7394
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7367
7395
|
instance.emit('hook:destroyed');
|
|
7368
7396
|
}
|
|
7369
7397
|
}
|
|
@@ -7424,12 +7452,12 @@ function defineReactiveSimple(obj, key, val) {
|
|
|
7424
7452
|
enumerable: true,
|
|
7425
7453
|
configurable: true,
|
|
7426
7454
|
get() {
|
|
7427
|
-
track(obj, "get" /* GET */, key);
|
|
7455
|
+
track(obj, "get" /* TrackOpTypes.GET */, key);
|
|
7428
7456
|
return val;
|
|
7429
7457
|
},
|
|
7430
7458
|
set(newVal) {
|
|
7431
7459
|
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
7432
|
-
trigger(obj, "set" /* SET */, key, newVal);
|
|
7460
|
+
trigger(obj, "set" /* TriggerOpTypes.SET */, key, newVal);
|
|
7433
7461
|
}
|
|
7434
7462
|
});
|
|
7435
7463
|
}
|
|
@@ -7622,7 +7650,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7622
7650
|
// because the template ref is forwarded to inner component
|
|
7623
7651
|
return;
|
|
7624
7652
|
}
|
|
7625
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
7653
|
+
const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
7626
7654
|
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
7627
7655
|
: vnode.el;
|
|
7628
7656
|
const value = isUnmount ? null : refValue;
|
|
@@ -7648,7 +7676,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7648
7676
|
}
|
|
7649
7677
|
}
|
|
7650
7678
|
if (isFunction(ref)) {
|
|
7651
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
7679
|
+
callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
|
|
7652
7680
|
}
|
|
7653
7681
|
else {
|
|
7654
7682
|
const _isString = isString(ref);
|
|
@@ -7685,7 +7713,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7685
7713
|
setupState[ref] = value;
|
|
7686
7714
|
}
|
|
7687
7715
|
}
|
|
7688
|
-
else if (
|
|
7716
|
+
else if (_isRef) {
|
|
7689
7717
|
ref.value = value;
|
|
7690
7718
|
if (rawRef.k)
|
|
7691
7719
|
refs[rawRef.k] = value;
|
|
@@ -7710,7 +7738,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7710
7738
|
|
|
7711
7739
|
let hasMismatch = false;
|
|
7712
7740
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
7713
|
-
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
7741
|
+
const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
|
|
7714
7742
|
// Note: hydration is DOM-specific
|
|
7715
7743
|
// But we have to place it in core due to tight coupling with core - splitting
|
|
7716
7744
|
// it out creates a ton of unnecessary complexity.
|
|
@@ -7724,11 +7752,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7724
7752
|
`Performing full mount instead.`);
|
|
7725
7753
|
patch(null, vnode, container);
|
|
7726
7754
|
flushPostFlushCbs();
|
|
7755
|
+
container._vnode = vnode;
|
|
7727
7756
|
return;
|
|
7728
7757
|
}
|
|
7729
7758
|
hasMismatch = false;
|
|
7730
7759
|
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
7731
7760
|
flushPostFlushCbs();
|
|
7761
|
+
container._vnode = vnode;
|
|
7732
7762
|
if (hasMismatch && !false) {
|
|
7733
7763
|
// this error should show up in production
|
|
7734
7764
|
console.error(`Hydration completed but contains mismatches.`);
|
|
@@ -7740,14 +7770,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7740
7770
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7741
7771
|
const domType = node.nodeType;
|
|
7742
7772
|
vnode.el = node;
|
|
7743
|
-
if (patchFlag === -2 /* BAIL */) {
|
|
7773
|
+
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7744
7774
|
optimized = false;
|
|
7745
7775
|
vnode.dynamicChildren = null;
|
|
7746
7776
|
}
|
|
7747
7777
|
let nextNode = null;
|
|
7748
7778
|
switch (type) {
|
|
7749
7779
|
case Text:
|
|
7750
|
-
if (domType !== 3 /* TEXT */) {
|
|
7780
|
+
if (domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7751
7781
|
// #5728 empty text node inside a slot can cause hydration failure
|
|
7752
7782
|
// because the server rendered HTML won't contain a text node
|
|
7753
7783
|
if (vnode.children === '') {
|
|
@@ -7770,7 +7800,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7770
7800
|
}
|
|
7771
7801
|
break;
|
|
7772
7802
|
case Comment:
|
|
7773
|
-
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
7803
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
|
|
7774
7804
|
nextNode = onMismatch();
|
|
7775
7805
|
}
|
|
7776
7806
|
else {
|
|
@@ -7778,7 +7808,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7778
7808
|
}
|
|
7779
7809
|
break;
|
|
7780
7810
|
case Static:
|
|
7781
|
-
if (domType !== 1 /* ELEMENT */) {
|
|
7811
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7782
7812
|
nextNode = onMismatch();
|
|
7783
7813
|
}
|
|
7784
7814
|
else {
|
|
@@ -7789,7 +7819,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7789
7819
|
const needToAdoptContent = !vnode.children.length;
|
|
7790
7820
|
for (let i = 0; i < vnode.staticCount; i++) {
|
|
7791
7821
|
if (needToAdoptContent)
|
|
7792
|
-
vnode.children +=
|
|
7822
|
+
vnode.children +=
|
|
7823
|
+
nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
|
|
7824
|
+
? nextNode.outerHTML
|
|
7825
|
+
: nextNode.data;
|
|
7793
7826
|
if (i === vnode.staticCount - 1) {
|
|
7794
7827
|
vnode.anchor = nextNode;
|
|
7795
7828
|
}
|
|
@@ -7807,8 +7840,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7807
7840
|
}
|
|
7808
7841
|
break;
|
|
7809
7842
|
default:
|
|
7810
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
7811
|
-
if (domType !== 1 /* ELEMENT */ ||
|
|
7843
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
7844
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
|
|
7812
7845
|
vnode.type.toLowerCase() !==
|
|
7813
7846
|
node.tagName.toLowerCase()) {
|
|
7814
7847
|
nextNode = onMismatch();
|
|
@@ -7817,7 +7850,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7817
7850
|
nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
7818
7851
|
}
|
|
7819
7852
|
}
|
|
7820
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
7853
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
7821
7854
|
// when setting up the render effect, if the initial vnode already
|
|
7822
7855
|
// has .el set, the component will perform hydration instead of mount
|
|
7823
7856
|
// on its sub-tree.
|
|
@@ -7856,15 +7889,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7856
7889
|
vnode.component.subTree = subTree;
|
|
7857
7890
|
}
|
|
7858
7891
|
}
|
|
7859
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
7860
|
-
if (domType !== 8 /* COMMENT */) {
|
|
7892
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
7893
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
|
|
7861
7894
|
nextNode = onMismatch();
|
|
7862
7895
|
}
|
|
7863
7896
|
else {
|
|
7864
7897
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
7865
7898
|
}
|
|
7866
7899
|
}
|
|
7867
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
7900
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
7868
7901
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
7869
7902
|
}
|
|
7870
7903
|
else {
|
|
@@ -7892,7 +7925,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7892
7925
|
if (props) {
|
|
7893
7926
|
if (forcePatchValue ||
|
|
7894
7927
|
!optimized ||
|
|
7895
|
-
patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
|
|
7928
|
+
patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
|
|
7896
7929
|
for (const key in props) {
|
|
7897
7930
|
if ((forcePatchValue && key.endsWith('value')) ||
|
|
7898
7931
|
(isOn(key) && !isReservedProp(key))) {
|
|
@@ -7921,7 +7954,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7921
7954
|
}, parentSuspense);
|
|
7922
7955
|
}
|
|
7923
7956
|
// children
|
|
7924
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
|
|
7957
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
|
|
7925
7958
|
// skip if element has innerHTML / textContent
|
|
7926
7959
|
!(props && (props.innerHTML || props.textContent))) {
|
|
7927
7960
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -7939,7 +7972,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7939
7972
|
remove(cur);
|
|
7940
7973
|
}
|
|
7941
7974
|
}
|
|
7942
|
-
else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
7975
|
+
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
7943
7976
|
if (el.textContent !== vnode.children) {
|
|
7944
7977
|
hasMismatch = true;
|
|
7945
7978
|
warn$1(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
@@ -8002,7 +8035,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8002
8035
|
};
|
|
8003
8036
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8004
8037
|
hasMismatch = true;
|
|
8005
|
-
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
|
|
8038
|
+
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8006
8039
|
? `(text)`
|
|
8007
8040
|
: isComment(node) && node.data === '['
|
|
8008
8041
|
? `(start of fragment)`
|
|
@@ -8133,7 +8166,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8133
8166
|
unmount(n1, parentComponent, parentSuspense, true);
|
|
8134
8167
|
n1 = null;
|
|
8135
8168
|
}
|
|
8136
|
-
if (n2.patchFlag === -2 /* BAIL */) {
|
|
8169
|
+
if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
8137
8170
|
optimized = false;
|
|
8138
8171
|
n2.dynamicChildren = null;
|
|
8139
8172
|
}
|
|
@@ -8157,16 +8190,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8157
8190
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8158
8191
|
break;
|
|
8159
8192
|
default:
|
|
8160
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
8193
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
8161
8194
|
processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8162
8195
|
}
|
|
8163
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
8196
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
8164
8197
|
processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8165
8198
|
}
|
|
8166
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
8199
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
8167
8200
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8168
8201
|
}
|
|
8169
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
8202
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
8170
8203
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8171
8204
|
}
|
|
8172
8205
|
else {
|
|
@@ -8252,10 +8285,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8252
8285
|
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
8253
8286
|
// mount children first, since some props may rely on child content
|
|
8254
8287
|
// being already rendered, e.g. `<select value>`
|
|
8255
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8288
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8256
8289
|
hostSetElementText(el, vnode.children);
|
|
8257
8290
|
}
|
|
8258
|
-
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8291
|
+
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8259
8292
|
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
8260
8293
|
}
|
|
8261
8294
|
if (dirs) {
|
|
@@ -8331,7 +8364,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8331
8364
|
if (parentComponent) {
|
|
8332
8365
|
let subTree = parentComponent.subTree;
|
|
8333
8366
|
if (subTree.patchFlag > 0 &&
|
|
8334
|
-
subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
8367
|
+
subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
8335
8368
|
subTree =
|
|
8336
8369
|
filterSingleRoot(subTree.children) || subTree;
|
|
8337
8370
|
}
|
|
@@ -8354,7 +8387,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8354
8387
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
8355
8388
|
// #1426 take the old vnode's patch flag into account since user may clone a
|
|
8356
8389
|
// compiler-generated vnode, which de-opts to FULL_PROPS
|
|
8357
|
-
patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
|
|
8390
|
+
patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
|
|
8358
8391
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
8359
8392
|
const newProps = n2.props || EMPTY_OBJ;
|
|
8360
8393
|
let vnodeHook;
|
|
@@ -8389,21 +8422,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8389
8422
|
// generated by the compiler and can take the fast path.
|
|
8390
8423
|
// in this path old node and new node are guaranteed to have the same shape
|
|
8391
8424
|
// (i.e. at the exact same position in the source template)
|
|
8392
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
8425
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
8393
8426
|
// element props contain dynamic keys, full diff needed
|
|
8394
8427
|
patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
|
|
8395
8428
|
}
|
|
8396
8429
|
else {
|
|
8397
8430
|
// class
|
|
8398
8431
|
// this flag is matched when the element has dynamic class bindings.
|
|
8399
|
-
if (patchFlag & 2 /* CLASS */) {
|
|
8432
|
+
if (patchFlag & 2 /* PatchFlags.CLASS */) {
|
|
8400
8433
|
if (oldProps.class !== newProps.class) {
|
|
8401
8434
|
hostPatchProp(el, 'class', null, newProps.class, isSVG);
|
|
8402
8435
|
}
|
|
8403
8436
|
}
|
|
8404
8437
|
// style
|
|
8405
8438
|
// this flag is matched when the element has dynamic style bindings
|
|
8406
|
-
if (patchFlag & 4 /* STYLE */) {
|
|
8439
|
+
if (patchFlag & 4 /* PatchFlags.STYLE */) {
|
|
8407
8440
|
hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
|
|
8408
8441
|
}
|
|
8409
8442
|
// props
|
|
@@ -8412,7 +8445,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8412
8445
|
// faster iteration.
|
|
8413
8446
|
// Note dynamic keys like :[foo]="bar" will cause this optimization to
|
|
8414
8447
|
// bail out and go through a full diff because we need to unset the old key
|
|
8415
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
8448
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
8416
8449
|
// if the flag is present then dynamicProps must be non-null
|
|
8417
8450
|
const propsToUpdate = n2.dynamicProps;
|
|
8418
8451
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
@@ -8428,7 +8461,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8428
8461
|
}
|
|
8429
8462
|
// text
|
|
8430
8463
|
// This flag is matched when the element has only dynamic text children.
|
|
8431
|
-
if (patchFlag & 1 /* TEXT */) {
|
|
8464
|
+
if (patchFlag & 1 /* PatchFlags.TEXT */) {
|
|
8432
8465
|
if (n1.children !== n2.children) {
|
|
8433
8466
|
hostSetElementText(el, n2.children);
|
|
8434
8467
|
}
|
|
@@ -8462,7 +8495,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8462
8495
|
// which also requires the correct parent container
|
|
8463
8496
|
!isSameVNodeType(oldVNode, newVNode) ||
|
|
8464
8497
|
// - In the case of a component, it could contain anything.
|
|
8465
|
-
oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
|
|
8498
|
+
oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
|
|
8466
8499
|
? hostParentNode(oldVNode.el)
|
|
8467
8500
|
: // In other cases, the parent container is not actually used so we
|
|
8468
8501
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
@@ -8500,7 +8533,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8500
8533
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
8501
8534
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8502
8535
|
if (// #5523 dev root fragment may inherit directives
|
|
8503
|
-
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8536
|
+
(isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
|
|
8504
8537
|
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8505
8538
|
patchFlag = 0;
|
|
8506
8539
|
optimized = false;
|
|
@@ -8522,7 +8555,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8522
8555
|
}
|
|
8523
8556
|
else {
|
|
8524
8557
|
if (patchFlag > 0 &&
|
|
8525
|
-
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8558
|
+
patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
|
|
8526
8559
|
dynamicChildren &&
|
|
8527
8560
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8528
8561
|
// of renderSlot() with no valid children
|
|
@@ -8555,7 +8588,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8555
8588
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8556
8589
|
n2.slotScopeIds = slotScopeIds;
|
|
8557
8590
|
if (n1 == null) {
|
|
8558
|
-
if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
8591
|
+
if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
8559
8592
|
parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
|
|
8560
8593
|
}
|
|
8561
8594
|
else {
|
|
@@ -8660,7 +8693,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8660
8693
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8661
8694
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8662
8695
|
}
|
|
8663
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8696
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8664
8697
|
instance.emit('hook:beforeMount');
|
|
8665
8698
|
}
|
|
8666
8699
|
toggleRecurse(instance, true);
|
|
@@ -8721,18 +8754,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8721
8754
|
const scopedInitialVNode = initialVNode;
|
|
8722
8755
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
8723
8756
|
}
|
|
8724
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8757
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8725
8758
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
8726
8759
|
}
|
|
8727
8760
|
// activated hook for keep-alive roots.
|
|
8728
8761
|
// #1742 activated hook must be accessed after first render
|
|
8729
8762
|
// since the hook may be injected by a child keep-alive
|
|
8730
|
-
if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8763
|
+
if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8731
8764
|
(parent &&
|
|
8732
8765
|
isAsyncWrapper(parent.vnode) &&
|
|
8733
|
-
parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8766
|
+
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8734
8767
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
8735
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8768
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8736
8769
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
8737
8770
|
}
|
|
8738
8771
|
}
|
|
@@ -8770,7 +8803,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8770
8803
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
8771
8804
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8772
8805
|
}
|
|
8773
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8806
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8774
8807
|
instance.emit('hook:beforeUpdate');
|
|
8775
8808
|
}
|
|
8776
8809
|
toggleRecurse(instance, true);
|
|
@@ -8810,7 +8843,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8810
8843
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
8811
8844
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
8812
8845
|
}
|
|
8813
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8846
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8814
8847
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
8815
8848
|
}
|
|
8816
8849
|
{
|
|
@@ -8850,7 +8883,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8850
8883
|
pauseTracking();
|
|
8851
8884
|
// props update may have triggered pre-flush watchers.
|
|
8852
8885
|
// flush them before the render update.
|
|
8853
|
-
flushPreFlushCbs(
|
|
8886
|
+
flushPreFlushCbs();
|
|
8854
8887
|
resetTracking();
|
|
8855
8888
|
};
|
|
8856
8889
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
|
|
@@ -8860,22 +8893,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8860
8893
|
const { patchFlag, shapeFlag } = n2;
|
|
8861
8894
|
// fast path
|
|
8862
8895
|
if (patchFlag > 0) {
|
|
8863
|
-
if (patchFlag & 128 /* KEYED_FRAGMENT */) {
|
|
8896
|
+
if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
|
|
8864
8897
|
// this could be either fully-keyed or mixed (some keyed some not)
|
|
8865
8898
|
// presence of patchFlag means children are guaranteed to be arrays
|
|
8866
8899
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8867
8900
|
return;
|
|
8868
8901
|
}
|
|
8869
|
-
else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
|
|
8902
|
+
else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
|
|
8870
8903
|
// unkeyed
|
|
8871
8904
|
patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8872
8905
|
return;
|
|
8873
8906
|
}
|
|
8874
8907
|
}
|
|
8875
8908
|
// children has 3 possibilities: text, array or no children.
|
|
8876
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8909
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8877
8910
|
// text children fast path
|
|
8878
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8911
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8879
8912
|
unmountChildren(c1, parentComponent, parentSuspense);
|
|
8880
8913
|
}
|
|
8881
8914
|
if (c2 !== c1) {
|
|
@@ -8883,9 +8916,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8883
8916
|
}
|
|
8884
8917
|
}
|
|
8885
8918
|
else {
|
|
8886
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8919
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8887
8920
|
// prev children was array
|
|
8888
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8921
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8889
8922
|
// two arrays, cannot assume anything, do full diff
|
|
8890
8923
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8891
8924
|
}
|
|
@@ -8897,11 +8930,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8897
8930
|
else {
|
|
8898
8931
|
// prev children was text OR null
|
|
8899
8932
|
// new children is array OR null
|
|
8900
|
-
if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8933
|
+
if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8901
8934
|
hostSetElementText(container, '');
|
|
8902
8935
|
}
|
|
8903
8936
|
// mount new if array
|
|
8904
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8937
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8905
8938
|
mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8906
8939
|
}
|
|
8907
8940
|
}
|
|
@@ -9092,7 +9125,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9092
9125
|
// There is no stable subsequence (e.g. a reverse)
|
|
9093
9126
|
// OR current node is not among the stable sequence
|
|
9094
9127
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
9095
|
-
move(nextChild, container, anchor, 2 /* REORDER */);
|
|
9128
|
+
move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
|
|
9096
9129
|
}
|
|
9097
9130
|
else {
|
|
9098
9131
|
j--;
|
|
@@ -9103,15 +9136,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9103
9136
|
};
|
|
9104
9137
|
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
9105
9138
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
9106
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9139
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9107
9140
|
move(vnode.component.subTree, container, anchor, moveType);
|
|
9108
9141
|
return;
|
|
9109
9142
|
}
|
|
9110
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9143
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9111
9144
|
vnode.suspense.move(container, anchor, moveType);
|
|
9112
9145
|
return;
|
|
9113
9146
|
}
|
|
9114
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9147
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9115
9148
|
type.move(vnode, container, anchor, internals);
|
|
9116
9149
|
return;
|
|
9117
9150
|
}
|
|
@@ -9128,11 +9161,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9128
9161
|
return;
|
|
9129
9162
|
}
|
|
9130
9163
|
// single nodes
|
|
9131
|
-
const needTransition = moveType !== 2 /* REORDER */ &&
|
|
9132
|
-
shapeFlag & 1 /* ELEMENT */ &&
|
|
9164
|
+
const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
|
|
9165
|
+
shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9133
9166
|
transition;
|
|
9134
9167
|
if (needTransition) {
|
|
9135
|
-
if (moveType === 0 /* ENTER */) {
|
|
9168
|
+
if (moveType === 0 /* MoveType.ENTER */) {
|
|
9136
9169
|
transition.beforeEnter(el);
|
|
9137
9170
|
hostInsert(el, container, anchor);
|
|
9138
9171
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9164,42 +9197,42 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9164
9197
|
if (ref != null) {
|
|
9165
9198
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
9166
9199
|
}
|
|
9167
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9200
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9168
9201
|
parentComponent.ctx.deactivate(vnode);
|
|
9169
9202
|
return;
|
|
9170
9203
|
}
|
|
9171
|
-
const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
|
|
9204
|
+
const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
|
|
9172
9205
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
9173
9206
|
let vnodeHook;
|
|
9174
9207
|
if (shouldInvokeVnodeHook &&
|
|
9175
9208
|
(vnodeHook = props && props.onVnodeBeforeUnmount)) {
|
|
9176
9209
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9177
9210
|
}
|
|
9178
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9211
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9179
9212
|
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
9180
9213
|
}
|
|
9181
9214
|
else {
|
|
9182
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9215
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9183
9216
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
9184
9217
|
return;
|
|
9185
9218
|
}
|
|
9186
9219
|
if (shouldInvokeDirs) {
|
|
9187
9220
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
|
|
9188
9221
|
}
|
|
9189
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9222
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9190
9223
|
vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
|
|
9191
9224
|
}
|
|
9192
9225
|
else if (dynamicChildren &&
|
|
9193
9226
|
// #1153: fast path should not be taken for non-stable (v-for) fragments
|
|
9194
9227
|
(type !== Fragment ||
|
|
9195
|
-
(patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
|
|
9228
|
+
(patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
|
|
9196
9229
|
// fast path for block nodes: only need to unmount dynamic children.
|
|
9197
9230
|
unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
9198
9231
|
}
|
|
9199
9232
|
else if ((type === Fragment &&
|
|
9200
9233
|
patchFlag &
|
|
9201
|
-
(128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
|
|
9202
|
-
(!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
|
|
9234
|
+
(128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
|
|
9235
|
+
(!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
|
|
9203
9236
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
9204
9237
|
}
|
|
9205
9238
|
if (doRemove) {
|
|
@@ -9220,7 +9253,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9220
9253
|
const { type, el, anchor, transition } = vnode;
|
|
9221
9254
|
if (type === Fragment) {
|
|
9222
9255
|
if (vnode.patchFlag > 0 &&
|
|
9223
|
-
vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
|
|
9256
|
+
vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
|
|
9224
9257
|
transition &&
|
|
9225
9258
|
!transition.persisted) {
|
|
9226
9259
|
vnode.children.forEach(child => {
|
|
@@ -9247,7 +9280,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9247
9280
|
transition.afterLeave();
|
|
9248
9281
|
}
|
|
9249
9282
|
};
|
|
9250
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ &&
|
|
9283
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9251
9284
|
transition &&
|
|
9252
9285
|
!transition.persisted) {
|
|
9253
9286
|
const { leave, delayLeave } = transition;
|
|
@@ -9283,7 +9316,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9283
9316
|
if (bum) {
|
|
9284
9317
|
invokeArrayFns(bum);
|
|
9285
9318
|
}
|
|
9286
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9319
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9287
9320
|
instance.emit('hook:beforeDestroy');
|
|
9288
9321
|
}
|
|
9289
9322
|
// stop effects in component scope
|
|
@@ -9299,7 +9332,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9299
9332
|
if (um) {
|
|
9300
9333
|
queuePostRenderEffect(um, parentSuspense);
|
|
9301
9334
|
}
|
|
9302
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9335
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9303
9336
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9304
9337
|
}
|
|
9305
9338
|
queuePostRenderEffect(() => {
|
|
@@ -9329,10 +9362,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9329
9362
|
}
|
|
9330
9363
|
};
|
|
9331
9364
|
const getNextHostNode = vnode => {
|
|
9332
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */) {
|
|
9365
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9333
9366
|
return getNextHostNode(vnode.component.subTree);
|
|
9334
9367
|
}
|
|
9335
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
9368
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9336
9369
|
return vnode.suspense.next();
|
|
9337
9370
|
}
|
|
9338
9371
|
return hostNextSibling((vnode.anchor || vnode.el));
|
|
@@ -9346,6 +9379,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9346
9379
|
else {
|
|
9347
9380
|
patch(container._vnode || null, vnode, container, null, null, null, isSVG);
|
|
9348
9381
|
}
|
|
9382
|
+
flushPreFlushCbs();
|
|
9349
9383
|
flushPostFlushCbs();
|
|
9350
9384
|
container._vnode = vnode;
|
|
9351
9385
|
};
|
|
@@ -9395,8 +9429,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9395
9429
|
// guaranteed to be vnodes
|
|
9396
9430
|
const c1 = ch1[i];
|
|
9397
9431
|
let c2 = ch2[i];
|
|
9398
|
-
if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
|
|
9399
|
-
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
|
|
9432
|
+
if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
|
|
9433
|
+
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
9400
9434
|
c2 = ch2[i] = cloneIfMounted(ch2[i]);
|
|
9401
9435
|
c2.el = c1.el;
|
|
9402
9436
|
}
|
|
@@ -9516,7 +9550,7 @@ const TeleportImpl = {
|
|
|
9516
9550
|
const mount = (container, anchor) => {
|
|
9517
9551
|
// Teleport *always* has Array children. This is enforced in both the
|
|
9518
9552
|
// compiler and vnode children normalization.
|
|
9519
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9553
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9520
9554
|
mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
9521
9555
|
}
|
|
9522
9556
|
};
|
|
@@ -9552,7 +9586,7 @@ const TeleportImpl = {
|
|
|
9552
9586
|
if (!wasDisabled) {
|
|
9553
9587
|
// enabled -> disabled
|
|
9554
9588
|
// move into main container
|
|
9555
|
-
moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
|
|
9589
|
+
moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9556
9590
|
}
|
|
9557
9591
|
}
|
|
9558
9592
|
else {
|
|
@@ -9560,7 +9594,7 @@ const TeleportImpl = {
|
|
|
9560
9594
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
9561
9595
|
const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
|
|
9562
9596
|
if (nextTarget) {
|
|
9563
|
-
moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
|
|
9597
|
+
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9564
9598
|
}
|
|
9565
9599
|
else {
|
|
9566
9600
|
warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
@@ -9569,7 +9603,7 @@ const TeleportImpl = {
|
|
|
9569
9603
|
else if (wasDisabled) {
|
|
9570
9604
|
// disabled -> enabled
|
|
9571
9605
|
// move into teleport target
|
|
9572
|
-
moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
|
|
9606
|
+
moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9573
9607
|
}
|
|
9574
9608
|
}
|
|
9575
9609
|
}
|
|
@@ -9582,7 +9616,7 @@ const TeleportImpl = {
|
|
|
9582
9616
|
// an unmounted teleport should always remove its children if not disabled
|
|
9583
9617
|
if (doRemove || !isTeleportDisabled(props)) {
|
|
9584
9618
|
hostRemove(anchor);
|
|
9585
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9619
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9586
9620
|
for (let i = 0; i < children.length; i++) {
|
|
9587
9621
|
const child = children[i];
|
|
9588
9622
|
unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
|
|
@@ -9593,13 +9627,13 @@ const TeleportImpl = {
|
|
|
9593
9627
|
move: moveTeleport,
|
|
9594
9628
|
hydrate: hydrateTeleport
|
|
9595
9629
|
};
|
|
9596
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
|
|
9630
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
|
|
9597
9631
|
// move target anchor if this is a target change.
|
|
9598
|
-
if (moveType === 0 /* TARGET_CHANGE */) {
|
|
9632
|
+
if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
|
|
9599
9633
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9600
9634
|
}
|
|
9601
9635
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9602
|
-
const isReorder = moveType === 2 /* REORDER */;
|
|
9636
|
+
const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
|
|
9603
9637
|
// move main view anchor if this is a re-order.
|
|
9604
9638
|
if (isReorder) {
|
|
9605
9639
|
insert(el, container, parentAnchor);
|
|
@@ -9609,9 +9643,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9609
9643
|
// is not a reorder, or the teleport is disabled
|
|
9610
9644
|
if (!isReorder || isTeleportDisabled(props)) {
|
|
9611
9645
|
// Teleport has either Array children or no children.
|
|
9612
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9646
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9613
9647
|
for (let i = 0; i < children.length; i++) {
|
|
9614
|
-
move(children[i], container, parentAnchor, 2 /* REORDER */);
|
|
9648
|
+
move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
|
|
9615
9649
|
}
|
|
9616
9650
|
}
|
|
9617
9651
|
}
|
|
@@ -9626,7 +9660,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9626
9660
|
// if multiple teleports rendered to the same target element, we need to
|
|
9627
9661
|
// pick up from where the last teleport finished instead of the first node
|
|
9628
9662
|
const targetNode = target._lpa || target.firstChild;
|
|
9629
|
-
if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9663
|
+
if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9630
9664
|
if (isTeleportDisabled(vnode.props)) {
|
|
9631
9665
|
vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9632
9666
|
vnode.targetAnchor = targetNode;
|
|
@@ -9703,7 +9737,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9703
9737
|
}
|
|
9704
9738
|
// 2.x async component
|
|
9705
9739
|
if (isFunction(comp) &&
|
|
9706
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* COMPONENT_ASYNC */, instance, comp)) {
|
|
9740
|
+
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9707
9741
|
// since after disabling this, plain functions are still valid usage, do not
|
|
9708
9742
|
// use softAssert here.
|
|
9709
9743
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -9711,7 +9745,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9711
9745
|
// 2.x functional component
|
|
9712
9746
|
if (isObject(comp) &&
|
|
9713
9747
|
comp.functional &&
|
|
9714
|
-
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9748
|
+
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9715
9749
|
return convertLegacyFunctionalComponent(comp);
|
|
9716
9750
|
}
|
|
9717
9751
|
return comp;
|
|
@@ -9808,7 +9842,7 @@ function isVNode(value) {
|
|
|
9808
9842
|
return value ? value.__v_isVNode === true : false;
|
|
9809
9843
|
}
|
|
9810
9844
|
function isSameVNodeType(n1, n2) {
|
|
9811
|
-
if (n2.shapeFlag & 6 /* COMPONENT */ &&
|
|
9845
|
+
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
9812
9846
|
hmrDirtyComponents.has(n2.type)) {
|
|
9813
9847
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
9814
9848
|
return false;
|
|
@@ -9839,7 +9873,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
|
9839
9873
|
: ref
|
|
9840
9874
|
: null);
|
|
9841
9875
|
};
|
|
9842
|
-
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9876
|
+
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9843
9877
|
const vnode = {
|
|
9844
9878
|
__v_isVNode: true,
|
|
9845
9879
|
__v_skip: true,
|
|
@@ -9870,7 +9904,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9870
9904
|
if (needFullChildrenNormalization) {
|
|
9871
9905
|
normalizeChildren(vnode, children);
|
|
9872
9906
|
// normalize suspense children
|
|
9873
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9907
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9874
9908
|
type.normalize(vnode);
|
|
9875
9909
|
}
|
|
9876
9910
|
}
|
|
@@ -9878,8 +9912,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9878
9912
|
// compiled element vnode - if children is passed, only possible types are
|
|
9879
9913
|
// string or Array.
|
|
9880
9914
|
vnode.shapeFlag |= isString(children)
|
|
9881
|
-
? 8 /* TEXT_CHILDREN */
|
|
9882
|
-
: 16 /* ARRAY_CHILDREN */;
|
|
9915
|
+
? 8 /* ShapeFlags.TEXT_CHILDREN */
|
|
9916
|
+
: 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
9883
9917
|
}
|
|
9884
9918
|
// validate key
|
|
9885
9919
|
if (vnode.key !== vnode.key) {
|
|
@@ -9895,10 +9929,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9895
9929
|
// component nodes also should always be patched, because even if the
|
|
9896
9930
|
// component doesn't need to update, it needs to persist the instance on to
|
|
9897
9931
|
// the next vnode so that it can be properly unmounted later.
|
|
9898
|
-
(vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
|
|
9932
|
+
(vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
|
|
9899
9933
|
// the EVENTS flag is only for hydration and if it is the only flag, the
|
|
9900
9934
|
// vnode should not be considered dynamic due to handler caching.
|
|
9901
|
-
vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
|
|
9935
|
+
vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
9902
9936
|
currentBlock.push(vnode);
|
|
9903
9937
|
}
|
|
9904
9938
|
{
|
|
@@ -9924,14 +9958,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9924
9958
|
normalizeChildren(cloned, children);
|
|
9925
9959
|
}
|
|
9926
9960
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
9927
|
-
if (cloned.shapeFlag & 6 /* COMPONENT */) {
|
|
9961
|
+
if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9928
9962
|
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
9929
9963
|
}
|
|
9930
9964
|
else {
|
|
9931
9965
|
currentBlock.push(cloned);
|
|
9932
9966
|
}
|
|
9933
9967
|
}
|
|
9934
|
-
cloned.patchFlag |= -2 /* BAIL */;
|
|
9968
|
+
cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
|
|
9935
9969
|
return cloned;
|
|
9936
9970
|
}
|
|
9937
9971
|
// class component normalization.
|
|
@@ -9961,17 +9995,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9961
9995
|
}
|
|
9962
9996
|
// encode the vnode type information into a bitmap
|
|
9963
9997
|
const shapeFlag = isString(type)
|
|
9964
|
-
? 1 /* ELEMENT */
|
|
9998
|
+
? 1 /* ShapeFlags.ELEMENT */
|
|
9965
9999
|
: isSuspense(type)
|
|
9966
|
-
? 128 /* SUSPENSE */
|
|
10000
|
+
? 128 /* ShapeFlags.SUSPENSE */
|
|
9967
10001
|
: isTeleport(type)
|
|
9968
|
-
? 64 /* TELEPORT */
|
|
10002
|
+
? 64 /* ShapeFlags.TELEPORT */
|
|
9969
10003
|
: isObject(type)
|
|
9970
|
-
? 4 /* STATEFUL_COMPONENT */
|
|
10004
|
+
? 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
9971
10005
|
: isFunction(type)
|
|
9972
|
-
? 2 /* FUNCTIONAL_COMPONENT */
|
|
10006
|
+
? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
|
|
9973
10007
|
: 0;
|
|
9974
|
-
if (shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10008
|
+
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
9975
10009
|
type = toRaw(type);
|
|
9976
10010
|
warn$1(`Vue received a Component which was made a reactive object. This can ` +
|
|
9977
10011
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
@@ -10010,7 +10044,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10010
10044
|
: ref,
|
|
10011
10045
|
scopeId: vnode.scopeId,
|
|
10012
10046
|
slotScopeIds: vnode.slotScopeIds,
|
|
10013
|
-
children: patchFlag === -1 /* HOISTED */ && isArray(children)
|
|
10047
|
+
children: patchFlag === -1 /* PatchFlags.HOISTED */ && isArray(children)
|
|
10014
10048
|
? children.map(deepCloneVNode)
|
|
10015
10049
|
: children,
|
|
10016
10050
|
target: vnode.target,
|
|
@@ -10023,8 +10057,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10023
10057
|
// fast paths only.
|
|
10024
10058
|
patchFlag: extraProps && vnode.type !== Fragment
|
|
10025
10059
|
? patchFlag === -1 // hoisted node
|
|
10026
|
-
? 16 /* FULL_PROPS */
|
|
10027
|
-
: patchFlag | 16 /* FULL_PROPS */
|
|
10060
|
+
? 16 /* PatchFlags.FULL_PROPS */
|
|
10061
|
+
: patchFlag | 16 /* PatchFlags.FULL_PROPS */
|
|
10028
10062
|
: patchFlag,
|
|
10029
10063
|
dynamicProps: vnode.dynamicProps,
|
|
10030
10064
|
dynamicChildren: vnode.dynamicChildren,
|
|
@@ -10117,10 +10151,10 @@ function normalizeChildren(vnode, children) {
|
|
|
10117
10151
|
children = null;
|
|
10118
10152
|
}
|
|
10119
10153
|
else if (isArray(children)) {
|
|
10120
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10154
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10121
10155
|
}
|
|
10122
10156
|
else if (typeof children === 'object') {
|
|
10123
|
-
if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
|
|
10157
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
|
|
10124
10158
|
// Normalize slot to plain children for plain element and Teleport
|
|
10125
10159
|
const slot = children.default;
|
|
10126
10160
|
if (slot) {
|
|
@@ -10132,37 +10166,37 @@ function normalizeChildren(vnode, children) {
|
|
|
10132
10166
|
return;
|
|
10133
10167
|
}
|
|
10134
10168
|
else {
|
|
10135
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10169
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10136
10170
|
const slotFlag = children._;
|
|
10137
10171
|
if (!slotFlag && !(InternalObjectKey in children)) {
|
|
10138
10172
|
children._ctx = currentRenderingInstance;
|
|
10139
10173
|
}
|
|
10140
|
-
else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
|
|
10174
|
+
else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
|
|
10141
10175
|
// a child component receives forwarded slots from the parent.
|
|
10142
10176
|
// its slot type is determined by its parent's slot type.
|
|
10143
|
-
if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
|
|
10144
|
-
children._ = 1 /* STABLE */;
|
|
10177
|
+
if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
|
|
10178
|
+
children._ = 1 /* SlotFlags.STABLE */;
|
|
10145
10179
|
}
|
|
10146
10180
|
else {
|
|
10147
|
-
children._ = 2 /* DYNAMIC */;
|
|
10148
|
-
vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
|
|
10181
|
+
children._ = 2 /* SlotFlags.DYNAMIC */;
|
|
10182
|
+
vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
10149
10183
|
}
|
|
10150
10184
|
}
|
|
10151
10185
|
}
|
|
10152
10186
|
}
|
|
10153
10187
|
else if (isFunction(children)) {
|
|
10154
10188
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
10155
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10189
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10156
10190
|
}
|
|
10157
10191
|
else {
|
|
10158
10192
|
children = String(children);
|
|
10159
10193
|
// force teleport children to array so it can be moved around
|
|
10160
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
10161
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10194
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
10195
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10162
10196
|
children = [createTextVNode(children)];
|
|
10163
10197
|
}
|
|
10164
10198
|
else {
|
|
10165
|
-
type = 8 /* TEXT_CHILDREN */;
|
|
10199
|
+
type = 8 /* ShapeFlags.TEXT_CHILDREN */;
|
|
10166
10200
|
}
|
|
10167
10201
|
}
|
|
10168
10202
|
vnode.children = children;
|
|
@@ -10200,7 +10234,7 @@ function mergeProps(...args) {
|
|
|
10200
10234
|
return ret;
|
|
10201
10235
|
}
|
|
10202
10236
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
10203
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
10237
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
|
|
10204
10238
|
vnode,
|
|
10205
10239
|
prevVNode
|
|
10206
10240
|
]);
|
|
@@ -10308,7 +10342,7 @@ function validateComponentName(name, config) {
|
|
|
10308
10342
|
}
|
|
10309
10343
|
}
|
|
10310
10344
|
function isStatefulComponent(instance) {
|
|
10311
|
-
return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
|
|
10345
|
+
return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
|
|
10312
10346
|
}
|
|
10313
10347
|
let isInSSRComponentSetup = false;
|
|
10314
10348
|
function setupComponent(instance, isSSR = false) {
|
|
@@ -10363,7 +10397,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10363
10397
|
setup.length > 1 ? createSetupContext(instance) : null);
|
|
10364
10398
|
setCurrentInstance(instance);
|
|
10365
10399
|
pauseTracking();
|
|
10366
|
-
const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
|
|
10400
|
+
const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
|
|
10367
10401
|
resetTracking();
|
|
10368
10402
|
unsetCurrentInstance();
|
|
10369
10403
|
if (isPromise(setupResult)) {
|
|
@@ -10375,7 +10409,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10375
10409
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10376
10410
|
})
|
|
10377
10411
|
.catch(e => {
|
|
10378
|
-
handleError(e, instance, 0 /* SETUP_FUNCTION */);
|
|
10412
|
+
handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
10379
10413
|
});
|
|
10380
10414
|
}
|
|
10381
10415
|
else {
|
|
@@ -10458,7 +10492,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10458
10492
|
if (!isSSR && compile && !Component.render) {
|
|
10459
10493
|
const template = (instance.vnode.props &&
|
|
10460
10494
|
instance.vnode.props['inline-template']) ||
|
|
10461
|
-
Component.template
|
|
10495
|
+
Component.template ||
|
|
10496
|
+
resolveMergedOptions(instance).template;
|
|
10462
10497
|
if (template) {
|
|
10463
10498
|
{
|
|
10464
10499
|
startMeasure(instance, `compile`);
|
|
@@ -10473,6 +10508,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10473
10508
|
// pass runtime compat config into the compiler
|
|
10474
10509
|
finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
|
|
10475
10510
|
if (Component.compatConfig) {
|
|
10511
|
+
// @ts-expect-error types are not compatible
|
|
10476
10512
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10477
10513
|
}
|
|
10478
10514
|
}
|
|
@@ -10517,7 +10553,7 @@ function createAttrsProxy(instance) {
|
|
|
10517
10553
|
return new Proxy(instance.attrs, {
|
|
10518
10554
|
get(target, key) {
|
|
10519
10555
|
markAttrsAccessed();
|
|
10520
|
-
track(instance, "get" /* GET */, '$attrs');
|
|
10556
|
+
track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
|
|
10521
10557
|
return target[key];
|
|
10522
10558
|
},
|
|
10523
10559
|
set() {
|
|
@@ -10573,10 +10609,10 @@ function getExposeProxy(instance) {
|
|
|
10573
10609
|
}
|
|
10574
10610
|
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
10575
10611
|
const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
|
|
10576
|
-
function getComponentName(Component) {
|
|
10612
|
+
function getComponentName(Component, includeInferred = true) {
|
|
10577
10613
|
return isFunction(Component)
|
|
10578
10614
|
? Component.displayName || Component.name
|
|
10579
|
-
: Component.name;
|
|
10615
|
+
: Component.name || (includeInferred && Component.__name);
|
|
10580
10616
|
}
|
|
10581
10617
|
/* istanbul ignore next */
|
|
10582
10618
|
function formatComponentName(instance, Component, isRoot = false) {
|
|
@@ -11020,9 +11056,9 @@ function isMemoSame(cached, memo) {
|
|
|
11020
11056
|
}
|
|
11021
11057
|
|
|
11022
11058
|
// Core API ------------------------------------------------------------------
|
|
11023
|
-
const version = "3.2.
|
|
11059
|
+
const version = "3.2.39";
|
|
11024
11060
|
/**
|
|
11025
|
-
* SSR utils for \@vue/server-renderer. Only exposed in
|
|
11061
|
+
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11026
11062
|
* @internal
|
|
11027
11063
|
*/
|
|
11028
11064
|
const ssrUtils = (null);
|
|
@@ -11270,14 +11306,14 @@ function compatCoerceAttr(el, key, value, instance = null) {
|
|
|
11270
11306
|
? 'true'
|
|
11271
11307
|
: null;
|
|
11272
11308
|
if (v2CocercedValue &&
|
|
11273
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11309
|
+
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11274
11310
|
el.setAttribute(key, v2CocercedValue);
|
|
11275
11311
|
return true;
|
|
11276
11312
|
}
|
|
11277
11313
|
}
|
|
11278
11314
|
else if (value === false &&
|
|
11279
11315
|
!isSpecialBooleanAttr(key) &&
|
|
11280
|
-
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, instance, key)) {
|
|
11316
|
+
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, instance, key)) {
|
|
11281
11317
|
el.removeAttribute(key);
|
|
11282
11318
|
return true;
|
|
11283
11319
|
}
|
|
@@ -11339,10 +11375,10 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11339
11375
|
}
|
|
11340
11376
|
else {
|
|
11341
11377
|
if (value === false &&
|
|
11342
|
-
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11378
|
+
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11343
11379
|
const type = typeof el[key];
|
|
11344
11380
|
if (type === 'string' || type === 'number') {
|
|
11345
|
-
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11381
|
+
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11346
11382
|
value = type === 'number' ? 0 : '';
|
|
11347
11383
|
needRemove = true;
|
|
11348
11384
|
}
|
|
@@ -11432,7 +11468,8 @@ function parseName(name) {
|
|
|
11432
11468
|
options[m[0].toLowerCase()] = true;
|
|
11433
11469
|
}
|
|
11434
11470
|
}
|
|
11435
|
-
|
|
11471
|
+
const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
|
|
11472
|
+
return [event, options];
|
|
11436
11473
|
}
|
|
11437
11474
|
function createInvoker(initialValue, instance) {
|
|
11438
11475
|
const invoker = (e) => {
|
|
@@ -11444,7 +11481,7 @@ function createInvoker(initialValue, instance) {
|
|
|
11444
11481
|
// AFTER it was attached.
|
|
11445
11482
|
const timeStamp = e.timeStamp || _getNow();
|
|
11446
11483
|
if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
|
|
11447
|
-
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
|
|
11484
|
+
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* ErrorCodes.NATIVE_EVENT_HANDLER */, [e]);
|
|
11448
11485
|
}
|
|
11449
11486
|
};
|
|
11450
11487
|
invoker.value = initialValue;
|
|
@@ -11799,7 +11836,7 @@ function useCssVars(getter) {
|
|
|
11799
11836
|
});
|
|
11800
11837
|
}
|
|
11801
11838
|
function setVarsOnVNode(vnode, vars) {
|
|
11802
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
11839
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
11803
11840
|
const suspense = vnode.suspense;
|
|
11804
11841
|
vnode = suspense.activeBranch;
|
|
11805
11842
|
if (suspense.pendingBranch && !suspense.isHydrating) {
|
|
@@ -11812,7 +11849,7 @@ function setVarsOnVNode(vnode, vars) {
|
|
|
11812
11849
|
while (vnode.component) {
|
|
11813
11850
|
vnode = vnode.component.subTree;
|
|
11814
11851
|
}
|
|
11815
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {
|
|
11852
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && vnode.el) {
|
|
11816
11853
|
setVarsOnNode(vnode.el, vars);
|
|
11817
11854
|
}
|
|
11818
11855
|
else if (vnode.type === Fragment) {
|
|
@@ -11901,7 +11938,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
11901
11938
|
}
|
|
11902
11939
|
const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
|
|
11903
11940
|
// legacy transition class compat
|
|
11904
|
-
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* TRANSITION_CLASSES */, null);
|
|
11941
|
+
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */, null);
|
|
11905
11942
|
let legacyEnterFromClass;
|
|
11906
11943
|
let legacyAppearFromClass;
|
|
11907
11944
|
let legacyLeaveFromClass;
|
|
@@ -12210,7 +12247,7 @@ const TransitionGroupImpl = {
|
|
|
12210
12247
|
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
12211
12248
|
let tag = rawProps.tag || Fragment;
|
|
12212
12249
|
if (!rawProps.tag &&
|
|
12213
|
-
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12250
|
+
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12214
12251
|
tag = 'span';
|
|
12215
12252
|
}
|
|
12216
12253
|
prevChildren = children;
|
|
@@ -12580,13 +12617,13 @@ const withKeys = (fn, modifiers) => {
|
|
|
12580
12617
|
let instance = null;
|
|
12581
12618
|
{
|
|
12582
12619
|
instance = getCurrentInstance();
|
|
12583
|
-
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */, instance)) {
|
|
12620
|
+
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */, instance)) {
|
|
12584
12621
|
if (instance) {
|
|
12585
12622
|
globalKeyCodes = instance.appContext.config.keyCodes;
|
|
12586
12623
|
}
|
|
12587
12624
|
}
|
|
12588
12625
|
if (modifiers.some(m => /^\d+$/.test(m))) {
|
|
12589
|
-
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance);
|
|
12626
|
+
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance);
|
|
12590
12627
|
}
|
|
12591
12628
|
}
|
|
12592
12629
|
return (event) => {
|
|
@@ -12599,7 +12636,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
12599
12636
|
}
|
|
12600
12637
|
{
|
|
12601
12638
|
const keyCode = String(event.keyCode);
|
|
12602
|
-
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12639
|
+
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12603
12640
|
modifiers.some(mod => mod == keyCode)) {
|
|
12604
12641
|
return fn(event);
|
|
12605
12642
|
}
|
|
@@ -12708,7 +12745,7 @@ const createApp = ((...args) => {
|
|
|
12708
12745
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
12709
12746
|
const attr = container.attributes[i];
|
|
12710
12747
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
12711
|
-
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
12748
|
+
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
12712
12749
|
break;
|
|
12713
12750
|
}
|
|
12714
12751
|
}
|
|
@@ -12965,7 +13002,7 @@ function initDev() {
|
|
|
12965
13002
|
function wrappedCreateApp(...args) {
|
|
12966
13003
|
// @ts-ignore
|
|
12967
13004
|
const app = createApp(...args);
|
|
12968
|
-
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, null)) {
|
|
13005
|
+
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, null)) {
|
|
12969
13006
|
// register built-in components so that they can be resolved via strings
|
|
12970
13007
|
// in the legacy h() call. The __compat__ prefix is to ensure that v3 h()
|
|
12971
13008
|
// doesn't get affected.
|