Open mattcroat opened 2 months ago
@antfu we can solve this the same way we solved #8 but i wonder if there's a way during the registerTransitionEnd
phase to know if the transition will start or not or at least have it "race" with some other promise that we know will resolve at the end of the process to avoid this problem once and for all.
When i was working on #9 i tried hard to think of a way to do this but i come out empty handed. If you have some ideas i think it could be a safer-for-the-future solution
I think i found a solution for this that involves element.getAnimations()
will try to experiment later
The issue from #8 is back when using line numbers — the transition never starts for tokens that don't change, and thus never resolves.
https://github.com/shikijs/shiki-magic-move/assets/38083522/f2fc6e98-3990-424d-a72a-6c668abcb286
The
promises
log fromshiki-magic-move
shows the unresolved promises.This is confirmed when you unfold the pending promises, and see they're the tokens that don't change.