-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
feat(nuxt): native async-context in vue's withAsyncContext
#23526
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
Conversation
|
Update: Fixed by avoiding virtual filesystem. But still like to investigate why unplugin vfs could be broken for webpack only in Nuxt (last commit to reproduce: 9f8d87b) |
I can confirm it works locally for the custom module π― |
/trigger release |
π Release triggered! You can now install nuxt@npm:nuxt3@pr-23526 |
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.
This is awesome.
Shall we add a section on https://nuxt.com/docs/guide/concepts/auto-imports#using-vue-and-nuxt-composables to explain our experimental feature, otherwise I don't know how they can test this π |
We currently document it here: https://nuxt.com/docs/api/composables/use-nuxt-app#native-async-context. Updating/centralising docs across there, runWithContext and auto-imports docs would be definitely an improvement |
vue.withAsyncContext
withAsyncContext
π Linked issue
Followup on #20918
reproduction by @atinux confirming issue (should run locally)
β Type of change
π Description
This PR, tries an alternative method of integrating Native Async Context with Vue by directly patching
withAsyncContext
import that is injected by Vue for it's non native async context support.This method has the benefit of being much simpler as we don't need AST based transforms also probably more future compliance because reflects the ideal change we expect from Vue upstream support to improve internal
withAsyncContext
.Note: I could confirm this solution externally on reproduction but seems local fixture is not working, investigating more. -- Update: It strangely also works fine in(working both externally and in fixture π )playground
but not fixture still!Local module to try:
π Checklist