@vue/reactivity 3.3.3 → 3.3.4
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/reactivity.esm-bundler.js +23 -23
- package/package.json +2 -2
|
@@ -39,7 +39,7 @@ class EffectScope {
|
|
|
39
39
|
} finally {
|
|
40
40
|
activeEffectScope = currentEffectScope;
|
|
41
41
|
}
|
|
42
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
42
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
43
43
|
warn(`cannot run an inactive effect scope.`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -97,7 +97,7 @@ function getCurrentScope() {
|
|
|
97
97
|
function onScopeDispose(fn) {
|
|
98
98
|
if (activeEffectScope) {
|
|
99
99
|
activeEffectScope.cleanups.push(fn);
|
|
100
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
100
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
101
101
|
warn(
|
|
102
102
|
`onScopeDispose() is called when there is no active effect scope to be associated with.`
|
|
103
103
|
);
|
|
@@ -142,8 +142,8 @@ let effectTrackDepth = 0;
|
|
|
142
142
|
let trackOpBit = 1;
|
|
143
143
|
const maxMarkerBits = 30;
|
|
144
144
|
let activeEffect;
|
|
145
|
-
const ITERATE_KEY = Symbol(process.env.NODE_ENV !== "production" ? "iterate" : "");
|
|
146
|
-
const MAP_KEY_ITERATE_KEY = Symbol(process.env.NODE_ENV !== "production" ? "Map key iterate" : "");
|
|
145
|
+
const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "iterate" : "");
|
|
146
|
+
const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map key iterate" : "");
|
|
147
147
|
class ReactiveEffect {
|
|
148
148
|
constructor(fn, scheduler = null, scope) {
|
|
149
149
|
this.fn = fn;
|
|
@@ -254,7 +254,7 @@ function track(target, type, key) {
|
|
|
254
254
|
if (!dep) {
|
|
255
255
|
depsMap.set(key, dep = createDep());
|
|
256
256
|
}
|
|
257
|
-
const eventInfo = process.env.NODE_ENV !== "production" ? { effect: activeEffect, target, type, key } : void 0;
|
|
257
|
+
const eventInfo = !!(process.env.NODE_ENV !== "production") ? { effect: activeEffect, target, type, key } : void 0;
|
|
258
258
|
trackEffects(dep, eventInfo);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
@@ -271,7 +271,7 @@ function trackEffects(dep, debuggerEventExtraInfo) {
|
|
|
271
271
|
if (shouldTrack2) {
|
|
272
272
|
dep.add(activeEffect);
|
|
273
273
|
activeEffect.deps.push(dep);
|
|
274
|
-
if (process.env.NODE_ENV !== "production" && activeEffect.onTrack) {
|
|
274
|
+
if (!!(process.env.NODE_ENV !== "production") && activeEffect.onTrack) {
|
|
275
275
|
activeEffect.onTrack(
|
|
276
276
|
extend(
|
|
277
277
|
{
|
|
@@ -328,10 +328,10 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
328
328
|
break;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
const eventInfo = process.env.NODE_ENV !== "production" ? { target, type, key, newValue, oldValue, oldTarget } : void 0;
|
|
331
|
+
const eventInfo = !!(process.env.NODE_ENV !== "production") ? { target, type, key, newValue, oldValue, oldTarget } : void 0;
|
|
332
332
|
if (deps.length === 1) {
|
|
333
333
|
if (deps[0]) {
|
|
334
|
-
if (process.env.NODE_ENV !== "production") {
|
|
334
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
335
335
|
triggerEffects(deps[0], eventInfo);
|
|
336
336
|
} else {
|
|
337
337
|
triggerEffects(deps[0]);
|
|
@@ -344,7 +344,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
344
344
|
effects.push(...dep);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
if (process.env.NODE_ENV !== "production") {
|
|
347
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
348
348
|
triggerEffects(createDep(effects), eventInfo);
|
|
349
349
|
} else {
|
|
350
350
|
triggerEffects(createDep(effects));
|
|
@@ -366,7 +366,7 @@ function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
|
366
366
|
}
|
|
367
367
|
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
368
368
|
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
369
|
-
if (process.env.NODE_ENV !== "production" && effect2.onTrigger) {
|
|
369
|
+
if (!!(process.env.NODE_ENV !== "production") && effect2.onTrigger) {
|
|
370
370
|
effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
371
371
|
}
|
|
372
372
|
if (effect2.scheduler) {
|
|
@@ -520,7 +520,7 @@ const mutableHandlers = {
|
|
|
520
520
|
const readonlyHandlers = {
|
|
521
521
|
get: readonlyGet,
|
|
522
522
|
set(target, key) {
|
|
523
|
-
if (process.env.NODE_ENV !== "production") {
|
|
523
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
524
524
|
warn(
|
|
525
525
|
`Set operation on key "${String(key)}" failed: target is readonly.`,
|
|
526
526
|
target
|
|
@@ -529,7 +529,7 @@ const readonlyHandlers = {
|
|
|
529
529
|
return true;
|
|
530
530
|
},
|
|
531
531
|
deleteProperty(target, key) {
|
|
532
|
-
if (process.env.NODE_ENV !== "production") {
|
|
532
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
533
533
|
warn(
|
|
534
534
|
`Delete operation on key "${String(key)}" failed: target is readonly.`,
|
|
535
535
|
target
|
|
@@ -612,7 +612,7 @@ function set(key, value) {
|
|
|
612
612
|
if (!hadKey) {
|
|
613
613
|
key = toRaw(key);
|
|
614
614
|
hadKey = has2.call(target, key);
|
|
615
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
615
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
616
616
|
checkIdentityKeys(target, has2, key);
|
|
617
617
|
}
|
|
618
618
|
const oldValue = get2.call(target, key);
|
|
@@ -631,7 +631,7 @@ function deleteEntry(key) {
|
|
|
631
631
|
if (!hadKey) {
|
|
632
632
|
key = toRaw(key);
|
|
633
633
|
hadKey = has2.call(target, key);
|
|
634
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
634
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
635
635
|
checkIdentityKeys(target, has2, key);
|
|
636
636
|
}
|
|
637
637
|
const oldValue = get2 ? get2.call(target, key) : void 0;
|
|
@@ -644,7 +644,7 @@ function deleteEntry(key) {
|
|
|
644
644
|
function clear() {
|
|
645
645
|
const target = toRaw(this);
|
|
646
646
|
const hadItems = target.size !== 0;
|
|
647
|
-
const oldTarget = process.env.NODE_ENV !== "production" ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
647
|
+
const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
|
|
648
648
|
const result = target.clear();
|
|
649
649
|
if (hadItems) {
|
|
650
650
|
trigger(target, "clear", void 0, void 0, oldTarget);
|
|
@@ -695,7 +695,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
|
|
|
695
695
|
}
|
|
696
696
|
function createReadonlyMethod(type) {
|
|
697
697
|
return function(...args) {
|
|
698
|
-
if (process.env.NODE_ENV !== "production") {
|
|
698
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
699
699
|
const key = args[0] ? `on key "${args[0]}" ` : ``;
|
|
700
700
|
console.warn(
|
|
701
701
|
`${capitalize(type)} operation ${key}failed: target is readonly.`,
|
|
@@ -903,7 +903,7 @@ function shallowReadonly(target) {
|
|
|
903
903
|
}
|
|
904
904
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
905
905
|
if (!isObject(target)) {
|
|
906
|
-
if (process.env.NODE_ENV !== "production") {
|
|
906
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
907
907
|
console.warn(`value cannot be made reactive: ${String(target)}`);
|
|
908
908
|
}
|
|
909
909
|
return target;
|
|
@@ -955,7 +955,7 @@ const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
|
955
955
|
function trackRefValue(ref2) {
|
|
956
956
|
if (shouldTrack && activeEffect) {
|
|
957
957
|
ref2 = toRaw(ref2);
|
|
958
|
-
if (process.env.NODE_ENV !== "production") {
|
|
958
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
959
959
|
trackEffects(ref2.dep || (ref2.dep = createDep()), {
|
|
960
960
|
target: ref2,
|
|
961
961
|
type: "get",
|
|
@@ -970,7 +970,7 @@ function triggerRefValue(ref2, newVal) {
|
|
|
970
970
|
ref2 = toRaw(ref2);
|
|
971
971
|
const dep = ref2.dep;
|
|
972
972
|
if (dep) {
|
|
973
|
-
if (process.env.NODE_ENV !== "production") {
|
|
973
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
974
974
|
triggerEffects(dep, {
|
|
975
975
|
target: ref2,
|
|
976
976
|
type: "set",
|
|
@@ -1020,7 +1020,7 @@ class RefImpl {
|
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
1022
|
function triggerRef(ref2) {
|
|
1023
|
-
triggerRefValue(ref2, process.env.NODE_ENV !== "production" ? ref2.value : void 0);
|
|
1023
|
+
triggerRefValue(ref2, !!(process.env.NODE_ENV !== "production") ? ref2.value : void 0);
|
|
1024
1024
|
}
|
|
1025
1025
|
function unref(ref2) {
|
|
1026
1026
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1065,7 +1065,7 @@ function customRef(factory) {
|
|
|
1065
1065
|
return new CustomRefImpl(factory);
|
|
1066
1066
|
}
|
|
1067
1067
|
function toRefs(object) {
|
|
1068
|
-
if (process.env.NODE_ENV !== "production" && !isProxy(object)) {
|
|
1068
|
+
if (!!(process.env.NODE_ENV !== "production") && !isProxy(object)) {
|
|
1069
1069
|
console.warn(`toRefs() expects a reactive object but received a plain one.`);
|
|
1070
1070
|
}
|
|
1071
1071
|
const ret = isArray(object) ? new Array(object.length) : {};
|
|
@@ -1158,7 +1158,7 @@ function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1158
1158
|
const onlyGetter = isFunction(getterOrOptions);
|
|
1159
1159
|
if (onlyGetter) {
|
|
1160
1160
|
getter = getterOrOptions;
|
|
1161
|
-
setter = process.env.NODE_ENV !== "production" ? () => {
|
|
1161
|
+
setter = !!(process.env.NODE_ENV !== "production") ? () => {
|
|
1162
1162
|
console.warn("Write operation failed: computed value is readonly");
|
|
1163
1163
|
} : NOOP;
|
|
1164
1164
|
} else {
|
|
@@ -1166,7 +1166,7 @@ function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1166
1166
|
setter = getterOrOptions.set;
|
|
1167
1167
|
}
|
|
1168
1168
|
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1169
|
-
if (process.env.NODE_ENV !== "production" && debugOptions && !isSSR) {
|
|
1169
|
+
if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
|
|
1170
1170
|
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1171
1171
|
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1172
1172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/reactivity",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "@vue/reactivity",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/reactivity.esm-bundler.js",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@vue/shared": "3.3.
|
|
39
|
+
"@vue/shared": "3.3.4"
|
|
40
40
|
}
|
|
41
41
|
}
|