@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
|
@@ -640,7 +640,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
let deps = [];
|
|
643
|
-
if (type === "clear" /* CLEAR */) {
|
|
643
|
+
if (type === "clear" /* TriggerOpTypes.CLEAR */) {
|
|
644
644
|
// collection being cleared
|
|
645
645
|
// trigger all effects for target
|
|
646
646
|
deps = [...depsMap.values()];
|
|
@@ -659,7 +659,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
659
659
|
}
|
|
660
660
|
// also run for iteration key on ADD | DELETE | Map.SET
|
|
661
661
|
switch (type) {
|
|
662
|
-
case "add" /* ADD */:
|
|
662
|
+
case "add" /* TriggerOpTypes.ADD */:
|
|
663
663
|
if (!isArray(target)) {
|
|
664
664
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
665
665
|
if (isMap(target)) {
|
|
@@ -671,7 +671,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
671
671
|
deps.push(depsMap.get('length'));
|
|
672
672
|
}
|
|
673
673
|
break;
|
|
674
|
-
case "delete" /* DELETE */:
|
|
674
|
+
case "delete" /* TriggerOpTypes.DELETE */:
|
|
675
675
|
if (!isArray(target)) {
|
|
676
676
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
677
677
|
if (isMap(target)) {
|
|
@@ -679,7 +679,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
break;
|
|
682
|
-
case "set" /* SET */:
|
|
682
|
+
case "set" /* TriggerOpTypes.SET */:
|
|
683
683
|
if (isMap(target)) {
|
|
684
684
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
685
685
|
}
|
|
@@ -763,7 +763,7 @@ function createArrayInstrumentations() {
|
|
|
763
763
|
instrumentations[key] = function (...args) {
|
|
764
764
|
const arr = toRaw(this);
|
|
765
765
|
for (let i = 0, l = this.length; i < l; i++) {
|
|
766
|
-
track(arr, "get" /* GET */, i + '');
|
|
766
|
+
track(arr, "get" /* TrackOpTypes.GET */, i + '');
|
|
767
767
|
}
|
|
768
768
|
// we run the method using the original args first (which may be reactive)
|
|
769
769
|
const res = arr[key](...args);
|
|
@@ -788,16 +788,16 @@ function createArrayInstrumentations() {
|
|
|
788
788
|
}
|
|
789
789
|
function createGetter(isReadonly = false, shallow = false) {
|
|
790
790
|
return function get(target, key, receiver) {
|
|
791
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
791
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
792
792
|
return !isReadonly;
|
|
793
793
|
}
|
|
794
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
794
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
795
795
|
return isReadonly;
|
|
796
796
|
}
|
|
797
|
-
else if (key === "__v_isShallow" /* IS_SHALLOW */) {
|
|
797
|
+
else if (key === "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */) {
|
|
798
798
|
return shallow;
|
|
799
799
|
}
|
|
800
|
-
else if (key === "__v_raw" /* RAW */ &&
|
|
800
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */ &&
|
|
801
801
|
receiver ===
|
|
802
802
|
(isReadonly
|
|
803
803
|
? shallow
|
|
@@ -817,7 +817,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
817
817
|
return res;
|
|
818
818
|
}
|
|
819
819
|
if (!isReadonly) {
|
|
820
|
-
track(target, "get" /* GET */, key);
|
|
820
|
+
track(target, "get" /* TrackOpTypes.GET */, key);
|
|
821
821
|
}
|
|
822
822
|
if (shallow) {
|
|
823
823
|
return res;
|
|
@@ -843,10 +843,10 @@ function createSetter(shallow = false) {
|
|
|
843
843
|
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
844
844
|
return false;
|
|
845
845
|
}
|
|
846
|
-
if (!shallow
|
|
847
|
-
if (!isShallow(value)) {
|
|
848
|
-
value = toRaw(value);
|
|
846
|
+
if (!shallow) {
|
|
847
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
849
848
|
oldValue = toRaw(oldValue);
|
|
849
|
+
value = toRaw(value);
|
|
850
850
|
}
|
|
851
851
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
852
852
|
oldValue.value = value;
|
|
@@ -860,10 +860,10 @@ function createSetter(shallow = false) {
|
|
|
860
860
|
// don't trigger if target is something up in the prototype chain of original
|
|
861
861
|
if (target === toRaw(receiver)) {
|
|
862
862
|
if (!hadKey) {
|
|
863
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
863
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
864
864
|
}
|
|
865
865
|
else if (hasChanged(value, oldValue)) {
|
|
866
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
866
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
return result;
|
|
@@ -874,19 +874,19 @@ function deleteProperty(target, key) {
|
|
|
874
874
|
const oldValue = target[key];
|
|
875
875
|
const result = Reflect.deleteProperty(target, key);
|
|
876
876
|
if (result && hadKey) {
|
|
877
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
877
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
878
878
|
}
|
|
879
879
|
return result;
|
|
880
880
|
}
|
|
881
881
|
function has(target, key) {
|
|
882
882
|
const result = Reflect.has(target, key);
|
|
883
883
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
884
|
-
track(target, "has" /* HAS */, key);
|
|
884
|
+
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
885
885
|
}
|
|
886
886
|
return result;
|
|
887
887
|
}
|
|
888
888
|
function ownKeys(target) {
|
|
889
|
-
track(target, "iterate" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
889
|
+
track(target, "iterate" /* TrackOpTypes.ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
890
890
|
return Reflect.ownKeys(target);
|
|
891
891
|
}
|
|
892
892
|
const mutableHandlers = {
|
|
@@ -927,14 +927,14 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
|
927
927
|
function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
928
928
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
929
929
|
// of the value
|
|
930
|
-
target = target["__v_raw" /* RAW */];
|
|
930
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
931
931
|
const rawTarget = toRaw(target);
|
|
932
932
|
const rawKey = toRaw(key);
|
|
933
933
|
if (!isReadonly) {
|
|
934
934
|
if (key !== rawKey) {
|
|
935
|
-
track(rawTarget, "get" /* GET */, key);
|
|
935
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, key);
|
|
936
936
|
}
|
|
937
|
-
track(rawTarget, "get" /* GET */, rawKey);
|
|
937
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, rawKey);
|
|
938
938
|
}
|
|
939
939
|
const { has } = getProto(rawTarget);
|
|
940
940
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
@@ -951,22 +951,22 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
function has$1(key, isReadonly = false) {
|
|
954
|
-
const target = this["__v_raw" /* RAW */];
|
|
954
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
955
955
|
const rawTarget = toRaw(target);
|
|
956
956
|
const rawKey = toRaw(key);
|
|
957
957
|
if (!isReadonly) {
|
|
958
958
|
if (key !== rawKey) {
|
|
959
|
-
track(rawTarget, "has" /* HAS */, key);
|
|
959
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, key);
|
|
960
960
|
}
|
|
961
|
-
track(rawTarget, "has" /* HAS */, rawKey);
|
|
961
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, rawKey);
|
|
962
962
|
}
|
|
963
963
|
return key === rawKey
|
|
964
964
|
? target.has(key)
|
|
965
965
|
: target.has(key) || target.has(rawKey);
|
|
966
966
|
}
|
|
967
967
|
function size(target, isReadonly = false) {
|
|
968
|
-
target = target["__v_raw" /* RAW */];
|
|
969
|
-
!isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
|
|
968
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
969
|
+
!isReadonly && track(toRaw(target), "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
970
970
|
return Reflect.get(target, 'size', target);
|
|
971
971
|
}
|
|
972
972
|
function add(value) {
|
|
@@ -976,7 +976,7 @@ function add(value) {
|
|
|
976
976
|
const hadKey = proto.has.call(target, value);
|
|
977
977
|
if (!hadKey) {
|
|
978
978
|
target.add(value);
|
|
979
|
-
trigger(target, "add" /* ADD */, value, value);
|
|
979
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, value, value);
|
|
980
980
|
}
|
|
981
981
|
return this;
|
|
982
982
|
}
|
|
@@ -995,10 +995,10 @@ function set$1(key, value) {
|
|
|
995
995
|
const oldValue = get.call(target, key);
|
|
996
996
|
target.set(key, value);
|
|
997
997
|
if (!hadKey) {
|
|
998
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
998
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
999
999
|
}
|
|
1000
1000
|
else if (hasChanged(value, oldValue)) {
|
|
1001
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
1001
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
1002
1002
|
}
|
|
1003
1003
|
return this;
|
|
1004
1004
|
}
|
|
@@ -1017,7 +1017,7 @@ function deleteEntry(key) {
|
|
|
1017
1017
|
// forward the operation before queueing reactions
|
|
1018
1018
|
const result = target.delete(key);
|
|
1019
1019
|
if (hadKey) {
|
|
1020
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
1020
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
1021
1021
|
}
|
|
1022
1022
|
return result;
|
|
1023
1023
|
}
|
|
@@ -1032,17 +1032,17 @@ function clear() {
|
|
|
1032
1032
|
// forward the operation before queueing reactions
|
|
1033
1033
|
const result = target.clear();
|
|
1034
1034
|
if (hadItems) {
|
|
1035
|
-
trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
|
|
1035
|
+
trigger(target, "clear" /* TriggerOpTypes.CLEAR */, undefined, undefined, oldTarget);
|
|
1036
1036
|
}
|
|
1037
1037
|
return result;
|
|
1038
1038
|
}
|
|
1039
1039
|
function createForEach(isReadonly, isShallow) {
|
|
1040
1040
|
return function forEach(callback, thisArg) {
|
|
1041
1041
|
const observed = this;
|
|
1042
|
-
const target = observed["__v_raw" /* RAW */];
|
|
1042
|
+
const target = observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1043
1043
|
const rawTarget = toRaw(target);
|
|
1044
1044
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1045
|
-
!isReadonly && track(rawTarget, "iterate" /* ITERATE */, ITERATE_KEY);
|
|
1045
|
+
!isReadonly && track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
1046
1046
|
return target.forEach((value, key) => {
|
|
1047
1047
|
// important: make sure the callback is
|
|
1048
1048
|
// 1. invoked with the reactive map as `this` and 3rd arg
|
|
@@ -1053,7 +1053,7 @@ function createForEach(isReadonly, isShallow) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
function createIterableMethod(method, isReadonly, isShallow) {
|
|
1055
1055
|
return function (...args) {
|
|
1056
|
-
const target = this["__v_raw" /* RAW */];
|
|
1056
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1057
1057
|
const rawTarget = toRaw(target);
|
|
1058
1058
|
const targetIsMap = isMap(rawTarget);
|
|
1059
1059
|
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
|
|
@@ -1061,7 +1061,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
|
|
|
1061
1061
|
const innerIterator = target[method](...args);
|
|
1062
1062
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1063
1063
|
!isReadonly &&
|
|
1064
|
-
track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1064
|
+
track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1065
1065
|
// return a wrapped iterator which returns observed versions of the
|
|
1066
1066
|
// values emitted from the real iterator
|
|
1067
1067
|
return {
|
|
@@ -1088,7 +1088,7 @@ function createReadonlyMethod(type) {
|
|
|
1088
1088
|
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
1089
1089
|
console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
1090
1090
|
}
|
|
1091
|
-
return type === "delete" /* DELETE */ ? false : this;
|
|
1091
|
+
return type === "delete" /* TriggerOpTypes.DELETE */ ? false : this;
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
1094
|
function createInstrumentations() {
|
|
@@ -1130,10 +1130,10 @@ function createInstrumentations() {
|
|
|
1130
1130
|
has(key) {
|
|
1131
1131
|
return has$1.call(this, key, true);
|
|
1132
1132
|
},
|
|
1133
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1134
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1135
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1136
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1133
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1134
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1135
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1136
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1137
1137
|
forEach: createForEach(true, false)
|
|
1138
1138
|
};
|
|
1139
1139
|
const shallowReadonlyInstrumentations = {
|
|
@@ -1146,10 +1146,10 @@ function createInstrumentations() {
|
|
|
1146
1146
|
has(key) {
|
|
1147
1147
|
return has$1.call(this, key, true);
|
|
1148
1148
|
},
|
|
1149
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1150
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1151
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1152
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1149
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1150
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1151
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1152
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1153
1153
|
forEach: createForEach(true, true)
|
|
1154
1154
|
};
|
|
1155
1155
|
const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
|
|
@@ -1176,13 +1176,13 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1176
1176
|
? readonlyInstrumentations
|
|
1177
1177
|
: mutableInstrumentations;
|
|
1178
1178
|
return (target, key, receiver) => {
|
|
1179
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
1179
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
1180
1180
|
return !isReadonly;
|
|
1181
1181
|
}
|
|
1182
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
1182
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
1183
1183
|
return isReadonly;
|
|
1184
1184
|
}
|
|
1185
|
-
else if (key === "__v_raw" /* RAW */) {
|
|
1185
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */) {
|
|
1186
1186
|
return target;
|
|
1187
1187
|
}
|
|
1188
1188
|
return Reflect.get(hasOwn(instrumentations, key) && key in target
|
|
@@ -1222,19 +1222,19 @@ function targetTypeMap(rawType) {
|
|
|
1222
1222
|
switch (rawType) {
|
|
1223
1223
|
case 'Object':
|
|
1224
1224
|
case 'Array':
|
|
1225
|
-
return 1 /* COMMON */;
|
|
1225
|
+
return 1 /* TargetType.COMMON */;
|
|
1226
1226
|
case 'Map':
|
|
1227
1227
|
case 'Set':
|
|
1228
1228
|
case 'WeakMap':
|
|
1229
1229
|
case 'WeakSet':
|
|
1230
|
-
return 2 /* COLLECTION */;
|
|
1230
|
+
return 2 /* TargetType.COLLECTION */;
|
|
1231
1231
|
default:
|
|
1232
|
-
return 0 /* INVALID */;
|
|
1232
|
+
return 0 /* TargetType.INVALID */;
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
1235
|
function getTargetType(value) {
|
|
1236
|
-
return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
|
|
1237
|
-
? 0 /* INVALID */
|
|
1236
|
+
return value["__v_skip" /* ReactiveFlags.SKIP */] || !Object.isExtensible(value)
|
|
1237
|
+
? 0 /* TargetType.INVALID */
|
|
1238
1238
|
: targetTypeMap(toRawType(value));
|
|
1239
1239
|
}
|
|
1240
1240
|
function reactive(target) {
|
|
@@ -1277,8 +1277,8 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1277
1277
|
}
|
|
1278
1278
|
// target is already a Proxy, return it.
|
|
1279
1279
|
// exception: calling readonly() on a reactive object
|
|
1280
|
-
if (target["__v_raw" /* RAW */] &&
|
|
1281
|
-
!(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
|
|
1280
|
+
if (target["__v_raw" /* ReactiveFlags.RAW */] &&
|
|
1281
|
+
!(isReadonly && target["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */])) {
|
|
1282
1282
|
return target;
|
|
1283
1283
|
}
|
|
1284
1284
|
// target already has corresponding Proxy
|
|
@@ -1288,34 +1288,34 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1288
1288
|
}
|
|
1289
1289
|
// only specific value types can be observed.
|
|
1290
1290
|
const targetType = getTargetType(target);
|
|
1291
|
-
if (targetType === 0 /* INVALID */) {
|
|
1291
|
+
if (targetType === 0 /* TargetType.INVALID */) {
|
|
1292
1292
|
return target;
|
|
1293
1293
|
}
|
|
1294
|
-
const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1294
|
+
const proxy = new Proxy(target, targetType === 2 /* TargetType.COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1295
1295
|
proxyMap.set(target, proxy);
|
|
1296
1296
|
return proxy;
|
|
1297
1297
|
}
|
|
1298
1298
|
function isReactive(value) {
|
|
1299
1299
|
if (isReadonly(value)) {
|
|
1300
|
-
return isReactive(value["__v_raw" /* RAW */]);
|
|
1300
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1301
1301
|
}
|
|
1302
|
-
return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
|
|
1302
|
+
return !!(value && value["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */]);
|
|
1303
1303
|
}
|
|
1304
1304
|
function isReadonly(value) {
|
|
1305
|
-
return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
|
|
1305
|
+
return !!(value && value["__v_isReadonly" /* ReactiveFlags.IS_READONLY */]);
|
|
1306
1306
|
}
|
|
1307
1307
|
function isShallow(value) {
|
|
1308
|
-
return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
|
|
1308
|
+
return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
|
|
1309
1309
|
}
|
|
1310
1310
|
function isProxy(value) {
|
|
1311
1311
|
return isReactive(value) || isReadonly(value);
|
|
1312
1312
|
}
|
|
1313
1313
|
function toRaw(observed) {
|
|
1314
|
-
const raw = observed && observed["__v_raw" /* RAW */];
|
|
1314
|
+
const raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1315
1315
|
return raw ? toRaw(raw) : observed;
|
|
1316
1316
|
}
|
|
1317
1317
|
function markRaw(value) {
|
|
1318
|
-
def(value, "__v_skip" /* SKIP */, true);
|
|
1318
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1319
1319
|
return value;
|
|
1320
1320
|
}
|
|
1321
1321
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
@@ -1327,7 +1327,7 @@ function trackRefValue(ref) {
|
|
|
1327
1327
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
1328
1328
|
trackEffects(ref.dep || (ref.dep = createDep()), {
|
|
1329
1329
|
target: ref,
|
|
1330
|
-
type: "get" /* GET */,
|
|
1330
|
+
type: "get" /* TrackOpTypes.GET */,
|
|
1331
1331
|
key: 'value'
|
|
1332
1332
|
});
|
|
1333
1333
|
}
|
|
@@ -1342,7 +1342,7 @@ function triggerRefValue(ref, newVal) {
|
|
|
1342
1342
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
1343
1343
|
triggerEffects(ref.dep, {
|
|
1344
1344
|
target: ref,
|
|
1345
|
-
type: "set" /* SET */,
|
|
1345
|
+
type: "set" /* TriggerOpTypes.SET */,
|
|
1346
1346
|
key: 'value',
|
|
1347
1347
|
newValue: newVal
|
|
1348
1348
|
});
|
|
@@ -1380,10 +1380,11 @@ class RefImpl {
|
|
|
1380
1380
|
return this._value;
|
|
1381
1381
|
}
|
|
1382
1382
|
set value(newVal) {
|
|
1383
|
-
|
|
1383
|
+
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1384
|
+
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1384
1385
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1385
1386
|
this._rawValue = newVal;
|
|
1386
|
-
this._value =
|
|
1387
|
+
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1387
1388
|
triggerRefValue(this, newVal);
|
|
1388
1389
|
}
|
|
1389
1390
|
}
|
|
@@ -1462,11 +1463,13 @@ function toRef(object, key, defaultValue) {
|
|
|
1462
1463
|
: new ObjectRefImpl(object, key, defaultValue);
|
|
1463
1464
|
}
|
|
1464
1465
|
|
|
1466
|
+
var _a;
|
|
1465
1467
|
class ComputedRefImpl {
|
|
1466
1468
|
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1467
1469
|
this._setter = _setter;
|
|
1468
1470
|
this.dep = undefined;
|
|
1469
1471
|
this.__v_isRef = true;
|
|
1472
|
+
this[_a] = false;
|
|
1470
1473
|
this._dirty = true;
|
|
1471
1474
|
this.effect = new ReactiveEffect(getter, () => {
|
|
1472
1475
|
if (!this._dirty) {
|
|
@@ -1476,7 +1479,7 @@ class ComputedRefImpl {
|
|
|
1476
1479
|
});
|
|
1477
1480
|
this.effect.computed = this;
|
|
1478
1481
|
this.effect.active = this._cacheable = !isSSR;
|
|
1479
|
-
this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
|
|
1482
|
+
this["__v_isReadonly" /* ReactiveFlags.IS_READONLY */] = isReadonly;
|
|
1480
1483
|
}
|
|
1481
1484
|
get value() {
|
|
1482
1485
|
// the computed ref may get wrapped by other proxies e.g. readonly() #3376
|
|
@@ -1492,6 +1495,7 @@ class ComputedRefImpl {
|
|
|
1492
1495
|
this._setter(newValue);
|
|
1493
1496
|
}
|
|
1494
1497
|
}
|
|
1498
|
+
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1495
1499
|
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1496
1500
|
let getter;
|
|
1497
1501
|
let setter;
|
|
@@ -1531,7 +1535,7 @@ function warn$1(msg, ...args) {
|
|
|
1531
1535
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1532
1536
|
const trace = getComponentTrace();
|
|
1533
1537
|
if (appWarnHandler) {
|
|
1534
|
-
callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
|
|
1538
|
+
callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
|
|
1535
1539
|
msg + args.join(''),
|
|
1536
1540
|
instance && instance.proxy,
|
|
1537
1541
|
trace
|
|
@@ -1631,35 +1635,35 @@ function formatProp(key, value, raw) {
|
|
|
1631
1635
|
}
|
|
1632
1636
|
|
|
1633
1637
|
const ErrorTypeStrings = {
|
|
1634
|
-
["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1635
|
-
["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1636
|
-
["c" /* CREATED */]: 'created hook',
|
|
1637
|
-
["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1638
|
-
["m" /* MOUNTED */]: 'mounted hook',
|
|
1639
|
-
["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1640
|
-
["u" /* UPDATED */]: 'updated',
|
|
1641
|
-
["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1642
|
-
["um" /* UNMOUNTED */]: 'unmounted hook',
|
|
1643
|
-
["a" /* ACTIVATED */]: 'activated hook',
|
|
1644
|
-
["da" /* DEACTIVATED */]: 'deactivated hook',
|
|
1645
|
-
["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1646
|
-
["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
|
|
1647
|
-
["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1648
|
-
[0 /* SETUP_FUNCTION */]: 'setup function',
|
|
1649
|
-
[1 /* RENDER_FUNCTION */]: 'render function',
|
|
1650
|
-
[2 /* WATCH_GETTER */]: 'watcher getter',
|
|
1651
|
-
[3 /* WATCH_CALLBACK */]: 'watcher callback',
|
|
1652
|
-
[4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1653
|
-
[5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1654
|
-
[6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1655
|
-
[7 /* VNODE_HOOK */]: 'vnode hook',
|
|
1656
|
-
[8 /* DIRECTIVE_HOOK */]: 'directive hook',
|
|
1657
|
-
[9 /* TRANSITION_HOOK */]: 'transition hook',
|
|
1658
|
-
[10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1659
|
-
[11 /* APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1660
|
-
[12 /* FUNCTION_REF */]: 'ref function',
|
|
1661
|
-
[13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1662
|
-
[14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1638
|
+
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1639
|
+
["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1640
|
+
["c" /* LifecycleHooks.CREATED */]: 'created hook',
|
|
1641
|
+
["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1642
|
+
["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
|
|
1643
|
+
["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1644
|
+
["u" /* LifecycleHooks.UPDATED */]: 'updated',
|
|
1645
|
+
["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1646
|
+
["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
|
|
1647
|
+
["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
|
|
1648
|
+
["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
|
|
1649
|
+
["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1650
|
+
["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
|
|
1651
|
+
["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1652
|
+
[0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
|
|
1653
|
+
[1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
|
|
1654
|
+
[2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
|
|
1655
|
+
[3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
|
|
1656
|
+
[4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1657
|
+
[5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1658
|
+
[6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1659
|
+
[7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
|
|
1660
|
+
[8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
|
|
1661
|
+
[9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
|
|
1662
|
+
[10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1663
|
+
[11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1664
|
+
[12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
|
|
1665
|
+
[13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1666
|
+
[14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1663
1667
|
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
|
|
1664
1668
|
};
|
|
1665
1669
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
@@ -1710,7 +1714,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1710
1714
|
// app-level handling
|
|
1711
1715
|
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
1712
1716
|
if (appErrorHandler) {
|
|
1713
|
-
callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1717
|
+
callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1714
1718
|
return;
|
|
1715
1719
|
}
|
|
1716
1720
|
}
|
|
@@ -1744,15 +1748,11 @@ let isFlushing = false;
|
|
|
1744
1748
|
let isFlushPending = false;
|
|
1745
1749
|
const queue = [];
|
|
1746
1750
|
let flushIndex = 0;
|
|
1747
|
-
const pendingPreFlushCbs = [];
|
|
1748
|
-
let activePreFlushCbs = null;
|
|
1749
|
-
let preFlushIndex = 0;
|
|
1750
1751
|
const pendingPostFlushCbs = [];
|
|
1751
1752
|
let activePostFlushCbs = null;
|
|
1752
1753
|
let postFlushIndex = 0;
|
|
1753
1754
|
const resolvedPromise = /*#__PURE__*/ Promise.resolve();
|
|
1754
1755
|
let currentFlushPromise = null;
|
|
1755
|
-
let currentPreFlushParentJob = null;
|
|
1756
1756
|
const RECURSION_LIMIT = 100;
|
|
1757
1757
|
function nextTick(fn) {
|
|
1758
1758
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -1780,9 +1780,8 @@ function queueJob(job) {
|
|
|
1780
1780
|
// if the job is a watch() callback, the search will start with a +1 index to
|
|
1781
1781
|
// allow it recursively trigger itself - it is the user's responsibility to
|
|
1782
1782
|
// ensure it doesn't end up in an infinite loop.
|
|
1783
|
-
if (
|
|
1784
|
-
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex))
|
|
1785
|
-
job !== currentPreFlushParentJob) {
|
|
1783
|
+
if (!queue.length ||
|
|
1784
|
+
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
|
|
1786
1785
|
if (job.id == null) {
|
|
1787
1786
|
queue.push(job);
|
|
1788
1787
|
}
|
|
@@ -1804,52 +1803,40 @@ function invalidateJob(job) {
|
|
|
1804
1803
|
queue.splice(i, 1);
|
|
1805
1804
|
}
|
|
1806
1805
|
}
|
|
1807
|
-
function
|
|
1806
|
+
function queuePostFlushCb(cb) {
|
|
1808
1807
|
if (!isArray(cb)) {
|
|
1809
|
-
if (!
|
|
1810
|
-
!
|
|
1811
|
-
|
|
1808
|
+
if (!activePostFlushCbs ||
|
|
1809
|
+
!activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
|
|
1810
|
+
pendingPostFlushCbs.push(cb);
|
|
1812
1811
|
}
|
|
1813
1812
|
}
|
|
1814
1813
|
else {
|
|
1815
1814
|
// if cb is an array, it is a component lifecycle hook which can only be
|
|
1816
1815
|
// triggered by a job, which is already deduped in the main queue, so
|
|
1817
1816
|
// we can skip duplicate check here to improve perf
|
|
1818
|
-
|
|
1817
|
+
pendingPostFlushCbs.push(...cb);
|
|
1819
1818
|
}
|
|
1820
1819
|
queueFlush();
|
|
1821
1820
|
}
|
|
1822
|
-
function
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
pendingPreFlushCbs.length = 0;
|
|
1833
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
1834
|
-
seen = seen || new Map();
|
|
1835
|
-
}
|
|
1836
|
-
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
1837
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
1838
|
-
checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
|
|
1821
|
+
function flushPreFlushCbs(seen,
|
|
1822
|
+
// if currently flushing, skip the current job itself
|
|
1823
|
+
i = isFlushing ? flushIndex + 1 : 0) {
|
|
1824
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
1825
|
+
seen = seen || new Map();
|
|
1826
|
+
}
|
|
1827
|
+
for (; i < queue.length; i++) {
|
|
1828
|
+
const cb = queue[i];
|
|
1829
|
+
if (cb && cb.pre) {
|
|
1830
|
+
if ((process.env.NODE_ENV !== 'production') && checkRecursiveUpdates(seen, cb)) {
|
|
1839
1831
|
continue;
|
|
1840
1832
|
}
|
|
1841
|
-
|
|
1833
|
+
queue.splice(i, 1);
|
|
1834
|
+
i--;
|
|
1835
|
+
cb();
|
|
1842
1836
|
}
|
|
1843
|
-
activePreFlushCbs = null;
|
|
1844
|
-
preFlushIndex = 0;
|
|
1845
|
-
currentPreFlushParentJob = null;
|
|
1846
|
-
// recursively flush until it drains
|
|
1847
|
-
flushPreFlushCbs(seen, parentJob);
|
|
1848
1837
|
}
|
|
1849
1838
|
}
|
|
1850
1839
|
function flushPostFlushCbs(seen) {
|
|
1851
|
-
// flush any pre cbs queued during the flush (e.g. pre watchers)
|
|
1852
|
-
flushPreFlushCbs();
|
|
1853
1840
|
if (pendingPostFlushCbs.length) {
|
|
1854
1841
|
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
1855
1842
|
pendingPostFlushCbs.length = 0;
|
|
@@ -1875,13 +1862,22 @@ function flushPostFlushCbs(seen) {
|
|
|
1875
1862
|
}
|
|
1876
1863
|
}
|
|
1877
1864
|
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
1865
|
+
const comparator = (a, b) => {
|
|
1866
|
+
const diff = getId(a) - getId(b);
|
|
1867
|
+
if (diff === 0) {
|
|
1868
|
+
if (a.pre && !b.pre)
|
|
1869
|
+
return -1;
|
|
1870
|
+
if (b.pre && !a.pre)
|
|
1871
|
+
return 1;
|
|
1872
|
+
}
|
|
1873
|
+
return diff;
|
|
1874
|
+
};
|
|
1878
1875
|
function flushJobs(seen) {
|
|
1879
1876
|
isFlushPending = false;
|
|
1880
1877
|
isFlushing = true;
|
|
1881
1878
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
1882
1879
|
seen = seen || new Map();
|
|
1883
1880
|
}
|
|
1884
|
-
flushPreFlushCbs(seen);
|
|
1885
1881
|
// Sort queue before flush.
|
|
1886
1882
|
// This ensures that:
|
|
1887
1883
|
// 1. Components are updated from parent to child. (because parent is always
|
|
@@ -1889,7 +1885,7 @@ function flushJobs(seen) {
|
|
|
1889
1885
|
// priority number)
|
|
1890
1886
|
// 2. If a component is unmounted during a parent component's update,
|
|
1891
1887
|
// its update can be skipped.
|
|
1892
|
-
queue.sort(
|
|
1888
|
+
queue.sort(comparator);
|
|
1893
1889
|
// conditional usage of checkRecursiveUpdate must be determined out of
|
|
1894
1890
|
// try ... catch block since Rollup by default de-optimizes treeshaking
|
|
1895
1891
|
// inside try-catch. This can leave all warning code unshaked. Although
|
|
@@ -1906,7 +1902,7 @@ function flushJobs(seen) {
|
|
|
1906
1902
|
continue;
|
|
1907
1903
|
}
|
|
1908
1904
|
// console.log(`running:`, job.id)
|
|
1909
|
-
callWithErrorHandling(job, null, 14 /* SCHEDULER */);
|
|
1905
|
+
callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
|
|
1910
1906
|
}
|
|
1911
1907
|
}
|
|
1912
1908
|
}
|
|
@@ -1918,9 +1914,7 @@ function flushJobs(seen) {
|
|
|
1918
1914
|
currentFlushPromise = null;
|
|
1919
1915
|
// some postFlushCb queued jobs!
|
|
1920
1916
|
// keep flushing until it drains.
|
|
1921
|
-
if (queue.length ||
|
|
1922
|
-
pendingPreFlushCbs.length ||
|
|
1923
|
-
pendingPostFlushCbs.length) {
|
|
1917
|
+
if (queue.length || pendingPostFlushCbs.length) {
|
|
1924
1918
|
flushJobs(seen);
|
|
1925
1919
|
}
|
|
1926
1920
|
}
|
|
@@ -2138,7 +2132,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2138
2132
|
}
|
|
2139
2133
|
}
|
|
2140
2134
|
function devtoolsInitApp(app, version) {
|
|
2141
|
-
emit("app:init" /* APP_INIT */, app, version, {
|
|
2135
|
+
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2142
2136
|
Fragment,
|
|
2143
2137
|
Text,
|
|
2144
2138
|
Comment,
|
|
@@ -2146,88 +2140,88 @@ function devtoolsInitApp(app, version) {
|
|
|
2146
2140
|
});
|
|
2147
2141
|
}
|
|
2148
2142
|
function devtoolsUnmountApp(app) {
|
|
2149
|
-
emit("app:unmount" /* APP_UNMOUNT */, app);
|
|
2143
|
+
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2150
2144
|
}
|
|
2151
|
-
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
|
|
2145
|
+
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2152
2146
|
const devtoolsComponentUpdated =
|
|
2153
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
|
|
2147
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
|
|
2154
2148
|
const devtoolsComponentRemoved =
|
|
2155
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
|
|
2149
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
|
|
2156
2150
|
function createDevtoolsComponentHook(hook) {
|
|
2157
2151
|
return (component) => {
|
|
2158
2152
|
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2159
2153
|
};
|
|
2160
2154
|
}
|
|
2161
|
-
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
|
|
2162
|
-
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
|
|
2155
|
+
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2156
|
+
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2163
2157
|
function createDevtoolsPerformanceHook(hook) {
|
|
2164
2158
|
return (component, type, time) => {
|
|
2165
2159
|
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2166
2160
|
};
|
|
2167
2161
|
}
|
|
2168
2162
|
function devtoolsComponentEmit(component, event, params) {
|
|
2169
|
-
emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2163
|
+
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2170
2164
|
}
|
|
2171
2165
|
|
|
2172
2166
|
const deprecationData = {
|
|
2173
|
-
["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
|
|
2167
|
+
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2174
2168
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2175
2169
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
2176
2170
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
|
|
2177
2171
|
},
|
|
2178
|
-
["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
|
|
2172
|
+
["GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */]: {
|
|
2179
2173
|
message: `Vue detected directives on the mount container. ` +
|
|
2180
2174
|
`In Vue 3, the container is no longer considered part of the template ` +
|
|
2181
2175
|
`and will not be processed/replaced.`,
|
|
2182
2176
|
link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
|
|
2183
2177
|
},
|
|
2184
|
-
["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
|
|
2178
|
+
["GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */]: {
|
|
2185
2179
|
message: `Vue.extend() has been removed in Vue 3. ` +
|
|
2186
2180
|
`Use defineComponent() instead.`,
|
|
2187
2181
|
link: `https://vuejs.org/api/general.html#definecomponent`
|
|
2188
2182
|
},
|
|
2189
|
-
["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
|
|
2183
|
+
["GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */]: {
|
|
2190
2184
|
message: `Vue.prototype is no longer available in Vue 3. ` +
|
|
2191
2185
|
`Use app.config.globalProperties instead.`,
|
|
2192
2186
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
|
|
2193
2187
|
},
|
|
2194
|
-
["GLOBAL_SET" /* GLOBAL_SET */]: {
|
|
2188
|
+
["GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */]: {
|
|
2195
2189
|
message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2196
2190
|
`Simply use native JavaScript mutations.`
|
|
2197
2191
|
},
|
|
2198
|
-
["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
|
|
2192
|
+
["GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */]: {
|
|
2199
2193
|
message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2200
2194
|
`Simply use native JavaScript mutations.`
|
|
2201
2195
|
},
|
|
2202
|
-
["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
|
|
2196
|
+
["GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */]: {
|
|
2203
2197
|
message: `Vue.observable() has been removed. ` +
|
|
2204
2198
|
`Use \`import { reactive } from "vue"\` from Composition API instead.`,
|
|
2205
2199
|
link: `https://vuejs.org/api/reactivity-core.html#reactive`
|
|
2206
2200
|
},
|
|
2207
|
-
["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
|
|
2201
|
+
["GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */]: {
|
|
2208
2202
|
message: `Vue.util has been removed. Please refactor to avoid its usage ` +
|
|
2209
2203
|
`since it was an internal API even in Vue 2.`
|
|
2210
2204
|
},
|
|
2211
|
-
["CONFIG_SILENT" /* CONFIG_SILENT */]: {
|
|
2205
|
+
["CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */]: {
|
|
2212
2206
|
message: `config.silent has been removed because it is not good practice to ` +
|
|
2213
2207
|
`intentionally suppress warnings. You can use your browser console's ` +
|
|
2214
2208
|
`filter features to focus on relevant messages.`
|
|
2215
2209
|
},
|
|
2216
|
-
["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
|
|
2210
|
+
["CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */]: {
|
|
2217
2211
|
message: `config.devtools has been removed. To enable devtools for ` +
|
|
2218
2212
|
`production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
|
|
2219
2213
|
link: `https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags`
|
|
2220
2214
|
},
|
|
2221
|
-
["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
|
|
2215
|
+
["CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */]: {
|
|
2222
2216
|
message: `config.keyCodes has been removed. ` +
|
|
2223
2217
|
`In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
|
|
2224
2218
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2225
2219
|
},
|
|
2226
|
-
["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
|
|
2220
|
+
["CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */]: {
|
|
2227
2221
|
message: `config.productionTip has been removed.`,
|
|
2228
2222
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
|
|
2229
2223
|
},
|
|
2230
|
-
["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
|
|
2224
|
+
["CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */]: {
|
|
2231
2225
|
message: () => {
|
|
2232
2226
|
let msg = `config.ignoredElements has been removed.`;
|
|
2233
2227
|
if (isRuntimeOnly()) {
|
|
@@ -2240,35 +2234,35 @@ const deprecationData = {
|
|
|
2240
2234
|
},
|
|
2241
2235
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
|
|
2242
2236
|
},
|
|
2243
|
-
["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
|
|
2237
|
+
["CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */]: {
|
|
2244
2238
|
// this warning is only relevant in the full build when using runtime
|
|
2245
2239
|
// compilation, so it's put in the runtime compatConfig list.
|
|
2246
2240
|
message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
|
|
2247
2241
|
`"preserve". To suppress this warning, provide an explicit value for ` +
|
|
2248
2242
|
`\`config.compilerOptions.whitespace\`.`
|
|
2249
2243
|
},
|
|
2250
|
-
["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2244
|
+
["CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2251
2245
|
message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
|
|
2252
2246
|
`Use custom merge functions instead.`
|
|
2253
2247
|
},
|
|
2254
|
-
["INSTANCE_SET" /* INSTANCE_SET */]: {
|
|
2248
|
+
["INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */]: {
|
|
2255
2249
|
message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2256
2250
|
`Simply use native JavaScript mutations.`
|
|
2257
2251
|
},
|
|
2258
|
-
["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
|
|
2252
|
+
["INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */]: {
|
|
2259
2253
|
message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2260
2254
|
`Simply use native JavaScript mutations.`
|
|
2261
2255
|
},
|
|
2262
|
-
["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
|
|
2256
|
+
["INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */]: {
|
|
2263
2257
|
message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
|
|
2264
2258
|
link: `https://vuejs.org/api/application.html#app-unmount`
|
|
2265
2259
|
},
|
|
2266
|
-
["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
|
|
2260
|
+
["INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */]: {
|
|
2267
2261
|
message: `vm.$on/$once/$off() have been removed. ` +
|
|
2268
2262
|
`Use an external event emitter library instead.`,
|
|
2269
2263
|
link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
|
|
2270
2264
|
},
|
|
2271
|
-
["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
|
|
2265
|
+
["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
|
|
2272
2266
|
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
2273
2267
|
`use the "vnode" prefix instead of "hook:". For example, @${event} ` +
|
|
2274
2268
|
`should be changed to @vnode-${event.slice(5)}. ` +
|
|
@@ -2276,23 +2270,23 @@ const deprecationData = {
|
|
|
2276
2270
|
`hooks.`,
|
|
2277
2271
|
link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
|
|
2278
2272
|
},
|
|
2279
|
-
["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
|
|
2273
|
+
["INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */]: {
|
|
2280
2274
|
message: `vm.$children has been removed. Consider refactoring your logic ` +
|
|
2281
2275
|
`to avoid relying on direct access to child components.`,
|
|
2282
2276
|
link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
|
|
2283
2277
|
},
|
|
2284
|
-
["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
|
|
2278
|
+
["INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */]: {
|
|
2285
2279
|
message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
|
|
2286
2280
|
`included in vm.$attrs and it is no longer necessary to separately use ` +
|
|
2287
2281
|
`v-on="$listeners" if you are already using v-bind="$attrs". ` +
|
|
2288
2282
|
`(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
|
|
2289
2283
|
link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
|
|
2290
2284
|
},
|
|
2291
|
-
["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
|
|
2285
|
+
["INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */]: {
|
|
2292
2286
|
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
|
2293
2287
|
link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
|
|
2294
2288
|
},
|
|
2295
|
-
["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2289
|
+
["INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2296
2290
|
message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
|
|
2297
2291
|
`relying on class/style fallthrough from parent. In Vue 3, class/style ` +
|
|
2298
2292
|
`are now included in $attrs and will no longer fallthrough when ` +
|
|
@@ -2303,75 +2297,75 @@ const deprecationData = {
|
|
|
2303
2297
|
`them on root via :class="$attrs.class".`,
|
|
2304
2298
|
link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
|
|
2305
2299
|
},
|
|
2306
|
-
["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
|
|
2300
|
+
["OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */]: {
|
|
2307
2301
|
message: `The "data" option can no longer be a plain object. ` +
|
|
2308
2302
|
`Always use a function.`,
|
|
2309
2303
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
|
|
2310
2304
|
},
|
|
2311
|
-
["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
|
|
2305
|
+
["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */]: {
|
|
2312
2306
|
message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
|
|
2313
2307
|
`In Vue 3, data keys are merged shallowly and will override one another.`,
|
|
2314
2308
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
|
|
2315
2309
|
},
|
|
2316
|
-
["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
|
|
2310
|
+
["OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */]: {
|
|
2317
2311
|
message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
|
2318
2312
|
},
|
|
2319
|
-
["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
|
|
2313
|
+
["OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */]: {
|
|
2320
2314
|
message: `\`destroyed\` has been renamed to \`unmounted\`.`
|
|
2321
2315
|
},
|
|
2322
|
-
["WATCH_ARRAY" /* WATCH_ARRAY */]: {
|
|
2316
|
+
["WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */]: {
|
|
2323
2317
|
message: `"watch" option or vm.$watch on an array value will no longer ` +
|
|
2324
2318
|
`trigger on array mutation unless the "deep" option is specified. ` +
|
|
2325
2319
|
`If current usage is intended, you can disable the compat behavior and ` +
|
|
2326
2320
|
`suppress this warning with:` +
|
|
2327
|
-
`\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
|
|
2321
|
+
`\n\n configureCompat({ ${"WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */}: false })\n`,
|
|
2328
2322
|
link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
|
|
2329
2323
|
},
|
|
2330
|
-
["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
|
|
2324
|
+
["PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */]: {
|
|
2331
2325
|
message: (key) => `props default value function no longer has access to "this". The compat ` +
|
|
2332
2326
|
`build only offers access to this.$options.` +
|
|
2333
2327
|
`(found in prop "${key}")`,
|
|
2334
2328
|
link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
|
|
2335
2329
|
},
|
|
2336
|
-
["CUSTOM_DIR" /* CUSTOM_DIR */]: {
|
|
2330
|
+
["CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */]: {
|
|
2337
2331
|
message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
|
|
2338
2332
|
`Use "${newHook}" instead.`,
|
|
2339
2333
|
link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
|
|
2340
2334
|
},
|
|
2341
|
-
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
2335
|
+
["V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */]: {
|
|
2342
2336
|
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
2343
2337
|
`Use kebab-case key name modifiers instead.`,
|
|
2344
2338
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2345
2339
|
},
|
|
2346
|
-
["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
|
|
2340
|
+
["ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */]: {
|
|
2347
2341
|
message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
|
|
2348
2342
|
`${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
|
|
2349
2343
|
`use \`null\` or \`undefined\` instead. If the usage is intended, ` +
|
|
2350
2344
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2351
|
-
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
|
|
2345
|
+
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */}: false })\n`,
|
|
2352
2346
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2353
2347
|
},
|
|
2354
|
-
["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
|
|
2348
|
+
["ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */]: {
|
|
2355
2349
|
message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
|
|
2356
2350
|
`${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
|
|
2357
2351
|
`Always use explicit "true" or "false" values for enumerated attributes. ` +
|
|
2358
2352
|
`If the usage is intended, ` +
|
|
2359
2353
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2360
|
-
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2354
|
+
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2361
2355
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2362
2356
|
},
|
|
2363
|
-
["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
|
|
2357
|
+
["TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */]: {
|
|
2364
2358
|
message: `` // this feature cannot be runtime-detected
|
|
2365
2359
|
},
|
|
2366
|
-
["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
|
|
2360
|
+
["TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */]: {
|
|
2367
2361
|
message: `<TransitionGroup> no longer renders a root <span> element by ` +
|
|
2368
2362
|
`default if no "tag" prop is specified. If you do not rely on the span ` +
|
|
2369
2363
|
`for styling, you can disable the compat behavior and suppress this ` +
|
|
2370
2364
|
`warning with:` +
|
|
2371
|
-
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2365
|
+
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2372
2366
|
link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
|
|
2373
2367
|
},
|
|
2374
|
-
["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
|
|
2368
|
+
["COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */]: {
|
|
2375
2369
|
message: (comp) => {
|
|
2376
2370
|
const name = getComponentName(comp);
|
|
2377
2371
|
return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
|
|
@@ -2380,11 +2374,11 @@ const deprecationData = {
|
|
|
2380
2374
|
`usage and intend to use plain functions for functional components, ` +
|
|
2381
2375
|
`you can disable the compat behavior and suppress this ` +
|
|
2382
2376
|
`warning with:` +
|
|
2383
|
-
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
|
|
2377
|
+
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */}: false })\n`);
|
|
2384
2378
|
},
|
|
2385
2379
|
link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
|
|
2386
2380
|
},
|
|
2387
|
-
["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
|
|
2381
|
+
["COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */]: {
|
|
2388
2382
|
message: (comp) => {
|
|
2389
2383
|
const name = getComponentName(comp);
|
|
2390
2384
|
return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
|
|
@@ -2395,10 +2389,10 @@ const deprecationData = {
|
|
|
2395
2389
|
},
|
|
2396
2390
|
link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
|
|
2397
2391
|
},
|
|
2398
|
-
["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
|
|
2392
|
+
["COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */]: {
|
|
2399
2393
|
message: (comp) => {
|
|
2400
2394
|
const configMsg = `opt-in to ` +
|
|
2401
|
-
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
2395
|
+
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */}: false }\`.`;
|
|
2402
2396
|
if (comp.props &&
|
|
2403
2397
|
(isArray(comp.props)
|
|
2404
2398
|
? comp.props.includes('modelValue')
|
|
@@ -2412,20 +2406,20 @@ const deprecationData = {
|
|
|
2412
2406
|
},
|
|
2413
2407
|
link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
|
|
2414
2408
|
},
|
|
2415
|
-
["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
|
|
2409
|
+
["RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */]: {
|
|
2416
2410
|
message: `Vue 3's render function API has changed. ` +
|
|
2417
2411
|
`You can opt-in to the new API with:` +
|
|
2418
|
-
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
|
|
2412
|
+
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */}: false })\n` +
|
|
2419
2413
|
`\n (This can also be done per-component via the "compatConfig" option.)`,
|
|
2420
2414
|
link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
|
|
2421
2415
|
},
|
|
2422
|
-
["FILTERS" /* FILTERS */]: {
|
|
2416
|
+
["FILTERS" /* DeprecationTypes.FILTERS */]: {
|
|
2423
2417
|
message: `filters have been removed in Vue 3. ` +
|
|
2424
2418
|
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
|
2425
2419
|
`Use method calls or computed properties instead.`,
|
|
2426
2420
|
link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
|
|
2427
2421
|
},
|
|
2428
|
-
["PRIVATE_APIS" /* PRIVATE_APIS */]: {
|
|
2422
|
+
["PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */]: {
|
|
2429
2423
|
message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
|
|
2430
2424
|
`If you are seeing this warning only due to a dependency, you can ` +
|
|
2431
2425
|
`suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
|
|
@@ -2503,8 +2497,8 @@ function validateCompatConfig(config, instance) {
|
|
|
2503
2497
|
warnedInvalidKeys[key] = true;
|
|
2504
2498
|
}
|
|
2505
2499
|
}
|
|
2506
|
-
if (instance && config["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */] != null) {
|
|
2507
|
-
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2500
|
+
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2501
|
+
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2508
2502
|
}
|
|
2509
2503
|
}
|
|
2510
2504
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2579,10 +2573,10 @@ function on(instance, event, fn) {
|
|
|
2579
2573
|
}
|
|
2580
2574
|
else {
|
|
2581
2575
|
if (event.startsWith('hook:')) {
|
|
2582
|
-
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2576
|
+
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2583
2577
|
}
|
|
2584
2578
|
else {
|
|
2585
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2579
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2586
2580
|
}
|
|
2587
2581
|
const events = getRegistry(instance);
|
|
2588
2582
|
(events[event] || (events[event] = [])).push(fn);
|
|
@@ -2599,7 +2593,7 @@ function once(instance, event, fn) {
|
|
|
2599
2593
|
return instance.proxy;
|
|
2600
2594
|
}
|
|
2601
2595
|
function off(instance, event, fn) {
|
|
2602
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2596
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2603
2597
|
const vm = instance.proxy;
|
|
2604
2598
|
// all
|
|
2605
2599
|
if (!event) {
|
|
@@ -2627,7 +2621,7 @@ function off(instance, event, fn) {
|
|
|
2627
2621
|
function emit$1(instance, event, args) {
|
|
2628
2622
|
const cbs = getRegistry(instance)[event];
|
|
2629
2623
|
if (cbs) {
|
|
2630
|
-
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2624
|
+
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2631
2625
|
}
|
|
2632
2626
|
return instance.proxy;
|
|
2633
2627
|
}
|
|
@@ -2637,8 +2631,8 @@ const warnedTypes = new WeakSet();
|
|
|
2637
2631
|
function convertLegacyVModelProps(vnode) {
|
|
2638
2632
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2639
2633
|
const comp = type;
|
|
2640
|
-
if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
|
|
2641
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
|
|
2634
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2635
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2642
2636
|
// this is a special case where we want to use the vnode component's
|
|
2643
2637
|
// compat config instead of the current rendering instance (which is the
|
|
2644
2638
|
// parent of the component that exposes v-model)
|
|
@@ -2647,7 +2641,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2647
2641
|
}
|
|
2648
2642
|
if ((process.env.NODE_ENV !== 'production') && !warnedTypes.has(comp)) {
|
|
2649
2643
|
pushWarningContext(vnode);
|
|
2650
|
-
warnDeprecation("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, { type }, comp);
|
|
2644
|
+
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2651
2645
|
popWarningContext();
|
|
2652
2646
|
warnedTypes.add(comp);
|
|
2653
2647
|
}
|
|
@@ -2680,13 +2674,13 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2680
2674
|
}
|
|
2681
2675
|
}
|
|
2682
2676
|
function compatModelEmit(instance, event, args) {
|
|
2683
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
|
|
2677
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2684
2678
|
return;
|
|
2685
2679
|
}
|
|
2686
2680
|
const props = instance.vnode.props;
|
|
2687
2681
|
const modelHandler = props && props[compatModelEventPrefix + event];
|
|
2688
2682
|
if (modelHandler) {
|
|
2689
|
-
callWithErrorHandling(modelHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2683
|
+
callWithErrorHandling(modelHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2690
2684
|
}
|
|
2691
2685
|
}
|
|
2692
2686
|
|
|
@@ -2753,7 +2747,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2753
2747
|
handler = props[(handlerName = toHandlerKey(hyphenate(event)))];
|
|
2754
2748
|
}
|
|
2755
2749
|
if (handler) {
|
|
2756
|
-
callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2750
|
+
callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2757
2751
|
}
|
|
2758
2752
|
const onceHandler = props[handlerName + `Once`];
|
|
2759
2753
|
if (onceHandler) {
|
|
@@ -2764,7 +2758,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2764
2758
|
return;
|
|
2765
2759
|
}
|
|
2766
2760
|
instance.emitted[handlerName] = true;
|
|
2767
|
-
callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2761
|
+
callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2768
2762
|
}
|
|
2769
2763
|
{
|
|
2770
2764
|
compatModelEmit(instance, event, args);
|
|
@@ -2800,7 +2794,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2800
2794
|
}
|
|
2801
2795
|
}
|
|
2802
2796
|
if (!raw && !hasExtends) {
|
|
2803
|
-
|
|
2797
|
+
if (isObject(comp)) {
|
|
2798
|
+
cache.set(comp, null);
|
|
2799
|
+
}
|
|
2804
2800
|
return null;
|
|
2805
2801
|
}
|
|
2806
2802
|
if (isArray(raw)) {
|
|
@@ -2809,7 +2805,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2809
2805
|
else {
|
|
2810
2806
|
extend(normalized, raw);
|
|
2811
2807
|
}
|
|
2812
|
-
|
|
2808
|
+
if (isObject(comp)) {
|
|
2809
|
+
cache.set(comp, normalized);
|
|
2810
|
+
}
|
|
2813
2811
|
return normalized;
|
|
2814
2812
|
}
|
|
2815
2813
|
// Check if an incoming prop key is a declared emit event listener.
|
|
@@ -2939,7 +2937,7 @@ function renderComponentRoot(instance) {
|
|
|
2939
2937
|
accessedAttrs = false;
|
|
2940
2938
|
}
|
|
2941
2939
|
try {
|
|
2942
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
2940
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
2943
2941
|
// withProxy is a proxy with a different `has` trap only for
|
|
2944
2942
|
// runtime-compiled render functions using `with` block.
|
|
2945
2943
|
const proxyToUse = withProxy || proxy;
|
|
@@ -2972,7 +2970,7 @@ function renderComponentRoot(instance) {
|
|
|
2972
2970
|
}
|
|
2973
2971
|
catch (err) {
|
|
2974
2972
|
blockStack.length = 0;
|
|
2975
|
-
handleError(err, instance, 1 /* RENDER_FUNCTION */);
|
|
2973
|
+
handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
|
|
2976
2974
|
result = createVNode(Comment);
|
|
2977
2975
|
}
|
|
2978
2976
|
// attr merging
|
|
@@ -2982,14 +2980,14 @@ function renderComponentRoot(instance) {
|
|
|
2982
2980
|
let setRoot = undefined;
|
|
2983
2981
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
2984
2982
|
result.patchFlag > 0 &&
|
|
2985
|
-
result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
2983
|
+
result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
2986
2984
|
[root, setRoot] = getChildRoot(result);
|
|
2987
2985
|
}
|
|
2988
2986
|
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
2989
2987
|
const keys = Object.keys(fallthroughAttrs);
|
|
2990
2988
|
const { shapeFlag } = root;
|
|
2991
2989
|
if (keys.length) {
|
|
2992
|
-
if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
2990
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
2993
2991
|
if (propsOptions && keys.some(isModelListener)) {
|
|
2994
2992
|
// If a v-model listener (onUpdate:xxx) has a corresponding declared
|
|
2995
2993
|
// prop, it indicates this component expects to handle v-model and
|
|
@@ -3034,13 +3032,13 @@ function renderComponentRoot(instance) {
|
|
|
3034
3032
|
}
|
|
3035
3033
|
}
|
|
3036
3034
|
}
|
|
3037
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3038
|
-
vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
|
|
3039
|
-
root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
3035
|
+
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3036
|
+
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3037
|
+
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3040
3038
|
const { class: cls, style } = vnode.props || {};
|
|
3041
3039
|
if (cls || style) {
|
|
3042
3040
|
if ((process.env.NODE_ENV !== 'production') && inheritAttrs === false) {
|
|
3043
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3041
|
+
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3044
3042
|
}
|
|
3045
3043
|
root = cloneVNode(root, {
|
|
3046
3044
|
class: cls,
|
|
@@ -3144,7 +3142,7 @@ const filterModelListeners = (attrs, props) => {
|
|
|
3144
3142
|
return res;
|
|
3145
3143
|
};
|
|
3146
3144
|
const isElementRoot = (vnode) => {
|
|
3147
|
-
return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
|
|
3145
|
+
return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
|
|
3148
3146
|
vnode.type === Comment // potential v-if branch switch
|
|
3149
3147
|
);
|
|
3150
3148
|
};
|
|
@@ -3163,19 +3161,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
|
3163
3161
|
return true;
|
|
3164
3162
|
}
|
|
3165
3163
|
if (optimized && patchFlag >= 0) {
|
|
3166
|
-
if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
|
|
3164
|
+
if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
|
|
3167
3165
|
// slot content that references values that might have changed,
|
|
3168
3166
|
// e.g. in a v-for
|
|
3169
3167
|
return true;
|
|
3170
3168
|
}
|
|
3171
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
3169
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
3172
3170
|
if (!prevProps) {
|
|
3173
3171
|
return !!nextProps;
|
|
3174
3172
|
}
|
|
3175
3173
|
// presence of this flag indicates props are always non-null
|
|
3176
3174
|
return hasPropsChanged(prevProps, nextProps, emits);
|
|
3177
3175
|
}
|
|
3178
|
-
else if (patchFlag & 8 /* PROPS */) {
|
|
3176
|
+
else if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
3179
3177
|
const dynamicProps = nextVNode.dynamicProps;
|
|
3180
3178
|
for (let i = 0; i < dynamicProps.length; i++) {
|
|
3181
3179
|
const key = dynamicProps[i];
|
|
@@ -3433,7 +3431,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3433
3431
|
if (delayEnter) {
|
|
3434
3432
|
activeBranch.transition.afterLeave = () => {
|
|
3435
3433
|
if (pendingId === suspense.pendingId) {
|
|
3436
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3434
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3437
3435
|
}
|
|
3438
3436
|
};
|
|
3439
3437
|
}
|
|
@@ -3448,7 +3446,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3448
3446
|
}
|
|
3449
3447
|
if (!delayEnter) {
|
|
3450
3448
|
// move content from off-dom container to actual container
|
|
3451
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3449
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3452
3450
|
}
|
|
3453
3451
|
}
|
|
3454
3452
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3522,7 +3520,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3522
3520
|
const hydratedEl = instance.vnode.el;
|
|
3523
3521
|
instance
|
|
3524
3522
|
.asyncDep.catch(err => {
|
|
3525
|
-
handleError(err, instance, 0 /* SETUP_FUNCTION */);
|
|
3523
|
+
handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
3526
3524
|
})
|
|
3527
3525
|
.then(asyncSetupResult => {
|
|
3528
3526
|
// retry when the setup() promise resolves.
|
|
@@ -3596,7 +3594,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
3596
3594
|
}
|
|
3597
3595
|
function normalizeSuspenseChildren(vnode) {
|
|
3598
3596
|
const { shapeFlag, children } = vnode;
|
|
3599
|
-
const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
|
|
3597
|
+
const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
3600
3598
|
vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
|
|
3601
3599
|
vnode.ssFallback = isSlotChildren
|
|
3602
3600
|
? normalizeSuspenseSlot(children.fallback)
|
|
@@ -3769,7 +3767,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3769
3767
|
return traverse(s);
|
|
3770
3768
|
}
|
|
3771
3769
|
else if (isFunction(s)) {
|
|
3772
|
-
return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
|
|
3770
|
+
return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3773
3771
|
}
|
|
3774
3772
|
else {
|
|
3775
3773
|
(process.env.NODE_ENV !== 'production') && warnInvalidSource(s);
|
|
@@ -3779,7 +3777,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3779
3777
|
else if (isFunction(source)) {
|
|
3780
3778
|
if (cb) {
|
|
3781
3779
|
// getter with cb
|
|
3782
|
-
getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
|
|
3780
|
+
getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3783
3781
|
}
|
|
3784
3782
|
else {
|
|
3785
3783
|
// no cb -> simple effect
|
|
@@ -3790,7 +3788,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3790
3788
|
if (cleanup) {
|
|
3791
3789
|
cleanup();
|
|
3792
3790
|
}
|
|
3793
|
-
return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
|
|
3791
|
+
return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
|
|
3794
3792
|
};
|
|
3795
3793
|
}
|
|
3796
3794
|
}
|
|
@@ -3804,7 +3802,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3804
3802
|
getter = () => {
|
|
3805
3803
|
const val = baseGetter();
|
|
3806
3804
|
if (isArray(val) &&
|
|
3807
|
-
checkCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance)) {
|
|
3805
|
+
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3808
3806
|
traverse(val);
|
|
3809
3807
|
}
|
|
3810
3808
|
return val;
|
|
@@ -3817,7 +3815,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3817
3815
|
let cleanup;
|
|
3818
3816
|
let onCleanup = (fn) => {
|
|
3819
3817
|
cleanup = effect.onStop = () => {
|
|
3820
|
-
callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
|
|
3818
|
+
callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
|
|
3821
3819
|
};
|
|
3822
3820
|
};
|
|
3823
3821
|
// in SSR there is no need to setup an actual effect, and it should be noop
|
|
@@ -3829,7 +3827,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3829
3827
|
getter();
|
|
3830
3828
|
}
|
|
3831
3829
|
else if (immediate) {
|
|
3832
|
-
callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
|
|
3830
|
+
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3833
3831
|
getter(),
|
|
3834
3832
|
isMultiSource ? [] : undefined,
|
|
3835
3833
|
onCleanup
|
|
@@ -3851,12 +3849,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3851
3849
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
3852
3850
|
: hasChanged(newValue, oldValue)) ||
|
|
3853
3851
|
(isArray(newValue) &&
|
|
3854
|
-
isCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance))) {
|
|
3852
|
+
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3855
3853
|
// cleanup before running cb again
|
|
3856
3854
|
if (cleanup) {
|
|
3857
3855
|
cleanup();
|
|
3858
3856
|
}
|
|
3859
|
-
callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
|
|
3857
|
+
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3860
3858
|
newValue,
|
|
3861
3859
|
// pass undefined as the old value when it's changed for the first time
|
|
3862
3860
|
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
|
|
@@ -3882,7 +3880,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3882
3880
|
}
|
|
3883
3881
|
else {
|
|
3884
3882
|
// default: 'pre'
|
|
3885
|
-
|
|
3883
|
+
job.pre = true;
|
|
3884
|
+
if (instance)
|
|
3885
|
+
job.id = instance.uid;
|
|
3886
|
+
scheduler = () => queueJob(job);
|
|
3886
3887
|
}
|
|
3887
3888
|
const effect = new ReactiveEffect(getter, scheduler);
|
|
3888
3889
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
@@ -3949,7 +3950,7 @@ function createPathGetter(ctx, path) {
|
|
|
3949
3950
|
};
|
|
3950
3951
|
}
|
|
3951
3952
|
function traverse(value, seen) {
|
|
3952
|
-
if (!isObject(value) || value["__v_skip" /* SKIP */]) {
|
|
3953
|
+
if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
|
|
3953
3954
|
return value;
|
|
3954
3955
|
}
|
|
3955
3956
|
seen = seen || new Set();
|
|
@@ -4139,7 +4140,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
4139
4140
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4140
4141
|
const callHook = (hook, args) => {
|
|
4141
4142
|
hook &&
|
|
4142
|
-
callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
|
|
4143
|
+
callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
|
|
4143
4144
|
};
|
|
4144
4145
|
const callAsyncHook = (hook, args) => {
|
|
4145
4146
|
const done = args[1];
|
|
@@ -4275,10 +4276,10 @@ function getKeepAliveChild(vnode) {
|
|
|
4275
4276
|
: vnode;
|
|
4276
4277
|
}
|
|
4277
4278
|
function setTransitionHooks(vnode, hooks) {
|
|
4278
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
|
|
4279
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
|
|
4279
4280
|
setTransitionHooks(vnode.component.subTree, hooks);
|
|
4280
4281
|
}
|
|
4281
|
-
else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4282
|
+
else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4282
4283
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4283
4284
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4284
4285
|
}
|
|
@@ -4297,7 +4298,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4297
4298
|
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
4298
4299
|
// handle fragment children case, e.g. v-for
|
|
4299
4300
|
if (child.type === Fragment) {
|
|
4300
|
-
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
4301
|
+
if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
|
|
4301
4302
|
keyedFragmentCount++;
|
|
4302
4303
|
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
4303
4304
|
}
|
|
@@ -4312,7 +4313,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4312
4313
|
// these children to force full diffs to ensure correct behavior.
|
|
4313
4314
|
if (keyedFragmentCount > 1) {
|
|
4314
4315
|
for (let i = 0; i < ret.length; i++) {
|
|
4315
|
-
ret[i].patchFlag = -2 /* BAIL */;
|
|
4316
|
+
ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
|
|
4316
4317
|
}
|
|
4317
4318
|
}
|
|
4318
4319
|
return ret;
|
|
@@ -4390,7 +4391,7 @@ function defineAsyncComponent(source) {
|
|
|
4390
4391
|
}
|
|
4391
4392
|
const onError = (err) => {
|
|
4392
4393
|
pendingRequest = null;
|
|
4393
|
-
handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4394
|
+
handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4394
4395
|
};
|
|
4395
4396
|
// suspense-controlled or SSR.
|
|
4396
4397
|
if ((suspensible && instance.suspense) ||
|
|
@@ -4500,7 +4501,7 @@ const KeepAliveImpl = {
|
|
|
4500
4501
|
const storageContainer = createElement('div');
|
|
4501
4502
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4502
4503
|
const instance = vnode.component;
|
|
4503
|
-
move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
|
|
4504
|
+
move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
|
|
4504
4505
|
// in case props have changed
|
|
4505
4506
|
patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
|
|
4506
4507
|
queuePostRenderEffect(() => {
|
|
@@ -4520,7 +4521,7 @@ const KeepAliveImpl = {
|
|
|
4520
4521
|
};
|
|
4521
4522
|
sharedContext.deactivate = (vnode) => {
|
|
4522
4523
|
const instance = vnode.component;
|
|
4523
|
-
move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
|
|
4524
|
+
move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
|
|
4524
4525
|
queuePostRenderEffect(() => {
|
|
4525
4526
|
if (instance.da) {
|
|
4526
4527
|
invokeArrayFns(instance.da);
|
|
@@ -4609,8 +4610,8 @@ const KeepAliveImpl = {
|
|
|
4609
4610
|
return children;
|
|
4610
4611
|
}
|
|
4611
4612
|
else if (!isVNode(rawVNode) ||
|
|
4612
|
-
(!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
|
|
4613
|
-
!(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
|
|
4613
|
+
(!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
|
|
4614
|
+
!(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
|
|
4614
4615
|
current = null;
|
|
4615
4616
|
return rawVNode;
|
|
4616
4617
|
}
|
|
@@ -4632,7 +4633,7 @@ const KeepAliveImpl = {
|
|
|
4632
4633
|
// clone vnode if it's reused because we are going to mutate it
|
|
4633
4634
|
if (vnode.el) {
|
|
4634
4635
|
vnode = cloneVNode(vnode);
|
|
4635
|
-
if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4636
|
+
if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4636
4637
|
rawVNode.ssContent = vnode;
|
|
4637
4638
|
}
|
|
4638
4639
|
}
|
|
@@ -4651,7 +4652,7 @@ const KeepAliveImpl = {
|
|
|
4651
4652
|
setTransitionHooks(vnode, vnode.transition);
|
|
4652
4653
|
}
|
|
4653
4654
|
// avoid vnode being mounted as fresh
|
|
4654
|
-
vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4655
|
+
vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4655
4656
|
// make this key the freshest
|
|
4656
4657
|
keys.delete(key);
|
|
4657
4658
|
keys.add(key);
|
|
@@ -4664,7 +4665,7 @@ const KeepAliveImpl = {
|
|
|
4664
4665
|
}
|
|
4665
4666
|
}
|
|
4666
4667
|
// avoid vnode being unmounted
|
|
4667
|
-
vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4668
|
+
vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4668
4669
|
current = vnode;
|
|
4669
4670
|
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
4670
4671
|
};
|
|
@@ -4690,10 +4691,10 @@ function matches(pattern, name) {
|
|
|
4690
4691
|
return false;
|
|
4691
4692
|
}
|
|
4692
4693
|
function onActivated(hook, target) {
|
|
4693
|
-
registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
|
|
4694
|
+
registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
|
|
4694
4695
|
}
|
|
4695
4696
|
function onDeactivated(hook, target) {
|
|
4696
|
-
registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
|
|
4697
|
+
registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
|
|
4697
4698
|
}
|
|
4698
4699
|
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
4699
4700
|
// cache the deactivate branch check wrapper for injected hooks so the same
|
|
@@ -4737,16 +4738,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4737
4738
|
}
|
|
4738
4739
|
function resetShapeFlag(vnode) {
|
|
4739
4740
|
let shapeFlag = vnode.shapeFlag;
|
|
4740
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4741
|
-
shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4741
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4742
|
+
shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4742
4743
|
}
|
|
4743
|
-
if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
4744
|
-
shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4744
|
+
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4745
|
+
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4745
4746
|
}
|
|
4746
4747
|
vnode.shapeFlag = shapeFlag;
|
|
4747
4748
|
}
|
|
4748
4749
|
function getInnerChild(vnode) {
|
|
4749
|
-
return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4750
|
+
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4750
4751
|
}
|
|
4751
4752
|
|
|
4752
4753
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
@@ -4792,23 +4793,23 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4792
4793
|
}
|
|
4793
4794
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4794
4795
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4795
|
-
(!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
|
|
4796
|
+
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4796
4797
|
injectHook(lifecycle, hook, target);
|
|
4797
|
-
const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
|
|
4798
|
-
const onMounted = createHook("m" /* MOUNTED */);
|
|
4799
|
-
const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
|
|
4800
|
-
const onUpdated = createHook("u" /* UPDATED */);
|
|
4801
|
-
const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
|
|
4802
|
-
const onUnmounted = createHook("um" /* UNMOUNTED */);
|
|
4803
|
-
const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
|
|
4804
|
-
const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
|
|
4805
|
-
const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
|
|
4798
|
+
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4799
|
+
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4800
|
+
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
4801
|
+
const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
|
|
4802
|
+
const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
|
|
4803
|
+
const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
|
|
4804
|
+
const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
|
|
4805
|
+
const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
|
|
4806
|
+
const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
|
|
4806
4807
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
4807
|
-
injectHook("ec" /* ERROR_CAPTURED */, hook, target);
|
|
4808
|
+
injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
|
|
4808
4809
|
}
|
|
4809
4810
|
|
|
4810
4811
|
function getCompatChildren(instance) {
|
|
4811
|
-
assertCompatEnabled("INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */, instance);
|
|
4812
|
+
assertCompatEnabled("INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */, instance);
|
|
4812
4813
|
const root = instance.subTree;
|
|
4813
4814
|
const children = [];
|
|
4814
4815
|
if (root) {
|
|
@@ -4820,7 +4821,7 @@ function walk(vnode, children) {
|
|
|
4820
4821
|
if (vnode.component) {
|
|
4821
4822
|
children.push(vnode.component.proxy);
|
|
4822
4823
|
}
|
|
4823
|
-
else if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
4824
|
+
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
4824
4825
|
const vnodes = vnode.children;
|
|
4825
4826
|
for (let i = 0; i < vnodes.length; i++) {
|
|
4826
4827
|
walk(vnodes[i], children);
|
|
@@ -4829,7 +4830,7 @@ function walk(vnode, children) {
|
|
|
4829
4830
|
}
|
|
4830
4831
|
|
|
4831
4832
|
function getCompatListeners(instance) {
|
|
4832
|
-
assertCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance);
|
|
4833
|
+
assertCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance);
|
|
4833
4834
|
const listeners = {};
|
|
4834
4835
|
const rawProps = instance.vnode.props;
|
|
4835
4836
|
if (!rawProps) {
|
|
@@ -4857,7 +4858,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4857
4858
|
mappedName.forEach(mapped => {
|
|
4858
4859
|
const mappedHook = dir[mapped];
|
|
4859
4860
|
if (mappedHook) {
|
|
4860
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mapped, name);
|
|
4861
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mapped, name);
|
|
4861
4862
|
hook.push(mappedHook);
|
|
4862
4863
|
}
|
|
4863
4864
|
});
|
|
@@ -4865,7 +4866,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4865
4866
|
}
|
|
4866
4867
|
else {
|
|
4867
4868
|
if (dir[mappedName]) {
|
|
4868
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mappedName, name);
|
|
4869
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mappedName, name);
|
|
4869
4870
|
}
|
|
4870
4871
|
return dir[mappedName];
|
|
4871
4872
|
}
|
|
@@ -4939,7 +4940,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4939
4940
|
// disable tracking inside all lifecycle hooks
|
|
4940
4941
|
// since they can potentially be called inside effects.
|
|
4941
4942
|
pauseTracking();
|
|
4942
|
-
callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
|
|
4943
|
+
callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
|
|
4943
4944
|
vnode.el,
|
|
4944
4945
|
binding,
|
|
4945
4946
|
vnode,
|
|
@@ -4992,7 +4993,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
4992
4993
|
const Component = instance.type;
|
|
4993
4994
|
// explicit self name has highest priority
|
|
4994
4995
|
if (type === COMPONENTS) {
|
|
4995
|
-
const selfName = getComponentName(Component);
|
|
4996
|
+
const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
|
|
4996
4997
|
if (selfName &&
|
|
4997
4998
|
(selfName === name ||
|
|
4998
4999
|
selfName === camelize(name) ||
|
|
@@ -5046,7 +5047,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
5046
5047
|
return;
|
|
5047
5048
|
}
|
|
5048
5049
|
// v2 render function, try to provide compat
|
|
5049
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance)) {
|
|
5050
|
+
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
5050
5051
|
const wrapped = (Component.render = function compatRender() {
|
|
5051
5052
|
// @ts-ignore
|
|
5052
5053
|
return render.call(this, compatH);
|
|
@@ -5168,7 +5169,7 @@ function convertLegacyDirectives(vnode, props) {
|
|
|
5168
5169
|
function convertLegacySlots(vnode) {
|
|
5169
5170
|
const { props, children } = vnode;
|
|
5170
5171
|
let slots;
|
|
5171
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && isArray(children)) {
|
|
5172
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && isArray(children)) {
|
|
5172
5173
|
slots = {};
|
|
5173
5174
|
// check "slot" property on vnodes and turn them into v3 function slots
|
|
5174
5175
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -5207,8 +5208,8 @@ function convertLegacySlots(vnode) {
|
|
|
5207
5208
|
}
|
|
5208
5209
|
function defineLegacyVNodeProperties(vnode) {
|
|
5209
5210
|
/* istanbul ignore if */
|
|
5210
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5211
|
-
isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5211
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5212
|
+
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5212
5213
|
const context = currentRenderingInstance;
|
|
5213
5214
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5214
5215
|
let componentOptions;
|
|
@@ -5222,7 +5223,7 @@ function defineLegacyVNodeProperties(vnode) {
|
|
|
5222
5223
|
context: { get: () => context && context.proxy },
|
|
5223
5224
|
componentOptions: {
|
|
5224
5225
|
get: () => {
|
|
5225
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
5226
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
5226
5227
|
if (componentOptions) {
|
|
5227
5228
|
return componentOptions;
|
|
5228
5229
|
}
|
|
@@ -5342,7 +5343,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5342
5343
|
}
|
|
5343
5344
|
else if (slot) {
|
|
5344
5345
|
// conditional single slot generated by <template v-if="..." #foo>
|
|
5345
|
-
slots[slot.name] = slot.
|
|
5346
|
+
slots[slot.name] = slot.key
|
|
5347
|
+
? (...args) => {
|
|
5348
|
+
const res = slot.fn(...args);
|
|
5349
|
+
res.key = slot.key;
|
|
5350
|
+
return res;
|
|
5351
|
+
}
|
|
5352
|
+
: slot.fn;
|
|
5346
5353
|
}
|
|
5347
5354
|
}
|
|
5348
5355
|
return slots;
|
|
@@ -5378,9 +5385,15 @@ fallback, noSlotted) {
|
|
|
5378
5385
|
}
|
|
5379
5386
|
openBlock();
|
|
5380
5387
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5381
|
-
const rendered = createBlock(Fragment, {
|
|
5382
|
-
|
|
5383
|
-
|
|
5388
|
+
const rendered = createBlock(Fragment, {
|
|
5389
|
+
key: props.key ||
|
|
5390
|
+
// slot content array of a dynamic conditional slot may have a branch
|
|
5391
|
+
// key attached in the `createSlots` helper, respect that
|
|
5392
|
+
(validSlotContent && validSlotContent.key) ||
|
|
5393
|
+
`_${name}`
|
|
5394
|
+
}, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
|
|
5395
|
+
? 64 /* PatchFlags.STABLE_FRAGMENT */
|
|
5396
|
+
: -2 /* PatchFlags.BAIL */);
|
|
5384
5397
|
if (!noSlotted && rendered.scopeId) {
|
|
5385
5398
|
rendered.slotScopeIds = [rendered.scopeId + '-s'];
|
|
5386
5399
|
}
|
|
@@ -5408,14 +5421,16 @@ function ensureValidVNode(vnodes) {
|
|
|
5408
5421
|
* For prefixing keys in v-on="obj" with "on"
|
|
5409
5422
|
* @private
|
|
5410
5423
|
*/
|
|
5411
|
-
function toHandlers(obj) {
|
|
5424
|
+
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5412
5425
|
const ret = {};
|
|
5413
5426
|
if ((process.env.NODE_ENV !== 'production') && !isObject(obj)) {
|
|
5414
5427
|
warn$1(`v-on with no argument expects an object value.`);
|
|
5415
5428
|
return ret;
|
|
5416
5429
|
}
|
|
5417
5430
|
for (const key in obj) {
|
|
5418
|
-
ret[
|
|
5431
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
|
|
5432
|
+
? `on:${key}`
|
|
5433
|
+
: toHandlerKey(key)] = obj[key];
|
|
5419
5434
|
}
|
|
5420
5435
|
return ret;
|
|
5421
5436
|
}
|
|
@@ -5551,26 +5566,26 @@ function installCompatInstanceProperties(map) {
|
|
|
5551
5566
|
};
|
|
5552
5567
|
extend(map, {
|
|
5553
5568
|
$set: i => {
|
|
5554
|
-
assertCompatEnabled("INSTANCE_SET" /* INSTANCE_SET */, i);
|
|
5569
|
+
assertCompatEnabled("INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */, i);
|
|
5555
5570
|
return set;
|
|
5556
5571
|
},
|
|
5557
5572
|
$delete: i => {
|
|
5558
|
-
assertCompatEnabled("INSTANCE_DELETE" /* INSTANCE_DELETE */, i);
|
|
5573
|
+
assertCompatEnabled("INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */, i);
|
|
5559
5574
|
return del;
|
|
5560
5575
|
},
|
|
5561
5576
|
$mount: i => {
|
|
5562
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5577
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5563
5578
|
// root mount override from ./global.ts in installCompatMount
|
|
5564
5579
|
return i.ctx._compat_mount || NOOP;
|
|
5565
5580
|
},
|
|
5566
5581
|
$destroy: i => {
|
|
5567
|
-
assertCompatEnabled("INSTANCE_DESTROY" /* INSTANCE_DESTROY */, i);
|
|
5582
|
+
assertCompatEnabled("INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */, i);
|
|
5568
5583
|
// root destroy override from ./global.ts in installCompatMount
|
|
5569
5584
|
return i.ctx._compat_destroy || NOOP;
|
|
5570
5585
|
},
|
|
5571
5586
|
// overrides existing accessor
|
|
5572
5587
|
$slots: i => {
|
|
5573
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, i) &&
|
|
5588
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5574
5589
|
i.render &&
|
|
5575
5590
|
i.render._compatWrapped) {
|
|
5576
5591
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5578,7 +5593,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5578
5593
|
return (process.env.NODE_ENV !== 'production') ? shallowReadonly(i.slots) : i.slots;
|
|
5579
5594
|
},
|
|
5580
5595
|
$scopedSlots: i => {
|
|
5581
|
-
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */, i);
|
|
5596
|
+
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */, i);
|
|
5582
5597
|
const res = {};
|
|
5583
5598
|
for (const key in i.slots) {
|
|
5584
5599
|
const fn = i.slots[key];
|
|
@@ -5595,7 +5610,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5595
5610
|
$listeners: getCompatListeners
|
|
5596
5611
|
});
|
|
5597
5612
|
/* istanbul ignore if */
|
|
5598
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, null)) {
|
|
5613
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5599
5614
|
extend(map, {
|
|
5600
5615
|
// needed by many libs / render fns
|
|
5601
5616
|
$vnode: i => i.vnode,
|
|
@@ -5700,23 +5715,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
5700
5715
|
const n = accessCache[key];
|
|
5701
5716
|
if (n !== undefined) {
|
|
5702
5717
|
switch (n) {
|
|
5703
|
-
case 1 /* SETUP */:
|
|
5718
|
+
case 1 /* AccessTypes.SETUP */:
|
|
5704
5719
|
return setupState[key];
|
|
5705
|
-
case 2 /* DATA */:
|
|
5720
|
+
case 2 /* AccessTypes.DATA */:
|
|
5706
5721
|
return data[key];
|
|
5707
|
-
case 4 /* CONTEXT */:
|
|
5722
|
+
case 4 /* AccessTypes.CONTEXT */:
|
|
5708
5723
|
return ctx[key];
|
|
5709
|
-
case 3 /* PROPS */:
|
|
5724
|
+
case 3 /* AccessTypes.PROPS */:
|
|
5710
5725
|
return props[key];
|
|
5711
5726
|
// default: just fallthrough
|
|
5712
5727
|
}
|
|
5713
5728
|
}
|
|
5714
5729
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
5715
|
-
accessCache[key] = 1 /* SETUP */;
|
|
5730
|
+
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5716
5731
|
return setupState[key];
|
|
5717
5732
|
}
|
|
5718
5733
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5719
|
-
accessCache[key] = 2 /* DATA */;
|
|
5734
|
+
accessCache[key] = 2 /* AccessTypes.DATA */;
|
|
5720
5735
|
return data[key];
|
|
5721
5736
|
}
|
|
5722
5737
|
else if (
|
|
@@ -5724,15 +5739,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
5724
5739
|
// props
|
|
5725
5740
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
5726
5741
|
hasOwn(normalizedProps, key)) {
|
|
5727
|
-
accessCache[key] = 3 /* PROPS */;
|
|
5742
|
+
accessCache[key] = 3 /* AccessTypes.PROPS */;
|
|
5728
5743
|
return props[key];
|
|
5729
5744
|
}
|
|
5730
5745
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5731
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5746
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5732
5747
|
return ctx[key];
|
|
5733
5748
|
}
|
|
5734
5749
|
else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
|
|
5735
|
-
accessCache[key] = 0 /* OTHER */;
|
|
5750
|
+
accessCache[key] = 0 /* AccessTypes.OTHER */;
|
|
5736
5751
|
}
|
|
5737
5752
|
}
|
|
5738
5753
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -5740,7 +5755,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5740
5755
|
// public $xxx properties
|
|
5741
5756
|
if (publicGetter) {
|
|
5742
5757
|
if (key === '$attrs') {
|
|
5743
|
-
track(instance, "get" /* GET */, key);
|
|
5758
|
+
track(instance, "get" /* TrackOpTypes.GET */, key);
|
|
5744
5759
|
(process.env.NODE_ENV !== 'production') && markAttrsAccessed();
|
|
5745
5760
|
}
|
|
5746
5761
|
return publicGetter(instance);
|
|
@@ -5753,7 +5768,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5753
5768
|
}
|
|
5754
5769
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5755
5770
|
// user may set custom properties to `this` that start with `$`
|
|
5756
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5771
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5757
5772
|
return ctx[key];
|
|
5758
5773
|
}
|
|
5759
5774
|
else if (
|
|
@@ -5932,7 +5947,7 @@ function deepMergeData(to, from) {
|
|
|
5932
5947
|
const toVal = to[key];
|
|
5933
5948
|
const fromVal = from[key];
|
|
5934
5949
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
5935
|
-
(process.env.NODE_ENV !== 'production') && warnDeprecation("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null, key);
|
|
5950
|
+
(process.env.NODE_ENV !== 'production') && warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
5936
5951
|
deepMergeData(toVal, fromVal);
|
|
5937
5952
|
}
|
|
5938
5953
|
else {
|
|
@@ -5963,7 +5978,7 @@ function applyOptions(instance) {
|
|
|
5963
5978
|
// call beforeCreate first before accessing other options since
|
|
5964
5979
|
// the hook may mutate resolved options (#2791)
|
|
5965
5980
|
if (options.beforeCreate) {
|
|
5966
|
-
callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
|
|
5981
|
+
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
5967
5982
|
}
|
|
5968
5983
|
const {
|
|
5969
5984
|
// state
|
|
@@ -5979,7 +5994,7 @@ function applyOptions(instance) {
|
|
|
5979
5994
|
const [propsOptions] = instance.propsOptions;
|
|
5980
5995
|
if (propsOptions) {
|
|
5981
5996
|
for (const key in propsOptions) {
|
|
5982
|
-
checkDuplicateProperties("Props" /* PROPS */, key);
|
|
5997
|
+
checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
|
|
5983
5998
|
}
|
|
5984
5999
|
}
|
|
5985
6000
|
}
|
|
@@ -6012,7 +6027,7 @@ function applyOptions(instance) {
|
|
|
6012
6027
|
ctx[key] = methodHandler.bind(publicThis);
|
|
6013
6028
|
}
|
|
6014
6029
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6015
|
-
checkDuplicateProperties("Methods" /* METHODS */, key);
|
|
6030
|
+
checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
|
|
6016
6031
|
}
|
|
6017
6032
|
}
|
|
6018
6033
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
@@ -6039,7 +6054,7 @@ function applyOptions(instance) {
|
|
|
6039
6054
|
instance.data = reactive(data);
|
|
6040
6055
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6041
6056
|
for (const key in data) {
|
|
6042
|
-
checkDuplicateProperties("Data" /* DATA */, key);
|
|
6057
|
+
checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
|
|
6043
6058
|
// expose data on ctx during dev
|
|
6044
6059
|
if (!isReservedPrefix(key[0])) {
|
|
6045
6060
|
Object.defineProperty(ctx, key, {
|
|
@@ -6084,7 +6099,7 @@ function applyOptions(instance) {
|
|
|
6084
6099
|
set: v => (c.value = v)
|
|
6085
6100
|
});
|
|
6086
6101
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6087
|
-
checkDuplicateProperties("Computed" /* COMPUTED */, key);
|
|
6102
|
+
checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
|
|
6088
6103
|
}
|
|
6089
6104
|
}
|
|
6090
6105
|
}
|
|
@@ -6102,7 +6117,7 @@ function applyOptions(instance) {
|
|
|
6102
6117
|
});
|
|
6103
6118
|
}
|
|
6104
6119
|
if (created) {
|
|
6105
|
-
callHook(created, instance, "c" /* CREATED */);
|
|
6120
|
+
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6106
6121
|
}
|
|
6107
6122
|
function registerLifecycleHook(register, hook) {
|
|
6108
6123
|
if (isArray(hook)) {
|
|
@@ -6126,11 +6141,11 @@ function applyOptions(instance) {
|
|
|
6126
6141
|
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
6127
6142
|
{
|
|
6128
6143
|
if (beforeDestroy &&
|
|
6129
|
-
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6144
|
+
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6130
6145
|
registerLifecycleHook(onBeforeUnmount, beforeDestroy);
|
|
6131
6146
|
}
|
|
6132
6147
|
if (destroyed &&
|
|
6133
|
-
softAssertCompatEnabled("OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */, instance)) {
|
|
6148
|
+
softAssertCompatEnabled("OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */, instance)) {
|
|
6134
6149
|
registerLifecycleHook(onUnmounted, destroyed);
|
|
6135
6150
|
}
|
|
6136
6151
|
}
|
|
@@ -6162,7 +6177,7 @@ function applyOptions(instance) {
|
|
|
6162
6177
|
if (directives)
|
|
6163
6178
|
instance.directives = directives;
|
|
6164
6179
|
if (filters &&
|
|
6165
|
-
isCompatEnabled("FILTERS" /* FILTERS */, instance)) {
|
|
6180
|
+
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6166
6181
|
instance.filters = filters;
|
|
6167
6182
|
}
|
|
6168
6183
|
}
|
|
@@ -6209,7 +6224,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6209
6224
|
ctx[key] = injected;
|
|
6210
6225
|
}
|
|
6211
6226
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6212
|
-
checkDuplicateProperties("Inject" /* INJECT */, key);
|
|
6227
|
+
checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
|
|
6213
6228
|
}
|
|
6214
6229
|
}
|
|
6215
6230
|
}
|
|
@@ -6269,7 +6284,7 @@ function resolveMergedOptions(instance) {
|
|
|
6269
6284
|
resolved = cached;
|
|
6270
6285
|
}
|
|
6271
6286
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6272
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, instance)) {
|
|
6287
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6273
6288
|
resolved = extend({}, base);
|
|
6274
6289
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6275
6290
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6285,7 +6300,9 @@ function resolveMergedOptions(instance) {
|
|
|
6285
6300
|
}
|
|
6286
6301
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
6287
6302
|
}
|
|
6288
|
-
|
|
6303
|
+
if (isObject(base)) {
|
|
6304
|
+
cache.set(base, resolved);
|
|
6305
|
+
}
|
|
6289
6306
|
return resolved;
|
|
6290
6307
|
}
|
|
6291
6308
|
function mergeOptions(to, from, strats, asMixin = false) {
|
|
@@ -6354,7 +6371,7 @@ function mergeDataFn(to, from) {
|
|
|
6354
6371
|
return from;
|
|
6355
6372
|
}
|
|
6356
6373
|
return function mergedDataFn() {
|
|
6357
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null)
|
|
6374
|
+
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6358
6375
|
? deepMergeData
|
|
6359
6376
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6360
6377
|
};
|
|
@@ -6394,7 +6411,7 @@ function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
|
6394
6411
|
return new Proxy({}, {
|
|
6395
6412
|
get(_, key) {
|
|
6396
6413
|
(process.env.NODE_ENV !== 'production') &&
|
|
6397
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, null, propKey);
|
|
6414
|
+
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6398
6415
|
// $options
|
|
6399
6416
|
if (key === '$options') {
|
|
6400
6417
|
return resolveMergedOptions(instance);
|
|
@@ -6424,11 +6441,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6424
6441
|
return true;
|
|
6425
6442
|
}
|
|
6426
6443
|
if ((key === 'class' || key === 'style') &&
|
|
6427
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6444
|
+
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6428
6445
|
return true;
|
|
6429
6446
|
}
|
|
6430
6447
|
if (isOn(key) &&
|
|
6431
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance)) {
|
|
6448
|
+
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6432
6449
|
return true;
|
|
6433
6450
|
}
|
|
6434
6451
|
// vue-router
|
|
@@ -6471,6 +6488,13 @@ isSSR = false) {
|
|
|
6471
6488
|
}
|
|
6472
6489
|
instance.attrs = attrs;
|
|
6473
6490
|
}
|
|
6491
|
+
function isInHmrContext(instance) {
|
|
6492
|
+
while (instance) {
|
|
6493
|
+
if (instance.type.__hmrId)
|
|
6494
|
+
return true;
|
|
6495
|
+
instance = instance.parent;
|
|
6496
|
+
}
|
|
6497
|
+
}
|
|
6474
6498
|
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
6475
6499
|
const { props, attrs, vnode: { patchFlag } } = instance;
|
|
6476
6500
|
const rawCurrentProps = toRaw(props);
|
|
@@ -6480,12 +6504,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6480
6504
|
// always force full diff in dev
|
|
6481
6505
|
// - #1942 if hmr is enabled with sfc component
|
|
6482
6506
|
// - vite#872 non-sfc component used by sfc component
|
|
6483
|
-
!((process.env.NODE_ENV !== 'production') &&
|
|
6484
|
-
(instance.type.__hmrId ||
|
|
6485
|
-
(instance.parent && instance.parent.type.__hmrId))) &&
|
|
6507
|
+
!((process.env.NODE_ENV !== 'production') && isInHmrContext(instance)) &&
|
|
6486
6508
|
(optimized || patchFlag > 0) &&
|
|
6487
|
-
!(patchFlag & 16 /* FULL_PROPS */)) {
|
|
6488
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
6509
|
+
!(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
|
|
6510
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
6489
6511
|
// Compiler-generated props & no keys change, just set the updated
|
|
6490
6512
|
// the props.
|
|
6491
6513
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
@@ -6572,7 +6594,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6572
6594
|
}
|
|
6573
6595
|
// trigger updates for $attrs in case it's used in component slots
|
|
6574
6596
|
if (hasAttrsChanged) {
|
|
6575
|
-
trigger(instance, "set" /* SET */, '$attrs');
|
|
6597
|
+
trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
|
|
6576
6598
|
}
|
|
6577
6599
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6578
6600
|
validateProps(rawProps || {}, props, instance);
|
|
@@ -6590,7 +6612,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
6590
6612
|
}
|
|
6591
6613
|
{
|
|
6592
6614
|
if (key.startsWith('onHook:')) {
|
|
6593
|
-
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6615
|
+
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6594
6616
|
}
|
|
6595
6617
|
if (key === 'inline-template') {
|
|
6596
6618
|
continue;
|
|
@@ -6651,7 +6673,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6651
6673
|
}
|
|
6652
6674
|
else {
|
|
6653
6675
|
setCurrentInstance(instance);
|
|
6654
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, instance)
|
|
6676
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6655
6677
|
? createPropsDefaultThis(instance, props, key)
|
|
6656
6678
|
: null, props);
|
|
6657
6679
|
unsetCurrentInstance();
|
|
@@ -6662,11 +6684,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6662
6684
|
}
|
|
6663
6685
|
}
|
|
6664
6686
|
// boolean casting
|
|
6665
|
-
if (opt[0 /* shouldCast */]) {
|
|
6687
|
+
if (opt[0 /* BooleanFlags.shouldCast */]) {
|
|
6666
6688
|
if (isAbsent && !hasDefault) {
|
|
6667
6689
|
value = false;
|
|
6668
6690
|
}
|
|
6669
|
-
else if (opt[1 /* shouldCastTrue */] &&
|
|
6691
|
+
else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
|
|
6670
6692
|
(value === '' || value === hyphenate(key))) {
|
|
6671
6693
|
value = true;
|
|
6672
6694
|
}
|
|
@@ -6707,7 +6729,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6707
6729
|
}
|
|
6708
6730
|
}
|
|
6709
6731
|
if (!raw && !hasExtends) {
|
|
6710
|
-
|
|
6732
|
+
if (isObject(comp)) {
|
|
6733
|
+
cache.set(comp, EMPTY_ARR);
|
|
6734
|
+
}
|
|
6711
6735
|
return EMPTY_ARR;
|
|
6712
6736
|
}
|
|
6713
6737
|
if (isArray(raw)) {
|
|
@@ -6734,8 +6758,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6734
6758
|
if (prop) {
|
|
6735
6759
|
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
6736
6760
|
const stringIndex = getTypeIndex(String, prop.type);
|
|
6737
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
6738
|
-
prop[1 /* shouldCastTrue */] =
|
|
6761
|
+
prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
|
|
6762
|
+
prop[1 /* BooleanFlags.shouldCastTrue */] =
|
|
6739
6763
|
stringIndex < 0 || booleanIndex < stringIndex;
|
|
6740
6764
|
// if the prop needs boolean casting or default value
|
|
6741
6765
|
if (booleanIndex > -1 || hasOwn(prop, 'default')) {
|
|
@@ -6746,7 +6770,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6746
6770
|
}
|
|
6747
6771
|
}
|
|
6748
6772
|
const res = [normalized, needCastKeys];
|
|
6749
|
-
|
|
6773
|
+
if (isObject(comp)) {
|
|
6774
|
+
cache.set(comp, res);
|
|
6775
|
+
}
|
|
6750
6776
|
return res;
|
|
6751
6777
|
}
|
|
6752
6778
|
function validatePropName(key) {
|
|
@@ -6938,7 +6964,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6938
6964
|
}
|
|
6939
6965
|
else if (value != null) {
|
|
6940
6966
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
6941
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6967
|
+
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6942
6968
|
warn$1(`Non-function value encountered for slot "${key}". ` +
|
|
6943
6969
|
`Prefer function slots for better performance.`);
|
|
6944
6970
|
}
|
|
@@ -6950,7 +6976,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6950
6976
|
const normalizeVNodeSlots = (instance, children) => {
|
|
6951
6977
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
6952
6978
|
!isKeepAlive(instance.vnode) &&
|
|
6953
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6979
|
+
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6954
6980
|
warn$1(`Non-function value encountered for default slot. ` +
|
|
6955
6981
|
`Prefer function slots for better performance.`);
|
|
6956
6982
|
}
|
|
@@ -6958,7 +6984,7 @@ const normalizeVNodeSlots = (instance, children) => {
|
|
|
6958
6984
|
instance.slots.default = () => normalized;
|
|
6959
6985
|
};
|
|
6960
6986
|
const initSlots = (instance, children) => {
|
|
6961
|
-
if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
6987
|
+
if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6962
6988
|
const type = children._;
|
|
6963
6989
|
if (type) {
|
|
6964
6990
|
// users can get the shallow readonly version of the slots object through `this.$slots`,
|
|
@@ -6983,7 +7009,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6983
7009
|
const { vnode, slots } = instance;
|
|
6984
7010
|
let needDeletionCheck = true;
|
|
6985
7011
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
6986
|
-
if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
7012
|
+
if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6987
7013
|
const type = children._;
|
|
6988
7014
|
if (type) {
|
|
6989
7015
|
// compiled slots.
|
|
@@ -6992,7 +7018,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6992
7018
|
// force update slots and mark instance for hmr as well
|
|
6993
7019
|
extend(slots, children);
|
|
6994
7020
|
}
|
|
6995
|
-
else if (optimized && type === 1 /* STABLE */) {
|
|
7021
|
+
else if (optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
6996
7022
|
// compiled AND stable.
|
|
6997
7023
|
// no need to update, and skip stale slots removal.
|
|
6998
7024
|
needDeletionCheck = false;
|
|
@@ -7005,7 +7031,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7005
7031
|
// when rendering the optimized slots by manually written render function,
|
|
7006
7032
|
// we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
|
|
7007
7033
|
// i.e. let the `renderSlot` create the bailed Fragment
|
|
7008
|
-
if (!optimized && type === 1 /* STABLE */) {
|
|
7034
|
+
if (!optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
7009
7035
|
delete slots._;
|
|
7010
7036
|
}
|
|
7011
7037
|
}
|
|
@@ -7034,11 +7060,11 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
7034
7060
|
// dev only
|
|
7035
7061
|
function installLegacyConfigWarnings(config) {
|
|
7036
7062
|
const legacyConfigOptions = {
|
|
7037
|
-
silent: "CONFIG_SILENT" /* CONFIG_SILENT */,
|
|
7038
|
-
devtools: "CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */,
|
|
7039
|
-
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */,
|
|
7040
|
-
keyCodes: "CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */,
|
|
7041
|
-
productionTip: "CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */
|
|
7063
|
+
silent: "CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */,
|
|
7064
|
+
devtools: "CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */,
|
|
7065
|
+
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */,
|
|
7066
|
+
keyCodes: "CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */,
|
|
7067
|
+
productionTip: "CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */
|
|
7042
7068
|
};
|
|
7043
7069
|
Object.keys(legacyConfigOptions).forEach(key => {
|
|
7044
7070
|
let val = config[key];
|
|
@@ -7063,7 +7089,7 @@ function installLegacyOptionMergeStrats(config) {
|
|
|
7063
7089
|
return target[key];
|
|
7064
7090
|
}
|
|
7065
7091
|
if (key in internalOptionMergeStrats &&
|
|
7066
|
-
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
7092
|
+
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
7067
7093
|
return internalOptionMergeStrats[key];
|
|
7068
7094
|
}
|
|
7069
7095
|
}
|
|
@@ -7081,11 +7107,11 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7081
7107
|
return createCompatApp(options, Vue);
|
|
7082
7108
|
});
|
|
7083
7109
|
function createCompatApp(options = {}, Ctor) {
|
|
7084
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null);
|
|
7110
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null);
|
|
7085
7111
|
const { data } = options;
|
|
7086
7112
|
if (data &&
|
|
7087
7113
|
!isFunction(data) &&
|
|
7088
|
-
softAssertCompatEnabled("OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */, null)) {
|
|
7114
|
+
softAssertCompatEnabled("OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */, null)) {
|
|
7089
7115
|
options.data = () => data;
|
|
7090
7116
|
}
|
|
7091
7117
|
const app = createApp(options);
|
|
@@ -7100,7 +7126,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7100
7126
|
return vm;
|
|
7101
7127
|
}
|
|
7102
7128
|
}
|
|
7103
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7129
|
+
Vue.version = `2.6.14-compat:${"3.2.39"}`;
|
|
7104
7130
|
Vue.config = singletonApp.config;
|
|
7105
7131
|
Vue.use = (p, ...options) => {
|
|
7106
7132
|
if (p && isFunction(p.install)) {
|
|
@@ -7139,7 +7165,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7139
7165
|
Vue.nextTick = nextTick;
|
|
7140
7166
|
const extendCache = new WeakMap();
|
|
7141
7167
|
function extendCtor(extendOptions = {}) {
|
|
7142
|
-
assertCompatEnabled("GLOBAL_EXTEND" /* GLOBAL_EXTEND */, null);
|
|
7168
|
+
assertCompatEnabled("GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */, null);
|
|
7143
7169
|
if (isFunction(extendOptions)) {
|
|
7144
7170
|
extendOptions = extendOptions.options;
|
|
7145
7171
|
}
|
|
@@ -7180,15 +7206,15 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7180
7206
|
}
|
|
7181
7207
|
Vue.extend = extendCtor.bind(Vue);
|
|
7182
7208
|
Vue.set = (target, key, value) => {
|
|
7183
|
-
assertCompatEnabled("GLOBAL_SET" /* GLOBAL_SET */, null);
|
|
7209
|
+
assertCompatEnabled("GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */, null);
|
|
7184
7210
|
target[key] = value;
|
|
7185
7211
|
};
|
|
7186
7212
|
Vue.delete = (target, key) => {
|
|
7187
|
-
assertCompatEnabled("GLOBAL_DELETE" /* GLOBAL_DELETE */, null);
|
|
7213
|
+
assertCompatEnabled("GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */, null);
|
|
7188
7214
|
delete target[key];
|
|
7189
7215
|
};
|
|
7190
7216
|
Vue.observable = (target) => {
|
|
7191
|
-
assertCompatEnabled("GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */, null);
|
|
7217
|
+
assertCompatEnabled("GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */, null);
|
|
7192
7218
|
return reactive(target);
|
|
7193
7219
|
};
|
|
7194
7220
|
Vue.filter = ((name, filter) => {
|
|
@@ -7209,7 +7235,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7209
7235
|
};
|
|
7210
7236
|
Object.defineProperty(Vue, 'util', {
|
|
7211
7237
|
get() {
|
|
7212
|
-
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */, null);
|
|
7238
|
+
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */, null);
|
|
7213
7239
|
return util;
|
|
7214
7240
|
}
|
|
7215
7241
|
});
|
|
@@ -7233,7 +7259,7 @@ function installAppCompatProperties(app, context, render) {
|
|
|
7233
7259
|
function installFilterMethod(app, context) {
|
|
7234
7260
|
context.filters = {};
|
|
7235
7261
|
app.filter = (name, filter) => {
|
|
7236
|
-
assertCompatEnabled("FILTERS" /* FILTERS */, null);
|
|
7262
|
+
assertCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, null);
|
|
7237
7263
|
if (!filter) {
|
|
7238
7264
|
return context.filters[name];
|
|
7239
7265
|
}
|
|
@@ -7250,7 +7276,7 @@ function installLegacyAPIs(app) {
|
|
|
7250
7276
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7251
7277
|
prototype: {
|
|
7252
7278
|
get() {
|
|
7253
|
-
(process.env.NODE_ENV !== 'production') && warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7279
|
+
(process.env.NODE_ENV !== 'production') && warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7254
7280
|
return app.config.globalProperties;
|
|
7255
7281
|
}
|
|
7256
7282
|
},
|
|
@@ -7287,7 +7313,7 @@ function applySingletonAppMutations(app) {
|
|
|
7287
7313
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7288
7314
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7289
7315
|
if (key === 'ignoredElements' &&
|
|
7290
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7316
|
+
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7291
7317
|
!isRuntimeOnly() &&
|
|
7292
7318
|
isArray(val)) {
|
|
7293
7319
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7300,7 +7326,7 @@ function applySingletonAppMutations(app) {
|
|
|
7300
7326
|
}
|
|
7301
7327
|
function applySingletonPrototype(app, Ctor) {
|
|
7302
7328
|
// copy prototype augmentations as config.globalProperties
|
|
7303
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7329
|
+
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7304
7330
|
if (enabled) {
|
|
7305
7331
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7306
7332
|
}
|
|
@@ -7315,7 +7341,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7315
7341
|
}
|
|
7316
7342
|
}
|
|
7317
7343
|
if ((process.env.NODE_ENV !== 'production') && hasPrototypeAugmentations) {
|
|
7318
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7344
|
+
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7319
7345
|
}
|
|
7320
7346
|
}
|
|
7321
7347
|
function installCompatMount(app, context, render) {
|
|
@@ -7386,7 +7412,7 @@ function installCompatMount(app, context, render) {
|
|
|
7386
7412
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7387
7413
|
const attr = container.attributes[i];
|
|
7388
7414
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7389
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
7415
|
+
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7390
7416
|
break;
|
|
7391
7417
|
}
|
|
7392
7418
|
}
|
|
@@ -7425,7 +7451,7 @@ function installCompatMount(app, context, render) {
|
|
|
7425
7451
|
if (bum) {
|
|
7426
7452
|
invokeArrayFns(bum);
|
|
7427
7453
|
}
|
|
7428
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7454
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7429
7455
|
instance.emit('hook:beforeDestroy');
|
|
7430
7456
|
}
|
|
7431
7457
|
// stop effects
|
|
@@ -7436,7 +7462,7 @@ function installCompatMount(app, context, render) {
|
|
|
7436
7462
|
if (um) {
|
|
7437
7463
|
invokeArrayFns(um);
|
|
7438
7464
|
}
|
|
7439
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7465
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7440
7466
|
instance.emit('hook:destroyed');
|
|
7441
7467
|
}
|
|
7442
7468
|
}
|
|
@@ -7497,12 +7523,12 @@ function defineReactiveSimple(obj, key, val) {
|
|
|
7497
7523
|
enumerable: true,
|
|
7498
7524
|
configurable: true,
|
|
7499
7525
|
get() {
|
|
7500
|
-
track(obj, "get" /* GET */, key);
|
|
7526
|
+
track(obj, "get" /* TrackOpTypes.GET */, key);
|
|
7501
7527
|
return val;
|
|
7502
7528
|
},
|
|
7503
7529
|
set(newVal) {
|
|
7504
7530
|
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
7505
|
-
trigger(obj, "set" /* SET */, key, newVal);
|
|
7531
|
+
trigger(obj, "set" /* TriggerOpTypes.SET */, key, newVal);
|
|
7506
7532
|
}
|
|
7507
7533
|
});
|
|
7508
7534
|
}
|
|
@@ -7698,7 +7724,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7698
7724
|
// because the template ref is forwarded to inner component
|
|
7699
7725
|
return;
|
|
7700
7726
|
}
|
|
7701
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
7727
|
+
const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
7702
7728
|
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
7703
7729
|
: vnode.el;
|
|
7704
7730
|
const value = isUnmount ? null : refValue;
|
|
@@ -7724,7 +7750,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7724
7750
|
}
|
|
7725
7751
|
}
|
|
7726
7752
|
if (isFunction(ref)) {
|
|
7727
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
7753
|
+
callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
|
|
7728
7754
|
}
|
|
7729
7755
|
else {
|
|
7730
7756
|
const _isString = isString(ref);
|
|
@@ -7761,7 +7787,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7761
7787
|
setupState[ref] = value;
|
|
7762
7788
|
}
|
|
7763
7789
|
}
|
|
7764
|
-
else if (
|
|
7790
|
+
else if (_isRef) {
|
|
7765
7791
|
ref.value = value;
|
|
7766
7792
|
if (rawRef.k)
|
|
7767
7793
|
refs[rawRef.k] = value;
|
|
@@ -7786,7 +7812,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7786
7812
|
|
|
7787
7813
|
let hasMismatch = false;
|
|
7788
7814
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
7789
|
-
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
7815
|
+
const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
|
|
7790
7816
|
// Note: hydration is DOM-specific
|
|
7791
7817
|
// But we have to place it in core due to tight coupling with core - splitting
|
|
7792
7818
|
// it out creates a ton of unnecessary complexity.
|
|
@@ -7801,11 +7827,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7801
7827
|
`Performing full mount instead.`);
|
|
7802
7828
|
patch(null, vnode, container);
|
|
7803
7829
|
flushPostFlushCbs();
|
|
7830
|
+
container._vnode = vnode;
|
|
7804
7831
|
return;
|
|
7805
7832
|
}
|
|
7806
7833
|
hasMismatch = false;
|
|
7807
7834
|
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
7808
7835
|
flushPostFlushCbs();
|
|
7836
|
+
container._vnode = vnode;
|
|
7809
7837
|
if (hasMismatch && !false) {
|
|
7810
7838
|
// this error should show up in production
|
|
7811
7839
|
console.error(`Hydration completed but contains mismatches.`);
|
|
@@ -7817,14 +7845,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7817
7845
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7818
7846
|
const domType = node.nodeType;
|
|
7819
7847
|
vnode.el = node;
|
|
7820
|
-
if (patchFlag === -2 /* BAIL */) {
|
|
7848
|
+
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7821
7849
|
optimized = false;
|
|
7822
7850
|
vnode.dynamicChildren = null;
|
|
7823
7851
|
}
|
|
7824
7852
|
let nextNode = null;
|
|
7825
7853
|
switch (type) {
|
|
7826
7854
|
case Text:
|
|
7827
|
-
if (domType !== 3 /* TEXT */) {
|
|
7855
|
+
if (domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7828
7856
|
// #5728 empty text node inside a slot can cause hydration failure
|
|
7829
7857
|
// because the server rendered HTML won't contain a text node
|
|
7830
7858
|
if (vnode.children === '') {
|
|
@@ -7848,7 +7876,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7848
7876
|
}
|
|
7849
7877
|
break;
|
|
7850
7878
|
case Comment:
|
|
7851
|
-
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
7879
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
|
|
7852
7880
|
nextNode = onMismatch();
|
|
7853
7881
|
}
|
|
7854
7882
|
else {
|
|
@@ -7856,7 +7884,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7856
7884
|
}
|
|
7857
7885
|
break;
|
|
7858
7886
|
case Static:
|
|
7859
|
-
if (domType !== 1 /* ELEMENT */) {
|
|
7887
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7860
7888
|
nextNode = onMismatch();
|
|
7861
7889
|
}
|
|
7862
7890
|
else {
|
|
@@ -7867,7 +7895,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7867
7895
|
const needToAdoptContent = !vnode.children.length;
|
|
7868
7896
|
for (let i = 0; i < vnode.staticCount; i++) {
|
|
7869
7897
|
if (needToAdoptContent)
|
|
7870
|
-
vnode.children +=
|
|
7898
|
+
vnode.children +=
|
|
7899
|
+
nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
|
|
7900
|
+
? nextNode.outerHTML
|
|
7901
|
+
: nextNode.data;
|
|
7871
7902
|
if (i === vnode.staticCount - 1) {
|
|
7872
7903
|
vnode.anchor = nextNode;
|
|
7873
7904
|
}
|
|
@@ -7885,8 +7916,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7885
7916
|
}
|
|
7886
7917
|
break;
|
|
7887
7918
|
default:
|
|
7888
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
7889
|
-
if (domType !== 1 /* ELEMENT */ ||
|
|
7919
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
7920
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
|
|
7890
7921
|
vnode.type.toLowerCase() !==
|
|
7891
7922
|
node.tagName.toLowerCase()) {
|
|
7892
7923
|
nextNode = onMismatch();
|
|
@@ -7895,7 +7926,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7895
7926
|
nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
7896
7927
|
}
|
|
7897
7928
|
}
|
|
7898
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
7929
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
7899
7930
|
// when setting up the render effect, if the initial vnode already
|
|
7900
7931
|
// has .el set, the component will perform hydration instead of mount
|
|
7901
7932
|
// on its sub-tree.
|
|
@@ -7934,15 +7965,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7934
7965
|
vnode.component.subTree = subTree;
|
|
7935
7966
|
}
|
|
7936
7967
|
}
|
|
7937
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
7938
|
-
if (domType !== 8 /* COMMENT */) {
|
|
7968
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
7969
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
|
|
7939
7970
|
nextNode = onMismatch();
|
|
7940
7971
|
}
|
|
7941
7972
|
else {
|
|
7942
7973
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
7943
7974
|
}
|
|
7944
7975
|
}
|
|
7945
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
7976
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
7946
7977
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
7947
7978
|
}
|
|
7948
7979
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
@@ -7962,7 +7993,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7962
7993
|
const forcePatchValue = (type === 'input' && dirs) || type === 'option';
|
|
7963
7994
|
// skip props & children if this is hoisted static nodes
|
|
7964
7995
|
// #5405 in dev, always hydrate children for HMR
|
|
7965
|
-
if ((process.env.NODE_ENV !== 'production') || forcePatchValue || patchFlag !== -1 /* HOISTED */) {
|
|
7996
|
+
if ((process.env.NODE_ENV !== 'production') || forcePatchValue || patchFlag !== -1 /* PatchFlags.HOISTED */) {
|
|
7966
7997
|
if (dirs) {
|
|
7967
7998
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
7968
7999
|
}
|
|
@@ -7970,7 +8001,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7970
8001
|
if (props) {
|
|
7971
8002
|
if (forcePatchValue ||
|
|
7972
8003
|
!optimized ||
|
|
7973
|
-
patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
|
|
8004
|
+
patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
|
|
7974
8005
|
for (const key in props) {
|
|
7975
8006
|
if ((forcePatchValue && key.endsWith('value')) ||
|
|
7976
8007
|
(isOn(key) && !isReservedProp(key))) {
|
|
@@ -7999,7 +8030,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7999
8030
|
}, parentSuspense);
|
|
8000
8031
|
}
|
|
8001
8032
|
// children
|
|
8002
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
|
|
8033
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
|
|
8003
8034
|
// skip if element has innerHTML / textContent
|
|
8004
8035
|
!(props && (props.innerHTML || props.textContent))) {
|
|
8005
8036
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -8017,7 +8048,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8017
8048
|
remove(cur);
|
|
8018
8049
|
}
|
|
8019
8050
|
}
|
|
8020
|
-
else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8051
|
+
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8021
8052
|
if (el.textContent !== vnode.children) {
|
|
8022
8053
|
hasMismatch = true;
|
|
8023
8054
|
(process.env.NODE_ENV !== 'production') &&
|
|
@@ -8082,7 +8113,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8082
8113
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8083
8114
|
hasMismatch = true;
|
|
8084
8115
|
(process.env.NODE_ENV !== 'production') &&
|
|
8085
|
-
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
|
|
8116
|
+
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8086
8117
|
? `(text)`
|
|
8087
8118
|
: isComment(node) && node.data === '['
|
|
8088
8119
|
? `(start of fragment)`
|
|
@@ -8244,7 +8275,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8244
8275
|
unmount(n1, parentComponent, parentSuspense, true);
|
|
8245
8276
|
n1 = null;
|
|
8246
8277
|
}
|
|
8247
|
-
if (n2.patchFlag === -2 /* BAIL */) {
|
|
8278
|
+
if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
8248
8279
|
optimized = false;
|
|
8249
8280
|
n2.dynamicChildren = null;
|
|
8250
8281
|
}
|
|
@@ -8268,16 +8299,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8268
8299
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8269
8300
|
break;
|
|
8270
8301
|
default:
|
|
8271
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
8302
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
8272
8303
|
processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8273
8304
|
}
|
|
8274
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
8305
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
8275
8306
|
processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8276
8307
|
}
|
|
8277
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
8308
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
8278
8309
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8279
8310
|
}
|
|
8280
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
8311
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
8281
8312
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8282
8313
|
}
|
|
8283
8314
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
@@ -8362,7 +8393,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8362
8393
|
if (!(process.env.NODE_ENV !== 'production') &&
|
|
8363
8394
|
vnode.el &&
|
|
8364
8395
|
hostCloneNode !== undefined &&
|
|
8365
|
-
patchFlag === -1 /* HOISTED */) {
|
|
8396
|
+
patchFlag === -1 /* PatchFlags.HOISTED */) {
|
|
8366
8397
|
// If a vnode has non-null el, it means it's being reused.
|
|
8367
8398
|
// Only static vnodes can be reused, so its mounted DOM nodes should be
|
|
8368
8399
|
// exactly the same, and we can simply do a clone here.
|
|
@@ -8373,10 +8404,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8373
8404
|
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
8374
8405
|
// mount children first, since some props may rely on child content
|
|
8375
8406
|
// being already rendered, e.g. `<select value>`
|
|
8376
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8407
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8377
8408
|
hostSetElementText(el, vnode.children);
|
|
8378
8409
|
}
|
|
8379
|
-
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8410
|
+
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8380
8411
|
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
8381
8412
|
}
|
|
8382
8413
|
if (dirs) {
|
|
@@ -8453,7 +8484,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8453
8484
|
let subTree = parentComponent.subTree;
|
|
8454
8485
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
8455
8486
|
subTree.patchFlag > 0 &&
|
|
8456
|
-
subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
8487
|
+
subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
8457
8488
|
subTree =
|
|
8458
8489
|
filterSingleRoot(subTree.children) || subTree;
|
|
8459
8490
|
}
|
|
@@ -8476,7 +8507,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8476
8507
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
8477
8508
|
// #1426 take the old vnode's patch flag into account since user may clone a
|
|
8478
8509
|
// compiler-generated vnode, which de-opts to FULL_PROPS
|
|
8479
|
-
patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
|
|
8510
|
+
patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
|
|
8480
8511
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
8481
8512
|
const newProps = n2.props || EMPTY_OBJ;
|
|
8482
8513
|
let vnodeHook;
|
|
@@ -8511,21 +8542,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8511
8542
|
// generated by the compiler and can take the fast path.
|
|
8512
8543
|
// in this path old node and new node are guaranteed to have the same shape
|
|
8513
8544
|
// (i.e. at the exact same position in the source template)
|
|
8514
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
8545
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
8515
8546
|
// element props contain dynamic keys, full diff needed
|
|
8516
8547
|
patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
|
|
8517
8548
|
}
|
|
8518
8549
|
else {
|
|
8519
8550
|
// class
|
|
8520
8551
|
// this flag is matched when the element has dynamic class bindings.
|
|
8521
|
-
if (patchFlag & 2 /* CLASS */) {
|
|
8552
|
+
if (patchFlag & 2 /* PatchFlags.CLASS */) {
|
|
8522
8553
|
if (oldProps.class !== newProps.class) {
|
|
8523
8554
|
hostPatchProp(el, 'class', null, newProps.class, isSVG);
|
|
8524
8555
|
}
|
|
8525
8556
|
}
|
|
8526
8557
|
// style
|
|
8527
8558
|
// this flag is matched when the element has dynamic style bindings
|
|
8528
|
-
if (patchFlag & 4 /* STYLE */) {
|
|
8559
|
+
if (patchFlag & 4 /* PatchFlags.STYLE */) {
|
|
8529
8560
|
hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
|
|
8530
8561
|
}
|
|
8531
8562
|
// props
|
|
@@ -8534,7 +8565,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8534
8565
|
// faster iteration.
|
|
8535
8566
|
// Note dynamic keys like :[foo]="bar" will cause this optimization to
|
|
8536
8567
|
// bail out and go through a full diff because we need to unset the old key
|
|
8537
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
8568
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
8538
8569
|
// if the flag is present then dynamicProps must be non-null
|
|
8539
8570
|
const propsToUpdate = n2.dynamicProps;
|
|
8540
8571
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
@@ -8550,7 +8581,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8550
8581
|
}
|
|
8551
8582
|
// text
|
|
8552
8583
|
// This flag is matched when the element has only dynamic text children.
|
|
8553
|
-
if (patchFlag & 1 /* TEXT */) {
|
|
8584
|
+
if (patchFlag & 1 /* PatchFlags.TEXT */) {
|
|
8554
8585
|
if (n1.children !== n2.children) {
|
|
8555
8586
|
hostSetElementText(el, n2.children);
|
|
8556
8587
|
}
|
|
@@ -8584,7 +8615,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8584
8615
|
// which also requires the correct parent container
|
|
8585
8616
|
!isSameVNodeType(oldVNode, newVNode) ||
|
|
8586
8617
|
// - In the case of a component, it could contain anything.
|
|
8587
|
-
oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
|
|
8618
|
+
oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
|
|
8588
8619
|
? hostParentNode(oldVNode.el)
|
|
8589
8620
|
: // In other cases, the parent container is not actually used so we
|
|
8590
8621
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
@@ -8623,7 +8654,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8623
8654
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8624
8655
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
8625
8656
|
// #5523 dev root fragment may inherit directives
|
|
8626
|
-
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8657
|
+
(isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
|
|
8627
8658
|
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8628
8659
|
patchFlag = 0;
|
|
8629
8660
|
optimized = false;
|
|
@@ -8645,7 +8676,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8645
8676
|
}
|
|
8646
8677
|
else {
|
|
8647
8678
|
if (patchFlag > 0 &&
|
|
8648
|
-
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8679
|
+
patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
|
|
8649
8680
|
dynamicChildren &&
|
|
8650
8681
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8651
8682
|
// of renderSlot() with no valid children
|
|
@@ -8678,7 +8709,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8678
8709
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8679
8710
|
n2.slotScopeIds = slotScopeIds;
|
|
8680
8711
|
if (n1 == null) {
|
|
8681
|
-
if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
8712
|
+
if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
8682
8713
|
parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
|
|
8683
8714
|
}
|
|
8684
8715
|
else {
|
|
@@ -8783,7 +8814,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8783
8814
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8784
8815
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8785
8816
|
}
|
|
8786
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8817
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8787
8818
|
instance.emit('hook:beforeMount');
|
|
8788
8819
|
}
|
|
8789
8820
|
toggleRecurse(instance, true);
|
|
@@ -8844,18 +8875,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8844
8875
|
const scopedInitialVNode = initialVNode;
|
|
8845
8876
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
8846
8877
|
}
|
|
8847
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8878
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8848
8879
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
8849
8880
|
}
|
|
8850
8881
|
// activated hook for keep-alive roots.
|
|
8851
8882
|
// #1742 activated hook must be accessed after first render
|
|
8852
8883
|
// since the hook may be injected by a child keep-alive
|
|
8853
|
-
if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8884
|
+
if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8854
8885
|
(parent &&
|
|
8855
8886
|
isAsyncWrapper(parent.vnode) &&
|
|
8856
|
-
parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8887
|
+
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8857
8888
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
8858
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8889
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8859
8890
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
8860
8891
|
}
|
|
8861
8892
|
}
|
|
@@ -8893,7 +8924,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8893
8924
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
8894
8925
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8895
8926
|
}
|
|
8896
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8927
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8897
8928
|
instance.emit('hook:beforeUpdate');
|
|
8898
8929
|
}
|
|
8899
8930
|
toggleRecurse(instance, true);
|
|
@@ -8933,7 +8964,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8933
8964
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
8934
8965
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
8935
8966
|
}
|
|
8936
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8967
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8937
8968
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
8938
8969
|
}
|
|
8939
8970
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
@@ -8973,7 +9004,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8973
9004
|
pauseTracking();
|
|
8974
9005
|
// props update may have triggered pre-flush watchers.
|
|
8975
9006
|
// flush them before the render update.
|
|
8976
|
-
flushPreFlushCbs(
|
|
9007
|
+
flushPreFlushCbs();
|
|
8977
9008
|
resetTracking();
|
|
8978
9009
|
};
|
|
8979
9010
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
|
|
@@ -8983,22 +9014,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8983
9014
|
const { patchFlag, shapeFlag } = n2;
|
|
8984
9015
|
// fast path
|
|
8985
9016
|
if (patchFlag > 0) {
|
|
8986
|
-
if (patchFlag & 128 /* KEYED_FRAGMENT */) {
|
|
9017
|
+
if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
|
|
8987
9018
|
// this could be either fully-keyed or mixed (some keyed some not)
|
|
8988
9019
|
// presence of patchFlag means children are guaranteed to be arrays
|
|
8989
9020
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8990
9021
|
return;
|
|
8991
9022
|
}
|
|
8992
|
-
else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
|
|
9023
|
+
else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
|
|
8993
9024
|
// unkeyed
|
|
8994
9025
|
patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8995
9026
|
return;
|
|
8996
9027
|
}
|
|
8997
9028
|
}
|
|
8998
9029
|
// children has 3 possibilities: text, array or no children.
|
|
8999
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
9030
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
9000
9031
|
// text children fast path
|
|
9001
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9032
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9002
9033
|
unmountChildren(c1, parentComponent, parentSuspense);
|
|
9003
9034
|
}
|
|
9004
9035
|
if (c2 !== c1) {
|
|
@@ -9006,9 +9037,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9006
9037
|
}
|
|
9007
9038
|
}
|
|
9008
9039
|
else {
|
|
9009
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9040
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9010
9041
|
// prev children was array
|
|
9011
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9042
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9012
9043
|
// two arrays, cannot assume anything, do full diff
|
|
9013
9044
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
9014
9045
|
}
|
|
@@ -9020,11 +9051,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9020
9051
|
else {
|
|
9021
9052
|
// prev children was text OR null
|
|
9022
9053
|
// new children is array OR null
|
|
9023
|
-
if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
9054
|
+
if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
9024
9055
|
hostSetElementText(container, '');
|
|
9025
9056
|
}
|
|
9026
9057
|
// mount new if array
|
|
9027
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9058
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9028
9059
|
mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
9029
9060
|
}
|
|
9030
9061
|
}
|
|
@@ -9215,7 +9246,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9215
9246
|
// There is no stable subsequence (e.g. a reverse)
|
|
9216
9247
|
// OR current node is not among the stable sequence
|
|
9217
9248
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
9218
|
-
move(nextChild, container, anchor, 2 /* REORDER */);
|
|
9249
|
+
move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
|
|
9219
9250
|
}
|
|
9220
9251
|
else {
|
|
9221
9252
|
j--;
|
|
@@ -9226,15 +9257,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9226
9257
|
};
|
|
9227
9258
|
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
9228
9259
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
9229
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9260
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9230
9261
|
move(vnode.component.subTree, container, anchor, moveType);
|
|
9231
9262
|
return;
|
|
9232
9263
|
}
|
|
9233
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9264
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9234
9265
|
vnode.suspense.move(container, anchor, moveType);
|
|
9235
9266
|
return;
|
|
9236
9267
|
}
|
|
9237
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9268
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9238
9269
|
type.move(vnode, container, anchor, internals);
|
|
9239
9270
|
return;
|
|
9240
9271
|
}
|
|
@@ -9251,11 +9282,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9251
9282
|
return;
|
|
9252
9283
|
}
|
|
9253
9284
|
// single nodes
|
|
9254
|
-
const needTransition = moveType !== 2 /* REORDER */ &&
|
|
9255
|
-
shapeFlag & 1 /* ELEMENT */ &&
|
|
9285
|
+
const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
|
|
9286
|
+
shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9256
9287
|
transition;
|
|
9257
9288
|
if (needTransition) {
|
|
9258
|
-
if (moveType === 0 /* ENTER */) {
|
|
9289
|
+
if (moveType === 0 /* MoveType.ENTER */) {
|
|
9259
9290
|
transition.beforeEnter(el);
|
|
9260
9291
|
hostInsert(el, container, anchor);
|
|
9261
9292
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9287,42 +9318,42 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9287
9318
|
if (ref != null) {
|
|
9288
9319
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
9289
9320
|
}
|
|
9290
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9321
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9291
9322
|
parentComponent.ctx.deactivate(vnode);
|
|
9292
9323
|
return;
|
|
9293
9324
|
}
|
|
9294
|
-
const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
|
|
9325
|
+
const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
|
|
9295
9326
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
9296
9327
|
let vnodeHook;
|
|
9297
9328
|
if (shouldInvokeVnodeHook &&
|
|
9298
9329
|
(vnodeHook = props && props.onVnodeBeforeUnmount)) {
|
|
9299
9330
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9300
9331
|
}
|
|
9301
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9332
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9302
9333
|
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
9303
9334
|
}
|
|
9304
9335
|
else {
|
|
9305
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9336
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9306
9337
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
9307
9338
|
return;
|
|
9308
9339
|
}
|
|
9309
9340
|
if (shouldInvokeDirs) {
|
|
9310
9341
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
|
|
9311
9342
|
}
|
|
9312
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9343
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9313
9344
|
vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
|
|
9314
9345
|
}
|
|
9315
9346
|
else if (dynamicChildren &&
|
|
9316
9347
|
// #1153: fast path should not be taken for non-stable (v-for) fragments
|
|
9317
9348
|
(type !== Fragment ||
|
|
9318
|
-
(patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
|
|
9349
|
+
(patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
|
|
9319
9350
|
// fast path for block nodes: only need to unmount dynamic children.
|
|
9320
9351
|
unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
9321
9352
|
}
|
|
9322
9353
|
else if ((type === Fragment &&
|
|
9323
9354
|
patchFlag &
|
|
9324
|
-
(128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
|
|
9325
|
-
(!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
|
|
9355
|
+
(128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
|
|
9356
|
+
(!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
|
|
9326
9357
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
9327
9358
|
}
|
|
9328
9359
|
if (doRemove) {
|
|
@@ -9344,7 +9375,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9344
9375
|
if (type === Fragment) {
|
|
9345
9376
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
9346
9377
|
vnode.patchFlag > 0 &&
|
|
9347
|
-
vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
|
|
9378
|
+
vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
|
|
9348
9379
|
transition &&
|
|
9349
9380
|
!transition.persisted) {
|
|
9350
9381
|
vnode.children.forEach(child => {
|
|
@@ -9371,7 +9402,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9371
9402
|
transition.afterLeave();
|
|
9372
9403
|
}
|
|
9373
9404
|
};
|
|
9374
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ &&
|
|
9405
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9375
9406
|
transition &&
|
|
9376
9407
|
!transition.persisted) {
|
|
9377
9408
|
const { leave, delayLeave } = transition;
|
|
@@ -9407,7 +9438,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9407
9438
|
if (bum) {
|
|
9408
9439
|
invokeArrayFns(bum);
|
|
9409
9440
|
}
|
|
9410
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9441
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9411
9442
|
instance.emit('hook:beforeDestroy');
|
|
9412
9443
|
}
|
|
9413
9444
|
// stop effects in component scope
|
|
@@ -9423,7 +9454,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9423
9454
|
if (um) {
|
|
9424
9455
|
queuePostRenderEffect(um, parentSuspense);
|
|
9425
9456
|
}
|
|
9426
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9457
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9427
9458
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9428
9459
|
}
|
|
9429
9460
|
queuePostRenderEffect(() => {
|
|
@@ -9453,10 +9484,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9453
9484
|
}
|
|
9454
9485
|
};
|
|
9455
9486
|
const getNextHostNode = vnode => {
|
|
9456
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */) {
|
|
9487
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9457
9488
|
return getNextHostNode(vnode.component.subTree);
|
|
9458
9489
|
}
|
|
9459
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
9490
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9460
9491
|
return vnode.suspense.next();
|
|
9461
9492
|
}
|
|
9462
9493
|
return hostNextSibling((vnode.anchor || vnode.el));
|
|
@@ -9470,6 +9501,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9470
9501
|
else {
|
|
9471
9502
|
patch(container._vnode || null, vnode, container, null, null, null, isSVG);
|
|
9472
9503
|
}
|
|
9504
|
+
flushPreFlushCbs();
|
|
9473
9505
|
flushPostFlushCbs();
|
|
9474
9506
|
container._vnode = vnode;
|
|
9475
9507
|
};
|
|
@@ -9519,8 +9551,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9519
9551
|
// guaranteed to be vnodes
|
|
9520
9552
|
const c1 = ch1[i];
|
|
9521
9553
|
let c2 = ch2[i];
|
|
9522
|
-
if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
|
|
9523
|
-
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
|
|
9554
|
+
if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
|
|
9555
|
+
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
9524
9556
|
c2 = ch2[i] = cloneIfMounted(ch2[i]);
|
|
9525
9557
|
c2.el = c1.el;
|
|
9526
9558
|
}
|
|
@@ -9644,7 +9676,7 @@ const TeleportImpl = {
|
|
|
9644
9676
|
const mount = (container, anchor) => {
|
|
9645
9677
|
// Teleport *always* has Array children. This is enforced in both the
|
|
9646
9678
|
// compiler and vnode children normalization.
|
|
9647
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9679
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9648
9680
|
mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
9649
9681
|
}
|
|
9650
9682
|
};
|
|
@@ -9680,7 +9712,7 @@ const TeleportImpl = {
|
|
|
9680
9712
|
if (!wasDisabled) {
|
|
9681
9713
|
// enabled -> disabled
|
|
9682
9714
|
// move into main container
|
|
9683
|
-
moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
|
|
9715
|
+
moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9684
9716
|
}
|
|
9685
9717
|
}
|
|
9686
9718
|
else {
|
|
@@ -9688,7 +9720,7 @@ const TeleportImpl = {
|
|
|
9688
9720
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
9689
9721
|
const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
|
|
9690
9722
|
if (nextTarget) {
|
|
9691
|
-
moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
|
|
9723
|
+
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9692
9724
|
}
|
|
9693
9725
|
else if ((process.env.NODE_ENV !== 'production')) {
|
|
9694
9726
|
warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
@@ -9697,7 +9729,7 @@ const TeleportImpl = {
|
|
|
9697
9729
|
else if (wasDisabled) {
|
|
9698
9730
|
// disabled -> enabled
|
|
9699
9731
|
// move into teleport target
|
|
9700
|
-
moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
|
|
9732
|
+
moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9701
9733
|
}
|
|
9702
9734
|
}
|
|
9703
9735
|
}
|
|
@@ -9710,7 +9742,7 @@ const TeleportImpl = {
|
|
|
9710
9742
|
// an unmounted teleport should always remove its children if not disabled
|
|
9711
9743
|
if (doRemove || !isTeleportDisabled(props)) {
|
|
9712
9744
|
hostRemove(anchor);
|
|
9713
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9745
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9714
9746
|
for (let i = 0; i < children.length; i++) {
|
|
9715
9747
|
const child = children[i];
|
|
9716
9748
|
unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
|
|
@@ -9721,13 +9753,13 @@ const TeleportImpl = {
|
|
|
9721
9753
|
move: moveTeleport,
|
|
9722
9754
|
hydrate: hydrateTeleport
|
|
9723
9755
|
};
|
|
9724
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
|
|
9756
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
|
|
9725
9757
|
// move target anchor if this is a target change.
|
|
9726
|
-
if (moveType === 0 /* TARGET_CHANGE */) {
|
|
9758
|
+
if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
|
|
9727
9759
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9728
9760
|
}
|
|
9729
9761
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9730
|
-
const isReorder = moveType === 2 /* REORDER */;
|
|
9762
|
+
const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
|
|
9731
9763
|
// move main view anchor if this is a re-order.
|
|
9732
9764
|
if (isReorder) {
|
|
9733
9765
|
insert(el, container, parentAnchor);
|
|
@@ -9737,9 +9769,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9737
9769
|
// is not a reorder, or the teleport is disabled
|
|
9738
9770
|
if (!isReorder || isTeleportDisabled(props)) {
|
|
9739
9771
|
// Teleport has either Array children or no children.
|
|
9740
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9772
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9741
9773
|
for (let i = 0; i < children.length; i++) {
|
|
9742
|
-
move(children[i], container, parentAnchor, 2 /* REORDER */);
|
|
9774
|
+
move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
|
|
9743
9775
|
}
|
|
9744
9776
|
}
|
|
9745
9777
|
}
|
|
@@ -9754,7 +9786,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9754
9786
|
// if multiple teleports rendered to the same target element, we need to
|
|
9755
9787
|
// pick up from where the last teleport finished instead of the first node
|
|
9756
9788
|
const targetNode = target._lpa || target.firstChild;
|
|
9757
|
-
if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9789
|
+
if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9758
9790
|
if (isTeleportDisabled(vnode.props)) {
|
|
9759
9791
|
vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9760
9792
|
vnode.targetAnchor = targetNode;
|
|
@@ -9831,7 +9863,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9831
9863
|
}
|
|
9832
9864
|
// 2.x async component
|
|
9833
9865
|
if (isFunction(comp) &&
|
|
9834
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* COMPONENT_ASYNC */, instance, comp)) {
|
|
9866
|
+
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9835
9867
|
// since after disabling this, plain functions are still valid usage, do not
|
|
9836
9868
|
// use softAssert here.
|
|
9837
9869
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -9839,7 +9871,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9839
9871
|
// 2.x functional component
|
|
9840
9872
|
if (isObject(comp) &&
|
|
9841
9873
|
comp.functional &&
|
|
9842
|
-
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9874
|
+
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9843
9875
|
return convertLegacyFunctionalComponent(comp);
|
|
9844
9876
|
}
|
|
9845
9877
|
return comp;
|
|
@@ -9937,7 +9969,7 @@ function isVNode(value) {
|
|
|
9937
9969
|
}
|
|
9938
9970
|
function isSameVNodeType(n1, n2) {
|
|
9939
9971
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
9940
|
-
n2.shapeFlag & 6 /* COMPONENT */ &&
|
|
9972
|
+
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
9941
9973
|
hmrDirtyComponents.has(n2.type)) {
|
|
9942
9974
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
9943
9975
|
return false;
|
|
@@ -9968,7 +10000,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
|
9968
10000
|
: ref
|
|
9969
10001
|
: null);
|
|
9970
10002
|
};
|
|
9971
|
-
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
10003
|
+
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9972
10004
|
const vnode = {
|
|
9973
10005
|
__v_isVNode: true,
|
|
9974
10006
|
__v_skip: true,
|
|
@@ -9999,7 +10031,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9999
10031
|
if (needFullChildrenNormalization) {
|
|
10000
10032
|
normalizeChildren(vnode, children);
|
|
10001
10033
|
// normalize suspense children
|
|
10002
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
10034
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
10003
10035
|
type.normalize(vnode);
|
|
10004
10036
|
}
|
|
10005
10037
|
}
|
|
@@ -10007,8 +10039,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10007
10039
|
// compiled element vnode - if children is passed, only possible types are
|
|
10008
10040
|
// string or Array.
|
|
10009
10041
|
vnode.shapeFlag |= isString(children)
|
|
10010
|
-
? 8 /* TEXT_CHILDREN */
|
|
10011
|
-
: 16 /* ARRAY_CHILDREN */;
|
|
10042
|
+
? 8 /* ShapeFlags.TEXT_CHILDREN */
|
|
10043
|
+
: 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10012
10044
|
}
|
|
10013
10045
|
// validate key
|
|
10014
10046
|
if ((process.env.NODE_ENV !== 'production') && vnode.key !== vnode.key) {
|
|
@@ -10024,10 +10056,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10024
10056
|
// component nodes also should always be patched, because even if the
|
|
10025
10057
|
// component doesn't need to update, it needs to persist the instance on to
|
|
10026
10058
|
// the next vnode so that it can be properly unmounted later.
|
|
10027
|
-
(vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
|
|
10059
|
+
(vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
|
|
10028
10060
|
// the EVENTS flag is only for hydration and if it is the only flag, the
|
|
10029
10061
|
// vnode should not be considered dynamic due to handler caching.
|
|
10030
|
-
vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
|
|
10062
|
+
vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
10031
10063
|
currentBlock.push(vnode);
|
|
10032
10064
|
}
|
|
10033
10065
|
{
|
|
@@ -10053,14 +10085,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10053
10085
|
normalizeChildren(cloned, children);
|
|
10054
10086
|
}
|
|
10055
10087
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
10056
|
-
if (cloned.shapeFlag & 6 /* COMPONENT */) {
|
|
10088
|
+
if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
10057
10089
|
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
10058
10090
|
}
|
|
10059
10091
|
else {
|
|
10060
10092
|
currentBlock.push(cloned);
|
|
10061
10093
|
}
|
|
10062
10094
|
}
|
|
10063
|
-
cloned.patchFlag |= -2 /* BAIL */;
|
|
10095
|
+
cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
|
|
10064
10096
|
return cloned;
|
|
10065
10097
|
}
|
|
10066
10098
|
// class component normalization.
|
|
@@ -10090,17 +10122,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
10090
10122
|
}
|
|
10091
10123
|
// encode the vnode type information into a bitmap
|
|
10092
10124
|
const shapeFlag = isString(type)
|
|
10093
|
-
? 1 /* ELEMENT */
|
|
10125
|
+
? 1 /* ShapeFlags.ELEMENT */
|
|
10094
10126
|
: isSuspense(type)
|
|
10095
|
-
? 128 /* SUSPENSE */
|
|
10127
|
+
? 128 /* ShapeFlags.SUSPENSE */
|
|
10096
10128
|
: isTeleport(type)
|
|
10097
|
-
? 64 /* TELEPORT */
|
|
10129
|
+
? 64 /* ShapeFlags.TELEPORT */
|
|
10098
10130
|
: isObject(type)
|
|
10099
|
-
? 4 /* STATEFUL_COMPONENT */
|
|
10131
|
+
? 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
10100
10132
|
: isFunction(type)
|
|
10101
|
-
? 2 /* FUNCTIONAL_COMPONENT */
|
|
10133
|
+
? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
|
|
10102
10134
|
: 0;
|
|
10103
|
-
if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10135
|
+
if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10104
10136
|
type = toRaw(type);
|
|
10105
10137
|
warn$1(`Vue received a Component which was made a reactive object. This can ` +
|
|
10106
10138
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
@@ -10139,7 +10171,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10139
10171
|
: ref,
|
|
10140
10172
|
scopeId: vnode.scopeId,
|
|
10141
10173
|
slotScopeIds: vnode.slotScopeIds,
|
|
10142
|
-
children: (process.env.NODE_ENV !== 'production') && patchFlag === -1 /* HOISTED */ && isArray(children)
|
|
10174
|
+
children: (process.env.NODE_ENV !== 'production') && patchFlag === -1 /* PatchFlags.HOISTED */ && isArray(children)
|
|
10143
10175
|
? children.map(deepCloneVNode)
|
|
10144
10176
|
: children,
|
|
10145
10177
|
target: vnode.target,
|
|
@@ -10152,8 +10184,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10152
10184
|
// fast paths only.
|
|
10153
10185
|
patchFlag: extraProps && vnode.type !== Fragment
|
|
10154
10186
|
? patchFlag === -1 // hoisted node
|
|
10155
|
-
? 16 /* FULL_PROPS */
|
|
10156
|
-
: patchFlag | 16 /* FULL_PROPS */
|
|
10187
|
+
? 16 /* PatchFlags.FULL_PROPS */
|
|
10188
|
+
: patchFlag | 16 /* PatchFlags.FULL_PROPS */
|
|
10157
10189
|
: patchFlag,
|
|
10158
10190
|
dynamicProps: vnode.dynamicProps,
|
|
10159
10191
|
dynamicChildren: vnode.dynamicChildren,
|
|
@@ -10246,10 +10278,10 @@ function normalizeChildren(vnode, children) {
|
|
|
10246
10278
|
children = null;
|
|
10247
10279
|
}
|
|
10248
10280
|
else if (isArray(children)) {
|
|
10249
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10281
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10250
10282
|
}
|
|
10251
10283
|
else if (typeof children === 'object') {
|
|
10252
|
-
if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
|
|
10284
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
|
|
10253
10285
|
// Normalize slot to plain children for plain element and Teleport
|
|
10254
10286
|
const slot = children.default;
|
|
10255
10287
|
if (slot) {
|
|
@@ -10261,37 +10293,37 @@ function normalizeChildren(vnode, children) {
|
|
|
10261
10293
|
return;
|
|
10262
10294
|
}
|
|
10263
10295
|
else {
|
|
10264
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10296
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10265
10297
|
const slotFlag = children._;
|
|
10266
10298
|
if (!slotFlag && !(InternalObjectKey in children)) {
|
|
10267
10299
|
children._ctx = currentRenderingInstance;
|
|
10268
10300
|
}
|
|
10269
|
-
else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
|
|
10301
|
+
else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
|
|
10270
10302
|
// a child component receives forwarded slots from the parent.
|
|
10271
10303
|
// its slot type is determined by its parent's slot type.
|
|
10272
|
-
if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
|
|
10273
|
-
children._ = 1 /* STABLE */;
|
|
10304
|
+
if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
|
|
10305
|
+
children._ = 1 /* SlotFlags.STABLE */;
|
|
10274
10306
|
}
|
|
10275
10307
|
else {
|
|
10276
|
-
children._ = 2 /* DYNAMIC */;
|
|
10277
|
-
vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
|
|
10308
|
+
children._ = 2 /* SlotFlags.DYNAMIC */;
|
|
10309
|
+
vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
10278
10310
|
}
|
|
10279
10311
|
}
|
|
10280
10312
|
}
|
|
10281
10313
|
}
|
|
10282
10314
|
else if (isFunction(children)) {
|
|
10283
10315
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
10284
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10316
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10285
10317
|
}
|
|
10286
10318
|
else {
|
|
10287
10319
|
children = String(children);
|
|
10288
10320
|
// force teleport children to array so it can be moved around
|
|
10289
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
10290
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10321
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
10322
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10291
10323
|
children = [createTextVNode(children)];
|
|
10292
10324
|
}
|
|
10293
10325
|
else {
|
|
10294
|
-
type = 8 /* TEXT_CHILDREN */;
|
|
10326
|
+
type = 8 /* ShapeFlags.TEXT_CHILDREN */;
|
|
10295
10327
|
}
|
|
10296
10328
|
}
|
|
10297
10329
|
vnode.children = children;
|
|
@@ -10329,7 +10361,7 @@ function mergeProps(...args) {
|
|
|
10329
10361
|
return ret;
|
|
10330
10362
|
}
|
|
10331
10363
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
10332
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
10364
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
|
|
10333
10365
|
vnode,
|
|
10334
10366
|
prevVNode
|
|
10335
10367
|
]);
|
|
@@ -10440,7 +10472,7 @@ function validateComponentName(name, config) {
|
|
|
10440
10472
|
}
|
|
10441
10473
|
}
|
|
10442
10474
|
function isStatefulComponent(instance) {
|
|
10443
|
-
return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
|
|
10475
|
+
return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
|
|
10444
10476
|
}
|
|
10445
10477
|
let isInSSRComponentSetup = false;
|
|
10446
10478
|
function setupComponent(instance, isSSR = false) {
|
|
@@ -10495,7 +10527,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10495
10527
|
setup.length > 1 ? createSetupContext(instance) : null);
|
|
10496
10528
|
setCurrentInstance(instance);
|
|
10497
10529
|
pauseTracking();
|
|
10498
|
-
const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);
|
|
10530
|
+
const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);
|
|
10499
10531
|
resetTracking();
|
|
10500
10532
|
unsetCurrentInstance();
|
|
10501
10533
|
if (isPromise(setupResult)) {
|
|
@@ -10507,7 +10539,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10507
10539
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10508
10540
|
})
|
|
10509
10541
|
.catch(e => {
|
|
10510
|
-
handleError(e, instance, 0 /* SETUP_FUNCTION */);
|
|
10542
|
+
handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
10511
10543
|
});
|
|
10512
10544
|
}
|
|
10513
10545
|
else {
|
|
@@ -10595,7 +10627,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10595
10627
|
if (!isSSR && compile && !Component.render) {
|
|
10596
10628
|
const template = (instance.vnode.props &&
|
|
10597
10629
|
instance.vnode.props['inline-template']) ||
|
|
10598
|
-
Component.template
|
|
10630
|
+
Component.template ||
|
|
10631
|
+
resolveMergedOptions(instance).template;
|
|
10599
10632
|
if (template) {
|
|
10600
10633
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
10601
10634
|
startMeasure(instance, `compile`);
|
|
@@ -10610,6 +10643,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10610
10643
|
// pass runtime compat config into the compiler
|
|
10611
10644
|
finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
|
|
10612
10645
|
if (Component.compatConfig) {
|
|
10646
|
+
// @ts-expect-error types are not compatible
|
|
10613
10647
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10614
10648
|
}
|
|
10615
10649
|
}
|
|
@@ -10655,7 +10689,7 @@ function createAttrsProxy(instance) {
|
|
|
10655
10689
|
? {
|
|
10656
10690
|
get(target, key) {
|
|
10657
10691
|
markAttrsAccessed();
|
|
10658
|
-
track(instance, "get" /* GET */, '$attrs');
|
|
10692
|
+
track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
|
|
10659
10693
|
return target[key];
|
|
10660
10694
|
},
|
|
10661
10695
|
set() {
|
|
@@ -10669,7 +10703,7 @@ function createAttrsProxy(instance) {
|
|
|
10669
10703
|
}
|
|
10670
10704
|
: {
|
|
10671
10705
|
get(target, key) {
|
|
10672
|
-
track(instance, "get" /* GET */, '$attrs');
|
|
10706
|
+
track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
|
|
10673
10707
|
return target[key];
|
|
10674
10708
|
}
|
|
10675
10709
|
});
|
|
@@ -10726,10 +10760,10 @@ function getExposeProxy(instance) {
|
|
|
10726
10760
|
}
|
|
10727
10761
|
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
10728
10762
|
const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
|
|
10729
|
-
function getComponentName(Component) {
|
|
10763
|
+
function getComponentName(Component, includeInferred = true) {
|
|
10730
10764
|
return isFunction(Component)
|
|
10731
10765
|
? Component.displayName || Component.name
|
|
10732
|
-
: Component.name;
|
|
10766
|
+
: Component.name || (includeInferred && Component.__name);
|
|
10733
10767
|
}
|
|
10734
10768
|
/* istanbul ignore next */
|
|
10735
10769
|
function formatComponentName(instance, Component, isRoot = false) {
|
|
@@ -11173,7 +11207,7 @@ function isMemoSame(cached, memo) {
|
|
|
11173
11207
|
}
|
|
11174
11208
|
|
|
11175
11209
|
// Core API ------------------------------------------------------------------
|
|
11176
|
-
const version = "3.2.
|
|
11210
|
+
const version = "3.2.39";
|
|
11177
11211
|
const _ssrUtils = {
|
|
11178
11212
|
createComponentInstance,
|
|
11179
11213
|
setupComponent,
|
|
@@ -11183,7 +11217,7 @@ const _ssrUtils = {
|
|
|
11183
11217
|
normalizeVNode
|
|
11184
11218
|
};
|
|
11185
11219
|
/**
|
|
11186
|
-
* SSR utils for \@vue/server-renderer. Only exposed in
|
|
11220
|
+
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11187
11221
|
* @internal
|
|
11188
11222
|
*/
|
|
11189
11223
|
const ssrUtils = (_ssrUtils );
|
|
@@ -11431,14 +11465,14 @@ function compatCoerceAttr(el, key, value, instance = null) {
|
|
|
11431
11465
|
? 'true'
|
|
11432
11466
|
: null;
|
|
11433
11467
|
if (v2CocercedValue &&
|
|
11434
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11468
|
+
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11435
11469
|
el.setAttribute(key, v2CocercedValue);
|
|
11436
11470
|
return true;
|
|
11437
11471
|
}
|
|
11438
11472
|
}
|
|
11439
11473
|
else if (value === false &&
|
|
11440
11474
|
!isSpecialBooleanAttr(key) &&
|
|
11441
|
-
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, instance, key)) {
|
|
11475
|
+
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, instance, key)) {
|
|
11442
11476
|
el.removeAttribute(key);
|
|
11443
11477
|
return true;
|
|
11444
11478
|
}
|
|
@@ -11500,11 +11534,11 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11500
11534
|
}
|
|
11501
11535
|
else {
|
|
11502
11536
|
if (value === false &&
|
|
11503
|
-
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11537
|
+
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11504
11538
|
const type = typeof el[key];
|
|
11505
11539
|
if (type === 'string' || type === 'number') {
|
|
11506
11540
|
(process.env.NODE_ENV !== 'production') &&
|
|
11507
|
-
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11541
|
+
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11508
11542
|
value = type === 'number' ? 0 : '';
|
|
11509
11543
|
needRemove = true;
|
|
11510
11544
|
}
|
|
@@ -11594,7 +11628,8 @@ function parseName(name) {
|
|
|
11594
11628
|
options[m[0].toLowerCase()] = true;
|
|
11595
11629
|
}
|
|
11596
11630
|
}
|
|
11597
|
-
|
|
11631
|
+
const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
|
|
11632
|
+
return [event, options];
|
|
11598
11633
|
}
|
|
11599
11634
|
function createInvoker(initialValue, instance) {
|
|
11600
11635
|
const invoker = (e) => {
|
|
@@ -11606,7 +11641,7 @@ function createInvoker(initialValue, instance) {
|
|
|
11606
11641
|
// AFTER it was attached.
|
|
11607
11642
|
const timeStamp = e.timeStamp || _getNow();
|
|
11608
11643
|
if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
|
|
11609
|
-
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
|
|
11644
|
+
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* ErrorCodes.NATIVE_EVENT_HANDLER */, [e]);
|
|
11610
11645
|
}
|
|
11611
11646
|
};
|
|
11612
11647
|
invoker.value = initialValue;
|
|
@@ -11963,7 +11998,7 @@ function useCssVars(getter) {
|
|
|
11963
11998
|
});
|
|
11964
11999
|
}
|
|
11965
12000
|
function setVarsOnVNode(vnode, vars) {
|
|
11966
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
12001
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
11967
12002
|
const suspense = vnode.suspense;
|
|
11968
12003
|
vnode = suspense.activeBranch;
|
|
11969
12004
|
if (suspense.pendingBranch && !suspense.isHydrating) {
|
|
@@ -11976,7 +12011,7 @@ function setVarsOnVNode(vnode, vars) {
|
|
|
11976
12011
|
while (vnode.component) {
|
|
11977
12012
|
vnode = vnode.component.subTree;
|
|
11978
12013
|
}
|
|
11979
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {
|
|
12014
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && vnode.el) {
|
|
11980
12015
|
setVarsOnNode(vnode.el, vars);
|
|
11981
12016
|
}
|
|
11982
12017
|
else if (vnode.type === Fragment) {
|
|
@@ -12065,7 +12100,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12065
12100
|
}
|
|
12066
12101
|
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;
|
|
12067
12102
|
// legacy transition class compat
|
|
12068
|
-
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* TRANSITION_CLASSES */, null);
|
|
12103
|
+
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */, null);
|
|
12069
12104
|
let legacyEnterFromClass;
|
|
12070
12105
|
let legacyAppearFromClass;
|
|
12071
12106
|
let legacyLeaveFromClass;
|
|
@@ -12375,7 +12410,7 @@ const TransitionGroupImpl = {
|
|
|
12375
12410
|
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
12376
12411
|
let tag = rawProps.tag || Fragment;
|
|
12377
12412
|
if (!rawProps.tag &&
|
|
12378
|
-
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12413
|
+
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12379
12414
|
tag = 'span';
|
|
12380
12415
|
}
|
|
12381
12416
|
prevChildren = children;
|
|
@@ -12782,13 +12817,13 @@ const withKeys = (fn, modifiers) => {
|
|
|
12782
12817
|
let instance = null;
|
|
12783
12818
|
{
|
|
12784
12819
|
instance = getCurrentInstance();
|
|
12785
|
-
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */, instance)) {
|
|
12820
|
+
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */, instance)) {
|
|
12786
12821
|
if (instance) {
|
|
12787
12822
|
globalKeyCodes = instance.appContext.config.keyCodes;
|
|
12788
12823
|
}
|
|
12789
12824
|
}
|
|
12790
12825
|
if ((process.env.NODE_ENV !== 'production') && modifiers.some(m => /^\d+$/.test(m))) {
|
|
12791
|
-
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance);
|
|
12826
|
+
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance);
|
|
12792
12827
|
}
|
|
12793
12828
|
}
|
|
12794
12829
|
return (event) => {
|
|
@@ -12801,7 +12836,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
12801
12836
|
}
|
|
12802
12837
|
{
|
|
12803
12838
|
const keyCode = String(event.keyCode);
|
|
12804
|
-
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12839
|
+
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12805
12840
|
modifiers.some(mod => mod == keyCode)) {
|
|
12806
12841
|
return fn(event);
|
|
12807
12842
|
}
|
|
@@ -12919,7 +12954,7 @@ const createApp = ((...args) => {
|
|
|
12919
12954
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
12920
12955
|
const attr = container.attributes[i];
|
|
12921
12956
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
12922
|
-
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
12957
|
+
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
12923
12958
|
break;
|
|
12924
12959
|
}
|
|
12925
12960
|
}
|
|
@@ -13181,7 +13216,7 @@ if ((process.env.NODE_ENV !== 'production')) {
|
|
|
13181
13216
|
function wrappedCreateApp(...args) {
|
|
13182
13217
|
// @ts-ignore
|
|
13183
13218
|
const app = createApp(...args);
|
|
13184
|
-
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, null)) {
|
|
13219
|
+
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, null)) {
|
|
13185
13220
|
// register built-in components so that they can be resolved via strings
|
|
13186
13221
|
// in the legacy h() call. The __compat__ prefix is to ensure that v3 h()
|
|
13187
13222
|
// doesn't get affected.
|