-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: debug throw on too many rerenders #4349
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10k
duration
usedJSHeapSize
filter-list
duration
usedJSHeapSize
hydrate1k
duration
usedJSHeapSize
many-updates
duration
usedJSHeapSize
replace1k
duration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-update
duration
usedJSHeapSize
todo
duration
usedJSHeapSize
update10th1k
duration
usedJSHeapSize
|
Size Change: +327 B (0%) Total Size: 61 kB
ℹ️ View Unchanged
|
if (renderCount >= 25) { | ||
throw new Error( | ||
`Too many re-renders. This is limited to prevent an infinite loop ` + | ||
`which may lock up your browser. The component causing this is: ${getDisplayName( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the ...which may lock up your browser.
bit just to emphasize this isn't something one could safely ignore, especially as we'll only address it in dev (for most users, anyhow. I doubt many are using /debug
in prod).
Note that this PR appears to throw the rerender error somewhat arbitrarily, causing the app to crash for high render components like the MUI-X Datagrid. Setting preact debug to false in vite.config is a workaround for now. It's possible that the MUI-X DataGrid could use some cleanup to prune renders, but the current performance is acceptable (pretty good actually), the top level component === currentComponent render ++ < 25 may not be robust enough. |
Rebase of @andrewiggins' work in #3965, and moves to
/debug
as mentioned.