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

docs: add nuxtApp.runWithContext #23258

Merged
merged 7 commits into from Sep 19, 2023
Merged

Conversation

fimion
Copy link
Sponsor Contributor

@fimion fimion commented Sep 17, 2023

πŸ”— Linked issue

#14723

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to 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

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Sep 17, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nuxt-studio
Copy link

nuxt-studio bot commented Sep 17, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview ede2e7a

Copy link
Member

@danielroe danielroe left a 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...

@fimion
Copy link
Sponsor Contributor Author

fimion commented Sep 17, 2023

Alright, I've moved it into the useNuxtApp docs and reworked the signature.

Are y'all using details/summary to collapse extra info? or would the detailed context documentation be better in a separate file under Advanced?

@fimion fimion changed the title docs: add callWithNuxt docs: add nuxtApp.runWithContext Sep 18, 2023
@danielroe
Copy link
Member

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.

@danielroe danielroe merged commit a661d58 into nuxt:main Sep 19, 2023
3 checks passed
This was referenced Sep 19, 2023
manniL pushed a commit that referenced this pull request Dec 11, 2023
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

2 participants