feat(cleanup): remove unnecessary flush microtasks as already handled by act #511
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.
What:
Remove some particularly complicated code that flushes microtasks as part of cleaning up the rendered hooks.
Why:
I noticed this change in RTL from which we originally borrowed the
flush-microtasks.js
implementation from. The interesting part is that we already have our cleanup wrapped inact
so the code was even less required.How:
I deleted the file and removed the import and usage of it.
One difference to the RTL PR to note is that they also change
cleanup
from anasync
function to a regular function. I chose not to do this as we recently introduced theaddCleanup
functionality inv3.5.0
which allowed user provided cleanup to beasync
and I didn't want to restrict them to being sync only, plus it avoided a breaking change.Checklist:
I wonder if this should go out into a beta release like they did in RTL or if their beta is proof that it's fine and we just release the minor?