4 ms·
Pretty interesting. Hope someone also writes a summary of how it works. Are they computing the tree in a worker, or have they just modified the rendering api it
by boucher 7y ago
Pretty interesting. Hope someone also writes a summary of how it works. Are they computing the tree in a worker, or have they just modified the rendering api itself to somehow be interrupt-able?
- boucher 7y agoSeems someone has written some of it up here: https://github.com/acdlite/react-fiber-architecture https://github.com/acdlite/react-fiber-architecture
- acemarke 7y agoRendering becomes interruptible. In Concurrent Mode, React will split the work of a single render pass across multiple chunks as time exists within a single frame, yielding back to the browser as needed to let it process events. Once the whole render pass is complete, React will finally "commit" the changes to the DOM. If a user input or other render - triggering event occurs partway through a render pass, React can set aside its partially completed calculations, start a new render pass, complete that and commit it, then effectively "rebase" the original changes on top of the just-applied change. Shawn Wang has been collecting links to all the info on Concurrent React that's been released over the last couple years : https://github.com/sw-yx/concurrent-react-notes https://github.com/sw-yx/concurrent-react-notes