Commit Graph

31 Commits

Author SHA1 Message Date
HeYunfei
b5b103a736
chore(types): delete @ts-ignore or use @ts-expected-error instead (#3669)
Co-authored-by: heyunfei.i <heyunfei.i@bytedance.com>
2022-05-11 20:40:59 -04:00
Evan You
154233abdb fix(reactivity): fix ref tracking of self-stopping effects
close #5707
2022-04-13 17:00:31 +08:00
Pick
35cc7b0d31
chore(reactivity): correct the description of the test case (#4135) 2021-07-19 17:59:30 -04:00
Bas van Meurs
6cf2377cd4 perf(reactivity): use bitwise dep markers to optimize re-tracking (#4017) 2021-07-16 14:30:49 -04:00
Evan You
87f69fd0bb perf(reactivity): improve reactive effect memory usage (#4001)
Based on #2345 , but with smaller API change

- Use class implementation for `ReactiveEffect`
- Switch internal creation of effects to use the class constructor
- Avoid options object allocation
- Avoid creating bound effect runner function (used in schedulers) when not necessary.
- Consumes ~17% less memory compared to last commit
- Introduces a very minor breaking change: the `scheduler` option passed to `effect` no longer receives the runner function.
2021-07-16 14:30:49 -04:00
Evan You
03a7a73148 fix(reactivity): ensure computed always expose value
fix #3099

Also changes the original fix for #910 by moving the fix from
reactivity to the scheduler
2021-05-27 20:53:21 -04:00
HcySunYang
5036c51cb7
fix(reactivity): fix tracking for readonly + reactive Map (#3604)
fix #3602
2021-05-07 18:49:11 -04:00
liaoliao666
c61e767422
fix(reactivity): should not trigger when setting value to same proxy (#2904) 2021-03-29 17:52:57 -04:00
ᴜɴвʏтᴇ
f316a332b0
fix(reactivity): avoid length mutating array methods causing infinite updates (#2138)
fix #2137

Co-authored-by: Evan You <yyx990803@gmail.com>
2020-09-18 01:01:36 -04:00
Evan You
7454e2a52b build(deps): upgrade to TypeScript 4 2020-08-20 17:48:28 -04:00
Evan You
730e39eb76 refactor: remove unnecessary conditions and test case 2020-07-28 12:26:14 -04:00
Evan You
7edfdf7e23 fix(reactivity): avoid tracking internal symbols in has trap
fix #1683
2020-07-22 21:23:32 -04:00
HiiTea
22717772dd
chore: fix typos (#1090) 2020-05-01 09:42:58 -04:00
Evan You
09b4202a22 refactor(reactivity): adjust APIs
BREAKING CHANGE: Reactivity APIs adjustments:

- `readonly` is now non-tracking if called on plain objects.
  `lock` and `unlock` have been removed. A `readonly` proxy can no
  longer be directly mutated. However, it can still wrap an already
  reactive object and track changes to the source reactive object.

- `isReactive` now only returns true for proxies created by `reactive`,
   or a `readonly` proxy that wraps a `reactive` proxy.

- A new utility `isProxy` is introduced, which returns true for both
  reactive or readonly proxies.

- `markNonReactive` has been renamed to `markRaw`.
2020-04-15 16:45:20 -04:00
Evan You
0764c33d3d fix(reactivity): scheduled effect should not execute if stopped
fix #910
2020-04-02 19:50:48 -04:00
guaijie
5fac65589b
fix(reactivity): should trigger all effects when array length is mutated (#754) 2020-02-21 11:38:07 +01:00
Evan You
e8e67729cb fix(reactivity): effect should handle self dependency mutations 2020-02-18 13:22:09 -05:00
Evan You
89a187b895 refactor(reactivity): separate track and trigger operation types 2019-12-03 11:30:24 -05:00
JiZhi
cb97d152b8 test(effect): add test for nested stopped effect (#417) 2019-10-30 11:36:17 -04:00
Evan You
247c53672d refactor(reactivity): simplify effect options 2019-10-30 11:11:23 -04:00
夜宴
57276f9dcb test(effect): add test for json methods (#371) 2019-10-25 10:17:31 -04:00
Mayness
18a349ce8c fix(reactivity): account for NaN in value change checks (#361) 2019-10-23 11:53:43 -04:00
Evan You
d69d3bf765 fix(reactivity): revert to Reflect.get and add test cases 2019-10-18 15:31:28 -04:00
唐道海
b7b89505eb test(reactivity/effect): add test for lazy option (#179) 2019-10-10 10:12:27 -04:00
Carlos Rodrigues
600ec5de42 chore: improve typings in reactivity tests (#96) 2019-10-05 10:39:40 -04:00
Evan You
62e07a1b7e test: coverage 2019-08-27 14:42:05 -04:00
Evan You
7ecdc79d5e test: finish tests for watch api 2019-08-27 11:35:22 -04:00
Evan You
cb3866890f test: effect.onStop 2019-08-26 21:24:44 -04:00
Evan You
aacad85058 test: fix reactivity tests 2019-08-20 09:58:10 -04:00
Evan You
caba6d5c9e wip: state -> reactive, value -> ref 2019-08-16 09:42:46 -04:00
Evan You
471899af8b refactor: rename reactivity package name and APIs 2019-06-11 23:50:28 +08:00