Commit Graph

148 Commits

Author SHA1 Message Date
Evan You 8867bb259a wip(vitest-migration): reactivity tests passing 2023-01-26 15:25:55 +08:00
8731852919
test(reactivity): Using toRaw on a raw Array (#7354) 2023-01-09 15:19:19 +01:00
Evan You 588bd44f03 fix(reactivity): track hasOwnProperty
fix #2619
close #2621
2022-11-14 17:17:35 +08:00
webfansplz 59ffe5ee1f
fix(types/effectScope): re-expose `active` as readonly property (#6187)
close #6186
2022-11-13 20:27:52 -05:00
bcq028 e6224f4256
fix(reactivity): enable trigger when use str to set length of arr (#6810)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2022-10-21 09:25:06 +02:00
Evan You a71f9ac41a fix(effectScope): calling off() of a detached scope should not break currentScope 2022-10-14 10:53:23 +08:00
Evan You a95554d35c fix(reactivity): fix shallow/readonly edge cases 2022-07-22 11:16:06 +08:00
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
那里好脏不可以 6042ab0f2f
chore: type [ci skip] 2022-05-09 22:51:51 -04:00
Evan You 82bdf86254 fix(reactivity): ensure computed is invalidated before other effects
fix #5720
2022-04-15 16:43:17 +08:00
Evan You 154233abdb fix(reactivity): fix ref tracking of self-stopping effects
close #5707
2022-04-13 17:00:31 +08:00
Wei 0a301d4dab
fix(reactivity): fix currentScope loss when running detached effect scope (#5575) 2022-04-12 03:51:05 -04:00
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