@vue/compat 3.2.37 → 3.2.38
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 +1164 -1122
- package/dist/vue.cjs.prod.js +973 -937
- package/dist/vue.esm-browser.js +1106 -1064
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +1110 -1070
- package/dist/vue.global.js +1106 -1064
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +531 -502
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +535 -508
- package/dist/vue.runtime.global.js +531 -502
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
|
@@ -638,7 +638,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
640
|
let deps = [];
|
|
641
|
-
if (type === "clear" /* CLEAR */) {
|
|
641
|
+
if (type === "clear" /* TriggerOpTypes.CLEAR */) {
|
|
642
642
|
// collection being cleared
|
|
643
643
|
// trigger all effects for target
|
|
644
644
|
deps = [...depsMap.values()];
|
|
@@ -657,7 +657,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
657
657
|
}
|
|
658
658
|
// also run for iteration key on ADD | DELETE | Map.SET
|
|
659
659
|
switch (type) {
|
|
660
|
-
case "add" /* ADD */:
|
|
660
|
+
case "add" /* TriggerOpTypes.ADD */:
|
|
661
661
|
if (!isArray(target)) {
|
|
662
662
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
663
663
|
if (isMap(target)) {
|
|
@@ -669,7 +669,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
669
669
|
deps.push(depsMap.get('length'));
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
|
-
case "delete" /* DELETE */:
|
|
672
|
+
case "delete" /* TriggerOpTypes.DELETE */:
|
|
673
673
|
if (!isArray(target)) {
|
|
674
674
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
675
675
|
if (isMap(target)) {
|
|
@@ -677,7 +677,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
break;
|
|
680
|
-
case "set" /* SET */:
|
|
680
|
+
case "set" /* TriggerOpTypes.SET */:
|
|
681
681
|
if (isMap(target)) {
|
|
682
682
|
deps.push(depsMap.get(ITERATE_KEY));
|
|
683
683
|
}
|
|
@@ -754,7 +754,7 @@ function createArrayInstrumentations() {
|
|
|
754
754
|
instrumentations[key] = function (...args) {
|
|
755
755
|
const arr = toRaw(this);
|
|
756
756
|
for (let i = 0, l = this.length; i < l; i++) {
|
|
757
|
-
track(arr, "get" /* GET */, i + '');
|
|
757
|
+
track(arr, "get" /* TrackOpTypes.GET */, i + '');
|
|
758
758
|
}
|
|
759
759
|
// we run the method using the original args first (which may be reactive)
|
|
760
760
|
const res = arr[key](...args);
|
|
@@ -779,16 +779,16 @@ function createArrayInstrumentations() {
|
|
|
779
779
|
}
|
|
780
780
|
function createGetter(isReadonly = false, shallow = false) {
|
|
781
781
|
return function get(target, key, receiver) {
|
|
782
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
782
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
783
783
|
return !isReadonly;
|
|
784
784
|
}
|
|
785
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
785
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
786
786
|
return isReadonly;
|
|
787
787
|
}
|
|
788
|
-
else if (key === "__v_isShallow" /* IS_SHALLOW */) {
|
|
788
|
+
else if (key === "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */) {
|
|
789
789
|
return shallow;
|
|
790
790
|
}
|
|
791
|
-
else if (key === "__v_raw" /* RAW */ &&
|
|
791
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */ &&
|
|
792
792
|
receiver ===
|
|
793
793
|
(isReadonly
|
|
794
794
|
? shallow
|
|
@@ -808,7 +808,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
808
808
|
return res;
|
|
809
809
|
}
|
|
810
810
|
if (!isReadonly) {
|
|
811
|
-
track(target, "get" /* GET */, key);
|
|
811
|
+
track(target, "get" /* TrackOpTypes.GET */, key);
|
|
812
812
|
}
|
|
813
813
|
if (shallow) {
|
|
814
814
|
return res;
|
|
@@ -834,10 +834,10 @@ function createSetter(shallow = false) {
|
|
|
834
834
|
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
835
835
|
return false;
|
|
836
836
|
}
|
|
837
|
-
if (!shallow
|
|
838
|
-
if (!isShallow(value)) {
|
|
839
|
-
value = toRaw(value);
|
|
837
|
+
if (!shallow) {
|
|
838
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
840
839
|
oldValue = toRaw(oldValue);
|
|
840
|
+
value = toRaw(value);
|
|
841
841
|
}
|
|
842
842
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
843
843
|
oldValue.value = value;
|
|
@@ -851,10 +851,10 @@ function createSetter(shallow = false) {
|
|
|
851
851
|
// don't trigger if target is something up in the prototype chain of original
|
|
852
852
|
if (target === toRaw(receiver)) {
|
|
853
853
|
if (!hadKey) {
|
|
854
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
854
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
855
855
|
}
|
|
856
856
|
else if (hasChanged(value, oldValue)) {
|
|
857
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
857
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
return result;
|
|
@@ -865,19 +865,19 @@ function deleteProperty(target, key) {
|
|
|
865
865
|
const oldValue = target[key];
|
|
866
866
|
const result = Reflect.deleteProperty(target, key);
|
|
867
867
|
if (result && hadKey) {
|
|
868
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
868
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
869
869
|
}
|
|
870
870
|
return result;
|
|
871
871
|
}
|
|
872
872
|
function has(target, key) {
|
|
873
873
|
const result = Reflect.has(target, key);
|
|
874
874
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
875
|
-
track(target, "has" /* HAS */, key);
|
|
875
|
+
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
876
876
|
}
|
|
877
877
|
return result;
|
|
878
878
|
}
|
|
879
879
|
function ownKeys(target) {
|
|
880
|
-
track(target, "iterate" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
880
|
+
track(target, "iterate" /* TrackOpTypes.ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
|
|
881
881
|
return Reflect.ownKeys(target);
|
|
882
882
|
}
|
|
883
883
|
const mutableHandlers = {
|
|
@@ -918,14 +918,14 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
|
918
918
|
function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
919
919
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
920
920
|
// of the value
|
|
921
|
-
target = target["__v_raw" /* RAW */];
|
|
921
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
922
922
|
const rawTarget = toRaw(target);
|
|
923
923
|
const rawKey = toRaw(key);
|
|
924
924
|
if (!isReadonly) {
|
|
925
925
|
if (key !== rawKey) {
|
|
926
|
-
track(rawTarget, "get" /* GET */, key);
|
|
926
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, key);
|
|
927
927
|
}
|
|
928
|
-
track(rawTarget, "get" /* GET */, rawKey);
|
|
928
|
+
track(rawTarget, "get" /* TrackOpTypes.GET */, rawKey);
|
|
929
929
|
}
|
|
930
930
|
const { has } = getProto(rawTarget);
|
|
931
931
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
@@ -942,22 +942,22 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
function has$1(key, isReadonly = false) {
|
|
945
|
-
const target = this["__v_raw" /* RAW */];
|
|
945
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
946
946
|
const rawTarget = toRaw(target);
|
|
947
947
|
const rawKey = toRaw(key);
|
|
948
948
|
if (!isReadonly) {
|
|
949
949
|
if (key !== rawKey) {
|
|
950
|
-
track(rawTarget, "has" /* HAS */, key);
|
|
950
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, key);
|
|
951
951
|
}
|
|
952
|
-
track(rawTarget, "has" /* HAS */, rawKey);
|
|
952
|
+
track(rawTarget, "has" /* TrackOpTypes.HAS */, rawKey);
|
|
953
953
|
}
|
|
954
954
|
return key === rawKey
|
|
955
955
|
? target.has(key)
|
|
956
956
|
: target.has(key) || target.has(rawKey);
|
|
957
957
|
}
|
|
958
958
|
function size(target, isReadonly = false) {
|
|
959
|
-
target = target["__v_raw" /* RAW */];
|
|
960
|
-
!isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
|
|
959
|
+
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
960
|
+
!isReadonly && track(toRaw(target), "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
961
961
|
return Reflect.get(target, 'size', target);
|
|
962
962
|
}
|
|
963
963
|
function add(value) {
|
|
@@ -967,7 +967,7 @@ function add(value) {
|
|
|
967
967
|
const hadKey = proto.has.call(target, value);
|
|
968
968
|
if (!hadKey) {
|
|
969
969
|
target.add(value);
|
|
970
|
-
trigger(target, "add" /* ADD */, value, value);
|
|
970
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, value, value);
|
|
971
971
|
}
|
|
972
972
|
return this;
|
|
973
973
|
}
|
|
@@ -986,10 +986,10 @@ function set$1(key, value) {
|
|
|
986
986
|
const oldValue = get.call(target, key);
|
|
987
987
|
target.set(key, value);
|
|
988
988
|
if (!hadKey) {
|
|
989
|
-
trigger(target, "add" /* ADD */, key, value);
|
|
989
|
+
trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
|
|
990
990
|
}
|
|
991
991
|
else if (hasChanged(value, oldValue)) {
|
|
992
|
-
trigger(target, "set" /* SET */, key, value, oldValue);
|
|
992
|
+
trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
|
|
993
993
|
}
|
|
994
994
|
return this;
|
|
995
995
|
}
|
|
@@ -1008,7 +1008,7 @@ function deleteEntry(key) {
|
|
|
1008
1008
|
// forward the operation before queueing reactions
|
|
1009
1009
|
const result = target.delete(key);
|
|
1010
1010
|
if (hadKey) {
|
|
1011
|
-
trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
|
|
1011
|
+
trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
|
|
1012
1012
|
}
|
|
1013
1013
|
return result;
|
|
1014
1014
|
}
|
|
@@ -1022,17 +1022,17 @@ function clear() {
|
|
|
1022
1022
|
// forward the operation before queueing reactions
|
|
1023
1023
|
const result = target.clear();
|
|
1024
1024
|
if (hadItems) {
|
|
1025
|
-
trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
|
|
1025
|
+
trigger(target, "clear" /* TriggerOpTypes.CLEAR */, undefined, undefined, oldTarget);
|
|
1026
1026
|
}
|
|
1027
1027
|
return result;
|
|
1028
1028
|
}
|
|
1029
1029
|
function createForEach(isReadonly, isShallow) {
|
|
1030
1030
|
return function forEach(callback, thisArg) {
|
|
1031
1031
|
const observed = this;
|
|
1032
|
-
const target = observed["__v_raw" /* RAW */];
|
|
1032
|
+
const target = observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1033
1033
|
const rawTarget = toRaw(target);
|
|
1034
1034
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1035
|
-
!isReadonly && track(rawTarget, "iterate" /* ITERATE */, ITERATE_KEY);
|
|
1035
|
+
!isReadonly && track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
|
|
1036
1036
|
return target.forEach((value, key) => {
|
|
1037
1037
|
// important: make sure the callback is
|
|
1038
1038
|
// 1. invoked with the reactive map as `this` and 3rd arg
|
|
@@ -1043,7 +1043,7 @@ function createForEach(isReadonly, isShallow) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
function createIterableMethod(method, isReadonly, isShallow) {
|
|
1045
1045
|
return function (...args) {
|
|
1046
|
-
const target = this["__v_raw" /* RAW */];
|
|
1046
|
+
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
1047
1047
|
const rawTarget = toRaw(target);
|
|
1048
1048
|
const targetIsMap = isMap(rawTarget);
|
|
1049
1049
|
const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
|
|
@@ -1051,7 +1051,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
|
|
|
1051
1051
|
const innerIterator = target[method](...args);
|
|
1052
1052
|
const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
|
|
1053
1053
|
!isReadonly &&
|
|
1054
|
-
track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1054
|
+
track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
1055
1055
|
// return a wrapped iterator which returns observed versions of the
|
|
1056
1056
|
// values emitted from the real iterator
|
|
1057
1057
|
return {
|
|
@@ -1078,7 +1078,7 @@ function createReadonlyMethod(type) {
|
|
|
1078
1078
|
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
1079
1079
|
console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
|
|
1080
1080
|
}
|
|
1081
|
-
return type === "delete" /* DELETE */ ? false : this;
|
|
1081
|
+
return type === "delete" /* TriggerOpTypes.DELETE */ ? false : this;
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
1084
|
function createInstrumentations() {
|
|
@@ -1120,10 +1120,10 @@ function createInstrumentations() {
|
|
|
1120
1120
|
has(key) {
|
|
1121
1121
|
return has$1.call(this, key, true);
|
|
1122
1122
|
},
|
|
1123
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1124
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1125
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1126
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1123
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1124
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1125
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1126
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1127
1127
|
forEach: createForEach(true, false)
|
|
1128
1128
|
};
|
|
1129
1129
|
const shallowReadonlyInstrumentations = {
|
|
@@ -1136,10 +1136,10 @@ function createInstrumentations() {
|
|
|
1136
1136
|
has(key) {
|
|
1137
1137
|
return has$1.call(this, key, true);
|
|
1138
1138
|
},
|
|
1139
|
-
add: createReadonlyMethod("add" /* ADD */),
|
|
1140
|
-
set: createReadonlyMethod("set" /* SET */),
|
|
1141
|
-
delete: createReadonlyMethod("delete" /* DELETE */),
|
|
1142
|
-
clear: createReadonlyMethod("clear" /* CLEAR */),
|
|
1139
|
+
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1140
|
+
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
1141
|
+
delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
|
|
1142
|
+
clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
|
|
1143
1143
|
forEach: createForEach(true, true)
|
|
1144
1144
|
};
|
|
1145
1145
|
const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
|
|
@@ -1166,13 +1166,13 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1166
1166
|
? readonlyInstrumentations
|
|
1167
1167
|
: mutableInstrumentations;
|
|
1168
1168
|
return (target, key, receiver) => {
|
|
1169
|
-
if (key === "__v_isReactive" /* IS_REACTIVE */) {
|
|
1169
|
+
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
1170
1170
|
return !isReadonly;
|
|
1171
1171
|
}
|
|
1172
|
-
else if (key === "__v_isReadonly" /* IS_READONLY */) {
|
|
1172
|
+
else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
|
|
1173
1173
|
return isReadonly;
|
|
1174
1174
|
}
|
|
1175
|
-
else if (key === "__v_raw" /* RAW */) {
|
|
1175
|
+
else if (key === "__v_raw" /* ReactiveFlags.RAW */) {
|
|
1176
1176
|
return target;
|
|
1177
1177
|
}
|
|
1178
1178
|
return Reflect.get(hasOwn(instrumentations, key) && key in target
|
|
@@ -1212,19 +1212,19 @@ function targetTypeMap(rawType) {
|
|
|
1212
1212
|
switch (rawType) {
|
|
1213
1213
|
case 'Object':
|
|
1214
1214
|
case 'Array':
|
|
1215
|
-
return 1 /* COMMON */;
|
|
1215
|
+
return 1 /* TargetType.COMMON */;
|
|
1216
1216
|
case 'Map':
|
|
1217
1217
|
case 'Set':
|
|
1218
1218
|
case 'WeakMap':
|
|
1219
1219
|
case 'WeakSet':
|
|
1220
|
-
return 2 /* COLLECTION */;
|
|
1220
|
+
return 2 /* TargetType.COLLECTION */;
|
|
1221
1221
|
default:
|
|
1222
|
-
return 0 /* INVALID */;
|
|
1222
|
+
return 0 /* TargetType.INVALID */;
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
function getTargetType(value) {
|
|
1226
|
-
return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
|
|
1227
|
-
? 0 /* INVALID */
|
|
1226
|
+
return value["__v_skip" /* ReactiveFlags.SKIP */] || !Object.isExtensible(value)
|
|
1227
|
+
? 0 /* TargetType.INVALID */
|
|
1228
1228
|
: targetTypeMap(toRawType(value));
|
|
1229
1229
|
}
|
|
1230
1230
|
function reactive(target) {
|
|
@@ -1267,8 +1267,8 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1267
1267
|
}
|
|
1268
1268
|
// target is already a Proxy, return it.
|
|
1269
1269
|
// exception: calling readonly() on a reactive object
|
|
1270
|
-
if (target["__v_raw" /* RAW */] &&
|
|
1271
|
-
!(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
|
|
1270
|
+
if (target["__v_raw" /* ReactiveFlags.RAW */] &&
|
|
1271
|
+
!(isReadonly && target["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */])) {
|
|
1272
1272
|
return target;
|
|
1273
1273
|
}
|
|
1274
1274
|
// target already has corresponding Proxy
|
|
@@ -1278,34 +1278,34 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1278
1278
|
}
|
|
1279
1279
|
// only specific value types can be observed.
|
|
1280
1280
|
const targetType = getTargetType(target);
|
|
1281
|
-
if (targetType === 0 /* INVALID */) {
|
|
1281
|
+
if (targetType === 0 /* TargetType.INVALID */) {
|
|
1282
1282
|
return target;
|
|
1283
1283
|
}
|
|
1284
|
-
const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1284
|
+
const proxy = new Proxy(target, targetType === 2 /* TargetType.COLLECTION */ ? collectionHandlers : baseHandlers);
|
|
1285
1285
|
proxyMap.set(target, proxy);
|
|
1286
1286
|
return proxy;
|
|
1287
1287
|
}
|
|
1288
1288
|
function isReactive(value) {
|
|
1289
1289
|
if (isReadonly(value)) {
|
|
1290
|
-
return isReactive(value["__v_raw" /* RAW */]);
|
|
1290
|
+
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
|
1291
1291
|
}
|
|
1292
|
-
return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
|
|
1292
|
+
return !!(value && value["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */]);
|
|
1293
1293
|
}
|
|
1294
1294
|
function isReadonly(value) {
|
|
1295
|
-
return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
|
|
1295
|
+
return !!(value && value["__v_isReadonly" /* ReactiveFlags.IS_READONLY */]);
|
|
1296
1296
|
}
|
|
1297
1297
|
function isShallow(value) {
|
|
1298
|
-
return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
|
|
1298
|
+
return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
|
|
1299
1299
|
}
|
|
1300
1300
|
function isProxy(value) {
|
|
1301
1301
|
return isReactive(value) || isReadonly(value);
|
|
1302
1302
|
}
|
|
1303
1303
|
function toRaw(observed) {
|
|
1304
|
-
const raw = observed && observed["__v_raw" /* RAW */];
|
|
1304
|
+
const raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
|
1305
1305
|
return raw ? toRaw(raw) : observed;
|
|
1306
1306
|
}
|
|
1307
1307
|
function markRaw(value) {
|
|
1308
|
-
def(value, "__v_skip" /* SKIP */, true);
|
|
1308
|
+
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
|
1309
1309
|
return value;
|
|
1310
1310
|
}
|
|
1311
1311
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
@@ -1317,7 +1317,7 @@ function trackRefValue(ref) {
|
|
|
1317
1317
|
{
|
|
1318
1318
|
trackEffects(ref.dep || (ref.dep = createDep()), {
|
|
1319
1319
|
target: ref,
|
|
1320
|
-
type: "get" /* GET */,
|
|
1320
|
+
type: "get" /* TrackOpTypes.GET */,
|
|
1321
1321
|
key: 'value'
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
@@ -1329,7 +1329,7 @@ function triggerRefValue(ref, newVal) {
|
|
|
1329
1329
|
{
|
|
1330
1330
|
triggerEffects(ref.dep, {
|
|
1331
1331
|
target: ref,
|
|
1332
|
-
type: "set" /* SET */,
|
|
1332
|
+
type: "set" /* TriggerOpTypes.SET */,
|
|
1333
1333
|
key: 'value',
|
|
1334
1334
|
newValue: newVal
|
|
1335
1335
|
});
|
|
@@ -1364,10 +1364,11 @@ class RefImpl {
|
|
|
1364
1364
|
return this._value;
|
|
1365
1365
|
}
|
|
1366
1366
|
set value(newVal) {
|
|
1367
|
-
|
|
1367
|
+
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1368
|
+
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1368
1369
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1369
1370
|
this._rawValue = newVal;
|
|
1370
|
-
this._value =
|
|
1371
|
+
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1371
1372
|
triggerRefValue(this, newVal);
|
|
1372
1373
|
}
|
|
1373
1374
|
}
|
|
@@ -1446,11 +1447,13 @@ function toRef(object, key, defaultValue) {
|
|
|
1446
1447
|
: new ObjectRefImpl(object, key, defaultValue);
|
|
1447
1448
|
}
|
|
1448
1449
|
|
|
1450
|
+
var _a;
|
|
1449
1451
|
class ComputedRefImpl {
|
|
1450
1452
|
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1451
1453
|
this._setter = _setter;
|
|
1452
1454
|
this.dep = undefined;
|
|
1453
1455
|
this.__v_isRef = true;
|
|
1456
|
+
this[_a] = false;
|
|
1454
1457
|
this._dirty = true;
|
|
1455
1458
|
this.effect = new ReactiveEffect(getter, () => {
|
|
1456
1459
|
if (!this._dirty) {
|
|
@@ -1460,7 +1463,7 @@ class ComputedRefImpl {
|
|
|
1460
1463
|
});
|
|
1461
1464
|
this.effect.computed = this;
|
|
1462
1465
|
this.effect.active = this._cacheable = !isSSR;
|
|
1463
|
-
this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
|
|
1466
|
+
this["__v_isReadonly" /* ReactiveFlags.IS_READONLY */] = isReadonly;
|
|
1464
1467
|
}
|
|
1465
1468
|
get value() {
|
|
1466
1469
|
// the computed ref may get wrapped by other proxies e.g. readonly() #3376
|
|
@@ -1476,6 +1479,7 @@ class ComputedRefImpl {
|
|
|
1476
1479
|
this._setter(newValue);
|
|
1477
1480
|
}
|
|
1478
1481
|
}
|
|
1482
|
+
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1479
1483
|
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1480
1484
|
let getter;
|
|
1481
1485
|
let setter;
|
|
@@ -1514,7 +1518,7 @@ function warn$1(msg, ...args) {
|
|
|
1514
1518
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1515
1519
|
const trace = getComponentTrace();
|
|
1516
1520
|
if (appWarnHandler) {
|
|
1517
|
-
callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
|
|
1521
|
+
callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
|
|
1518
1522
|
msg + args.join(''),
|
|
1519
1523
|
instance && instance.proxy,
|
|
1520
1524
|
trace
|
|
@@ -1614,35 +1618,35 @@ function formatProp(key, value, raw) {
|
|
|
1614
1618
|
}
|
|
1615
1619
|
|
|
1616
1620
|
const ErrorTypeStrings = {
|
|
1617
|
-
["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1618
|
-
["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1619
|
-
["c" /* CREATED */]: 'created hook',
|
|
1620
|
-
["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1621
|
-
["m" /* MOUNTED */]: 'mounted hook',
|
|
1622
|
-
["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1623
|
-
["u" /* UPDATED */]: 'updated',
|
|
1624
|
-
["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1625
|
-
["um" /* UNMOUNTED */]: 'unmounted hook',
|
|
1626
|
-
["a" /* ACTIVATED */]: 'activated hook',
|
|
1627
|
-
["da" /* DEACTIVATED */]: 'deactivated hook',
|
|
1628
|
-
["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1629
|
-
["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
|
|
1630
|
-
["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1631
|
-
[0 /* SETUP_FUNCTION */]: 'setup function',
|
|
1632
|
-
[1 /* RENDER_FUNCTION */]: 'render function',
|
|
1633
|
-
[2 /* WATCH_GETTER */]: 'watcher getter',
|
|
1634
|
-
[3 /* WATCH_CALLBACK */]: 'watcher callback',
|
|
1635
|
-
[4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1636
|
-
[5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1637
|
-
[6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1638
|
-
[7 /* VNODE_HOOK */]: 'vnode hook',
|
|
1639
|
-
[8 /* DIRECTIVE_HOOK */]: 'directive hook',
|
|
1640
|
-
[9 /* TRANSITION_HOOK */]: 'transition hook',
|
|
1641
|
-
[10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1642
|
-
[11 /* APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1643
|
-
[12 /* FUNCTION_REF */]: 'ref function',
|
|
1644
|
-
[13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1645
|
-
[14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1621
|
+
["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
|
|
1622
|
+
["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
|
|
1623
|
+
["c" /* LifecycleHooks.CREATED */]: 'created hook',
|
|
1624
|
+
["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
|
|
1625
|
+
["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
|
|
1626
|
+
["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
|
|
1627
|
+
["u" /* LifecycleHooks.UPDATED */]: 'updated',
|
|
1628
|
+
["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
|
|
1629
|
+
["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
|
|
1630
|
+
["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
|
|
1631
|
+
["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
|
|
1632
|
+
["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
|
|
1633
|
+
["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
|
|
1634
|
+
["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
|
|
1635
|
+
[0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
|
|
1636
|
+
[1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
|
|
1637
|
+
[2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
|
|
1638
|
+
[3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
|
|
1639
|
+
[4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
|
|
1640
|
+
[5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
|
|
1641
|
+
[6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
|
|
1642
|
+
[7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
|
|
1643
|
+
[8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
|
|
1644
|
+
[9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
|
|
1645
|
+
[10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
|
|
1646
|
+
[11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
|
|
1647
|
+
[12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
|
|
1648
|
+
[13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
|
|
1649
|
+
[14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
|
|
1646
1650
|
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
|
|
1647
1651
|
};
|
|
1648
1652
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
@@ -1693,7 +1697,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1693
1697
|
// app-level handling
|
|
1694
1698
|
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
1695
1699
|
if (appErrorHandler) {
|
|
1696
|
-
callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1700
|
+
callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
1697
1701
|
return;
|
|
1698
1702
|
}
|
|
1699
1703
|
}
|
|
@@ -1723,15 +1727,11 @@ let isFlushing = false;
|
|
|
1723
1727
|
let isFlushPending = false;
|
|
1724
1728
|
const queue = [];
|
|
1725
1729
|
let flushIndex = 0;
|
|
1726
|
-
const pendingPreFlushCbs = [];
|
|
1727
|
-
let activePreFlushCbs = null;
|
|
1728
|
-
let preFlushIndex = 0;
|
|
1729
1730
|
const pendingPostFlushCbs = [];
|
|
1730
1731
|
let activePostFlushCbs = null;
|
|
1731
1732
|
let postFlushIndex = 0;
|
|
1732
1733
|
const resolvedPromise = /*#__PURE__*/ Promise.resolve();
|
|
1733
1734
|
let currentFlushPromise = null;
|
|
1734
|
-
let currentPreFlushParentJob = null;
|
|
1735
1735
|
const RECURSION_LIMIT = 100;
|
|
1736
1736
|
function nextTick(fn) {
|
|
1737
1737
|
const p = currentFlushPromise || resolvedPromise;
|
|
@@ -1759,9 +1759,8 @@ function queueJob(job) {
|
|
|
1759
1759
|
// if the job is a watch() callback, the search will start with a +1 index to
|
|
1760
1760
|
// allow it recursively trigger itself - it is the user's responsibility to
|
|
1761
1761
|
// ensure it doesn't end up in an infinite loop.
|
|
1762
|
-
if (
|
|
1763
|
-
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex))
|
|
1764
|
-
job !== currentPreFlushParentJob) {
|
|
1762
|
+
if (!queue.length ||
|
|
1763
|
+
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
|
|
1765
1764
|
if (job.id == null) {
|
|
1766
1765
|
queue.push(job);
|
|
1767
1766
|
}
|
|
@@ -1783,51 +1782,38 @@ function invalidateJob(job) {
|
|
|
1783
1782
|
queue.splice(i, 1);
|
|
1784
1783
|
}
|
|
1785
1784
|
}
|
|
1786
|
-
function
|
|
1785
|
+
function queuePostFlushCb(cb) {
|
|
1787
1786
|
if (!isArray(cb)) {
|
|
1788
|
-
if (!
|
|
1789
|
-
!
|
|
1790
|
-
|
|
1787
|
+
if (!activePostFlushCbs ||
|
|
1788
|
+
!activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
|
|
1789
|
+
pendingPostFlushCbs.push(cb);
|
|
1791
1790
|
}
|
|
1792
1791
|
}
|
|
1793
1792
|
else {
|
|
1794
1793
|
// if cb is an array, it is a component lifecycle hook which can only be
|
|
1795
1794
|
// triggered by a job, which is already deduped in the main queue, so
|
|
1796
1795
|
// we can skip duplicate check here to improve perf
|
|
1797
|
-
|
|
1796
|
+
pendingPostFlushCbs.push(...cb);
|
|
1798
1797
|
}
|
|
1799
1798
|
queueFlush();
|
|
1800
1799
|
}
|
|
1801
|
-
function
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
currentPreFlushParentJob = parentJob;
|
|
1810
|
-
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
1811
|
-
pendingPreFlushCbs.length = 0;
|
|
1812
|
-
{
|
|
1813
|
-
seen = seen || new Map();
|
|
1814
|
-
}
|
|
1815
|
-
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
1816
|
-
if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
|
|
1800
|
+
function flushPreFlushCbs(seen, i = flushIndex) {
|
|
1801
|
+
{
|
|
1802
|
+
seen = seen || new Map();
|
|
1803
|
+
}
|
|
1804
|
+
for (; i < queue.length; i++) {
|
|
1805
|
+
const cb = queue[i];
|
|
1806
|
+
if (cb && cb.pre) {
|
|
1807
|
+
if (checkRecursiveUpdates(seen, cb)) {
|
|
1817
1808
|
continue;
|
|
1818
1809
|
}
|
|
1819
|
-
|
|
1810
|
+
queue.splice(i, 1);
|
|
1811
|
+
i--;
|
|
1812
|
+
cb();
|
|
1820
1813
|
}
|
|
1821
|
-
activePreFlushCbs = null;
|
|
1822
|
-
preFlushIndex = 0;
|
|
1823
|
-
currentPreFlushParentJob = null;
|
|
1824
|
-
// recursively flush until it drains
|
|
1825
|
-
flushPreFlushCbs(seen, parentJob);
|
|
1826
1814
|
}
|
|
1827
1815
|
}
|
|
1828
1816
|
function flushPostFlushCbs(seen) {
|
|
1829
|
-
// flush any pre cbs queued during the flush (e.g. pre watchers)
|
|
1830
|
-
flushPreFlushCbs();
|
|
1831
1817
|
if (pendingPostFlushCbs.length) {
|
|
1832
1818
|
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
1833
1819
|
pendingPostFlushCbs.length = 0;
|
|
@@ -1852,13 +1838,22 @@ function flushPostFlushCbs(seen) {
|
|
|
1852
1838
|
}
|
|
1853
1839
|
}
|
|
1854
1840
|
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
1841
|
+
const comparator = (a, b) => {
|
|
1842
|
+
const diff = getId(a) - getId(b);
|
|
1843
|
+
if (diff === 0) {
|
|
1844
|
+
if (a.pre && !b.pre)
|
|
1845
|
+
return -1;
|
|
1846
|
+
if (b.pre && !a.pre)
|
|
1847
|
+
return 1;
|
|
1848
|
+
}
|
|
1849
|
+
return diff;
|
|
1850
|
+
};
|
|
1855
1851
|
function flushJobs(seen) {
|
|
1856
1852
|
isFlushPending = false;
|
|
1857
1853
|
isFlushing = true;
|
|
1858
1854
|
{
|
|
1859
1855
|
seen = seen || new Map();
|
|
1860
1856
|
}
|
|
1861
|
-
flushPreFlushCbs(seen);
|
|
1862
1857
|
// Sort queue before flush.
|
|
1863
1858
|
// This ensures that:
|
|
1864
1859
|
// 1. Components are updated from parent to child. (because parent is always
|
|
@@ -1866,7 +1861,7 @@ function flushJobs(seen) {
|
|
|
1866
1861
|
// priority number)
|
|
1867
1862
|
// 2. If a component is unmounted during a parent component's update,
|
|
1868
1863
|
// its update can be skipped.
|
|
1869
|
-
queue.sort(
|
|
1864
|
+
queue.sort(comparator);
|
|
1870
1865
|
// conditional usage of checkRecursiveUpdate must be determined out of
|
|
1871
1866
|
// try ... catch block since Rollup by default de-optimizes treeshaking
|
|
1872
1867
|
// inside try-catch. This can leave all warning code unshaked. Although
|
|
@@ -1882,7 +1877,7 @@ function flushJobs(seen) {
|
|
|
1882
1877
|
continue;
|
|
1883
1878
|
}
|
|
1884
1879
|
// console.log(`running:`, job.id)
|
|
1885
|
-
callWithErrorHandling(job, null, 14 /* SCHEDULER */);
|
|
1880
|
+
callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
|
|
1886
1881
|
}
|
|
1887
1882
|
}
|
|
1888
1883
|
}
|
|
@@ -1894,9 +1889,7 @@ function flushJobs(seen) {
|
|
|
1894
1889
|
currentFlushPromise = null;
|
|
1895
1890
|
// some postFlushCb queued jobs!
|
|
1896
1891
|
// keep flushing until it drains.
|
|
1897
|
-
if (queue.length ||
|
|
1898
|
-
pendingPreFlushCbs.length ||
|
|
1899
|
-
pendingPostFlushCbs.length) {
|
|
1892
|
+
if (queue.length || pendingPostFlushCbs.length) {
|
|
1900
1893
|
flushJobs(seen);
|
|
1901
1894
|
}
|
|
1902
1895
|
}
|
|
@@ -2114,7 +2107,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2114
2107
|
}
|
|
2115
2108
|
}
|
|
2116
2109
|
function devtoolsInitApp(app, version) {
|
|
2117
|
-
emit("app:init" /* APP_INIT */, app, version, {
|
|
2110
|
+
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2118
2111
|
Fragment,
|
|
2119
2112
|
Text,
|
|
2120
2113
|
Comment,
|
|
@@ -2122,88 +2115,88 @@ function devtoolsInitApp(app, version) {
|
|
|
2122
2115
|
});
|
|
2123
2116
|
}
|
|
2124
2117
|
function devtoolsUnmountApp(app) {
|
|
2125
|
-
emit("app:unmount" /* APP_UNMOUNT */, app);
|
|
2118
|
+
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2126
2119
|
}
|
|
2127
|
-
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
|
|
2120
|
+
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2128
2121
|
const devtoolsComponentUpdated =
|
|
2129
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
|
|
2122
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
|
|
2130
2123
|
const devtoolsComponentRemoved =
|
|
2131
|
-
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
|
|
2124
|
+
/*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
|
|
2132
2125
|
function createDevtoolsComponentHook(hook) {
|
|
2133
2126
|
return (component) => {
|
|
2134
2127
|
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2135
2128
|
};
|
|
2136
2129
|
}
|
|
2137
|
-
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
|
|
2138
|
-
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
|
|
2130
|
+
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2131
|
+
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2139
2132
|
function createDevtoolsPerformanceHook(hook) {
|
|
2140
2133
|
return (component, type, time) => {
|
|
2141
2134
|
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2142
2135
|
};
|
|
2143
2136
|
}
|
|
2144
2137
|
function devtoolsComponentEmit(component, event, params) {
|
|
2145
|
-
emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2138
|
+
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2146
2139
|
}
|
|
2147
2140
|
|
|
2148
2141
|
const deprecationData = {
|
|
2149
|
-
["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
|
|
2142
|
+
["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
|
|
2150
2143
|
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
2151
2144
|
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
2152
2145
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
|
|
2153
2146
|
},
|
|
2154
|
-
["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
|
|
2147
|
+
["GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */]: {
|
|
2155
2148
|
message: `Vue detected directives on the mount container. ` +
|
|
2156
2149
|
`In Vue 3, the container is no longer considered part of the template ` +
|
|
2157
2150
|
`and will not be processed/replaced.`,
|
|
2158
2151
|
link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
|
|
2159
2152
|
},
|
|
2160
|
-
["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
|
|
2153
|
+
["GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */]: {
|
|
2161
2154
|
message: `Vue.extend() has been removed in Vue 3. ` +
|
|
2162
2155
|
`Use defineComponent() instead.`,
|
|
2163
2156
|
link: `https://vuejs.org/api/general.html#definecomponent`
|
|
2164
2157
|
},
|
|
2165
|
-
["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
|
|
2158
|
+
["GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */]: {
|
|
2166
2159
|
message: `Vue.prototype is no longer available in Vue 3. ` +
|
|
2167
2160
|
`Use app.config.globalProperties instead.`,
|
|
2168
2161
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
|
|
2169
2162
|
},
|
|
2170
|
-
["GLOBAL_SET" /* GLOBAL_SET */]: {
|
|
2163
|
+
["GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */]: {
|
|
2171
2164
|
message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2172
2165
|
`Simply use native JavaScript mutations.`
|
|
2173
2166
|
},
|
|
2174
|
-
["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
|
|
2167
|
+
["GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */]: {
|
|
2175
2168
|
message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2176
2169
|
`Simply use native JavaScript mutations.`
|
|
2177
2170
|
},
|
|
2178
|
-
["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
|
|
2171
|
+
["GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */]: {
|
|
2179
2172
|
message: `Vue.observable() has been removed. ` +
|
|
2180
2173
|
`Use \`import { reactive } from "vue"\` from Composition API instead.`,
|
|
2181
2174
|
link: `https://vuejs.org/api/reactivity-core.html#reactive`
|
|
2182
2175
|
},
|
|
2183
|
-
["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
|
|
2176
|
+
["GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */]: {
|
|
2184
2177
|
message: `Vue.util has been removed. Please refactor to avoid its usage ` +
|
|
2185
2178
|
`since it was an internal API even in Vue 2.`
|
|
2186
2179
|
},
|
|
2187
|
-
["CONFIG_SILENT" /* CONFIG_SILENT */]: {
|
|
2180
|
+
["CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */]: {
|
|
2188
2181
|
message: `config.silent has been removed because it is not good practice to ` +
|
|
2189
2182
|
`intentionally suppress warnings. You can use your browser console's ` +
|
|
2190
2183
|
`filter features to focus on relevant messages.`
|
|
2191
2184
|
},
|
|
2192
|
-
["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
|
|
2185
|
+
["CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */]: {
|
|
2193
2186
|
message: `config.devtools has been removed. To enable devtools for ` +
|
|
2194
2187
|
`production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
|
|
2195
2188
|
link: `https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags`
|
|
2196
2189
|
},
|
|
2197
|
-
["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
|
|
2190
|
+
["CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */]: {
|
|
2198
2191
|
message: `config.keyCodes has been removed. ` +
|
|
2199
2192
|
`In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
|
|
2200
2193
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2201
2194
|
},
|
|
2202
|
-
["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
|
|
2195
|
+
["CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */]: {
|
|
2203
2196
|
message: `config.productionTip has been removed.`,
|
|
2204
2197
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
|
|
2205
2198
|
},
|
|
2206
|
-
["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
|
|
2199
|
+
["CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */]: {
|
|
2207
2200
|
message: () => {
|
|
2208
2201
|
let msg = `config.ignoredElements has been removed.`;
|
|
2209
2202
|
if (isRuntimeOnly()) {
|
|
@@ -2216,35 +2209,35 @@ const deprecationData = {
|
|
|
2216
2209
|
},
|
|
2217
2210
|
link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
|
|
2218
2211
|
},
|
|
2219
|
-
["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
|
|
2212
|
+
["CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */]: {
|
|
2220
2213
|
// this warning is only relevant in the full build when using runtime
|
|
2221
2214
|
// compilation, so it's put in the runtime compatConfig list.
|
|
2222
2215
|
message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
|
|
2223
2216
|
`"preserve". To suppress this warning, provide an explicit value for ` +
|
|
2224
2217
|
`\`config.compilerOptions.whitespace\`.`
|
|
2225
2218
|
},
|
|
2226
|
-
["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2219
|
+
["CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */]: {
|
|
2227
2220
|
message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
|
|
2228
2221
|
`Use custom merge functions instead.`
|
|
2229
2222
|
},
|
|
2230
|
-
["INSTANCE_SET" /* INSTANCE_SET */]: {
|
|
2223
|
+
["INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */]: {
|
|
2231
2224
|
message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
|
|
2232
2225
|
`Simply use native JavaScript mutations.`
|
|
2233
2226
|
},
|
|
2234
|
-
["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
|
|
2227
|
+
["INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */]: {
|
|
2235
2228
|
message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
2236
2229
|
`Simply use native JavaScript mutations.`
|
|
2237
2230
|
},
|
|
2238
|
-
["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
|
|
2231
|
+
["INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */]: {
|
|
2239
2232
|
message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
|
|
2240
2233
|
link: `https://vuejs.org/api/application.html#app-unmount`
|
|
2241
2234
|
},
|
|
2242
|
-
["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
|
|
2235
|
+
["INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */]: {
|
|
2243
2236
|
message: `vm.$on/$once/$off() have been removed. ` +
|
|
2244
2237
|
`Use an external event emitter library instead.`,
|
|
2245
2238
|
link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
|
|
2246
2239
|
},
|
|
2247
|
-
["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
|
|
2240
|
+
["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
|
|
2248
2241
|
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
2249
2242
|
`use the "vnode" prefix instead of "hook:". For example, @${event} ` +
|
|
2250
2243
|
`should be changed to @vnode-${event.slice(5)}. ` +
|
|
@@ -2252,23 +2245,23 @@ const deprecationData = {
|
|
|
2252
2245
|
`hooks.`,
|
|
2253
2246
|
link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
|
|
2254
2247
|
},
|
|
2255
|
-
["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
|
|
2248
|
+
["INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */]: {
|
|
2256
2249
|
message: `vm.$children has been removed. Consider refactoring your logic ` +
|
|
2257
2250
|
`to avoid relying on direct access to child components.`,
|
|
2258
2251
|
link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
|
|
2259
2252
|
},
|
|
2260
|
-
["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
|
|
2253
|
+
["INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */]: {
|
|
2261
2254
|
message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
|
|
2262
2255
|
`included in vm.$attrs and it is no longer necessary to separately use ` +
|
|
2263
2256
|
`v-on="$listeners" if you are already using v-bind="$attrs". ` +
|
|
2264
2257
|
`(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
|
|
2265
2258
|
link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
|
|
2266
2259
|
},
|
|
2267
|
-
["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
|
|
2260
|
+
["INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */]: {
|
|
2268
2261
|
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
|
2269
2262
|
link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
|
|
2270
2263
|
},
|
|
2271
|
-
["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2264
|
+
["INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
2272
2265
|
message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
|
|
2273
2266
|
`relying on class/style fallthrough from parent. In Vue 3, class/style ` +
|
|
2274
2267
|
`are now included in $attrs and will no longer fallthrough when ` +
|
|
@@ -2279,75 +2272,75 @@ const deprecationData = {
|
|
|
2279
2272
|
`them on root via :class="$attrs.class".`,
|
|
2280
2273
|
link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
|
|
2281
2274
|
},
|
|
2282
|
-
["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
|
|
2275
|
+
["OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */]: {
|
|
2283
2276
|
message: `The "data" option can no longer be a plain object. ` +
|
|
2284
2277
|
`Always use a function.`,
|
|
2285
2278
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
|
|
2286
2279
|
},
|
|
2287
|
-
["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
|
|
2280
|
+
["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */]: {
|
|
2288
2281
|
message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
|
|
2289
2282
|
`In Vue 3, data keys are merged shallowly and will override one another.`,
|
|
2290
2283
|
link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
|
|
2291
2284
|
},
|
|
2292
|
-
["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
|
|
2285
|
+
["OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */]: {
|
|
2293
2286
|
message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
|
2294
2287
|
},
|
|
2295
|
-
["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
|
|
2288
|
+
["OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */]: {
|
|
2296
2289
|
message: `\`destroyed\` has been renamed to \`unmounted\`.`
|
|
2297
2290
|
},
|
|
2298
|
-
["WATCH_ARRAY" /* WATCH_ARRAY */]: {
|
|
2291
|
+
["WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */]: {
|
|
2299
2292
|
message: `"watch" option or vm.$watch on an array value will no longer ` +
|
|
2300
2293
|
`trigger on array mutation unless the "deep" option is specified. ` +
|
|
2301
2294
|
`If current usage is intended, you can disable the compat behavior and ` +
|
|
2302
2295
|
`suppress this warning with:` +
|
|
2303
|
-
`\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
|
|
2296
|
+
`\n\n configureCompat({ ${"WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */}: false })\n`,
|
|
2304
2297
|
link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
|
|
2305
2298
|
},
|
|
2306
|
-
["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
|
|
2299
|
+
["PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */]: {
|
|
2307
2300
|
message: (key) => `props default value function no longer has access to "this". The compat ` +
|
|
2308
2301
|
`build only offers access to this.$options.` +
|
|
2309
2302
|
`(found in prop "${key}")`,
|
|
2310
2303
|
link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
|
|
2311
2304
|
},
|
|
2312
|
-
["CUSTOM_DIR" /* CUSTOM_DIR */]: {
|
|
2305
|
+
["CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */]: {
|
|
2313
2306
|
message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
|
|
2314
2307
|
`Use "${newHook}" instead.`,
|
|
2315
2308
|
link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
|
|
2316
2309
|
},
|
|
2317
|
-
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
2310
|
+
["V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */]: {
|
|
2318
2311
|
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
2319
2312
|
`Use kebab-case key name modifiers instead.`,
|
|
2320
2313
|
link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
|
|
2321
2314
|
},
|
|
2322
|
-
["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
|
|
2315
|
+
["ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */]: {
|
|
2323
2316
|
message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
|
|
2324
2317
|
`${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
|
|
2325
2318
|
`use \`null\` or \`undefined\` instead. If the usage is intended, ` +
|
|
2326
2319
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2327
|
-
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
|
|
2320
|
+
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */}: false })\n`,
|
|
2328
2321
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2329
2322
|
},
|
|
2330
|
-
["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
|
|
2323
|
+
["ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */]: {
|
|
2331
2324
|
message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
|
|
2332
2325
|
`${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
|
|
2333
2326
|
`Always use explicit "true" or "false" values for enumerated attributes. ` +
|
|
2334
2327
|
`If the usage is intended, ` +
|
|
2335
2328
|
`you can disable the compat behavior and suppress this warning with:` +
|
|
2336
|
-
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2329
|
+
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
2337
2330
|
link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
|
|
2338
2331
|
},
|
|
2339
|
-
["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
|
|
2332
|
+
["TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */]: {
|
|
2340
2333
|
message: `` // this feature cannot be runtime-detected
|
|
2341
2334
|
},
|
|
2342
|
-
["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
|
|
2335
|
+
["TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */]: {
|
|
2343
2336
|
message: `<TransitionGroup> no longer renders a root <span> element by ` +
|
|
2344
2337
|
`default if no "tag" prop is specified. If you do not rely on the span ` +
|
|
2345
2338
|
`for styling, you can disable the compat behavior and suppress this ` +
|
|
2346
2339
|
`warning with:` +
|
|
2347
|
-
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2340
|
+
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
2348
2341
|
link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
|
|
2349
2342
|
},
|
|
2350
|
-
["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
|
|
2343
|
+
["COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */]: {
|
|
2351
2344
|
message: (comp) => {
|
|
2352
2345
|
const name = getComponentName(comp);
|
|
2353
2346
|
return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
|
|
@@ -2356,11 +2349,11 @@ const deprecationData = {
|
|
|
2356
2349
|
`usage and intend to use plain functions for functional components, ` +
|
|
2357
2350
|
`you can disable the compat behavior and suppress this ` +
|
|
2358
2351
|
`warning with:` +
|
|
2359
|
-
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
|
|
2352
|
+
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */}: false })\n`);
|
|
2360
2353
|
},
|
|
2361
2354
|
link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
|
|
2362
2355
|
},
|
|
2363
|
-
["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
|
|
2356
|
+
["COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */]: {
|
|
2364
2357
|
message: (comp) => {
|
|
2365
2358
|
const name = getComponentName(comp);
|
|
2366
2359
|
return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
|
|
@@ -2371,10 +2364,10 @@ const deprecationData = {
|
|
|
2371
2364
|
},
|
|
2372
2365
|
link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
|
|
2373
2366
|
},
|
|
2374
|
-
["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
|
|
2367
|
+
["COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */]: {
|
|
2375
2368
|
message: (comp) => {
|
|
2376
2369
|
const configMsg = `opt-in to ` +
|
|
2377
|
-
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
2370
|
+
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */}: false }\`.`;
|
|
2378
2371
|
if (comp.props &&
|
|
2379
2372
|
(isArray(comp.props)
|
|
2380
2373
|
? comp.props.includes('modelValue')
|
|
@@ -2388,20 +2381,20 @@ const deprecationData = {
|
|
|
2388
2381
|
},
|
|
2389
2382
|
link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
|
|
2390
2383
|
},
|
|
2391
|
-
["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
|
|
2384
|
+
["RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */]: {
|
|
2392
2385
|
message: `Vue 3's render function API has changed. ` +
|
|
2393
2386
|
`You can opt-in to the new API with:` +
|
|
2394
|
-
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
|
|
2387
|
+
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */}: false })\n` +
|
|
2395
2388
|
`\n (This can also be done per-component via the "compatConfig" option.)`,
|
|
2396
2389
|
link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
|
|
2397
2390
|
},
|
|
2398
|
-
["FILTERS" /* FILTERS */]: {
|
|
2391
|
+
["FILTERS" /* DeprecationTypes.FILTERS */]: {
|
|
2399
2392
|
message: `filters have been removed in Vue 3. ` +
|
|
2400
2393
|
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
|
2401
2394
|
`Use method calls or computed properties instead.`,
|
|
2402
2395
|
link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
|
|
2403
2396
|
},
|
|
2404
|
-
["PRIVATE_APIS" /* PRIVATE_APIS */]: {
|
|
2397
|
+
["PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */]: {
|
|
2405
2398
|
message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
|
|
2406
2399
|
`If you are seeing this warning only due to a dependency, you can ` +
|
|
2407
2400
|
`suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
|
|
@@ -2476,8 +2469,8 @@ function validateCompatConfig(config, instance) {
|
|
|
2476
2469
|
warnedInvalidKeys[key] = true;
|
|
2477
2470
|
}
|
|
2478
2471
|
}
|
|
2479
|
-
if (instance && config["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */] != null) {
|
|
2480
|
-
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2472
|
+
if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
|
|
2473
|
+
warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
|
|
2481
2474
|
}
|
|
2482
2475
|
}
|
|
2483
2476
|
function getCompatConfigForKey(key, instance) {
|
|
@@ -2552,10 +2545,10 @@ function on(instance, event, fn) {
|
|
|
2552
2545
|
}
|
|
2553
2546
|
else {
|
|
2554
2547
|
if (event.startsWith('hook:')) {
|
|
2555
|
-
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2548
|
+
assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, event);
|
|
2556
2549
|
}
|
|
2557
2550
|
else {
|
|
2558
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2551
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2559
2552
|
}
|
|
2560
2553
|
const events = getRegistry(instance);
|
|
2561
2554
|
(events[event] || (events[event] = [])).push(fn);
|
|
@@ -2572,7 +2565,7 @@ function once(instance, event, fn) {
|
|
|
2572
2565
|
return instance.proxy;
|
|
2573
2566
|
}
|
|
2574
2567
|
function off(instance, event, fn) {
|
|
2575
|
-
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
|
|
2568
|
+
assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
|
|
2576
2569
|
const vm = instance.proxy;
|
|
2577
2570
|
// all
|
|
2578
2571
|
if (!event) {
|
|
@@ -2600,7 +2593,7 @@ function off(instance, event, fn) {
|
|
|
2600
2593
|
function emit$1(instance, event, args) {
|
|
2601
2594
|
const cbs = getRegistry(instance)[event];
|
|
2602
2595
|
if (cbs) {
|
|
2603
|
-
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2596
|
+
callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2604
2597
|
}
|
|
2605
2598
|
return instance.proxy;
|
|
2606
2599
|
}
|
|
@@ -2610,8 +2603,8 @@ const warnedTypes = new WeakSet();
|
|
|
2610
2603
|
function convertLegacyVModelProps(vnode) {
|
|
2611
2604
|
const { type, shapeFlag, props, dynamicProps } = vnode;
|
|
2612
2605
|
const comp = type;
|
|
2613
|
-
if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
|
|
2614
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
|
|
2606
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
|
|
2607
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
|
|
2615
2608
|
// this is a special case where we want to use the vnode component's
|
|
2616
2609
|
// compat config instead of the current rendering instance (which is the
|
|
2617
2610
|
// parent of the component that exposes v-model)
|
|
@@ -2620,7 +2613,7 @@ function convertLegacyVModelProps(vnode) {
|
|
|
2620
2613
|
}
|
|
2621
2614
|
if (!warnedTypes.has(comp)) {
|
|
2622
2615
|
pushWarningContext(vnode);
|
|
2623
|
-
warnDeprecation("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, { type }, comp);
|
|
2616
|
+
warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
|
|
2624
2617
|
popWarningContext();
|
|
2625
2618
|
warnedTypes.add(comp);
|
|
2626
2619
|
}
|
|
@@ -2653,13 +2646,13 @@ function applyModelFromMixins(model, mixins) {
|
|
|
2653
2646
|
}
|
|
2654
2647
|
}
|
|
2655
2648
|
function compatModelEmit(instance, event, args) {
|
|
2656
|
-
if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
|
|
2649
|
+
if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
|
|
2657
2650
|
return;
|
|
2658
2651
|
}
|
|
2659
2652
|
const props = instance.vnode.props;
|
|
2660
2653
|
const modelHandler = props && props[compatModelEventPrefix + event];
|
|
2661
2654
|
if (modelHandler) {
|
|
2662
|
-
callWithErrorHandling(modelHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2655
|
+
callWithErrorHandling(modelHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2663
2656
|
}
|
|
2664
2657
|
}
|
|
2665
2658
|
|
|
@@ -2726,7 +2719,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2726
2719
|
handler = props[(handlerName = toHandlerKey(hyphenate(event)))];
|
|
2727
2720
|
}
|
|
2728
2721
|
if (handler) {
|
|
2729
|
-
callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2722
|
+
callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2730
2723
|
}
|
|
2731
2724
|
const onceHandler = props[handlerName + `Once`];
|
|
2732
2725
|
if (onceHandler) {
|
|
@@ -2737,7 +2730,7 @@ function emit$2(instance, event, ...rawArgs) {
|
|
|
2737
2730
|
return;
|
|
2738
2731
|
}
|
|
2739
2732
|
instance.emitted[handlerName] = true;
|
|
2740
|
-
callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
|
|
2733
|
+
callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
|
|
2741
2734
|
}
|
|
2742
2735
|
{
|
|
2743
2736
|
compatModelEmit(instance, event, args);
|
|
@@ -2773,7 +2766,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2773
2766
|
}
|
|
2774
2767
|
}
|
|
2775
2768
|
if (!raw && !hasExtends) {
|
|
2776
|
-
|
|
2769
|
+
if (isObject(comp)) {
|
|
2770
|
+
cache.set(comp, null);
|
|
2771
|
+
}
|
|
2777
2772
|
return null;
|
|
2778
2773
|
}
|
|
2779
2774
|
if (isArray(raw)) {
|
|
@@ -2782,7 +2777,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2782
2777
|
else {
|
|
2783
2778
|
extend(normalized, raw);
|
|
2784
2779
|
}
|
|
2785
|
-
|
|
2780
|
+
if (isObject(comp)) {
|
|
2781
|
+
cache.set(comp, normalized);
|
|
2782
|
+
}
|
|
2786
2783
|
return normalized;
|
|
2787
2784
|
}
|
|
2788
2785
|
// Check if an incoming prop key is a declared emit event listener.
|
|
@@ -2912,7 +2909,7 @@ function renderComponentRoot(instance) {
|
|
|
2912
2909
|
accessedAttrs = false;
|
|
2913
2910
|
}
|
|
2914
2911
|
try {
|
|
2915
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
2912
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
2916
2913
|
// withProxy is a proxy with a different `has` trap only for
|
|
2917
2914
|
// runtime-compiled render functions using `with` block.
|
|
2918
2915
|
const proxyToUse = withProxy || proxy;
|
|
@@ -2945,7 +2942,7 @@ function renderComponentRoot(instance) {
|
|
|
2945
2942
|
}
|
|
2946
2943
|
catch (err) {
|
|
2947
2944
|
blockStack.length = 0;
|
|
2948
|
-
handleError(err, instance, 1 /* RENDER_FUNCTION */);
|
|
2945
|
+
handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
|
|
2949
2946
|
result = createVNode(Comment);
|
|
2950
2947
|
}
|
|
2951
2948
|
// attr merging
|
|
@@ -2954,14 +2951,14 @@ function renderComponentRoot(instance) {
|
|
|
2954
2951
|
let root = result;
|
|
2955
2952
|
let setRoot = undefined;
|
|
2956
2953
|
if (result.patchFlag > 0 &&
|
|
2957
|
-
result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
2954
|
+
result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
2958
2955
|
[root, setRoot] = getChildRoot(result);
|
|
2959
2956
|
}
|
|
2960
2957
|
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
2961
2958
|
const keys = Object.keys(fallthroughAttrs);
|
|
2962
2959
|
const { shapeFlag } = root;
|
|
2963
2960
|
if (keys.length) {
|
|
2964
|
-
if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
2961
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
2965
2962
|
if (propsOptions && keys.some(isModelListener)) {
|
|
2966
2963
|
// If a v-model listener (onUpdate:xxx) has a corresponding declared
|
|
2967
2964
|
// prop, it indicates this component expects to handle v-model and
|
|
@@ -3006,13 +3003,13 @@ function renderComponentRoot(instance) {
|
|
|
3006
3003
|
}
|
|
3007
3004
|
}
|
|
3008
3005
|
}
|
|
3009
|
-
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3010
|
-
vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
|
|
3011
|
-
root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
3006
|
+
if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
|
|
3007
|
+
vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
|
|
3008
|
+
root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
|
|
3012
3009
|
const { class: cls, style } = vnode.props || {};
|
|
3013
3010
|
if (cls || style) {
|
|
3014
3011
|
if (inheritAttrs === false) {
|
|
3015
|
-
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3012
|
+
warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
|
|
3016
3013
|
}
|
|
3017
3014
|
root = cloneVNode(root, {
|
|
3018
3015
|
class: cls,
|
|
@@ -3116,7 +3113,7 @@ const filterModelListeners = (attrs, props) => {
|
|
|
3116
3113
|
return res;
|
|
3117
3114
|
};
|
|
3118
3115
|
const isElementRoot = (vnode) => {
|
|
3119
|
-
return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
|
|
3116
|
+
return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
|
|
3120
3117
|
vnode.type === Comment // potential v-if branch switch
|
|
3121
3118
|
);
|
|
3122
3119
|
};
|
|
@@ -3135,19 +3132,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
|
3135
3132
|
return true;
|
|
3136
3133
|
}
|
|
3137
3134
|
if (optimized && patchFlag >= 0) {
|
|
3138
|
-
if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
|
|
3135
|
+
if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
|
|
3139
3136
|
// slot content that references values that might have changed,
|
|
3140
3137
|
// e.g. in a v-for
|
|
3141
3138
|
return true;
|
|
3142
3139
|
}
|
|
3143
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
3140
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
3144
3141
|
if (!prevProps) {
|
|
3145
3142
|
return !!nextProps;
|
|
3146
3143
|
}
|
|
3147
3144
|
// presence of this flag indicates props are always non-null
|
|
3148
3145
|
return hasPropsChanged(prevProps, nextProps, emits);
|
|
3149
3146
|
}
|
|
3150
|
-
else if (patchFlag & 8 /* PROPS */) {
|
|
3147
|
+
else if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
3151
3148
|
const dynamicProps = nextVNode.dynamicProps;
|
|
3152
3149
|
for (let i = 0; i < dynamicProps.length; i++) {
|
|
3153
3150
|
const key = dynamicProps[i];
|
|
@@ -3405,7 +3402,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3405
3402
|
if (delayEnter) {
|
|
3406
3403
|
activeBranch.transition.afterLeave = () => {
|
|
3407
3404
|
if (pendingId === suspense.pendingId) {
|
|
3408
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3405
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3409
3406
|
}
|
|
3410
3407
|
};
|
|
3411
3408
|
}
|
|
@@ -3420,7 +3417,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3420
3417
|
}
|
|
3421
3418
|
if (!delayEnter) {
|
|
3422
3419
|
// move content from off-dom container to actual container
|
|
3423
|
-
move(pendingBranch, container, anchor, 0 /* ENTER */);
|
|
3420
|
+
move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
|
|
3424
3421
|
}
|
|
3425
3422
|
}
|
|
3426
3423
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3494,7 +3491,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3494
3491
|
const hydratedEl = instance.vnode.el;
|
|
3495
3492
|
instance
|
|
3496
3493
|
.asyncDep.catch(err => {
|
|
3497
|
-
handleError(err, instance, 0 /* SETUP_FUNCTION */);
|
|
3494
|
+
handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
3498
3495
|
})
|
|
3499
3496
|
.then(asyncSetupResult => {
|
|
3500
3497
|
// retry when the setup() promise resolves.
|
|
@@ -3568,7 +3565,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
3568
3565
|
}
|
|
3569
3566
|
function normalizeSuspenseChildren(vnode) {
|
|
3570
3567
|
const { shapeFlag, children } = vnode;
|
|
3571
|
-
const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
|
|
3568
|
+
const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
3572
3569
|
vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
|
|
3573
3570
|
vnode.ssFallback = isSlotChildren
|
|
3574
3571
|
? normalizeSuspenseSlot(children.fallback)
|
|
@@ -3739,7 +3736,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3739
3736
|
return traverse(s);
|
|
3740
3737
|
}
|
|
3741
3738
|
else if (isFunction(s)) {
|
|
3742
|
-
return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
|
|
3739
|
+
return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3743
3740
|
}
|
|
3744
3741
|
else {
|
|
3745
3742
|
warnInvalidSource(s);
|
|
@@ -3749,7 +3746,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3749
3746
|
else if (isFunction(source)) {
|
|
3750
3747
|
if (cb) {
|
|
3751
3748
|
// getter with cb
|
|
3752
|
-
getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
|
|
3749
|
+
getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
|
|
3753
3750
|
}
|
|
3754
3751
|
else {
|
|
3755
3752
|
// no cb -> simple effect
|
|
@@ -3760,7 +3757,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3760
3757
|
if (cleanup) {
|
|
3761
3758
|
cleanup();
|
|
3762
3759
|
}
|
|
3763
|
-
return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
|
|
3760
|
+
return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
|
|
3764
3761
|
};
|
|
3765
3762
|
}
|
|
3766
3763
|
}
|
|
@@ -3774,7 +3771,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3774
3771
|
getter = () => {
|
|
3775
3772
|
const val = baseGetter();
|
|
3776
3773
|
if (isArray(val) &&
|
|
3777
|
-
checkCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance)) {
|
|
3774
|
+
checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
|
|
3778
3775
|
traverse(val);
|
|
3779
3776
|
}
|
|
3780
3777
|
return val;
|
|
@@ -3787,7 +3784,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3787
3784
|
let cleanup;
|
|
3788
3785
|
let onCleanup = (fn) => {
|
|
3789
3786
|
cleanup = effect.onStop = () => {
|
|
3790
|
-
callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
|
|
3787
|
+
callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
|
|
3791
3788
|
};
|
|
3792
3789
|
};
|
|
3793
3790
|
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
@@ -3804,12 +3801,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3804
3801
|
? newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
3805
3802
|
: hasChanged(newValue, oldValue)) ||
|
|
3806
3803
|
(isArray(newValue) &&
|
|
3807
|
-
isCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance))) {
|
|
3804
|
+
isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
|
|
3808
3805
|
// cleanup before running cb again
|
|
3809
3806
|
if (cleanup) {
|
|
3810
3807
|
cleanup();
|
|
3811
3808
|
}
|
|
3812
|
-
callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
|
|
3809
|
+
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3813
3810
|
newValue,
|
|
3814
3811
|
// pass undefined as the old value when it's changed for the first time
|
|
3815
3812
|
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
|
|
@@ -3835,7 +3832,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3835
3832
|
}
|
|
3836
3833
|
else {
|
|
3837
3834
|
// default: 'pre'
|
|
3838
|
-
|
|
3835
|
+
job.pre = true;
|
|
3836
|
+
if (instance)
|
|
3837
|
+
job.id = instance.uid;
|
|
3838
|
+
scheduler = () => queueJob(job);
|
|
3839
3839
|
}
|
|
3840
3840
|
const effect = new ReactiveEffect(getter, scheduler);
|
|
3841
3841
|
{
|
|
@@ -3902,7 +3902,7 @@ function createPathGetter(ctx, path) {
|
|
|
3902
3902
|
};
|
|
3903
3903
|
}
|
|
3904
3904
|
function traverse(value, seen) {
|
|
3905
|
-
if (!isObject(value) || value["__v_skip" /* SKIP */]) {
|
|
3905
|
+
if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
|
|
3906
3906
|
return value;
|
|
3907
3907
|
}
|
|
3908
3908
|
seen = seen || new Set();
|
|
@@ -4089,7 +4089,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
4089
4089
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
4090
4090
|
const callHook = (hook, args) => {
|
|
4091
4091
|
hook &&
|
|
4092
|
-
callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
|
|
4092
|
+
callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
|
|
4093
4093
|
};
|
|
4094
4094
|
const callAsyncHook = (hook, args) => {
|
|
4095
4095
|
const done = args[1];
|
|
@@ -4225,10 +4225,10 @@ function getKeepAliveChild(vnode) {
|
|
|
4225
4225
|
: vnode;
|
|
4226
4226
|
}
|
|
4227
4227
|
function setTransitionHooks(vnode, hooks) {
|
|
4228
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
|
|
4228
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
|
|
4229
4229
|
setTransitionHooks(vnode.component.subTree, hooks);
|
|
4230
4230
|
}
|
|
4231
|
-
else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4231
|
+
else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4232
4232
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4233
4233
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4234
4234
|
}
|
|
@@ -4247,7 +4247,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4247
4247
|
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
4248
4248
|
// handle fragment children case, e.g. v-for
|
|
4249
4249
|
if (child.type === Fragment) {
|
|
4250
|
-
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
4250
|
+
if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
|
|
4251
4251
|
keyedFragmentCount++;
|
|
4252
4252
|
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
4253
4253
|
}
|
|
@@ -4262,7 +4262,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
4262
4262
|
// these children to force full diffs to ensure correct behavior.
|
|
4263
4263
|
if (keyedFragmentCount > 1) {
|
|
4264
4264
|
for (let i = 0; i < ret.length; i++) {
|
|
4265
|
-
ret[i].patchFlag = -2 /* BAIL */;
|
|
4265
|
+
ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
|
|
4266
4266
|
}
|
|
4267
4267
|
}
|
|
4268
4268
|
return ret;
|
|
@@ -4340,7 +4340,7 @@ function defineAsyncComponent(source) {
|
|
|
4340
4340
|
}
|
|
4341
4341
|
const onError = (err) => {
|
|
4342
4342
|
pendingRequest = null;
|
|
4343
|
-
handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4343
|
+
handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
|
|
4344
4344
|
};
|
|
4345
4345
|
// suspense-controlled or SSR.
|
|
4346
4346
|
if ((suspensible && instance.suspense) ||
|
|
@@ -4442,7 +4442,7 @@ const KeepAliveImpl = {
|
|
|
4442
4442
|
const storageContainer = createElement('div');
|
|
4443
4443
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4444
4444
|
const instance = vnode.component;
|
|
4445
|
-
move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
|
|
4445
|
+
move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
|
|
4446
4446
|
// in case props have changed
|
|
4447
4447
|
patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
|
|
4448
4448
|
queuePostRenderEffect(() => {
|
|
@@ -4462,7 +4462,7 @@ const KeepAliveImpl = {
|
|
|
4462
4462
|
};
|
|
4463
4463
|
sharedContext.deactivate = (vnode) => {
|
|
4464
4464
|
const instance = vnode.component;
|
|
4465
|
-
move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
|
|
4465
|
+
move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
|
|
4466
4466
|
queuePostRenderEffect(() => {
|
|
4467
4467
|
if (instance.da) {
|
|
4468
4468
|
invokeArrayFns(instance.da);
|
|
@@ -4551,8 +4551,8 @@ const KeepAliveImpl = {
|
|
|
4551
4551
|
return children;
|
|
4552
4552
|
}
|
|
4553
4553
|
else if (!isVNode(rawVNode) ||
|
|
4554
|
-
(!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
|
|
4555
|
-
!(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
|
|
4554
|
+
(!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
|
|
4555
|
+
!(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
|
|
4556
4556
|
current = null;
|
|
4557
4557
|
return rawVNode;
|
|
4558
4558
|
}
|
|
@@ -4574,7 +4574,7 @@ const KeepAliveImpl = {
|
|
|
4574
4574
|
// clone vnode if it's reused because we are going to mutate it
|
|
4575
4575
|
if (vnode.el) {
|
|
4576
4576
|
vnode = cloneVNode(vnode);
|
|
4577
|
-
if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
|
|
4577
|
+
if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
4578
4578
|
rawVNode.ssContent = vnode;
|
|
4579
4579
|
}
|
|
4580
4580
|
}
|
|
@@ -4593,7 +4593,7 @@ const KeepAliveImpl = {
|
|
|
4593
4593
|
setTransitionHooks(vnode, vnode.transition);
|
|
4594
4594
|
}
|
|
4595
4595
|
// avoid vnode being mounted as fresh
|
|
4596
|
-
vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4596
|
+
vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4597
4597
|
// make this key the freshest
|
|
4598
4598
|
keys.delete(key);
|
|
4599
4599
|
keys.add(key);
|
|
@@ -4606,7 +4606,7 @@ const KeepAliveImpl = {
|
|
|
4606
4606
|
}
|
|
4607
4607
|
}
|
|
4608
4608
|
// avoid vnode being unmounted
|
|
4609
|
-
vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4609
|
+
vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4610
4610
|
current = vnode;
|
|
4611
4611
|
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
4612
4612
|
};
|
|
@@ -4632,10 +4632,10 @@ function matches(pattern, name) {
|
|
|
4632
4632
|
return false;
|
|
4633
4633
|
}
|
|
4634
4634
|
function onActivated(hook, target) {
|
|
4635
|
-
registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
|
|
4635
|
+
registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
|
|
4636
4636
|
}
|
|
4637
4637
|
function onDeactivated(hook, target) {
|
|
4638
|
-
registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
|
|
4638
|
+
registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
|
|
4639
4639
|
}
|
|
4640
4640
|
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
4641
4641
|
// cache the deactivate branch check wrapper for injected hooks so the same
|
|
@@ -4679,16 +4679,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4679
4679
|
}
|
|
4680
4680
|
function resetShapeFlag(vnode) {
|
|
4681
4681
|
let shapeFlag = vnode.shapeFlag;
|
|
4682
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4683
|
-
shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4682
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
4683
|
+
shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4684
4684
|
}
|
|
4685
|
-
if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
4686
|
-
shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
4685
|
+
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4686
|
+
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4687
4687
|
}
|
|
4688
4688
|
vnode.shapeFlag = shapeFlag;
|
|
4689
4689
|
}
|
|
4690
4690
|
function getInnerChild(vnode) {
|
|
4691
|
-
return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4691
|
+
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
4692
4692
|
}
|
|
4693
4693
|
|
|
4694
4694
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
@@ -4734,23 +4734,23 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4734
4734
|
}
|
|
4735
4735
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4736
4736
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4737
|
-
(!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
|
|
4737
|
+
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4738
4738
|
injectHook(lifecycle, hook, target);
|
|
4739
|
-
const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
|
|
4740
|
-
const onMounted = createHook("m" /* MOUNTED */);
|
|
4741
|
-
const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
|
|
4742
|
-
const onUpdated = createHook("u" /* UPDATED */);
|
|
4743
|
-
const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
|
|
4744
|
-
const onUnmounted = createHook("um" /* UNMOUNTED */);
|
|
4745
|
-
const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
|
|
4746
|
-
const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
|
|
4747
|
-
const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
|
|
4739
|
+
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4740
|
+
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4741
|
+
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
4742
|
+
const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
|
|
4743
|
+
const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
|
|
4744
|
+
const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
|
|
4745
|
+
const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
|
|
4746
|
+
const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
|
|
4747
|
+
const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
|
|
4748
4748
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
4749
|
-
injectHook("ec" /* ERROR_CAPTURED */, hook, target);
|
|
4749
|
+
injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
|
|
4750
4750
|
}
|
|
4751
4751
|
|
|
4752
4752
|
function getCompatChildren(instance) {
|
|
4753
|
-
assertCompatEnabled("INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */, instance);
|
|
4753
|
+
assertCompatEnabled("INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */, instance);
|
|
4754
4754
|
const root = instance.subTree;
|
|
4755
4755
|
const children = [];
|
|
4756
4756
|
if (root) {
|
|
@@ -4762,7 +4762,7 @@ function walk(vnode, children) {
|
|
|
4762
4762
|
if (vnode.component) {
|
|
4763
4763
|
children.push(vnode.component.proxy);
|
|
4764
4764
|
}
|
|
4765
|
-
else if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
4765
|
+
else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
4766
4766
|
const vnodes = vnode.children;
|
|
4767
4767
|
for (let i = 0; i < vnodes.length; i++) {
|
|
4768
4768
|
walk(vnodes[i], children);
|
|
@@ -4771,7 +4771,7 @@ function walk(vnode, children) {
|
|
|
4771
4771
|
}
|
|
4772
4772
|
|
|
4773
4773
|
function getCompatListeners(instance) {
|
|
4774
|
-
assertCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance);
|
|
4774
|
+
assertCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance);
|
|
4775
4775
|
const listeners = {};
|
|
4776
4776
|
const rawProps = instance.vnode.props;
|
|
4777
4777
|
if (!rawProps) {
|
|
@@ -4799,7 +4799,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4799
4799
|
mappedName.forEach(mapped => {
|
|
4800
4800
|
const mappedHook = dir[mapped];
|
|
4801
4801
|
if (mappedHook) {
|
|
4802
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mapped, name);
|
|
4802
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mapped, name);
|
|
4803
4803
|
hook.push(mappedHook);
|
|
4804
4804
|
}
|
|
4805
4805
|
});
|
|
@@ -4807,7 +4807,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
|
|
|
4807
4807
|
}
|
|
4808
4808
|
else {
|
|
4809
4809
|
if (dir[mappedName]) {
|
|
4810
|
-
softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mappedName, name);
|
|
4810
|
+
softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mappedName, name);
|
|
4811
4811
|
}
|
|
4812
4812
|
return dir[mappedName];
|
|
4813
4813
|
}
|
|
@@ -4881,7 +4881,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4881
4881
|
// disable tracking inside all lifecycle hooks
|
|
4882
4882
|
// since they can potentially be called inside effects.
|
|
4883
4883
|
pauseTracking();
|
|
4884
|
-
callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
|
|
4884
|
+
callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
|
|
4885
4885
|
vnode.el,
|
|
4886
4886
|
binding,
|
|
4887
4887
|
vnode,
|
|
@@ -4988,7 +4988,7 @@ function convertLegacyRenderFn(instance) {
|
|
|
4988
4988
|
return;
|
|
4989
4989
|
}
|
|
4990
4990
|
// v2 render function, try to provide compat
|
|
4991
|
-
if (checkCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance)) {
|
|
4991
|
+
if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
|
|
4992
4992
|
const wrapped = (Component.render = function compatRender() {
|
|
4993
4993
|
// @ts-ignore
|
|
4994
4994
|
return render.call(this, compatH);
|
|
@@ -5110,7 +5110,7 @@ function convertLegacyDirectives(vnode, props) {
|
|
|
5110
5110
|
function convertLegacySlots(vnode) {
|
|
5111
5111
|
const { props, children } = vnode;
|
|
5112
5112
|
let slots;
|
|
5113
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && isArray(children)) {
|
|
5113
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && isArray(children)) {
|
|
5114
5114
|
slots = {};
|
|
5115
5115
|
// check "slot" property on vnodes and turn them into v3 function slots
|
|
5116
5116
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -5149,8 +5149,8 @@ function convertLegacySlots(vnode) {
|
|
|
5149
5149
|
}
|
|
5150
5150
|
function defineLegacyVNodeProperties(vnode) {
|
|
5151
5151
|
/* istanbul ignore if */
|
|
5152
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5153
|
-
isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5152
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
|
|
5153
|
+
isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
|
|
5154
5154
|
const context = currentRenderingInstance;
|
|
5155
5155
|
const getInstance = () => vnode.component && vnode.component.proxy;
|
|
5156
5156
|
let componentOptions;
|
|
@@ -5164,7 +5164,7 @@ function defineLegacyVNodeProperties(vnode) {
|
|
|
5164
5164
|
context: { get: () => context && context.proxy },
|
|
5165
5165
|
componentOptions: {
|
|
5166
5166
|
get: () => {
|
|
5167
|
-
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
5167
|
+
if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
|
|
5168
5168
|
if (componentOptions) {
|
|
5169
5169
|
return componentOptions;
|
|
5170
5170
|
}
|
|
@@ -5284,7 +5284,13 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5284
5284
|
}
|
|
5285
5285
|
else if (slot) {
|
|
5286
5286
|
// conditional single slot generated by <template v-if="..." #foo>
|
|
5287
|
-
slots[slot.name] = slot.
|
|
5287
|
+
slots[slot.name] = slot.key
|
|
5288
|
+
? (...args) => {
|
|
5289
|
+
const res = slot.fn(...args);
|
|
5290
|
+
res.key = slot.key;
|
|
5291
|
+
return res;
|
|
5292
|
+
}
|
|
5293
|
+
: slot.fn;
|
|
5288
5294
|
}
|
|
5289
5295
|
}
|
|
5290
5296
|
return slots;
|
|
@@ -5320,9 +5326,15 @@ fallback, noSlotted) {
|
|
|
5320
5326
|
}
|
|
5321
5327
|
openBlock();
|
|
5322
5328
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5323
|
-
const rendered = createBlock(Fragment, {
|
|
5324
|
-
|
|
5325
|
-
|
|
5329
|
+
const rendered = createBlock(Fragment, {
|
|
5330
|
+
key: props.key ||
|
|
5331
|
+
// slot content array of a dynamic conditional slot may have a branch
|
|
5332
|
+
// key attached in the `createSlots` helper, respect that
|
|
5333
|
+
(validSlotContent && validSlotContent.key) ||
|
|
5334
|
+
`_${name}`
|
|
5335
|
+
}, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
|
|
5336
|
+
? 64 /* PatchFlags.STABLE_FRAGMENT */
|
|
5337
|
+
: -2 /* PatchFlags.BAIL */);
|
|
5326
5338
|
if (!noSlotted && rendered.scopeId) {
|
|
5327
5339
|
rendered.slotScopeIds = [rendered.scopeId + '-s'];
|
|
5328
5340
|
}
|
|
@@ -5350,14 +5362,16 @@ function ensureValidVNode(vnodes) {
|
|
|
5350
5362
|
* For prefixing keys in v-on="obj" with "on"
|
|
5351
5363
|
* @private
|
|
5352
5364
|
*/
|
|
5353
|
-
function toHandlers(obj) {
|
|
5365
|
+
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
5354
5366
|
const ret = {};
|
|
5355
5367
|
if (!isObject(obj)) {
|
|
5356
5368
|
warn$1(`v-on with no argument expects an object value.`);
|
|
5357
5369
|
return ret;
|
|
5358
5370
|
}
|
|
5359
5371
|
for (const key in obj) {
|
|
5360
|
-
ret[
|
|
5372
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
|
|
5373
|
+
? `on:${key}`
|
|
5374
|
+
: toHandlerKey(key)] = obj[key];
|
|
5361
5375
|
}
|
|
5362
5376
|
return ret;
|
|
5363
5377
|
}
|
|
@@ -5493,26 +5507,26 @@ function installCompatInstanceProperties(map) {
|
|
|
5493
5507
|
};
|
|
5494
5508
|
extend(map, {
|
|
5495
5509
|
$set: i => {
|
|
5496
|
-
assertCompatEnabled("INSTANCE_SET" /* INSTANCE_SET */, i);
|
|
5510
|
+
assertCompatEnabled("INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */, i);
|
|
5497
5511
|
return set;
|
|
5498
5512
|
},
|
|
5499
5513
|
$delete: i => {
|
|
5500
|
-
assertCompatEnabled("INSTANCE_DELETE" /* INSTANCE_DELETE */, i);
|
|
5514
|
+
assertCompatEnabled("INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */, i);
|
|
5501
5515
|
return del;
|
|
5502
5516
|
},
|
|
5503
5517
|
$mount: i => {
|
|
5504
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5518
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null /* this warning is global */);
|
|
5505
5519
|
// root mount override from ./global.ts in installCompatMount
|
|
5506
5520
|
return i.ctx._compat_mount || NOOP;
|
|
5507
5521
|
},
|
|
5508
5522
|
$destroy: i => {
|
|
5509
|
-
assertCompatEnabled("INSTANCE_DESTROY" /* INSTANCE_DESTROY */, i);
|
|
5523
|
+
assertCompatEnabled("INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */, i);
|
|
5510
5524
|
// root destroy override from ./global.ts in installCompatMount
|
|
5511
5525
|
return i.ctx._compat_destroy || NOOP;
|
|
5512
5526
|
},
|
|
5513
5527
|
// overrides existing accessor
|
|
5514
5528
|
$slots: i => {
|
|
5515
|
-
if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, i) &&
|
|
5529
|
+
if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
|
|
5516
5530
|
i.render &&
|
|
5517
5531
|
i.render._compatWrapped) {
|
|
5518
5532
|
return new Proxy(i.slots, legacySlotProxyHandlers);
|
|
@@ -5520,7 +5534,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5520
5534
|
return shallowReadonly(i.slots) ;
|
|
5521
5535
|
},
|
|
5522
5536
|
$scopedSlots: i => {
|
|
5523
|
-
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */, i);
|
|
5537
|
+
assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */, i);
|
|
5524
5538
|
const res = {};
|
|
5525
5539
|
for (const key in i.slots) {
|
|
5526
5540
|
const fn = i.slots[key];
|
|
@@ -5537,7 +5551,7 @@ function installCompatInstanceProperties(map) {
|
|
|
5537
5551
|
$listeners: getCompatListeners
|
|
5538
5552
|
});
|
|
5539
5553
|
/* istanbul ignore if */
|
|
5540
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, null)) {
|
|
5554
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
|
|
5541
5555
|
extend(map, {
|
|
5542
5556
|
// needed by many libs / render fns
|
|
5543
5557
|
$vnode: i => i.vnode,
|
|
@@ -5641,23 +5655,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
5641
5655
|
const n = accessCache[key];
|
|
5642
5656
|
if (n !== undefined) {
|
|
5643
5657
|
switch (n) {
|
|
5644
|
-
case 1 /* SETUP */:
|
|
5658
|
+
case 1 /* AccessTypes.SETUP */:
|
|
5645
5659
|
return setupState[key];
|
|
5646
|
-
case 2 /* DATA */:
|
|
5660
|
+
case 2 /* AccessTypes.DATA */:
|
|
5647
5661
|
return data[key];
|
|
5648
|
-
case 4 /* CONTEXT */:
|
|
5662
|
+
case 4 /* AccessTypes.CONTEXT */:
|
|
5649
5663
|
return ctx[key];
|
|
5650
|
-
case 3 /* PROPS */:
|
|
5664
|
+
case 3 /* AccessTypes.PROPS */:
|
|
5651
5665
|
return props[key];
|
|
5652
5666
|
// default: just fallthrough
|
|
5653
5667
|
}
|
|
5654
5668
|
}
|
|
5655
5669
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
5656
|
-
accessCache[key] = 1 /* SETUP */;
|
|
5670
|
+
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5657
5671
|
return setupState[key];
|
|
5658
5672
|
}
|
|
5659
5673
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
5660
|
-
accessCache[key] = 2 /* DATA */;
|
|
5674
|
+
accessCache[key] = 2 /* AccessTypes.DATA */;
|
|
5661
5675
|
return data[key];
|
|
5662
5676
|
}
|
|
5663
5677
|
else if (
|
|
@@ -5665,15 +5679,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
5665
5679
|
// props
|
|
5666
5680
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
5667
5681
|
hasOwn(normalizedProps, key)) {
|
|
5668
|
-
accessCache[key] = 3 /* PROPS */;
|
|
5682
|
+
accessCache[key] = 3 /* AccessTypes.PROPS */;
|
|
5669
5683
|
return props[key];
|
|
5670
5684
|
}
|
|
5671
5685
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5672
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5686
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5673
5687
|
return ctx[key];
|
|
5674
5688
|
}
|
|
5675
5689
|
else if (shouldCacheAccess) {
|
|
5676
|
-
accessCache[key] = 0 /* OTHER */;
|
|
5690
|
+
accessCache[key] = 0 /* AccessTypes.OTHER */;
|
|
5677
5691
|
}
|
|
5678
5692
|
}
|
|
5679
5693
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -5681,7 +5695,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5681
5695
|
// public $xxx properties
|
|
5682
5696
|
if (publicGetter) {
|
|
5683
5697
|
if (key === '$attrs') {
|
|
5684
|
-
track(instance, "get" /* GET */, key);
|
|
5698
|
+
track(instance, "get" /* TrackOpTypes.GET */, key);
|
|
5685
5699
|
markAttrsAccessed();
|
|
5686
5700
|
}
|
|
5687
5701
|
return publicGetter(instance);
|
|
@@ -5694,7 +5708,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5694
5708
|
}
|
|
5695
5709
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
5696
5710
|
// user may set custom properties to `this` that start with `$`
|
|
5697
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
5711
|
+
accessCache[key] = 4 /* AccessTypes.CONTEXT */;
|
|
5698
5712
|
return ctx[key];
|
|
5699
5713
|
}
|
|
5700
5714
|
else if (
|
|
@@ -5870,7 +5884,7 @@ function deepMergeData(to, from) {
|
|
|
5870
5884
|
const toVal = to[key];
|
|
5871
5885
|
const fromVal = from[key];
|
|
5872
5886
|
if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
|
5873
|
-
warnDeprecation("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null, key);
|
|
5887
|
+
warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
|
|
5874
5888
|
deepMergeData(toVal, fromVal);
|
|
5875
5889
|
}
|
|
5876
5890
|
else {
|
|
@@ -5901,7 +5915,7 @@ function applyOptions(instance) {
|
|
|
5901
5915
|
// call beforeCreate first before accessing other options since
|
|
5902
5916
|
// the hook may mutate resolved options (#2791)
|
|
5903
5917
|
if (options.beforeCreate) {
|
|
5904
|
-
callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
|
|
5918
|
+
callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
|
|
5905
5919
|
}
|
|
5906
5920
|
const {
|
|
5907
5921
|
// state
|
|
@@ -5917,7 +5931,7 @@ function applyOptions(instance) {
|
|
|
5917
5931
|
const [propsOptions] = instance.propsOptions;
|
|
5918
5932
|
if (propsOptions) {
|
|
5919
5933
|
for (const key in propsOptions) {
|
|
5920
|
-
checkDuplicateProperties("Props" /* PROPS */, key);
|
|
5934
|
+
checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
|
|
5921
5935
|
}
|
|
5922
5936
|
}
|
|
5923
5937
|
}
|
|
@@ -5947,7 +5961,7 @@ function applyOptions(instance) {
|
|
|
5947
5961
|
});
|
|
5948
5962
|
}
|
|
5949
5963
|
{
|
|
5950
|
-
checkDuplicateProperties("Methods" /* METHODS */, key);
|
|
5964
|
+
checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
|
|
5951
5965
|
}
|
|
5952
5966
|
}
|
|
5953
5967
|
else {
|
|
@@ -5974,7 +5988,7 @@ function applyOptions(instance) {
|
|
|
5974
5988
|
instance.data = reactive(data);
|
|
5975
5989
|
{
|
|
5976
5990
|
for (const key in data) {
|
|
5977
|
-
checkDuplicateProperties("Data" /* DATA */, key);
|
|
5991
|
+
checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
|
|
5978
5992
|
// expose data on ctx during dev
|
|
5979
5993
|
if (!isReservedPrefix(key[0])) {
|
|
5980
5994
|
Object.defineProperty(ctx, key, {
|
|
@@ -6018,7 +6032,7 @@ function applyOptions(instance) {
|
|
|
6018
6032
|
set: v => (c.value = v)
|
|
6019
6033
|
});
|
|
6020
6034
|
{
|
|
6021
|
-
checkDuplicateProperties("Computed" /* COMPUTED */, key);
|
|
6035
|
+
checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
|
|
6022
6036
|
}
|
|
6023
6037
|
}
|
|
6024
6038
|
}
|
|
@@ -6036,7 +6050,7 @@ function applyOptions(instance) {
|
|
|
6036
6050
|
});
|
|
6037
6051
|
}
|
|
6038
6052
|
if (created) {
|
|
6039
|
-
callHook(created, instance, "c" /* CREATED */);
|
|
6053
|
+
callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
|
|
6040
6054
|
}
|
|
6041
6055
|
function registerLifecycleHook(register, hook) {
|
|
6042
6056
|
if (isArray(hook)) {
|
|
@@ -6060,11 +6074,11 @@ function applyOptions(instance) {
|
|
|
6060
6074
|
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
6061
6075
|
{
|
|
6062
6076
|
if (beforeDestroy &&
|
|
6063
|
-
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6077
|
+
softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */, instance)) {
|
|
6064
6078
|
registerLifecycleHook(onBeforeUnmount, beforeDestroy);
|
|
6065
6079
|
}
|
|
6066
6080
|
if (destroyed &&
|
|
6067
|
-
softAssertCompatEnabled("OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */, instance)) {
|
|
6081
|
+
softAssertCompatEnabled("OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */, instance)) {
|
|
6068
6082
|
registerLifecycleHook(onUnmounted, destroyed);
|
|
6069
6083
|
}
|
|
6070
6084
|
}
|
|
@@ -6096,7 +6110,7 @@ function applyOptions(instance) {
|
|
|
6096
6110
|
if (directives)
|
|
6097
6111
|
instance.directives = directives;
|
|
6098
6112
|
if (filters &&
|
|
6099
|
-
isCompatEnabled("FILTERS" /* FILTERS */, instance)) {
|
|
6113
|
+
isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
|
|
6100
6114
|
instance.filters = filters;
|
|
6101
6115
|
}
|
|
6102
6116
|
}
|
|
@@ -6143,7 +6157,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
6143
6157
|
ctx[key] = injected;
|
|
6144
6158
|
}
|
|
6145
6159
|
{
|
|
6146
|
-
checkDuplicateProperties("Inject" /* INJECT */, key);
|
|
6160
|
+
checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
|
|
6147
6161
|
}
|
|
6148
6162
|
}
|
|
6149
6163
|
}
|
|
@@ -6203,7 +6217,7 @@ function resolveMergedOptions(instance) {
|
|
|
6203
6217
|
resolved = cached;
|
|
6204
6218
|
}
|
|
6205
6219
|
else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
6206
|
-
if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, instance)) {
|
|
6220
|
+
if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
|
|
6207
6221
|
resolved = extend({}, base);
|
|
6208
6222
|
resolved.parent = instance.parent && instance.parent.proxy;
|
|
6209
6223
|
resolved.propsData = instance.vnode.props;
|
|
@@ -6219,7 +6233,9 @@ function resolveMergedOptions(instance) {
|
|
|
6219
6233
|
}
|
|
6220
6234
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
6221
6235
|
}
|
|
6222
|
-
|
|
6236
|
+
if (isObject(base)) {
|
|
6237
|
+
cache.set(base, resolved);
|
|
6238
|
+
}
|
|
6223
6239
|
return resolved;
|
|
6224
6240
|
}
|
|
6225
6241
|
function mergeOptions(to, from, strats, asMixin = false) {
|
|
@@ -6287,7 +6303,7 @@ function mergeDataFn(to, from) {
|
|
|
6287
6303
|
return from;
|
|
6288
6304
|
}
|
|
6289
6305
|
return function mergedDataFn() {
|
|
6290
|
-
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null)
|
|
6306
|
+
return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
|
|
6291
6307
|
? deepMergeData
|
|
6292
6308
|
: extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
6293
6309
|
};
|
|
@@ -6326,7 +6342,7 @@ function mergeWatchOptions(to, from) {
|
|
|
6326
6342
|
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6327
6343
|
return new Proxy({}, {
|
|
6328
6344
|
get(_, key) {
|
|
6329
|
-
warnDeprecation("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, null, propKey);
|
|
6345
|
+
warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
|
|
6330
6346
|
// $options
|
|
6331
6347
|
if (key === '$options') {
|
|
6332
6348
|
return resolveMergedOptions(instance);
|
|
@@ -6356,11 +6372,11 @@ function shouldSkipAttr(key, instance) {
|
|
|
6356
6372
|
return true;
|
|
6357
6373
|
}
|
|
6358
6374
|
if ((key === 'class' || key === 'style') &&
|
|
6359
|
-
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6375
|
+
isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
|
|
6360
6376
|
return true;
|
|
6361
6377
|
}
|
|
6362
6378
|
if (isOn(key) &&
|
|
6363
|
-
isCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance)) {
|
|
6379
|
+
isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
|
|
6364
6380
|
return true;
|
|
6365
6381
|
}
|
|
6366
6382
|
// vue-router
|
|
@@ -6403,6 +6419,13 @@ isSSR = false) {
|
|
|
6403
6419
|
}
|
|
6404
6420
|
instance.attrs = attrs;
|
|
6405
6421
|
}
|
|
6422
|
+
function isInHmrContext(instance) {
|
|
6423
|
+
while (instance) {
|
|
6424
|
+
if (instance.type.__hmrId)
|
|
6425
|
+
return true;
|
|
6426
|
+
instance = instance.parent;
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6406
6429
|
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
6407
6430
|
const { props, attrs, vnode: { patchFlag } } = instance;
|
|
6408
6431
|
const rawCurrentProps = toRaw(props);
|
|
@@ -6412,11 +6435,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6412
6435
|
// always force full diff in dev
|
|
6413
6436
|
// - #1942 if hmr is enabled with sfc component
|
|
6414
6437
|
// - vite#872 non-sfc component used by sfc component
|
|
6415
|
-
!((instance
|
|
6416
|
-
(instance.parent && instance.parent.type.__hmrId))) &&
|
|
6438
|
+
!(isInHmrContext(instance)) &&
|
|
6417
6439
|
(optimized || patchFlag > 0) &&
|
|
6418
|
-
!(patchFlag & 16 /* FULL_PROPS */)) {
|
|
6419
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
6440
|
+
!(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
|
|
6441
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
6420
6442
|
// Compiler-generated props & no keys change, just set the updated
|
|
6421
6443
|
// the props.
|
|
6422
6444
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
@@ -6503,7 +6525,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
6503
6525
|
}
|
|
6504
6526
|
// trigger updates for $attrs in case it's used in component slots
|
|
6505
6527
|
if (hasAttrsChanged) {
|
|
6506
|
-
trigger(instance, "set" /* SET */, '$attrs');
|
|
6528
|
+
trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
|
|
6507
6529
|
}
|
|
6508
6530
|
{
|
|
6509
6531
|
validateProps(rawProps || {}, props, instance);
|
|
@@ -6521,7 +6543,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
6521
6543
|
}
|
|
6522
6544
|
{
|
|
6523
6545
|
if (key.startsWith('onHook:')) {
|
|
6524
|
-
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6546
|
+
softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
|
|
6525
6547
|
}
|
|
6526
6548
|
if (key === 'inline-template') {
|
|
6527
6549
|
continue;
|
|
@@ -6582,7 +6604,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6582
6604
|
}
|
|
6583
6605
|
else {
|
|
6584
6606
|
setCurrentInstance(instance);
|
|
6585
|
-
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, instance)
|
|
6607
|
+
value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
|
|
6586
6608
|
? createPropsDefaultThis(instance, props, key)
|
|
6587
6609
|
: null, props);
|
|
6588
6610
|
unsetCurrentInstance();
|
|
@@ -6593,11 +6615,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
|
6593
6615
|
}
|
|
6594
6616
|
}
|
|
6595
6617
|
// boolean casting
|
|
6596
|
-
if (opt[0 /* shouldCast */]) {
|
|
6618
|
+
if (opt[0 /* BooleanFlags.shouldCast */]) {
|
|
6597
6619
|
if (isAbsent && !hasDefault) {
|
|
6598
6620
|
value = false;
|
|
6599
6621
|
}
|
|
6600
|
-
else if (opt[1 /* shouldCastTrue */] &&
|
|
6622
|
+
else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
|
|
6601
6623
|
(value === '' || value === hyphenate(key))) {
|
|
6602
6624
|
value = true;
|
|
6603
6625
|
}
|
|
@@ -6638,7 +6660,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6638
6660
|
}
|
|
6639
6661
|
}
|
|
6640
6662
|
if (!raw && !hasExtends) {
|
|
6641
|
-
|
|
6663
|
+
if (isObject(comp)) {
|
|
6664
|
+
cache.set(comp, EMPTY_ARR);
|
|
6665
|
+
}
|
|
6642
6666
|
return EMPTY_ARR;
|
|
6643
6667
|
}
|
|
6644
6668
|
if (isArray(raw)) {
|
|
@@ -6665,8 +6689,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6665
6689
|
if (prop) {
|
|
6666
6690
|
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
6667
6691
|
const stringIndex = getTypeIndex(String, prop.type);
|
|
6668
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
6669
|
-
prop[1 /* shouldCastTrue */] =
|
|
6692
|
+
prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
|
|
6693
|
+
prop[1 /* BooleanFlags.shouldCastTrue */] =
|
|
6670
6694
|
stringIndex < 0 || booleanIndex < stringIndex;
|
|
6671
6695
|
// if the prop needs boolean casting or default value
|
|
6672
6696
|
if (booleanIndex > -1 || hasOwn(prop, 'default')) {
|
|
@@ -6677,7 +6701,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
6677
6701
|
}
|
|
6678
6702
|
}
|
|
6679
6703
|
const res = [normalized, needCastKeys];
|
|
6680
|
-
|
|
6704
|
+
if (isObject(comp)) {
|
|
6705
|
+
cache.set(comp, res);
|
|
6706
|
+
}
|
|
6681
6707
|
return res;
|
|
6682
6708
|
}
|
|
6683
6709
|
function validatePropName(key) {
|
|
@@ -6868,7 +6894,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6868
6894
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
6869
6895
|
}
|
|
6870
6896
|
else if (value != null) {
|
|
6871
|
-
if (!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6897
|
+
if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6872
6898
|
warn$1(`Non-function value encountered for slot "${key}". ` +
|
|
6873
6899
|
`Prefer function slots for better performance.`);
|
|
6874
6900
|
}
|
|
@@ -6879,7 +6905,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
6879
6905
|
};
|
|
6880
6906
|
const normalizeVNodeSlots = (instance, children) => {
|
|
6881
6907
|
if (!isKeepAlive(instance.vnode) &&
|
|
6882
|
-
!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
|
|
6908
|
+
!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
|
|
6883
6909
|
warn$1(`Non-function value encountered for default slot. ` +
|
|
6884
6910
|
`Prefer function slots for better performance.`);
|
|
6885
6911
|
}
|
|
@@ -6887,7 +6913,7 @@ const normalizeVNodeSlots = (instance, children) => {
|
|
|
6887
6913
|
instance.slots.default = () => normalized;
|
|
6888
6914
|
};
|
|
6889
6915
|
const initSlots = (instance, children) => {
|
|
6890
|
-
if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
6916
|
+
if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6891
6917
|
const type = children._;
|
|
6892
6918
|
if (type) {
|
|
6893
6919
|
// users can get the shallow readonly version of the slots object through `this.$slots`,
|
|
@@ -6912,7 +6938,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6912
6938
|
const { vnode, slots } = instance;
|
|
6913
6939
|
let needDeletionCheck = true;
|
|
6914
6940
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
6915
|
-
if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
|
|
6941
|
+
if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
|
|
6916
6942
|
const type = children._;
|
|
6917
6943
|
if (type) {
|
|
6918
6944
|
// compiled slots.
|
|
@@ -6921,7 +6947,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6921
6947
|
// force update slots and mark instance for hmr as well
|
|
6922
6948
|
extend(slots, children);
|
|
6923
6949
|
}
|
|
6924
|
-
else if (optimized && type === 1 /* STABLE */) {
|
|
6950
|
+
else if (optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
6925
6951
|
// compiled AND stable.
|
|
6926
6952
|
// no need to update, and skip stale slots removal.
|
|
6927
6953
|
needDeletionCheck = false;
|
|
@@ -6934,7 +6960,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6934
6960
|
// when rendering the optimized slots by manually written render function,
|
|
6935
6961
|
// we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
|
|
6936
6962
|
// i.e. let the `renderSlot` create the bailed Fragment
|
|
6937
|
-
if (!optimized && type === 1 /* STABLE */) {
|
|
6963
|
+
if (!optimized && type === 1 /* SlotFlags.STABLE */) {
|
|
6938
6964
|
delete slots._;
|
|
6939
6965
|
}
|
|
6940
6966
|
}
|
|
@@ -6963,11 +6989,11 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
6963
6989
|
// dev only
|
|
6964
6990
|
function installLegacyConfigWarnings(config) {
|
|
6965
6991
|
const legacyConfigOptions = {
|
|
6966
|
-
silent: "CONFIG_SILENT" /* CONFIG_SILENT */,
|
|
6967
|
-
devtools: "CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */,
|
|
6968
|
-
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */,
|
|
6969
|
-
keyCodes: "CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */,
|
|
6970
|
-
productionTip: "CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */
|
|
6992
|
+
silent: "CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */,
|
|
6993
|
+
devtools: "CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */,
|
|
6994
|
+
ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */,
|
|
6995
|
+
keyCodes: "CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */,
|
|
6996
|
+
productionTip: "CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */
|
|
6971
6997
|
};
|
|
6972
6998
|
Object.keys(legacyConfigOptions).forEach(key => {
|
|
6973
6999
|
let val = config[key];
|
|
@@ -6992,7 +7018,7 @@ function installLegacyOptionMergeStrats(config) {
|
|
|
6992
7018
|
return target[key];
|
|
6993
7019
|
}
|
|
6994
7020
|
if (key in internalOptionMergeStrats &&
|
|
6995
|
-
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
7021
|
+
softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */, null)) {
|
|
6996
7022
|
return internalOptionMergeStrats[key];
|
|
6997
7023
|
}
|
|
6998
7024
|
}
|
|
@@ -7010,11 +7036,11 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7010
7036
|
return createCompatApp(options, Vue);
|
|
7011
7037
|
});
|
|
7012
7038
|
function createCompatApp(options = {}, Ctor) {
|
|
7013
|
-
assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null);
|
|
7039
|
+
assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null);
|
|
7014
7040
|
const { data } = options;
|
|
7015
7041
|
if (data &&
|
|
7016
7042
|
!isFunction(data) &&
|
|
7017
|
-
softAssertCompatEnabled("OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */, null)) {
|
|
7043
|
+
softAssertCompatEnabled("OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */, null)) {
|
|
7018
7044
|
options.data = () => data;
|
|
7019
7045
|
}
|
|
7020
7046
|
const app = createApp(options);
|
|
@@ -7029,7 +7055,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7029
7055
|
return vm;
|
|
7030
7056
|
}
|
|
7031
7057
|
}
|
|
7032
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7058
|
+
Vue.version = `2.6.14-compat:${"3.2.38"}`;
|
|
7033
7059
|
Vue.config = singletonApp.config;
|
|
7034
7060
|
Vue.use = (p, ...options) => {
|
|
7035
7061
|
if (p && isFunction(p.install)) {
|
|
@@ -7068,7 +7094,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7068
7094
|
Vue.nextTick = nextTick;
|
|
7069
7095
|
const extendCache = new WeakMap();
|
|
7070
7096
|
function extendCtor(extendOptions = {}) {
|
|
7071
|
-
assertCompatEnabled("GLOBAL_EXTEND" /* GLOBAL_EXTEND */, null);
|
|
7097
|
+
assertCompatEnabled("GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */, null);
|
|
7072
7098
|
if (isFunction(extendOptions)) {
|
|
7073
7099
|
extendOptions = extendOptions.options;
|
|
7074
7100
|
}
|
|
@@ -7109,15 +7135,15 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7109
7135
|
}
|
|
7110
7136
|
Vue.extend = extendCtor.bind(Vue);
|
|
7111
7137
|
Vue.set = (target, key, value) => {
|
|
7112
|
-
assertCompatEnabled("GLOBAL_SET" /* GLOBAL_SET */, null);
|
|
7138
|
+
assertCompatEnabled("GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */, null);
|
|
7113
7139
|
target[key] = value;
|
|
7114
7140
|
};
|
|
7115
7141
|
Vue.delete = (target, key) => {
|
|
7116
|
-
assertCompatEnabled("GLOBAL_DELETE" /* GLOBAL_DELETE */, null);
|
|
7142
|
+
assertCompatEnabled("GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */, null);
|
|
7117
7143
|
delete target[key];
|
|
7118
7144
|
};
|
|
7119
7145
|
Vue.observable = (target) => {
|
|
7120
|
-
assertCompatEnabled("GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */, null);
|
|
7146
|
+
assertCompatEnabled("GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */, null);
|
|
7121
7147
|
return reactive(target);
|
|
7122
7148
|
};
|
|
7123
7149
|
Vue.filter = ((name, filter) => {
|
|
@@ -7138,7 +7164,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7138
7164
|
};
|
|
7139
7165
|
Object.defineProperty(Vue, 'util', {
|
|
7140
7166
|
get() {
|
|
7141
|
-
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */, null);
|
|
7167
|
+
assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */, null);
|
|
7142
7168
|
return util;
|
|
7143
7169
|
}
|
|
7144
7170
|
});
|
|
@@ -7161,7 +7187,7 @@ function installAppCompatProperties(app, context, render) {
|
|
|
7161
7187
|
function installFilterMethod(app, context) {
|
|
7162
7188
|
context.filters = {};
|
|
7163
7189
|
app.filter = (name, filter) => {
|
|
7164
|
-
assertCompatEnabled("FILTERS" /* FILTERS */, null);
|
|
7190
|
+
assertCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, null);
|
|
7165
7191
|
if (!filter) {
|
|
7166
7192
|
return context.filters[name];
|
|
7167
7193
|
}
|
|
@@ -7178,7 +7204,7 @@ function installLegacyAPIs(app) {
|
|
|
7178
7204
|
// so that app.use() can work with legacy plugins that extend prototypes
|
|
7179
7205
|
prototype: {
|
|
7180
7206
|
get() {
|
|
7181
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7207
|
+
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7182
7208
|
return app.config.globalProperties;
|
|
7183
7209
|
}
|
|
7184
7210
|
},
|
|
@@ -7215,7 +7241,7 @@ function applySingletonAppMutations(app) {
|
|
|
7215
7241
|
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7216
7242
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7217
7243
|
if (key === 'ignoredElements' &&
|
|
7218
|
-
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7244
|
+
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
7219
7245
|
!isRuntimeOnly() &&
|
|
7220
7246
|
isArray(val)) {
|
|
7221
7247
|
app.config.compilerOptions.isCustomElement = tag => {
|
|
@@ -7228,7 +7254,7 @@ function applySingletonAppMutations(app) {
|
|
|
7228
7254
|
}
|
|
7229
7255
|
function applySingletonPrototype(app, Ctor) {
|
|
7230
7256
|
// copy prototype augmentations as config.globalProperties
|
|
7231
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7257
|
+
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7232
7258
|
if (enabled) {
|
|
7233
7259
|
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
7234
7260
|
}
|
|
@@ -7243,7 +7269,7 @@ function applySingletonPrototype(app, Ctor) {
|
|
|
7243
7269
|
}
|
|
7244
7270
|
}
|
|
7245
7271
|
if (hasPrototypeAugmentations) {
|
|
7246
|
-
warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
|
|
7272
|
+
warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
|
|
7247
7273
|
}
|
|
7248
7274
|
}
|
|
7249
7275
|
function installCompatMount(app, context, render) {
|
|
@@ -7313,7 +7339,7 @@ function installCompatMount(app, context, render) {
|
|
|
7313
7339
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
7314
7340
|
const attr = container.attributes[i];
|
|
7315
7341
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
7316
|
-
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
7342
|
+
warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
7317
7343
|
break;
|
|
7318
7344
|
}
|
|
7319
7345
|
}
|
|
@@ -7352,7 +7378,7 @@ function installCompatMount(app, context, render) {
|
|
|
7352
7378
|
if (bum) {
|
|
7353
7379
|
invokeArrayFns(bum);
|
|
7354
7380
|
}
|
|
7355
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7381
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7356
7382
|
instance.emit('hook:beforeDestroy');
|
|
7357
7383
|
}
|
|
7358
7384
|
// stop effects
|
|
@@ -7363,7 +7389,7 @@ function installCompatMount(app, context, render) {
|
|
|
7363
7389
|
if (um) {
|
|
7364
7390
|
invokeArrayFns(um);
|
|
7365
7391
|
}
|
|
7366
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7392
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
7367
7393
|
instance.emit('hook:destroyed');
|
|
7368
7394
|
}
|
|
7369
7395
|
}
|
|
@@ -7424,12 +7450,12 @@ function defineReactiveSimple(obj, key, val) {
|
|
|
7424
7450
|
enumerable: true,
|
|
7425
7451
|
configurable: true,
|
|
7426
7452
|
get() {
|
|
7427
|
-
track(obj, "get" /* GET */, key);
|
|
7453
|
+
track(obj, "get" /* TrackOpTypes.GET */, key);
|
|
7428
7454
|
return val;
|
|
7429
7455
|
},
|
|
7430
7456
|
set(newVal) {
|
|
7431
7457
|
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
7432
|
-
trigger(obj, "set" /* SET */, key, newVal);
|
|
7458
|
+
trigger(obj, "set" /* TriggerOpTypes.SET */, key, newVal);
|
|
7433
7459
|
}
|
|
7434
7460
|
});
|
|
7435
7461
|
}
|
|
@@ -7622,7 +7648,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7622
7648
|
// because the template ref is forwarded to inner component
|
|
7623
7649
|
return;
|
|
7624
7650
|
}
|
|
7625
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
7651
|
+
const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
7626
7652
|
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
7627
7653
|
: vnode.el;
|
|
7628
7654
|
const value = isUnmount ? null : refValue;
|
|
@@ -7648,7 +7674,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7648
7674
|
}
|
|
7649
7675
|
}
|
|
7650
7676
|
if (isFunction(ref)) {
|
|
7651
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
7677
|
+
callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
|
|
7652
7678
|
}
|
|
7653
7679
|
else {
|
|
7654
7680
|
const _isString = isString(ref);
|
|
@@ -7710,7 +7736,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7710
7736
|
|
|
7711
7737
|
let hasMismatch = false;
|
|
7712
7738
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
7713
|
-
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
7739
|
+
const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
|
|
7714
7740
|
// Note: hydration is DOM-specific
|
|
7715
7741
|
// But we have to place it in core due to tight coupling with core - splitting
|
|
7716
7742
|
// it out creates a ton of unnecessary complexity.
|
|
@@ -7742,14 +7768,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7742
7768
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7743
7769
|
const domType = node.nodeType;
|
|
7744
7770
|
vnode.el = node;
|
|
7745
|
-
if (patchFlag === -2 /* BAIL */) {
|
|
7771
|
+
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7746
7772
|
optimized = false;
|
|
7747
7773
|
vnode.dynamicChildren = null;
|
|
7748
7774
|
}
|
|
7749
7775
|
let nextNode = null;
|
|
7750
7776
|
switch (type) {
|
|
7751
7777
|
case Text:
|
|
7752
|
-
if (domType !== 3 /* TEXT */) {
|
|
7778
|
+
if (domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7753
7779
|
// #5728 empty text node inside a slot can cause hydration failure
|
|
7754
7780
|
// because the server rendered HTML won't contain a text node
|
|
7755
7781
|
if (vnode.children === '') {
|
|
@@ -7772,7 +7798,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7772
7798
|
}
|
|
7773
7799
|
break;
|
|
7774
7800
|
case Comment:
|
|
7775
|
-
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
7801
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
|
|
7776
7802
|
nextNode = onMismatch();
|
|
7777
7803
|
}
|
|
7778
7804
|
else {
|
|
@@ -7780,7 +7806,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7780
7806
|
}
|
|
7781
7807
|
break;
|
|
7782
7808
|
case Static:
|
|
7783
|
-
if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
|
|
7809
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
|
|
7784
7810
|
nextNode = onMismatch();
|
|
7785
7811
|
}
|
|
7786
7812
|
else {
|
|
@@ -7792,7 +7818,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7792
7818
|
for (let i = 0; i < vnode.staticCount; i++) {
|
|
7793
7819
|
if (needToAdoptContent)
|
|
7794
7820
|
vnode.children +=
|
|
7795
|
-
nextNode.nodeType === 1 /* ELEMENT */
|
|
7821
|
+
nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
|
|
7796
7822
|
? nextNode.outerHTML
|
|
7797
7823
|
: nextNode.data;
|
|
7798
7824
|
if (i === vnode.staticCount - 1) {
|
|
@@ -7812,8 +7838,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7812
7838
|
}
|
|
7813
7839
|
break;
|
|
7814
7840
|
default:
|
|
7815
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
7816
|
-
if (domType !== 1 /* ELEMENT */ ||
|
|
7841
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
7842
|
+
if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
|
|
7817
7843
|
vnode.type.toLowerCase() !==
|
|
7818
7844
|
node.tagName.toLowerCase()) {
|
|
7819
7845
|
nextNode = onMismatch();
|
|
@@ -7822,7 +7848,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7822
7848
|
nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
7823
7849
|
}
|
|
7824
7850
|
}
|
|
7825
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
7851
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
7826
7852
|
// when setting up the render effect, if the initial vnode already
|
|
7827
7853
|
// has .el set, the component will perform hydration instead of mount
|
|
7828
7854
|
// on its sub-tree.
|
|
@@ -7861,15 +7887,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7861
7887
|
vnode.component.subTree = subTree;
|
|
7862
7888
|
}
|
|
7863
7889
|
}
|
|
7864
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
7865
|
-
if (domType !== 8 /* COMMENT */) {
|
|
7890
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
7891
|
+
if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
|
|
7866
7892
|
nextNode = onMismatch();
|
|
7867
7893
|
}
|
|
7868
7894
|
else {
|
|
7869
7895
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
7870
7896
|
}
|
|
7871
7897
|
}
|
|
7872
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
7898
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
7873
7899
|
nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
7874
7900
|
}
|
|
7875
7901
|
else {
|
|
@@ -7897,7 +7923,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7897
7923
|
if (props) {
|
|
7898
7924
|
if (forcePatchValue ||
|
|
7899
7925
|
!optimized ||
|
|
7900
|
-
patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
|
|
7926
|
+
patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
|
|
7901
7927
|
for (const key in props) {
|
|
7902
7928
|
if ((forcePatchValue && key.endsWith('value')) ||
|
|
7903
7929
|
(isOn(key) && !isReservedProp(key))) {
|
|
@@ -7926,7 +7952,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7926
7952
|
}, parentSuspense);
|
|
7927
7953
|
}
|
|
7928
7954
|
// children
|
|
7929
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
|
|
7955
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
|
|
7930
7956
|
// skip if element has innerHTML / textContent
|
|
7931
7957
|
!(props && (props.innerHTML || props.textContent))) {
|
|
7932
7958
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -7944,7 +7970,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7944
7970
|
remove(cur);
|
|
7945
7971
|
}
|
|
7946
7972
|
}
|
|
7947
|
-
else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
7973
|
+
else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
7948
7974
|
if (el.textContent !== vnode.children) {
|
|
7949
7975
|
hasMismatch = true;
|
|
7950
7976
|
warn$1(`Hydration text content mismatch in <${vnode.type}>:\n` +
|
|
@@ -8007,7 +8033,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8007
8033
|
};
|
|
8008
8034
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
8009
8035
|
hasMismatch = true;
|
|
8010
|
-
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
|
|
8036
|
+
warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
|
|
8011
8037
|
? `(text)`
|
|
8012
8038
|
: isComment(node) && node.data === '['
|
|
8013
8039
|
? `(start of fragment)`
|
|
@@ -8138,7 +8164,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8138
8164
|
unmount(n1, parentComponent, parentSuspense, true);
|
|
8139
8165
|
n1 = null;
|
|
8140
8166
|
}
|
|
8141
|
-
if (n2.patchFlag === -2 /* BAIL */) {
|
|
8167
|
+
if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
8142
8168
|
optimized = false;
|
|
8143
8169
|
n2.dynamicChildren = null;
|
|
8144
8170
|
}
|
|
@@ -8162,16 +8188,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8162
8188
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8163
8189
|
break;
|
|
8164
8190
|
default:
|
|
8165
|
-
if (shapeFlag & 1 /* ELEMENT */) {
|
|
8191
|
+
if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
|
|
8166
8192
|
processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8167
8193
|
}
|
|
8168
|
-
else if (shapeFlag & 6 /* COMPONENT */) {
|
|
8194
|
+
else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
8169
8195
|
processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8170
8196
|
}
|
|
8171
|
-
else if (shapeFlag & 64 /* TELEPORT */) {
|
|
8197
|
+
else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
8172
8198
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8173
8199
|
}
|
|
8174
|
-
else if (shapeFlag & 128 /* SUSPENSE */) {
|
|
8200
|
+
else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
8175
8201
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
8176
8202
|
}
|
|
8177
8203
|
else {
|
|
@@ -8257,10 +8283,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8257
8283
|
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
8258
8284
|
// mount children first, since some props may rely on child content
|
|
8259
8285
|
// being already rendered, e.g. `<select value>`
|
|
8260
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8286
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8261
8287
|
hostSetElementText(el, vnode.children);
|
|
8262
8288
|
}
|
|
8263
|
-
else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8289
|
+
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8264
8290
|
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
8265
8291
|
}
|
|
8266
8292
|
if (dirs) {
|
|
@@ -8336,7 +8362,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8336
8362
|
if (parentComponent) {
|
|
8337
8363
|
let subTree = parentComponent.subTree;
|
|
8338
8364
|
if (subTree.patchFlag > 0 &&
|
|
8339
|
-
subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
8365
|
+
subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
|
|
8340
8366
|
subTree =
|
|
8341
8367
|
filterSingleRoot(subTree.children) || subTree;
|
|
8342
8368
|
}
|
|
@@ -8359,7 +8385,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8359
8385
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
8360
8386
|
// #1426 take the old vnode's patch flag into account since user may clone a
|
|
8361
8387
|
// compiler-generated vnode, which de-opts to FULL_PROPS
|
|
8362
|
-
patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
|
|
8388
|
+
patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
|
|
8363
8389
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
8364
8390
|
const newProps = n2.props || EMPTY_OBJ;
|
|
8365
8391
|
let vnodeHook;
|
|
@@ -8394,21 +8420,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8394
8420
|
// generated by the compiler and can take the fast path.
|
|
8395
8421
|
// in this path old node and new node are guaranteed to have the same shape
|
|
8396
8422
|
// (i.e. at the exact same position in the source template)
|
|
8397
|
-
if (patchFlag & 16 /* FULL_PROPS */) {
|
|
8423
|
+
if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
|
|
8398
8424
|
// element props contain dynamic keys, full diff needed
|
|
8399
8425
|
patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
|
|
8400
8426
|
}
|
|
8401
8427
|
else {
|
|
8402
8428
|
// class
|
|
8403
8429
|
// this flag is matched when the element has dynamic class bindings.
|
|
8404
|
-
if (patchFlag & 2 /* CLASS */) {
|
|
8430
|
+
if (patchFlag & 2 /* PatchFlags.CLASS */) {
|
|
8405
8431
|
if (oldProps.class !== newProps.class) {
|
|
8406
8432
|
hostPatchProp(el, 'class', null, newProps.class, isSVG);
|
|
8407
8433
|
}
|
|
8408
8434
|
}
|
|
8409
8435
|
// style
|
|
8410
8436
|
// this flag is matched when the element has dynamic style bindings
|
|
8411
|
-
if (patchFlag & 4 /* STYLE */) {
|
|
8437
|
+
if (patchFlag & 4 /* PatchFlags.STYLE */) {
|
|
8412
8438
|
hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
|
|
8413
8439
|
}
|
|
8414
8440
|
// props
|
|
@@ -8417,7 +8443,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8417
8443
|
// faster iteration.
|
|
8418
8444
|
// Note dynamic keys like :[foo]="bar" will cause this optimization to
|
|
8419
8445
|
// bail out and go through a full diff because we need to unset the old key
|
|
8420
|
-
if (patchFlag & 8 /* PROPS */) {
|
|
8446
|
+
if (patchFlag & 8 /* PatchFlags.PROPS */) {
|
|
8421
8447
|
// if the flag is present then dynamicProps must be non-null
|
|
8422
8448
|
const propsToUpdate = n2.dynamicProps;
|
|
8423
8449
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
@@ -8433,7 +8459,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8433
8459
|
}
|
|
8434
8460
|
// text
|
|
8435
8461
|
// This flag is matched when the element has only dynamic text children.
|
|
8436
|
-
if (patchFlag & 1 /* TEXT */) {
|
|
8462
|
+
if (patchFlag & 1 /* PatchFlags.TEXT */) {
|
|
8437
8463
|
if (n1.children !== n2.children) {
|
|
8438
8464
|
hostSetElementText(el, n2.children);
|
|
8439
8465
|
}
|
|
@@ -8467,7 +8493,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8467
8493
|
// which also requires the correct parent container
|
|
8468
8494
|
!isSameVNodeType(oldVNode, newVNode) ||
|
|
8469
8495
|
// - In the case of a component, it could contain anything.
|
|
8470
|
-
oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
|
|
8496
|
+
oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
|
|
8471
8497
|
? hostParentNode(oldVNode.el)
|
|
8472
8498
|
: // In other cases, the parent container is not actually used so we
|
|
8473
8499
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
@@ -8505,7 +8531,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8505
8531
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
8506
8532
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8507
8533
|
if (// #5523 dev root fragment may inherit directives
|
|
8508
|
-
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8534
|
+
(isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
|
|
8509
8535
|
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8510
8536
|
patchFlag = 0;
|
|
8511
8537
|
optimized = false;
|
|
@@ -8527,7 +8553,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8527
8553
|
}
|
|
8528
8554
|
else {
|
|
8529
8555
|
if (patchFlag > 0 &&
|
|
8530
|
-
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8556
|
+
patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
|
|
8531
8557
|
dynamicChildren &&
|
|
8532
8558
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8533
8559
|
// of renderSlot() with no valid children
|
|
@@ -8560,7 +8586,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8560
8586
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8561
8587
|
n2.slotScopeIds = slotScopeIds;
|
|
8562
8588
|
if (n1 == null) {
|
|
8563
|
-
if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
|
|
8589
|
+
if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
8564
8590
|
parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
|
|
8565
8591
|
}
|
|
8566
8592
|
else {
|
|
@@ -8665,7 +8691,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8665
8691
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
8666
8692
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
8667
8693
|
}
|
|
8668
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8694
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8669
8695
|
instance.emit('hook:beforeMount');
|
|
8670
8696
|
}
|
|
8671
8697
|
toggleRecurse(instance, true);
|
|
@@ -8726,18 +8752,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8726
8752
|
const scopedInitialVNode = initialVNode;
|
|
8727
8753
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
|
|
8728
8754
|
}
|
|
8729
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8755
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8730
8756
|
queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
|
|
8731
8757
|
}
|
|
8732
8758
|
// activated hook for keep-alive roots.
|
|
8733
8759
|
// #1742 activated hook must be accessed after first render
|
|
8734
8760
|
// since the hook may be injected by a child keep-alive
|
|
8735
|
-
if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8761
|
+
if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
|
|
8736
8762
|
(parent &&
|
|
8737
8763
|
isAsyncWrapper(parent.vnode) &&
|
|
8738
|
-
parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8764
|
+
parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
|
|
8739
8765
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
8740
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8766
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8741
8767
|
queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
|
|
8742
8768
|
}
|
|
8743
8769
|
}
|
|
@@ -8775,7 +8801,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8775
8801
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
8776
8802
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
8777
8803
|
}
|
|
8778
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8804
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8779
8805
|
instance.emit('hook:beforeUpdate');
|
|
8780
8806
|
}
|
|
8781
8807
|
toggleRecurse(instance, true);
|
|
@@ -8815,7 +8841,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8815
8841
|
if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
|
|
8816
8842
|
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
|
|
8817
8843
|
}
|
|
8818
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8844
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
8819
8845
|
queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
|
|
8820
8846
|
}
|
|
8821
8847
|
{
|
|
@@ -8855,7 +8881,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8855
8881
|
pauseTracking();
|
|
8856
8882
|
// props update may have triggered pre-flush watchers.
|
|
8857
8883
|
// flush them before the render update.
|
|
8858
|
-
flushPreFlushCbs(
|
|
8884
|
+
flushPreFlushCbs();
|
|
8859
8885
|
resetTracking();
|
|
8860
8886
|
};
|
|
8861
8887
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
|
|
@@ -8865,22 +8891,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8865
8891
|
const { patchFlag, shapeFlag } = n2;
|
|
8866
8892
|
// fast path
|
|
8867
8893
|
if (patchFlag > 0) {
|
|
8868
|
-
if (patchFlag & 128 /* KEYED_FRAGMENT */) {
|
|
8894
|
+
if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
|
|
8869
8895
|
// this could be either fully-keyed or mixed (some keyed some not)
|
|
8870
8896
|
// presence of patchFlag means children are guaranteed to be arrays
|
|
8871
8897
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8872
8898
|
return;
|
|
8873
8899
|
}
|
|
8874
|
-
else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
|
|
8900
|
+
else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
|
|
8875
8901
|
// unkeyed
|
|
8876
8902
|
patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8877
8903
|
return;
|
|
8878
8904
|
}
|
|
8879
8905
|
}
|
|
8880
8906
|
// children has 3 possibilities: text, array or no children.
|
|
8881
|
-
if (shapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8907
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8882
8908
|
// text children fast path
|
|
8883
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8909
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8884
8910
|
unmountChildren(c1, parentComponent, parentSuspense);
|
|
8885
8911
|
}
|
|
8886
8912
|
if (c2 !== c1) {
|
|
@@ -8888,9 +8914,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8888
8914
|
}
|
|
8889
8915
|
}
|
|
8890
8916
|
else {
|
|
8891
|
-
if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8917
|
+
if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8892
8918
|
// prev children was array
|
|
8893
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8919
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8894
8920
|
// two arrays, cannot assume anything, do full diff
|
|
8895
8921
|
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8896
8922
|
}
|
|
@@ -8902,11 +8928,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8902
8928
|
else {
|
|
8903
8929
|
// prev children was text OR null
|
|
8904
8930
|
// new children is array OR null
|
|
8905
|
-
if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
|
|
8931
|
+
if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8906
8932
|
hostSetElementText(container, '');
|
|
8907
8933
|
}
|
|
8908
8934
|
// mount new if array
|
|
8909
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
8935
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8910
8936
|
mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
8911
8937
|
}
|
|
8912
8938
|
}
|
|
@@ -9097,7 +9123,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9097
9123
|
// There is no stable subsequence (e.g. a reverse)
|
|
9098
9124
|
// OR current node is not among the stable sequence
|
|
9099
9125
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
9100
|
-
move(nextChild, container, anchor, 2 /* REORDER */);
|
|
9126
|
+
move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
|
|
9101
9127
|
}
|
|
9102
9128
|
else {
|
|
9103
9129
|
j--;
|
|
@@ -9108,15 +9134,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9108
9134
|
};
|
|
9109
9135
|
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
9110
9136
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
9111
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9137
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9112
9138
|
move(vnode.component.subTree, container, anchor, moveType);
|
|
9113
9139
|
return;
|
|
9114
9140
|
}
|
|
9115
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9141
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9116
9142
|
vnode.suspense.move(container, anchor, moveType);
|
|
9117
9143
|
return;
|
|
9118
9144
|
}
|
|
9119
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9145
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9120
9146
|
type.move(vnode, container, anchor, internals);
|
|
9121
9147
|
return;
|
|
9122
9148
|
}
|
|
@@ -9133,11 +9159,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9133
9159
|
return;
|
|
9134
9160
|
}
|
|
9135
9161
|
// single nodes
|
|
9136
|
-
const needTransition = moveType !== 2 /* REORDER */ &&
|
|
9137
|
-
shapeFlag & 1 /* ELEMENT */ &&
|
|
9162
|
+
const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
|
|
9163
|
+
shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9138
9164
|
transition;
|
|
9139
9165
|
if (needTransition) {
|
|
9140
|
-
if (moveType === 0 /* ENTER */) {
|
|
9166
|
+
if (moveType === 0 /* MoveType.ENTER */) {
|
|
9141
9167
|
transition.beforeEnter(el);
|
|
9142
9168
|
hostInsert(el, container, anchor);
|
|
9143
9169
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9169,42 +9195,42 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9169
9195
|
if (ref != null) {
|
|
9170
9196
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
9171
9197
|
}
|
|
9172
|
-
if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9198
|
+
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
|
|
9173
9199
|
parentComponent.ctx.deactivate(vnode);
|
|
9174
9200
|
return;
|
|
9175
9201
|
}
|
|
9176
|
-
const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
|
|
9202
|
+
const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
|
|
9177
9203
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
9178
9204
|
let vnodeHook;
|
|
9179
9205
|
if (shouldInvokeVnodeHook &&
|
|
9180
9206
|
(vnodeHook = props && props.onVnodeBeforeUnmount)) {
|
|
9181
9207
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9182
9208
|
}
|
|
9183
|
-
if (shapeFlag & 6 /* COMPONENT */) {
|
|
9209
|
+
if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9184
9210
|
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
9185
9211
|
}
|
|
9186
9212
|
else {
|
|
9187
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9213
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9188
9214
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
9189
9215
|
return;
|
|
9190
9216
|
}
|
|
9191
9217
|
if (shouldInvokeDirs) {
|
|
9192
9218
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
|
|
9193
9219
|
}
|
|
9194
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
9220
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
9195
9221
|
vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
|
|
9196
9222
|
}
|
|
9197
9223
|
else if (dynamicChildren &&
|
|
9198
9224
|
// #1153: fast path should not be taken for non-stable (v-for) fragments
|
|
9199
9225
|
(type !== Fragment ||
|
|
9200
|
-
(patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
|
|
9226
|
+
(patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
|
|
9201
9227
|
// fast path for block nodes: only need to unmount dynamic children.
|
|
9202
9228
|
unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
9203
9229
|
}
|
|
9204
9230
|
else if ((type === Fragment &&
|
|
9205
9231
|
patchFlag &
|
|
9206
|
-
(128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
|
|
9207
|
-
(!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
|
|
9232
|
+
(128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
|
|
9233
|
+
(!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
|
|
9208
9234
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
9209
9235
|
}
|
|
9210
9236
|
if (doRemove) {
|
|
@@ -9225,7 +9251,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9225
9251
|
const { type, el, anchor, transition } = vnode;
|
|
9226
9252
|
if (type === Fragment) {
|
|
9227
9253
|
if (vnode.patchFlag > 0 &&
|
|
9228
|
-
vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
|
|
9254
|
+
vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
|
|
9229
9255
|
transition &&
|
|
9230
9256
|
!transition.persisted) {
|
|
9231
9257
|
vnode.children.forEach(child => {
|
|
@@ -9252,7 +9278,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9252
9278
|
transition.afterLeave();
|
|
9253
9279
|
}
|
|
9254
9280
|
};
|
|
9255
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ &&
|
|
9281
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
|
|
9256
9282
|
transition &&
|
|
9257
9283
|
!transition.persisted) {
|
|
9258
9284
|
const { leave, delayLeave } = transition;
|
|
@@ -9288,7 +9314,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9288
9314
|
if (bum) {
|
|
9289
9315
|
invokeArrayFns(bum);
|
|
9290
9316
|
}
|
|
9291
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9317
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9292
9318
|
instance.emit('hook:beforeDestroy');
|
|
9293
9319
|
}
|
|
9294
9320
|
// stop effects in component scope
|
|
@@ -9304,7 +9330,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9304
9330
|
if (um) {
|
|
9305
9331
|
queuePostRenderEffect(um, parentSuspense);
|
|
9306
9332
|
}
|
|
9307
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9333
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
|
|
9308
9334
|
queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
|
|
9309
9335
|
}
|
|
9310
9336
|
queuePostRenderEffect(() => {
|
|
@@ -9334,10 +9360,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9334
9360
|
}
|
|
9335
9361
|
};
|
|
9336
9362
|
const getNextHostNode = vnode => {
|
|
9337
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */) {
|
|
9363
|
+
if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9338
9364
|
return getNextHostNode(vnode.component.subTree);
|
|
9339
9365
|
}
|
|
9340
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
9366
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9341
9367
|
return vnode.suspense.next();
|
|
9342
9368
|
}
|
|
9343
9369
|
return hostNextSibling((vnode.anchor || vnode.el));
|
|
@@ -9351,6 +9377,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9351
9377
|
else {
|
|
9352
9378
|
patch(container._vnode || null, vnode, container, null, null, null, isSVG);
|
|
9353
9379
|
}
|
|
9380
|
+
flushPreFlushCbs();
|
|
9354
9381
|
flushPostFlushCbs();
|
|
9355
9382
|
container._vnode = vnode;
|
|
9356
9383
|
};
|
|
@@ -9400,8 +9427,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9400
9427
|
// guaranteed to be vnodes
|
|
9401
9428
|
const c1 = ch1[i];
|
|
9402
9429
|
let c2 = ch2[i];
|
|
9403
|
-
if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
|
|
9404
|
-
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
|
|
9430
|
+
if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
|
|
9431
|
+
if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
9405
9432
|
c2 = ch2[i] = cloneIfMounted(ch2[i]);
|
|
9406
9433
|
c2.el = c1.el;
|
|
9407
9434
|
}
|
|
@@ -9521,7 +9548,7 @@ const TeleportImpl = {
|
|
|
9521
9548
|
const mount = (container, anchor) => {
|
|
9522
9549
|
// Teleport *always* has Array children. This is enforced in both the
|
|
9523
9550
|
// compiler and vnode children normalization.
|
|
9524
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9551
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9525
9552
|
mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
9526
9553
|
}
|
|
9527
9554
|
};
|
|
@@ -9557,7 +9584,7 @@ const TeleportImpl = {
|
|
|
9557
9584
|
if (!wasDisabled) {
|
|
9558
9585
|
// enabled -> disabled
|
|
9559
9586
|
// move into main container
|
|
9560
|
-
moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
|
|
9587
|
+
moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9561
9588
|
}
|
|
9562
9589
|
}
|
|
9563
9590
|
else {
|
|
@@ -9565,7 +9592,7 @@ const TeleportImpl = {
|
|
|
9565
9592
|
if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
9566
9593
|
const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
|
|
9567
9594
|
if (nextTarget) {
|
|
9568
|
-
moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
|
|
9595
|
+
moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
|
|
9569
9596
|
}
|
|
9570
9597
|
else {
|
|
9571
9598
|
warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
|
|
@@ -9574,7 +9601,7 @@ const TeleportImpl = {
|
|
|
9574
9601
|
else if (wasDisabled) {
|
|
9575
9602
|
// disabled -> enabled
|
|
9576
9603
|
// move into teleport target
|
|
9577
|
-
moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
|
|
9604
|
+
moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
|
|
9578
9605
|
}
|
|
9579
9606
|
}
|
|
9580
9607
|
}
|
|
@@ -9587,7 +9614,7 @@ const TeleportImpl = {
|
|
|
9587
9614
|
// an unmounted teleport should always remove its children if not disabled
|
|
9588
9615
|
if (doRemove || !isTeleportDisabled(props)) {
|
|
9589
9616
|
hostRemove(anchor);
|
|
9590
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9617
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9591
9618
|
for (let i = 0; i < children.length; i++) {
|
|
9592
9619
|
const child = children[i];
|
|
9593
9620
|
unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
|
|
@@ -9598,13 +9625,13 @@ const TeleportImpl = {
|
|
|
9598
9625
|
move: moveTeleport,
|
|
9599
9626
|
hydrate: hydrateTeleport
|
|
9600
9627
|
};
|
|
9601
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
|
|
9628
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
|
|
9602
9629
|
// move target anchor if this is a target change.
|
|
9603
|
-
if (moveType === 0 /* TARGET_CHANGE */) {
|
|
9630
|
+
if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
|
|
9604
9631
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9605
9632
|
}
|
|
9606
9633
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9607
|
-
const isReorder = moveType === 2 /* REORDER */;
|
|
9634
|
+
const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
|
|
9608
9635
|
// move main view anchor if this is a re-order.
|
|
9609
9636
|
if (isReorder) {
|
|
9610
9637
|
insert(el, container, parentAnchor);
|
|
@@ -9614,9 +9641,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9614
9641
|
// is not a reorder, or the teleport is disabled
|
|
9615
9642
|
if (!isReorder || isTeleportDisabled(props)) {
|
|
9616
9643
|
// Teleport has either Array children or no children.
|
|
9617
|
-
if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9644
|
+
if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9618
9645
|
for (let i = 0; i < children.length; i++) {
|
|
9619
|
-
move(children[i], container, parentAnchor, 2 /* REORDER */);
|
|
9646
|
+
move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
|
|
9620
9647
|
}
|
|
9621
9648
|
}
|
|
9622
9649
|
}
|
|
@@ -9631,7 +9658,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9631
9658
|
// if multiple teleports rendered to the same target element, we need to
|
|
9632
9659
|
// pick up from where the last teleport finished instead of the first node
|
|
9633
9660
|
const targetNode = target._lpa || target.firstChild;
|
|
9634
|
-
if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
|
|
9661
|
+
if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
9635
9662
|
if (isTeleportDisabled(vnode.props)) {
|
|
9636
9663
|
vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9637
9664
|
vnode.targetAnchor = targetNode;
|
|
@@ -9708,7 +9735,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9708
9735
|
}
|
|
9709
9736
|
// 2.x async component
|
|
9710
9737
|
if (isFunction(comp) &&
|
|
9711
|
-
checkCompatEnabled("COMPONENT_ASYNC" /* COMPONENT_ASYNC */, instance, comp)) {
|
|
9738
|
+
checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
|
|
9712
9739
|
// since after disabling this, plain functions are still valid usage, do not
|
|
9713
9740
|
// use softAssert here.
|
|
9714
9741
|
return convertLegacyAsyncComponent(comp);
|
|
@@ -9716,7 +9743,7 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9716
9743
|
// 2.x functional component
|
|
9717
9744
|
if (isObject(comp) &&
|
|
9718
9745
|
comp.functional &&
|
|
9719
|
-
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9746
|
+
softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */, instance, comp)) {
|
|
9720
9747
|
return convertLegacyFunctionalComponent(comp);
|
|
9721
9748
|
}
|
|
9722
9749
|
return comp;
|
|
@@ -9813,7 +9840,7 @@ function isVNode(value) {
|
|
|
9813
9840
|
return value ? value.__v_isVNode === true : false;
|
|
9814
9841
|
}
|
|
9815
9842
|
function isSameVNodeType(n1, n2) {
|
|
9816
|
-
if (n2.shapeFlag & 6 /* COMPONENT */ &&
|
|
9843
|
+
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
9817
9844
|
hmrDirtyComponents.has(n2.type)) {
|
|
9818
9845
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
9819
9846
|
return false;
|
|
@@ -9844,7 +9871,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
|
9844
9871
|
: ref
|
|
9845
9872
|
: null);
|
|
9846
9873
|
};
|
|
9847
|
-
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9874
|
+
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
9848
9875
|
const vnode = {
|
|
9849
9876
|
__v_isVNode: true,
|
|
9850
9877
|
__v_skip: true,
|
|
@@ -9875,7 +9902,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9875
9902
|
if (needFullChildrenNormalization) {
|
|
9876
9903
|
normalizeChildren(vnode, children);
|
|
9877
9904
|
// normalize suspense children
|
|
9878
|
-
if (shapeFlag & 128 /* SUSPENSE */) {
|
|
9905
|
+
if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
9879
9906
|
type.normalize(vnode);
|
|
9880
9907
|
}
|
|
9881
9908
|
}
|
|
@@ -9883,8 +9910,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9883
9910
|
// compiled element vnode - if children is passed, only possible types are
|
|
9884
9911
|
// string or Array.
|
|
9885
9912
|
vnode.shapeFlag |= isString(children)
|
|
9886
|
-
? 8 /* TEXT_CHILDREN */
|
|
9887
|
-
: 16 /* ARRAY_CHILDREN */;
|
|
9913
|
+
? 8 /* ShapeFlags.TEXT_CHILDREN */
|
|
9914
|
+
: 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
9888
9915
|
}
|
|
9889
9916
|
// validate key
|
|
9890
9917
|
if (vnode.key !== vnode.key) {
|
|
@@ -9900,10 +9927,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
9900
9927
|
// component nodes also should always be patched, because even if the
|
|
9901
9928
|
// component doesn't need to update, it needs to persist the instance on to
|
|
9902
9929
|
// the next vnode so that it can be properly unmounted later.
|
|
9903
|
-
(vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
|
|
9930
|
+
(vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
|
|
9904
9931
|
// the EVENTS flag is only for hydration and if it is the only flag, the
|
|
9905
9932
|
// vnode should not be considered dynamic due to handler caching.
|
|
9906
|
-
vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
|
|
9933
|
+
vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
|
|
9907
9934
|
currentBlock.push(vnode);
|
|
9908
9935
|
}
|
|
9909
9936
|
{
|
|
@@ -9929,14 +9956,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9929
9956
|
normalizeChildren(cloned, children);
|
|
9930
9957
|
}
|
|
9931
9958
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
9932
|
-
if (cloned.shapeFlag & 6 /* COMPONENT */) {
|
|
9959
|
+
if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
|
|
9933
9960
|
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
9934
9961
|
}
|
|
9935
9962
|
else {
|
|
9936
9963
|
currentBlock.push(cloned);
|
|
9937
9964
|
}
|
|
9938
9965
|
}
|
|
9939
|
-
cloned.patchFlag |= -2 /* BAIL */;
|
|
9966
|
+
cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
|
|
9940
9967
|
return cloned;
|
|
9941
9968
|
}
|
|
9942
9969
|
// class component normalization.
|
|
@@ -9966,17 +9993,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
9966
9993
|
}
|
|
9967
9994
|
// encode the vnode type information into a bitmap
|
|
9968
9995
|
const shapeFlag = isString(type)
|
|
9969
|
-
? 1 /* ELEMENT */
|
|
9996
|
+
? 1 /* ShapeFlags.ELEMENT */
|
|
9970
9997
|
: isSuspense(type)
|
|
9971
|
-
? 128 /* SUSPENSE */
|
|
9998
|
+
? 128 /* ShapeFlags.SUSPENSE */
|
|
9972
9999
|
: isTeleport(type)
|
|
9973
|
-
? 64 /* TELEPORT */
|
|
10000
|
+
? 64 /* ShapeFlags.TELEPORT */
|
|
9974
10001
|
: isObject(type)
|
|
9975
|
-
? 4 /* STATEFUL_COMPONENT */
|
|
10002
|
+
? 4 /* ShapeFlags.STATEFUL_COMPONENT */
|
|
9976
10003
|
: isFunction(type)
|
|
9977
|
-
? 2 /* FUNCTIONAL_COMPONENT */
|
|
10004
|
+
? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
|
|
9978
10005
|
: 0;
|
|
9979
|
-
if (shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
10006
|
+
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
9980
10007
|
type = toRaw(type);
|
|
9981
10008
|
warn$1(`Vue received a Component which was made a reactive object. This can ` +
|
|
9982
10009
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
@@ -10015,7 +10042,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10015
10042
|
: ref,
|
|
10016
10043
|
scopeId: vnode.scopeId,
|
|
10017
10044
|
slotScopeIds: vnode.slotScopeIds,
|
|
10018
|
-
children: patchFlag === -1 /* HOISTED */ && isArray(children)
|
|
10045
|
+
children: patchFlag === -1 /* PatchFlags.HOISTED */ && isArray(children)
|
|
10019
10046
|
? children.map(deepCloneVNode)
|
|
10020
10047
|
: children,
|
|
10021
10048
|
target: vnode.target,
|
|
@@ -10028,8 +10055,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10028
10055
|
// fast paths only.
|
|
10029
10056
|
patchFlag: extraProps && vnode.type !== Fragment
|
|
10030
10057
|
? patchFlag === -1 // hoisted node
|
|
10031
|
-
? 16 /* FULL_PROPS */
|
|
10032
|
-
: patchFlag | 16 /* FULL_PROPS */
|
|
10058
|
+
? 16 /* PatchFlags.FULL_PROPS */
|
|
10059
|
+
: patchFlag | 16 /* PatchFlags.FULL_PROPS */
|
|
10033
10060
|
: patchFlag,
|
|
10034
10061
|
dynamicProps: vnode.dynamicProps,
|
|
10035
10062
|
dynamicChildren: vnode.dynamicChildren,
|
|
@@ -10122,10 +10149,10 @@ function normalizeChildren(vnode, children) {
|
|
|
10122
10149
|
children = null;
|
|
10123
10150
|
}
|
|
10124
10151
|
else if (isArray(children)) {
|
|
10125
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10152
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10126
10153
|
}
|
|
10127
10154
|
else if (typeof children === 'object') {
|
|
10128
|
-
if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
|
|
10155
|
+
if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
|
|
10129
10156
|
// Normalize slot to plain children for plain element and Teleport
|
|
10130
10157
|
const slot = children.default;
|
|
10131
10158
|
if (slot) {
|
|
@@ -10137,37 +10164,37 @@ function normalizeChildren(vnode, children) {
|
|
|
10137
10164
|
return;
|
|
10138
10165
|
}
|
|
10139
10166
|
else {
|
|
10140
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10167
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10141
10168
|
const slotFlag = children._;
|
|
10142
10169
|
if (!slotFlag && !(InternalObjectKey in children)) {
|
|
10143
10170
|
children._ctx = currentRenderingInstance;
|
|
10144
10171
|
}
|
|
10145
|
-
else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
|
|
10172
|
+
else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
|
|
10146
10173
|
// a child component receives forwarded slots from the parent.
|
|
10147
10174
|
// its slot type is determined by its parent's slot type.
|
|
10148
|
-
if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
|
|
10149
|
-
children._ = 1 /* STABLE */;
|
|
10175
|
+
if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
|
|
10176
|
+
children._ = 1 /* SlotFlags.STABLE */;
|
|
10150
10177
|
}
|
|
10151
10178
|
else {
|
|
10152
|
-
children._ = 2 /* DYNAMIC */;
|
|
10153
|
-
vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
|
|
10179
|
+
children._ = 2 /* SlotFlags.DYNAMIC */;
|
|
10180
|
+
vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
10154
10181
|
}
|
|
10155
10182
|
}
|
|
10156
10183
|
}
|
|
10157
10184
|
}
|
|
10158
10185
|
else if (isFunction(children)) {
|
|
10159
10186
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
10160
|
-
type = 32 /* SLOTS_CHILDREN */;
|
|
10187
|
+
type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
|
|
10161
10188
|
}
|
|
10162
10189
|
else {
|
|
10163
10190
|
children = String(children);
|
|
10164
10191
|
// force teleport children to array so it can be moved around
|
|
10165
|
-
if (shapeFlag & 64 /* TELEPORT */) {
|
|
10166
|
-
type = 16 /* ARRAY_CHILDREN */;
|
|
10192
|
+
if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
|
|
10193
|
+
type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
|
|
10167
10194
|
children = [createTextVNode(children)];
|
|
10168
10195
|
}
|
|
10169
10196
|
else {
|
|
10170
|
-
type = 8 /* TEXT_CHILDREN */;
|
|
10197
|
+
type = 8 /* ShapeFlags.TEXT_CHILDREN */;
|
|
10171
10198
|
}
|
|
10172
10199
|
}
|
|
10173
10200
|
vnode.children = children;
|
|
@@ -10205,7 +10232,7 @@ function mergeProps(...args) {
|
|
|
10205
10232
|
return ret;
|
|
10206
10233
|
}
|
|
10207
10234
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
10208
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
10235
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
|
|
10209
10236
|
vnode,
|
|
10210
10237
|
prevVNode
|
|
10211
10238
|
]);
|
|
@@ -10313,7 +10340,7 @@ function validateComponentName(name, config) {
|
|
|
10313
10340
|
}
|
|
10314
10341
|
}
|
|
10315
10342
|
function isStatefulComponent(instance) {
|
|
10316
|
-
return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
|
|
10343
|
+
return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
|
|
10317
10344
|
}
|
|
10318
10345
|
let isInSSRComponentSetup = false;
|
|
10319
10346
|
function setupComponent(instance, isSSR = false) {
|
|
@@ -10368,7 +10395,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10368
10395
|
setup.length > 1 ? createSetupContext(instance) : null);
|
|
10369
10396
|
setCurrentInstance(instance);
|
|
10370
10397
|
pauseTracking();
|
|
10371
|
-
const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
|
|
10398
|
+
const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
|
|
10372
10399
|
resetTracking();
|
|
10373
10400
|
unsetCurrentInstance();
|
|
10374
10401
|
if (isPromise(setupResult)) {
|
|
@@ -10380,7 +10407,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10380
10407
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10381
10408
|
})
|
|
10382
10409
|
.catch(e => {
|
|
10383
|
-
handleError(e, instance, 0 /* SETUP_FUNCTION */);
|
|
10410
|
+
handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
|
|
10384
10411
|
});
|
|
10385
10412
|
}
|
|
10386
10413
|
else {
|
|
@@ -10478,6 +10505,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10478
10505
|
// pass runtime compat config into the compiler
|
|
10479
10506
|
finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
|
|
10480
10507
|
if (Component.compatConfig) {
|
|
10508
|
+
// @ts-expect-error types are not compatible
|
|
10481
10509
|
extend(finalCompilerOptions.compatConfig, Component.compatConfig);
|
|
10482
10510
|
}
|
|
10483
10511
|
}
|
|
@@ -10522,7 +10550,7 @@ function createAttrsProxy(instance) {
|
|
|
10522
10550
|
return new Proxy(instance.attrs, {
|
|
10523
10551
|
get(target, key) {
|
|
10524
10552
|
markAttrsAccessed();
|
|
10525
|
-
track(instance, "get" /* GET */, '$attrs');
|
|
10553
|
+
track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
|
|
10526
10554
|
return target[key];
|
|
10527
10555
|
},
|
|
10528
10556
|
set() {
|
|
@@ -11025,7 +11053,7 @@ function isMemoSame(cached, memo) {
|
|
|
11025
11053
|
}
|
|
11026
11054
|
|
|
11027
11055
|
// Core API ------------------------------------------------------------------
|
|
11028
|
-
const version = "3.2.
|
|
11056
|
+
const version = "3.2.38";
|
|
11029
11057
|
/**
|
|
11030
11058
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11031
11059
|
* @internal
|
|
@@ -11275,14 +11303,14 @@ function compatCoerceAttr(el, key, value, instance = null) {
|
|
|
11275
11303
|
? 'true'
|
|
11276
11304
|
: null;
|
|
11277
11305
|
if (v2CocercedValue &&
|
|
11278
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11306
|
+
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
|
|
11279
11307
|
el.setAttribute(key, v2CocercedValue);
|
|
11280
11308
|
return true;
|
|
11281
11309
|
}
|
|
11282
11310
|
}
|
|
11283
11311
|
else if (value === false &&
|
|
11284
11312
|
!isSpecialBooleanAttr(key) &&
|
|
11285
|
-
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, instance, key)) {
|
|
11313
|
+
compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, instance, key)) {
|
|
11286
11314
|
el.removeAttribute(key);
|
|
11287
11315
|
return true;
|
|
11288
11316
|
}
|
|
@@ -11344,10 +11372,10 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11344
11372
|
}
|
|
11345
11373
|
else {
|
|
11346
11374
|
if (value === false &&
|
|
11347
|
-
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11375
|
+
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11348
11376
|
const type = typeof el[key];
|
|
11349
11377
|
if (type === 'string' || type === 'number') {
|
|
11350
|
-
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11378
|
+
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11351
11379
|
value = type === 'number' ? 0 : '';
|
|
11352
11380
|
needRemove = true;
|
|
11353
11381
|
}
|
|
@@ -11437,7 +11465,8 @@ function parseName(name) {
|
|
|
11437
11465
|
options[m[0].toLowerCase()] = true;
|
|
11438
11466
|
}
|
|
11439
11467
|
}
|
|
11440
|
-
|
|
11468
|
+
const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
|
|
11469
|
+
return [event, options];
|
|
11441
11470
|
}
|
|
11442
11471
|
function createInvoker(initialValue, instance) {
|
|
11443
11472
|
const invoker = (e) => {
|
|
@@ -11449,7 +11478,7 @@ function createInvoker(initialValue, instance) {
|
|
|
11449
11478
|
// AFTER it was attached.
|
|
11450
11479
|
const timeStamp = e.timeStamp || _getNow();
|
|
11451
11480
|
if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
|
|
11452
|
-
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
|
|
11481
|
+
callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* ErrorCodes.NATIVE_EVENT_HANDLER */, [e]);
|
|
11453
11482
|
}
|
|
11454
11483
|
};
|
|
11455
11484
|
invoker.value = initialValue;
|
|
@@ -11804,7 +11833,7 @@ function useCssVars(getter) {
|
|
|
11804
11833
|
});
|
|
11805
11834
|
}
|
|
11806
11835
|
function setVarsOnVNode(vnode, vars) {
|
|
11807
|
-
if (vnode.shapeFlag & 128 /* SUSPENSE */) {
|
|
11836
|
+
if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
|
|
11808
11837
|
const suspense = vnode.suspense;
|
|
11809
11838
|
vnode = suspense.activeBranch;
|
|
11810
11839
|
if (suspense.pendingBranch && !suspense.isHydrating) {
|
|
@@ -11817,7 +11846,7 @@ function setVarsOnVNode(vnode, vars) {
|
|
|
11817
11846
|
while (vnode.component) {
|
|
11818
11847
|
vnode = vnode.component.subTree;
|
|
11819
11848
|
}
|
|
11820
|
-
if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {
|
|
11849
|
+
if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && vnode.el) {
|
|
11821
11850
|
setVarsOnNode(vnode.el, vars);
|
|
11822
11851
|
}
|
|
11823
11852
|
else if (vnode.type === Fragment) {
|
|
@@ -11906,7 +11935,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
11906
11935
|
}
|
|
11907
11936
|
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;
|
|
11908
11937
|
// legacy transition class compat
|
|
11909
|
-
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* TRANSITION_CLASSES */, null);
|
|
11938
|
+
const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */, null);
|
|
11910
11939
|
let legacyEnterFromClass;
|
|
11911
11940
|
let legacyAppearFromClass;
|
|
11912
11941
|
let legacyLeaveFromClass;
|
|
@@ -12215,7 +12244,7 @@ const TransitionGroupImpl = {
|
|
|
12215
12244
|
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
12216
12245
|
let tag = rawProps.tag || Fragment;
|
|
12217
12246
|
if (!rawProps.tag &&
|
|
12218
|
-
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12247
|
+
compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */, instance.parent)) {
|
|
12219
12248
|
tag = 'span';
|
|
12220
12249
|
}
|
|
12221
12250
|
prevChildren = children;
|
|
@@ -12585,13 +12614,13 @@ const withKeys = (fn, modifiers) => {
|
|
|
12585
12614
|
let instance = null;
|
|
12586
12615
|
{
|
|
12587
12616
|
instance = getCurrentInstance();
|
|
12588
|
-
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */, instance)) {
|
|
12617
|
+
if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */, instance)) {
|
|
12589
12618
|
if (instance) {
|
|
12590
12619
|
globalKeyCodes = instance.appContext.config.keyCodes;
|
|
12591
12620
|
}
|
|
12592
12621
|
}
|
|
12593
12622
|
if (modifiers.some(m => /^\d+$/.test(m))) {
|
|
12594
|
-
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance);
|
|
12623
|
+
compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance);
|
|
12595
12624
|
}
|
|
12596
12625
|
}
|
|
12597
12626
|
return (event) => {
|
|
@@ -12604,7 +12633,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
12604
12633
|
}
|
|
12605
12634
|
{
|
|
12606
12635
|
const keyCode = String(event.keyCode);
|
|
12607
|
-
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12636
|
+
if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance) &&
|
|
12608
12637
|
modifiers.some(mod => mod == keyCode)) {
|
|
12609
12638
|
return fn(event);
|
|
12610
12639
|
}
|
|
@@ -12713,7 +12742,7 @@ const createApp = ((...args) => {
|
|
|
12713
12742
|
for (let i = 0; i < container.attributes.length; i++) {
|
|
12714
12743
|
const attr = container.attributes[i];
|
|
12715
12744
|
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
|
|
12716
|
-
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
|
|
12745
|
+
compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
|
|
12717
12746
|
break;
|
|
12718
12747
|
}
|
|
12719
12748
|
}
|
|
@@ -12970,7 +12999,7 @@ function initDev() {
|
|
|
12970
12999
|
function wrappedCreateApp(...args) {
|
|
12971
13000
|
// @ts-ignore
|
|
12972
13001
|
const app = createApp(...args);
|
|
12973
|
-
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, null)) {
|
|
13002
|
+
if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, null)) {
|
|
12974
13003
|
// register built-in components so that they can be resolved via strings
|
|
12975
13004
|
// in the legacy h() call. The __compat__ prefix is to ensure that v3 h()
|
|
12976
13005
|
// doesn't get affected.
|