Skip to content

Fix: SPA navigation (once again)#3554

Merged
mattgperry merged 2 commits intomotiondivision:mainfrom
MrVoshel:main
Mar 3, 2026
Merged

Fix: SPA navigation (once again)#3554
mattgperry merged 2 commits intomotiondivision:mainfrom
MrVoshel:main

Conversation

@MrVoshel
Copy link
Contributor

@MrVoshel MrVoshel commented Feb 11, 2026

Follow up on #3516

Unfortunately #3543 was on the wrong track, nothing improved with client side navigations. Pruning worked correctly there, but didn't fix the animation skip shown in my original PR.

I also tried to simplify the overall code, made the test more accurate, and did some further debugging that made me find a leak where the flat tree nodes were growing in size (since pruning was scoped to the members of add() only).

Here the animations are triggered correctly, pruning is basically the same + unmount()

I tried setting the new test runs to 100 and checking the js heap size.
Now
image

Without unmount (pruning only stack.ts' members)
image

@MrVoshel
Copy link
Contributor Author

test-react-19 🤷
image

@mattgperry
Copy link
Collaborator

Thanks for your work on this!

Copy link

@codeCraft-Ritik codeCraft-Ritik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice approach — the logic flows well and is readable

@mattgperry mattgperry merged commit 8930b90 into motiondivision:main Mar 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants