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
docs: add nuxtApp.runWithContext
#23258
Conversation
Run & review this pull request in StackBlitz Codeflow. |
β Live Preview ready!
|
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 absolutely beautiful work.
The only thing I'd suggest is that we document nuxtApp.runWithContext(() => fn())
instead, as it's a bit more intuitive how it works, and I think largely replaces callWithNuxt
.
Very little would need to change for us to do this, just the function signature...
Alright, I've moved it into the Are y'all using details/summary to collapse extra info? or would the detailed context documentation be better in a separate file under Advanced? |
I think this is great, and as it's in the API section I think we can include all of this there. It's possible we could add something less/abbreviated in future in Concepts, maybe within https://nuxt.com/docs/guide/concepts/vuejs-development, or possibly a bit longer in a Composables section in Get Started. |
π Linked issue
#14723
β Type of change
π Description
@danielroe suggested I take a crack at this as there was not any public documentation about
callWithNuxt
.I've added a header stating that this method should be used sparingly, and that ultimately this is something that would ideally be solved at the framework level.
I've also included the detailed explanation with edits that make more sense for documentation.
Let me know if there is any further details I should add, or if the format needs to change at all.
π Checklist