feat: support custom transitioning classes for LinkTo #20712
+14
−4
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.
It has long been an issue that async model hooks with loading substates causes ember applications to feel sluggish for transitions. The LinkTo doesn't change until the full transition is complete
See this issue from 2014 #4908
For my applications, for many years now, I've avoided them wherever possible, opting to use ember-concurrency tasks or reactiveweb tracked functions instead. Instant transitions & allows for much greater control over loading state etc.
I came up against a situation where I needed to use an async model hook for a kinda slow request, and wasn't happy about how slow it made the page feel, particularly due to the LinkTo. I ended up delving into LinkTo source code and found out about
ember-transitioning-in
andember-transitioning-out
- if only I had known years ago!I think it's important that more users know about these classes, and that that's why their pages feel slow when they use async model hooks. By making
transitioningInClass
andtransitioningOutClass
customizable, this should help with visibility a lot, ideally accompanying an API reference update as well.Alternatively, as mentioned in that issue, should the LinkTo active class be updated to be eager? This is probably a better solution, but I understand that might have wider impacts. The change proposed in this PR shouldn't cause any breaking changes.
The PR I linked has a good gif demonstrating the "slow" LinkTo update, but here's a new demonstration video that shows it as well. Note how long it takes the "Reports" side nav item to update to active/blue after I click it
Screen.Recording.2024-07-05.at.5.33.49.pm.mov