-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
feat(reactivity): more efficient reactivity system #5912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
225 commits
Select commit
Hold shift + click to select a range
f485ea0
perf: calculate embedded `computed()` on-demand
johnsoncodehk 208e59c
fix: computed effect dons't transfer
johnsoncodehk 4a3e554
fix: revert effects trigger order
johnsoncodehk ed871c2
refactor: remove `computedToAskDirty` arg from `trigger()`
johnsoncodehk fbf214a
chore: use `hasChanged()` instead of `!==`
johnsoncodehk 399f155
perf: reduce `triggerRefValue()` triggered
johnsoncodehk 0e0c44e
perf: avoid duplicate trigger effect to deps
johnsoncodehk 7768d43
fix: avoid track unrelated effects
johnsoncodehk a353eac
chore: make `_computedsToAskDirty` private
johnsoncodehk 014dcd5
fix: jest -> vitest
johnsoncodehk eb0f8fa
fix: urgent assessment edge case
johnsoncodehk f3a0071
feat: more purposeful test
johnsoncodehk 998c400
chore: add test for effect() on-demand trigger
johnsoncodehk b5527a1
Revert "chore: add test for effect() on-demand trigger"
johnsoncodehk 3e0c2af
wip: on-demand effect()
johnsoncodehk 62dc5ee
fix: ref newVal arg incorrect
johnsoncodehk e34619f
Merge branch 'computed-ondemand' into effect-ondemand
johnsoncodehk 8895117
release: v3.3.0-alpha.9
haoqunjiang 909afcc
fix: fixed effect for tests
johnsoncodehk da6263c
refactor: implement simplify
johnsoncodehk d2fd264
Revert "release: v3.3.0-alpha.9"
haoqunjiang f4d345d
Merge remote-tracking branch 'upstream/main' into computed-ondemand
johnsoncodehk 866a3ee
Merge branch 'computed-ondemand' into effect-ondemand
johnsoncodehk 0a16e82
Merge branch 'main' into pr/5912
johnsoncodehk 6c9f058
chore: naming
johnsoncodehk 66bcc3e
chore: with "s"
johnsoncodehk 06f813e
Merge branch 'pr/5912' into pr/8043
johnsoncodehk debddde
chore: naming
johnsoncodehk ba66880
chore: undo format
johnsoncodehk cb081f6
chore: `_c` -> `deferredComputed`
johnsoncodehk 7d21edf
Merge branch 'pr/5912' into pr/8043
johnsoncodehk 76e2e6e
chore: `_c` -> `deferredComputed`
johnsoncodehk de4e436
chore: expressiveness
johnsoncodehk 6c13a30
refactor: reuse `effectTrackDepth`
johnsoncodehk ef2a6e3
refactor: remove unneeded `pauseTracking()`, `resetTracking()`
johnsoncodehk 7bc1069
chore: sort in one line
johnsoncodehk d77f842
Merge branch 'pr/5912' into pr/8043
johnsoncodehk f0512d6
chore: sort in one line
johnsoncodehk 7e2ac74
chore: naming
johnsoncodehk e98d329
chore: import type
johnsoncodehk 02805c5
Merge branch 'pr/5912' into pr/8043
johnsoncodehk d5595cb
chore: narrow `pauseTracking()`
johnsoncodehk 01c7b80
Merge branch 'pr/5912' into pr/8043
johnsoncodehk 44cbb5e
perf: cache dep indexes
johnsoncodehk 8a3c786
perf: redo `length >= 2`
johnsoncodehk 76da327
chore: hoist `triggerRefValue` for readability
johnsoncodehk 9002b93
chore: always clear dep indexes cache to avoid memory leak
johnsoncodehk 0f2c388
chore: less type hack
johnsoncodehk 3b912e8
Merge branch 'main' into pr/5912
johnsoncodehk f8ff93a
chore: format
johnsoncodehk 17342d5
refactor: abstract deferred computeds into ReactiveEffect
johnsoncodehk 0194f02
fix: fixes _dirty updating for deferredComputed
johnsoncodehk 16dc2b8
chore: revert deferredComputed
johnsoncodehk 1b666b9
chore: format
johnsoncodehk bf89e57
perf: more efficient `watch()`
johnsoncodehk 09e3512
chore(effect): use allow function
johnsoncodehk 25578fd
chore(effect): release _deferredComputeds earlier
johnsoncodehk 4b72c94
refactor(effect): make `scheduler` required
johnsoncodehk 0257e69
refactor(effect): dirty -> applyDirty()
johnsoncodehk 37d5c03
chore(effect): applyDirty() -> dirty, _dirty
johnsoncodehk 1269644
chore(effect): add triggerEffectCallbacks()
johnsoncodehk 07da2dd
chore(effect): triggerEffectCallbacks -> scheduleEffectCallbacks
johnsoncodehk 891d937
chore(effect): fix syntax
johnsoncodehk 3350c24
perf(reactivity): Array `shift()` should only trigger effect once
johnsoncodehk c187177
refactor(effect): de-abstract `scheduled`
johnsoncodehk d3517e0
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 8f58ea3
chore(effect): mark dirty by default
johnsoncodehk 770b2de
refactor(effect): abstract `dirty` setter
johnsoncodehk e0ef714
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk e5e895d
fix(effect): revert updates for watch apis
johnsoncodehk 3a89f4d
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 3fc6349
chore: remove unneeded change
johnsoncodehk 3821687
fix(computed): polyfill `_dirty`
johnsoncodehk a4b8bd2
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk eb360e6
perf(runtime-core): re-render on deps changed
johnsoncodehk 128b1eb
chore: format
johnsoncodehk a8f2bba
fix: computed causes render twice at the beginning
johnsoncodehk 3aaa3af
chore: format
johnsoncodehk 72c3312
Merge branch 'computed-ondemand' into renderer-ondemand
johnsoncodehk c7567d0
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 1be6c50
fix: multiple computed triggers render multiple times
johnsoncodehk d2a5706
fix: computed getter trigger effect repeatedly
johnsoncodehk 13c9a2c
fix: avoid computed side effects causing re-rendering
johnsoncodehk 53db76c
chore: _mode -> _
johnsoncodehk e76b42c
chore: format
johnsoncodehk 35f0ddd
chore: remove computed.init
johnsoncodehk 914f62d
Merge branch 'computed-ondemand' into renderer-ondemand
johnsoncodehk e83221a
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk e605560
refactor: TriggerReason -> TriggerType
johnsoncodehk fe8d996
chore: use resetDirty
johnsoncodehk 9ab4eb1
chore: format
johnsoncodehk 942be5d
chore: format
johnsoncodehk b1bd1de
fix: don't reset hard reset dirty for computed
johnsoncodehk ee05427
fix: computed deps update should re-trigger effects
johnsoncodehk 99af87b
refactor(effect): add dirty setter
johnsoncodehk a181339
fix: computed should allow recursion dirty trigger
johnsoncodehk 8084d74
fix: avoid tree shaking `deferredComputed.value`
johnsoncodehk 194f8a8
perf: reuse `_depIndexes`
johnsoncodehk d4bf9ad
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 85a7f22
Merge branch 'computed-ondemand' into renderer-ondemand
johnsoncodehk f620aa9
chore: fix tests
johnsoncodehk 254d923
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 8f8f384
Squashed commit of the following:
johnsoncodehk c02f650
perf: faster computed effect spread
johnsoncodehk 8094661
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk e74cd43
chore: format
johnsoncodehk fd1c9be
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 9214ff4
Merge branch 'computed-ondemand' into renderer-ondemand
johnsoncodehk f5b0331
refactor: remove deferredComputed arg
johnsoncodehk 9e64219
fix: fix vant test
johnsoncodehk b43c494
chore: fix triggerRefValue newValue for dev
johnsoncodehk c522871
chore: remove _alwaysAcceptComputedValueUpdated
johnsoncodehk 5bd18ef
chore: less changes
johnsoncodehk b8c0a72
chore: less changes
johnsoncodehk e41763c
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 857f60e
chore: remove unneeded `deps.includes`
johnsoncodehk 174626c
refactor: reduce `dep` arg for triggerEffect()
johnsoncodehk d73ba7a
chore: move `_valueMaybeDirty = false`
johnsoncodehk 80ea250
fix: remove `_valueMaybeDirty` for fix vuetify test
johnsoncodehk bc85a96
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk e339def
refactor: abstract triggerType
johnsoncodehk f3625b0
chore: fix deferredComputed
johnsoncodehk f41bc9b
feat: redo apiWatch
johnsoncodehk 09d6f05
fix: continuous effects cause computed dirty race condition
johnsoncodehk 576be5f
fix: render triggers twice
johnsoncodehk 7058975
refactor: remove queueEffectCbs
johnsoncodehk b3f502e
chore: DepsMaybeDirty -> ComputedValueMaybeDirty
johnsoncodehk a1cb22a
fix: computed scheduler should always trigger
johnsoncodehk bf85f9a
refactor: remove computed hack
johnsoncodehk 710c7c5
feat(runtime-core): add `once` option to watch (#9034)
Alfred-Skyblue f5088d2
feat(compiler-sfc): expose resolve type-based props and emits (#8874)
sxzz ef8070c
feat(compiler-core): export error message (#8729)
shengxinjing f9bf306
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk ab25229
Update deferredComputed.ts
johnsoncodehk 3f5c373
make new logic working for `watch()`
johnsoncodehk 1591ce1
update test result
johnsoncodehk eec0a78
sync #9056
johnsoncodehk b5eba14
Merge branch 'computed-ondemand' into array-effect
johnsoncodehk 01e21d2
update test comment
johnsoncodehk 0bdacad
chore: remove scheduleEffectCallbacks
johnsoncodehk 3b0c4a7
combine if & while
johnsoncodehk f1eb3b6
deprecated deferredComputed
johnsoncodehk 9f6d9b6
[autofix.ci] apply automated fixes
autofix-ci[bot] 27a0b40
simplify triggerEffects
johnsoncodehk 0147f1d
`dep.computed` -> `dep.triggerDirty()`
johnsoncodehk f4b13db
Update dep.ts
johnsoncodehk ee6fcca
update test title
johnsoncodehk 7c59d8e
remove async
johnsoncodehk fc326b2
perf: check _scheduled
johnsoncodehk e26976f
refactor: operations.ts -> constants.ts
johnsoncodehk 6af9492
Merge remote-tracking branch 'upstream/3.4' into computed-ondemand
johnsoncodehk a0b4fcb
add test for pauseScheduling
johnsoncodehk 5978311
expose pauseScheduling, resetScheduling
johnsoncodehk 52ac1ab
chore: fix test message
johnsoncodehk c44cb56
feat(runtime-core): add `once` option to watch (#9034)
Alfred-Skyblue 7bc3ab1
feat(compiler-sfc): expose resolve type-based props and emits (#8874)
sxzz dc30885
feat(compiler-core): export error message (#8729)
shengxinjing f2bb0ea
chore: mark `@internal` for pauseScheduling, resetScheduling
johnsoncodehk f59957d
Merge branch 'minor' into computed-ondemand
johnsoncodehk 196cdd3
Update packages/reactivity/src/computed.ts
johnsoncodehk e6ee9f3
fixs https://github.com/vuejs/core/pull/5912/commits/196cdd3eb8fa1b5e…
johnsoncodehk f5e93b7
Update computed.ts
johnsoncodehk d573e50
feat(runtime-core): add `once` option to watch (#9034)
Alfred-Skyblue d52617f
feat(compiler-sfc): expose resolve type-based props and emits (#8874)
sxzz be91d43
feat(compiler-core): export error message (#8729)
shengxinjing 81cba7c
Merge branch 'minor' into computed-ondemand
johnsoncodehk 3a3b46d
chore: less diff
johnsoncodehk 3170eff
test: add test for #6018
johnsoncodehk afd7c54
fix: chained computed dirty reallocation after querying dirty
johnsoncodehk 0f99a01
fix: always cleanup effect
johnsoncodehk 34f0d26
refactor: alternative for `wasTracked`, `newTracked` markers
johnsoncodehk de25d13
perf: don't set deps length to 0 if no change
johnsoncodehk a9f0c02
chore: cleanup invalid deps for `trigger()`
johnsoncodehk 6cd8340
chore: remove unneeded code
johnsoncodehk 6e8700e
refactor: simplify `trigger()`
johnsoncodehk c75c3b3
chore: inline debug info
johnsoncodehk 191e00b
chore: redo `cleanupEffect()`
johnsoncodehk 951073b
perf: only schedule when dirty level change
johnsoncodehk 2cf67b1
perf: use number for `pauseScheduling()`
johnsoncodehk ca1e1f1
chore: less condition
johnsoncodehk 16127eb
chore: cleanup invalid effects before trigger callbacks
johnsoncodehk e0b1b88
refactor: only trigger with dirty level 0
johnsoncodehk 586aa70
perf: defer reset `_scheduled`
johnsoncodehk 2785f88
fix(computed): dirty not schedule edge case
johnsoncodehk 33aab34
chore(computed): only reset _scheduled when value change
johnsoncodehk 0636bac
test(computed): add a failed edge case
johnsoncodehk e13a421
fix(computed): remove unneeded `_scheduled` and fixes failed test
johnsoncodehk 9d31bc9
refactor: cleanup deps just in time and avoid memory leak
johnsoncodehk fa80d44
chore: remove queryDirty
johnsoncodehk adc3ad7
chore: trigger side effects after scheduled for watch() and render()
johnsoncodehk dc54c59
Revert "feat(compiler-core): export error message (#8729)"
johnsoncodehk 59a8c26
Revert "feat(compiler-sfc): expose resolve type-based props and emits…
johnsoncodehk 34a0de4
remove a test
johnsoncodehk 50418be
Revert "feat(runtime-core): add `once` option to watch (#9034)"
johnsoncodehk 93b5beb
fix(reactivity): fix dep memory leak
johnsoncodehk fc76e81
refactor: move code to reactiveEffect.ts
johnsoncodehk 66da31a
fix: use `WeakRef` for dep to avoid `ReactiveEffect` memory leak (#9233)
johnsoncodehk 9f8f02e
perf: deferred create track token
johnsoncodehk e67116c
chore: _queryingDirty -> _queryings
johnsoncodehk 3364351
chore: add missing dep cleanup
johnsoncodehk d3ff222
fix: only auto gc computed
johnsoncodehk 8ff2a89
chore: stubbed WeakRef
johnsoncodehk 9cd9335
chore: remove schedulerJob variable
johnsoncodehk 888d934
Merge remote-tracking branch 'upstream/main' into computed-ondemand
johnsoncodehk c4829f3
Update reactiveEffect.ts
johnsoncodehk 526faea
Update apiWatch.ts
johnsoncodehk 081ccd4
fix: use FinalizationRegistry to cleanup unused computed
johnsoncodehk c388d13
Update effect.ts [skip ci]
johnsoncodehk c6b9bd2
test: disable threads for `FinalizationRegistry.register`
johnsoncodehk 78c50e3
chore: remove `@internal` for fix dts build
johnsoncodehk 3353fb4
chore: remove FakeFinalizationRegistry
johnsoncodehk c53bd48
chore: use const
johnsoncodehk ee17f37
fix: create trackToken when actually track [skip ci]
johnsoncodehk 2bbb451
chore: remove StrongRef
johnsoncodehk 3540dd1
chore: add TrackToken type [skip ci]
johnsoncodehk 6799da0
chore: move TrackToken type [skip ci]
johnsoncodehk 7023234
Merge remote-tracking branch 'upstream/main' into computed-ondemand
johnsoncodehk 1e2db5b
chore: sort code
johnsoncodehk e888f58
asdf
johnsoncodehk 1ce784b
qwer
johnsoncodehk b98b6b8
chore: avoid exposing internal properties on ReactiveEffect
yyx990803 600966b
refactor: use NOOP for empty triggers
yyx990803 265c22f
refactor: unuse `FinalizationRegistry`, `WeakRef`
johnsoncodehk b93299c
chore: remove `TrackToken` type
johnsoncodehk 0555892
chore: revert `threads` option
johnsoncodehk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: use FinalizationRegistry to cleanup unused computed
- Loading branch information
commit 081ccd49ba25be3f39541fa202a760e0398106ec
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.