@reactive-vscode/reactivity 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  /**
4
- * @vue/shared v3.5.12
4
+ * @vue/shared v3.5.13
5
5
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
6
6
  * @license MIT
7
7
  **/
@@ -62,7 +62,7 @@ const def = (obj, key, value, writable = false) => {
62
62
  });
63
63
  };
64
64
  /**
65
- * @vue/reactivity v3.5.12
65
+ * @vue/reactivity v3.5.13
66
66
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
67
67
  * @license MIT
68
68
  **/
@@ -149,17 +149,21 @@ class EffectScope {
149
149
  }
150
150
  stop(fromParent) {
151
151
  if (this._active) {
152
+ this._active = false;
152
153
  let i, l;
153
154
  for (i = 0, l = this.effects.length; i < l; i++) {
154
155
  this.effects[i].stop();
155
156
  }
157
+ this.effects.length = 0;
156
158
  for (i = 0, l = this.cleanups.length; i < l; i++) {
157
159
  this.cleanups[i]();
158
160
  }
161
+ this.cleanups.length = 0;
159
162
  if (this.scopes) {
160
163
  for (i = 0, l = this.scopes.length; i < l; i++) {
161
164
  this.scopes[i].stop(true);
162
165
  }
166
+ this.scopes.length = 0;
163
167
  }
164
168
  if (!this.detached && this.parent && !fromParent) {
165
169
  const last = this.parent.scopes.pop();
@@ -169,7 +173,6 @@ class EffectScope {
169
173
  }
170
174
  }
171
175
  this.parent = void 0;
172
- this._active = false;
173
176
  }
174
177
  }
175
178
  }
@@ -937,6 +940,7 @@ class BaseReactiveHandler {
937
940
  this._isShallow = _isShallow;
938
941
  }
939
942
  get(target, key, receiver) {
943
+ if (key === "__v_skip") return target["__v_skip"];
940
944
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
941
945
  if (key === "__v_isReactive") {
942
946
  return !isReadonly2;
@@ -1762,7 +1766,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1762
1766
  const scope = getCurrentScope();
1763
1767
  const watchHandle = () => {
1764
1768
  effect2.stop();
1765
- if (scope) {
1769
+ if (scope && scope.active) {
1766
1770
  remove(scope.effects, effect2);
1767
1771
  }
1768
1772
  };
@@ -2146,7 +2150,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
2146
2150
  }
2147
2151
  const baseWatchOptions = extend({}, options);
2148
2152
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn;
2149
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, type, args);
2153
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, null, type, args);
2150
2154
  let isPre = false;
2151
2155
  if (flush !== "sync") {
2152
2156
  isPre = true;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.12
2
+ * @vue/shared v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -60,7 +60,7 @@ const def = (obj, key, value, writable = false) => {
60
60
  });
61
61
  };
62
62
  /**
63
- * @vue/reactivity v3.5.12
63
+ * @vue/reactivity v3.5.13
64
64
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
65
65
  * @license MIT
66
66
  **/
@@ -147,17 +147,21 @@ class EffectScope {
147
147
  }
148
148
  stop(fromParent) {
149
149
  if (this._active) {
150
+ this._active = false;
150
151
  let i, l;
151
152
  for (i = 0, l = this.effects.length; i < l; i++) {
152
153
  this.effects[i].stop();
153
154
  }
155
+ this.effects.length = 0;
154
156
  for (i = 0, l = this.cleanups.length; i < l; i++) {
155
157
  this.cleanups[i]();
156
158
  }
159
+ this.cleanups.length = 0;
157
160
  if (this.scopes) {
158
161
  for (i = 0, l = this.scopes.length; i < l; i++) {
159
162
  this.scopes[i].stop(true);
160
163
  }
164
+ this.scopes.length = 0;
161
165
  }
162
166
  if (!this.detached && this.parent && !fromParent) {
163
167
  const last = this.parent.scopes.pop();
@@ -167,7 +171,6 @@ class EffectScope {
167
171
  }
168
172
  }
169
173
  this.parent = void 0;
170
- this._active = false;
171
174
  }
172
175
  }
173
176
  }
@@ -935,6 +938,7 @@ class BaseReactiveHandler {
935
938
  this._isShallow = _isShallow;
936
939
  }
937
940
  get(target, key, receiver) {
941
+ if (key === "__v_skip") return target["__v_skip"];
938
942
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
939
943
  if (key === "__v_isReactive") {
940
944
  return !isReadonly2;
@@ -1760,7 +1764,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1760
1764
  const scope = getCurrentScope();
1761
1765
  const watchHandle = () => {
1762
1766
  effect2.stop();
1763
- if (scope) {
1767
+ if (scope && scope.active) {
1764
1768
  remove(scope.effects, effect2);
1765
1769
  }
1766
1770
  };
@@ -2144,7 +2148,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
2144
2148
  }
2145
2149
  const baseWatchOptions = extend({}, options);
2146
2150
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn;
2147
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, type, args);
2151
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, null, type, args);
2148
2152
  let isPre = false;
2149
2153
  if (flush !== "sync") {
2150
2154
  isPre = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reactive-vscode/reactivity",
3
3
  "type": "module",
4
- "version": "0.2.8",
4
+ "version": "0.2.9",
5
5
  "description": "Full Vue Reactivity API without DOM",
6
6
  "author": "_Kerman <kermanx@qq.com>",
7
7
  "license": "MIT",
@@ -30,10 +30,10 @@
30
30
  "dist"
31
31
  ],
32
32
  "devDependencies": {
33
- "@vue/reactivity": "^3.5.12",
34
- "@vue/shared": "^3.5.12",
35
- "typescript": "^5.6.3",
36
- "vite": "^5.4.10",
33
+ "@vue/reactivity": "^3.5.13",
34
+ "@vue/shared": "^3.5.13",
35
+ "typescript": "^5.7.2",
36
+ "vite": "^5.4.11",
37
37
  "vite-plugin-dts": "^4.3.0"
38
38
  },
39
39
  "scripts": {