Conversation
Due to dynamic imports amount of usedBy nodes could change of every call, thereby making this field useless
It turns out it breaks .getState in common restore tests
movpushmov
force-pushed
the
release/v24
branch
2 times, most recently
from
April 6, 2026 19:57
600b673 to
6973b14
Compare
movpushmov
force-pushed
the
lazy-computations
branch
from
April 6, 2026 23:03
bdfea97 to
7d81814
Compare
movpushmov
force-pushed
the
lazy-computations
branch
2 times, most recently
from
April 7, 2026 18:04
9061327 to
4d46426
Compare
movpushmov
force-pushed
the
lazy-computations
branch
from
April 8, 2026 16:20
4d46426 to
3f61afd
Compare
igorkamyshev
marked this pull request as ready for review
April 20, 2026 11:01
igorkamyshev
marked this pull request as draft
April 20, 2026 11:01
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements lazy computations by building a graph of connected nodes. Each unit now has lazy metadata consisting of alwaysActive, usedBy, and activate.
Laziness is implemented through the isUsed function in the Effector kernel, which allows unused nodes to be skipped and prevents them from being evaluated in the stack machine.
There is also an edge case where a derived store is not subscribed to, but its value is requested via getState(). To handle this case, initRef was changed so that it checks whether the derived store value is still up to date. If the stores it depends on have changed, its value is treated as stale and recomputed. For this operation, the node’s meta part is used outside of a scope, and scope.lazy is used inside a scope.