-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(nuxt): finish view transition on app error instead of aborting #33723
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
base: main
Are you sure you want to change the base?
Conversation
|
|
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
WalkthroughThe view-transitions client plugin was modified: the Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CodSpeed Performance ReportMerging #33723 will degrade performances by 12.65%Comparing Summary
Benchmarks breakdown
|
|
|
||
| nuxtApp.hook('app:error', () => { | ||
| // Finish the transition instead of aborting to allow smooth animation to error page | ||
| finishTransition?.() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do:
| finishTransition?.() | |
| abortTransition?.() |
...or, alternatively, should we call finishTransition within vue:error as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the change; that was my first solution. But if I intentionally chose Transition, wouldn't I also want the transition to my error page to be animated?
That was the reason why I was using finishTransition
Edit: Therefore, I would tend to use finishTransition in vue:error as well. As I said, if I want a nice transition, it shouldn't stop at the error page, especially if you want to provide a consistent UI experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed abortTransition to finishTransition in vue:error as well. If you still prefer to set both to abortTransition, then that's of course also ok for me!
🔗 Linked issue
Fixes: #32721
📚 Description
When navigating to non-existent routes with viewTransition enabled, the transition was being aborted on app:error, causing a significant delay (several seconds) before the error page could render.
This changes the behavior to finish the transition smoothly instead of aborting it, allowing immediate and smooth animation to the error page while maintaining the visual transition effect.
The fix makes sense - by calling finishTransition() instead of abortTransition() on the app:error hook, you allow the View Transition API to complete gracefully and animate to the error page, rather than aborting mid-transition which causes the hang/delay.