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

[WIP] outroing update flow #4699

Closed
wants to merge 13 commits into from
Closed

[WIP] outroing update flow #4699

wants to merge 13 commits into from

Conversation

pushkine
Copy link
Contributor

@pushkine pushkine commented Apr 21, 2020

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

  • a compound if_block is nested in a simple element that has an outro
  • that element is nested in a simple if_block that switches off then on again before outroend
  • in the same exact tick it also changes the condition for the nested compound

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

pushkin and others added 13 commits April 5, 2020 23:15
Fixes #4630, summary of #4620, #4064, #3685, #3410 and #3202.

prior to this change, a component would simply cancel the outro of its `if_block` for any update happening between `outrostart` and `outroend`

I tested the REPL provided on each issue and they're all fixed, all but #4064 that also has another bug I'll be looking into
#4064 did not have another bug, the first change just blocked nested `if_block`s from getting updates
This reverts commit 80e4f6b.
@pushkine
Copy link
Contributor Author

pushkine commented Apr 21, 2020

#4693 made me realize that it's not just the outro part that needs "edge case" fixing, fragments in general require significant rework
Closing this as I do not plan to address the mentioned issues directly,
I'll submit another pr in a few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants