[WIP] outroing update flow #4699
Closed
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.
Resolves #4683
This is a followup to #4634
while a dirty check in simple if_blocks managed to fix the issue for many, every other update between outrostart and outroend will still either be voided, breaking or worked around using nasty checks such as
!current || dirty
Here is an edge case among others :
https://svelte.dev/repl/b71f70fa92a94bd8b82c677b919083a9?version=3.20.1
Fixes #4696, Fixes #4064
on first tick a hard outro is triggered on the element, a soft one on the current_block
on second thick, the update goes first, it calls a hard outro on the current_block
since it has not yet done its soft outro, the hard outro is voided
then it calls transition_in, but current_index has changed due to the update
so while the current_block gets transition_in called twice, the previous_block ends its soft outro and stays in the dom
this cannot be fixed in a single line as it necessitates to call
transition_in
before updating, that comes with the price of breaking every!current || dirty
check, so it's a WIP