Repository navigation
Render updates queued behind a render error - #5306
Closed
otarampinelli wants to merge 2 commits into
Closed
otarampinelli wants to merge 2 commits into
otarampinelli wants to merge 2 commits into
Conversation
📊 Tachometer Benchmark ResultsSummaryA summary of the benchmark results will show here once they finish. ResultsThe full results of your benchmarks will show here once they finish. |
Member
|
https://github.com/preactjs/.github/blob/master/CODE_OF_CONDUCT.md#our-standards LLM usage should be disclosed and other PR's are handling this issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #5305, as an alternative to its fix. Opened as a draft to discuss the behaviour change.
#5305 stops components queued behind a render error from freezing, by clearing
COMPONENT_DIRTYon the componentsprocess()drops. They still lose the update they were queued for, though it only shows once something else re-renders them.This keeps them queued instead and schedules another
process(), so their pending updates render in the next flush:rerenderCountto 0, as before.rerenderCountstopsenqueueRenderfrom scheduling a second flush in the meantime.COMPONENT_DIRTYcleared before rendering, so it isn't queued again. Each failed flush removes at least one component.Behaviour change
An error no longer discards the rest of the batch. Components queued after the one that threw still render, one tick later. If the error left shared state inconsistent, they render with that state. They would also do so at their next update under #5305.
Testing
New test:
should render updates that were queued behind a render that threw. It fails with #5305 fix and passes here:The tests from #5305 and the existing "should reset the rerender queue if rendering throws" still pass. Full suite:
pnpm run test.