Commit Graph

89 Commits

Author SHA1 Message Date
Kevin Deng 三咲智子 928af5fe2f
refactor(types): enable `isolatedDeclarations` (#11178) 2024-08-08 23:05:21 +08:00
远方os 267093c314
feat(reactivity/watch): add pause/resume for ReactiveEffect, EffectScope, and WatchHandle (#9651) 2024-08-02 14:41:27 +08:00
Evan You 85f3592725
refactor: should throw errors in computed getters 2024-04-24 17:27:51 +08:00
Evan You ef2eaef3aa refactor: inline recordEffectScope 2024-03-07 17:53:10 +08:00
Evan You 2cc5615590 feat(reactivity): `onEffectCleanup` API
ref #10173

Instead of exposing `getCurrentEffect`, this version accepts a second
argument to suppress the no-active-effect warning.
2024-03-05 22:53:20 +08:00
Evan You 55660b0cfc
refactor(scheduler): use bitwise flags for scheduler jobs + optimize queueJob (#10407)
related: https://github.com/vuejs/core-vapor/pull/138
2024-02-26 10:22:12 +08:00
Evan You 05eb4e0fef
Refactor reactivity system to use version counting and doubly-linked list tracking (#10397)
Bug fixes
close #10236
close #10069

PRs made stale by this one
close #10290
close #10354
close #10189
close #9480
2024-02-25 16:51:49 +08:00
Johnson Chu 0bced13ee5
fix(reactivity): avoid infinite recursion from side effects in computed getter (#10232)
close #10214
2024-02-06 18:44:09 +08:00
Johnson Chu 6c7e0bd88f
fix(reactivity): handle `MaybeDirty` recurse (#10187)
close #10185
2024-02-06 18:23:56 +08:00
Johnson Chu c2b274a887
fix(reactivity): re-fix #10114 (#10123) 2024-01-18 10:46:57 +08:00
Doctor Wu 20f62afaaf
fix(reactivity): fix regression for computed with mutation (#10119)
close #10114
2024-01-15 23:38:57 +08:00
Johnson Chu e45a8d24b4
fix(reactivity): fix dirtyLevel checks for recursive effects (#10101)
close #10082
2024-01-13 15:53:06 +08:00
Evan You 8b1848173b revert: fix(reactivity): correct dirty assign in render function (#10091)
This reverts commit 8d04205041.

close #10098
close #10100
2024-01-13 10:38:25 +08:00
Doctorwu 8d04205041
fix(reactivity): correct dirty assign in render function (#10091)
close #10082
2024-01-12 21:13:17 +08:00
LiuSeen 03b54962dc
chore(types): use EffectScheduler type for its queue (#10023) 2024-01-09 15:27:17 +08:00
三咲智子 Kevin Deng bfe6b459d3
style: update format & lint config (#9162)
Co-authored-by: 丶远方 <yangpanteng@gmail.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
Co-authored-by: Guo Xingjun <99574369+Plumbiu@users.noreply.github.com>
2023-12-26 19:39:47 +08:00
Johnson Chu 16e06ca08f
feat(reactivity): more efficient reactivity system (#5912)
fix #311, fix #1811, fix #6018, fix #7160, fix #8714, fix #9149, fix #9419, fix #9464
2023-10-27 23:28:40 +09:00
skirtle e9e2778e9e
fix(reactivity): assigning array.length while observing a symbol property (#7568) 2023-10-21 09:48:59 +08:00
chenfan e33d554cae
refactor(reactivity): add instance check for effect (#9055) 2023-09-05 03:27:54 -05:00
Roland Hummel c346af2b6a
docs: comments on reactivity functions (fixes #4832) (#4836)
close #4832
2023-03-31 17:06:10 +08:00
Evan You 6213b73cd2 build: custom const enum processing 2023-02-03 09:54:15 +08:00
Anthony Fu e64c9ae957
fix(reactivity): `triggerRef` working with `toRef` from reactive (#7507)
* fix(reactivity): `triggerRef` working with `toRef` from reactive

* chore: refactor
2023-02-01 03:20:47 -05:00
Evan You efa2ac54d9 refactor: use Number constructor when coercing array length 2022-11-14 16:10:05 +08:00
Evan You d9de6caecd refactor: move toNumber call out of loop 2022-10-26 15:17:25 +08: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 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
Evan You 7efb9dba30 refactor: remove use of Object.assign
TS already transpiles spread to Object.assign with target:es2016
2022-04-12 15:22:11 +08:00
Evan You a51f935b72 refactor: remove isTracking() method 2022-01-30 18:53:43 +08:00
Evan You 2993a24618 perf(reactivity): optimize effect/effectScope active state tracking 2022-01-28 18:35:09 +08:00
Evan You 2f91872e7b fix(ssr): only cache computed getters during render phase
fix #5300
2022-01-21 12:31:54 +08:00
Evan You 25bc6549eb perf(reactivity): optimize effect run condition 2022-01-21 09:41:58 +08:00
Jeet Mandaliya 61720231b4
chore: typo [skip ci] (#4961) 2021-11-18 11:01:11 +01: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
Evan You 979a841946 chore: use consistent file naming 2021-07-16 14:30:49 -04:00
Evan You eae7c247af refactor: reduce bundle size 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
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
Evan You b2554aefba refactor: small bundle size / readability optimization 2021-07-16 14:30:49 -04:00
Bas van Meurs 64310405ac perf(reactivity): ref-specific track/trigger and miscellaneous optimizations (#3995) 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 ea1f87eabf
fix(reactivity): should add allowRecurse to the effect (#2213)
So that the scheduler also respects effect's allowRecurse option.

fix #2200
2020-10-05 16:36:02 -04:00
Evan You 3810de7d6b fix(reactivity): effect shoud only recursively self trigger with explicit options
fix #2125
2020-09-16 10:52:31 -04:00
Evan You 0124eacc91 refactor(reactivity): refactor iteration key trigger logic + use more robust Map/Set check 2020-09-14 11:26:34 -04:00
Evan You 5f4053967c fix(reactivity): revert ac81dcf
fix #2043
2020-09-04 11:10:26 -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 ac81dcf0cc fix(reactivity): effect should still check sync self-trigger 2020-08-13 17:45:21 -04:00