115 Commits

Author SHA1 Message Date
Evan You
6eb47f000a fix(reactivity): computed should not trigger scheduler if stopped
fix 
2021-07-19 13:37:03 -04:00
Evan You
5cea9a1d4e feat(reactivity): support onTrack/onTrigger debug options for computed 2021-07-16 14:30:49 -04:00
Evan You
2dd4739089 test: more test cases for computed w/ scheduler 2021-07-16 14:30:49 -04:00
Evan You
1fe2239270 refactor: sync value access for chained computed w/ scheduler 2021-07-16 14:30:49 -04:00
Bas van Meurs
6cf2377cd4 perf(reactivity): use bitwise dep markers to optimize re-tracking () 2021-07-16 14:30:49 -04:00
Evan You
bde855e017 test: test for computed optimization 2021-07-16 14:30:49 -04:00
Anthony Fu
f5617fc3bb feat(reactivity): new effectScope API () 2021-07-16 14:30:49 -04:00
Evan You
87f69fd0bb perf(reactivity): improve reactive effect memory usage ()
Based on  , 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
TheDro
1cfe290352
fix(reactivity): call array subclass methods ()
fix , close 
2021-07-15 17:17:13 -04:00
Yang Mingshan
08f504c1b7
fix(ref): should not trigger when setting value to same proxy () 2021-07-15 16:28:01 -04:00
Evan You
03a7a73148 fix(reactivity): ensure computed always expose value
fix 

Also changes the original fix for  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 ()
fix 
2021-05-07 18:49:11 -04:00
kiyon
7a8bac73e1
chore: fix typo in test case description 2021-04-16 10:43:56 +08:00
liaoliao666
c61e767422
fix(reactivity): should not trigger when setting value to same proxy () 2021-03-29 17:52:57 -04:00
Thorsten Lünborg
22cc4a7659
fix(reactivity): ensure that shallow and normal proxies are tracked seperately (close ) ()
fix 
2021-03-26 15:39:56 -04:00
HcySunYang
68de9f408a
fix(reactivity): fix shallow readonly behavior for collections ()
fix 
2021-03-26 15:10:21 -04:00
Evan You
41e02f0fac fix(reactivity): ensure computed can be wrapped by readonly
fix 
2021-03-25 11:23:34 -04:00
Thorsten Lünborg
6e46a574ed
fix(reactivity): ensure add/set on reactive collections return the proxy ()
fix 
2020-11-27 14:16:00 -05:00
Thorsten Lünborg
34703082fd
fix(reactivity): ensure readonly on plain arrays doesn't track array methods. ()
fix 
2020-11-27 10:24:31 -05:00
Evan You
0e5a3c47a7 fix(reactivity): track length on for in iteration on Array
fix 
2020-10-19 17:37:35 -04:00
ᴜɴвʏтᴇ
f316a332b0
fix(reactivity): avoid length mutating array methods causing infinite updates ()
fix 

Co-authored-by: Evan You <yyx990803@gmail.com>
2020-09-18 01:01:36 -04:00
izayl
848ccf56fb
test(reactive): add test case of mutation in original reflecting in observed value () 2020-09-15 10:49:59 -04:00
Carlos Rodrigues
d4bf9bcbb4
fix(reactivity): toRef should not wrap a ref () 2020-09-15 10:29:38 -04:00
Pick
fcf9b2cf19
fix(reactivity): should trigger collection's write-function correctly on non-reactive keys () 2020-09-14 21:31:04 -04:00
Hefty
0d4910a211
fix(reactivity): add NaN prop on Array should not trigger length dependency. () 2020-09-14 20:40:09 -04:00
Pick
97bc30edad
perf(reactivity): avoid triggering Map.has twice on non-reactive keys () 2020-08-26 11:41:18 -04:00
xxgjzftd
d5c4f6ed4d
perf(reactivity): add existing index or non-integer prop on Array should not trigger length dependency () 2020-08-26 11:28:58 -04:00
Evan You
016ba116a8 fix(reactivity): fix iOS 12 JSON.stringify error on reactive objects
- Use WeakMap for raw -> reactive/readonly storage. This is slightly
  more expensive than using a field on the taget object but avoids
  polluting the original.

- also fix Collection.forEach callback value

fix 
2020-08-24 15:34:04 -04:00
ᴜɴвʏтᴇ
3c05f8bbd6
fix(reactivity): unwrap non-index accessed refs on reactive arrays ()
close 
2020-08-21 13:36:41 -04:00
Evan You
7454e2a52b build(deps): upgrade to TypeScript 4 2020-08-20 17:48:28 -04:00
Pick
02dcc68c24
test(reactivity): improve built-in Collection subclass test cases () 2020-08-19 16:22:31 -04:00
Jordan Pittman
4172fdb90c
feat(reactivity): return array when calling toRefs on array ()
close 
2020-08-18 12:11:13 -04:00
ᴜɴвʏтᴇ
d005b578b1
fix(reactivity): accept subtypes of collections () 2020-08-17 12:17:46 -04:00
Evan You
50adc014f5 refactor(reactivity): readonly collections should not track 2020-08-06 12:10:03 -04:00
Evan You
ed4381020f fix(reactivity): readonly+reactive collection should also expose readonly+reactive values
fix 
2020-08-06 11:18:16 -04:00
wujieZ
2787c34cd4
fix(reactivity): use isExtensible instead of isFrozen ()
close 
2020-08-05 11:53:50 -04:00
Evan You
730e39eb76 refactor: remove unnecessary conditions and test case 2020-07-28 12:26:14 -04:00
Evan You
5c74243211 test: move mockWarn into setup files 2020-07-27 22:58:51 -04:00
Evan You
7edfdf7e23 fix(reactivity): avoid tracking internal symbols in has trap
fix 
2020-07-22 21:23:32 -04:00
Carlos Rodrigues
dabdc5e115
feat(computed): add readonly flag if no setter is provided () 2020-07-20 17:35:31 -04:00
Pick
028a8c20df
test(reactivity): adjust ref unwrap test inside arrays () 2020-06-29 12:10:29 -04:00
Yang Mingshan
80e1693e1f
fix(reactivity): replaced ref in reactive object should be tracked () 2020-06-12 09:20:43 -04:00
蜗牛老湿
426803046f
test(reactivity): 100% reactivity coverage () 2020-06-11 16:55:56 -04:00
Evan You
10bb34bb86 fix(reactivity): fix toRaw for objects prototype inherting reactive
fix 
2020-06-11 15:12:57 -04:00
Carlos Rodrigues
c97d1bae56
fix(reactivity): shallowReactive collection to not-readonly () 2020-06-09 17:20:30 -04:00
doly mood
d3c436ae2e
feat(types): mixins/extends support in TypeScript () 2020-06-09 10:37:00 -04:00
Carlos Rodrigues
488e2bcfef
fix(reactivity): shallowReactive for collections ()
close 
2020-05-18 11:17:37 -04:00
龙腾道
e08f6f0ede
fix(reactivity): use correct thisArg for collection method callbacks () 2020-05-06 13:41:34 -04:00
XinPing Wang
8bab78b648 test: reactive proto 2020-05-03 15:36:19 -04:00
HiiTea
22717772dd
chore: fix typos () 2020-05-01 09:42:58 -04:00