Commit Graph

136 Commits

Author SHA1 Message Date
Thorsten Lünborg
4be1037f31
fix(reactivity): ensure readonly refs can be replaced with new refs in reactive objects (#5310)
fix #5307
2022-01-23 08:08:27 -05:00
HcySunYang
c64907d261
fix(types): calling readonly() with ref() should return Readonly<Ref<T>> (#5212) 2022-01-21 02:33:30 -05:00
Thorsten Lünborg
171f5e9c60
fix(reactivity): mutating a readonly ref nested in a reactive object should fail. (#5048)
fix: #5042
2022-01-21 02:33:18 -05:00
Evan You
ae4b0783d7 chore: update repo references 2022-01-18 16:43:59 +08:00
Evan You
9c304bfe79 fix(reactivity): differentiate shallow/deep proxies of same target when nested in reactive
fix #5271
2022-01-18 09:22:41 +08:00
Evan You
9fda9411ec feat(reactivity): add isShallow api 2022-01-18 09:22:41 +08:00
Evan You
2db9c909c2 feat(reactivity): support default value in toRef() 2021-12-11 16:41:58 +08:00
mehan
2a4f134fc5
chore: remove unnecessary assertion (#4867) 2021-11-25 23:08:25 -05:00
Evan You
d145128ab4 fix(reactivity): retain readonly proxies when setting as reactive property
fix #4986
2021-11-25 12:14:39 +08:00
huangkairan
592cdbdd7c
chore: remove unnecessary 'async' for test case (#4490) 2021-09-02 09:44:38 -04:00
阿崔cxr
a46b0a9a96
chore(test): make unnecessarily async test case sync (#4421) 2021-08-23 18:52:11 -04:00
Haoqun Jiang
7c4e4514d1
chore: rename onDispose to onScopeDispose in warnings and tests (#4355) 2021-08-16 18:19:06 -04:00
webfansplz
e04680b0aa
test(reactivity): add test case for effectScope (#4239) 2021-08-10 13:59:58 -04:00
Evan You
13c69469f2 refactor: simplify for size 2021-07-29 10:45:05 -04:00
Bas van Meurs
91f29540fe
refactor(reactivity): optimize child effect scope dereferencing (#4184) 2021-07-29 10:26:24 -04:00
Evan You
1867591e7c fix(reactivity): dereference nested effect scopes on manual stop 2021-07-28 12:08:01 -04:00
Pick
b79e4ca717
types(reactivity): Simplify the SymbolExtract (#4162) 2021-07-28 11:12:46 -04:00
Evan You
14ca881a1b feat(reactivity): deferredComputed
Note: this is not exposed as part of Vue API, only as
a lower-level API specific to @vue/reactivity
2021-07-20 17:39:19 -04:00
Evan You
33c2fbfdc8 fix(reactivity): revert computed scheduler change
fix #4157
2021-07-20 16:45:29 -04:00
Evan You
47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Pick
35cc7b0d31
chore(reactivity): correct the description of the test case (#4135) 2021-07-19 17:59:30 -04:00
Evan You
6eb47f000a fix(reactivity): computed should not trigger scheduler if stopped
fix #4149
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 (#4017) 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 (#2195) 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
TheDro
1cfe290352
fix(reactivity): call array subclass methods (#3624)
fix #2314, close #2315
2021-07-15 17:17:13 -04:00
Yang Mingshan
08f504c1b7
fix(ref): should not trigger when setting value to same proxy (#3658) 2021-07-15 16:28:01 -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
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 (#2904) 2021-03-29 17:52:57 -04:00
Thorsten Lünborg
22cc4a7659
fix(reactivity): ensure that shallow and normal proxies are tracked seperately (close #2843) (#2851)
fix #2843
2021-03-26 15:39:56 -04:00
HcySunYang
68de9f408a
fix(reactivity): fix shallow readonly behavior for collections (#3003)
fix #3007
2021-03-26 15:10:21 -04:00
Evan You
41e02f0fac fix(reactivity): ensure computed can be wrapped by readonly
fix #3376
2021-03-25 11:23:34 -04:00
Thorsten Lünborg
6e46a574ed
fix(reactivity): ensure add/set on reactive collections return the proxy (#2534)
fix #2530
2020-11-27 14:16:00 -05:00
Thorsten Lünborg
34703082fd
fix(reactivity): ensure readonly on plain arrays doesn't track array methods. (#2506)
fix #2493
2020-11-27 10:24:31 -05:00
Evan You
0e5a3c47a7 fix(reactivity): track length on for in iteration on Array
fix #2427
2020-10-19 17:37:35 -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
izayl
848ccf56fb
test(reactive): add test case of mutation in original reflecting in observed value (#2118) 2020-09-15 10:49:59 -04:00
Carlos Rodrigues
d4bf9bcbb4
fix(reactivity): toRef should not wrap a ref (#2103) 2020-09-15 10:29:38 -04:00
Pick
fcf9b2cf19
fix(reactivity): should trigger collection's write-function correctly on non-reactive keys (#1992) 2020-09-14 21:31:04 -04:00
Hefty
0d4910a211
fix(reactivity): add NaN prop on Array should not trigger length dependency. (#1998) 2020-09-14 20:40:09 -04:00
Pick
97bc30edad
perf(reactivity): avoid triggering Map.has twice on non-reactive keys (#1972) 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 (#1969) 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 #1916
2020-08-24 15:34:04 -04:00
ᴜɴвʏтᴇ
3c05f8bbd6
fix(reactivity): unwrap non-index accessed refs on reactive arrays (#1859)
close #1846
2020-08-21 13:36:41 -04:00