Skip to content
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

RFC: Speculative Mode #150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

gnoff
Copy link
Contributor

@gnoff gnoff commented Feb 28, 2020

Summary

This RFC describes an approach to making all work done in React lazier. This was inspired by @sebmarkbage 's comments in response to #118 and #119 where the lazy approach seems good but the whole React work process could and should benefit from it

In a few sentences Speculative Mode is a feature where if React bails out of updates it will no longer clone child fibers and but will actually start work on the current tree. It defers the creation of workInProgress until it has actually confirmed an update is required. Only then does the current tree get copied into the workInProgress tree

See Rendered Text

Implementation: facebook/react#18262
Example: https://codesandbox.io/s/speculative-mode-dr89t

Find me on twitter (@joshcstory) or tag me (@gnoff) in a comment if you have any questions

@gaearon
Copy link
Member

gaearon commented Aug 18, 2021

I'll keep this open but wanted to note for readers that parts of the ideas from here have been upstreamed into experiments, while the rest is too complicated to fit into the current architecture — but we'll keep it in mind for the next time we revamp it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants