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

feat: support custom transitioning classes for LinkTo #20712

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Techn1x
Copy link

@Techn1x Techn1x commented Jul 4, 2024

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 and ember-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 and transitioningOutClass 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

@Techn1x
Copy link
Author

Techn1x commented Jul 4, 2024

Knowing about the transitioning classes is the way to solve the issue, here's a tailwind example of how you can make it look eager to update

<LinkTo class="bg-white [&.active]:bg-blue-325 [&.ember-transitioning-in]:bg-blue-325 [&.active][&.ember-transitioning-out]:bg-white"

This PR just tries to make the transitioning classes visible & public


example that uses transitioning classes, note the sidenav link updates eagerly

Screen.Recording.2024-07-05.at.5.31.18.pm.mov

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.

None yet

1 participant