RFC: Speculative Mode
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: https://github.com/facebook/react/pull/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
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.