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

DevTools: Fix Fiber leak caused by Refresh hot reloading #21506

Closed
wants to merge 1 commit into from

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented May 13, 2021

Resolves #21469 as well as #21436 and #21442 (I think)

Posting for discussion purposes with @gaearon

The general idea is to add a new hook that Fast Refresh can use to inform DevTools when a force remount is scheduled. Then DevTools can clean up any Fibers that would have otherwise been linked by the clone-and-splice operation on the tree.

Added some basic integration tests for Fast Refresh + DevTools, including one that fails without this fix:
Screen Shot 2021-05-13 at 4 49 45 PM

@sizebot
Copy link

sizebot commented May 13, 2021

Comparing: 46491dc...de95ad8

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 126.12 kB 126.12 kB = 40.46 kB 40.46 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 128.94 kB 128.94 kB = 41.40 kB 41.40 kB
facebook-www/ReactDOM-prod.classic.js = 406.40 kB 406.40 kB = 75.19 kB 75.19 kB
facebook-www/ReactDOM-prod.modern.js = 394.46 kB 394.46 kB = 73.29 kB 73.29 kB
facebook-www/ReactDOMForked-prod.classic.js = 406.40 kB 406.40 kB = 75.19 kB 75.19 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against de95ad8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DevTools Bug]: Children list grows indefinitely when adding/removing useEffect
3 participants