Skip to content

feat(nuxt,schema): allow configuring vue AppConfig #28873

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

Merged
merged 6 commits into from
Sep 19, 2024

Conversation

DamianGlowala
Copy link
Member

🔗 Linked issue

#28285 (comment)

📚 Description

This allows for configuring the Vue's app.config.idPrefix through vue.idPrefix in Nuxt config.

Thoughts on the name? Shall we consider vue.useIdPrefix?

@DamianGlowala DamianGlowala self-assigned this Sep 6, 2024
Copy link

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

@DamianGlowala DamianGlowala changed the title feat: allow configuring useId prefix feat(nuxt,schema): allow configuring useId prefix Sep 6, 2024
Copy link
Member

@huang-julien huang-julien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this something configurable with app:created hook ?

@DamianGlowala
Copy link
Member Author

Good point, it is. The question is whether we should recommend creating a plugin like so:

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.hook('app:created', (app) => {
    app.config.idPrefix = 'foo'
  })
})

... or prefer to set it in the Nuxt config. (I don't have a strong opinion on this matter and happy to close the PR if using a hook is the preferred way.)

@huang-julien
Copy link
Member

I'm in favor of letting users create a plugin. But our documentation may require a change if this wasn't clear enough that we can set runtime config of vue within a plugin 👀

@danielroe
Copy link
Member

I can see a benefit to allowing users to define the serialisable bits of the vue app config in their nuxt.config file.

could we generalise this a bit, maybe with vue.config?

@DamianGlowala
Copy link
Member Author

@danielroe updated 👌

@danielroe danielroe changed the title feat(nuxt,schema): allow configuring useId prefix feat(nuxt,schema): allow configuring vue AppConfig Sep 9, 2024
@danielroe danielroe changed the title feat(nuxt,schema): allow configuring vue AppConfig feat(nuxt): allow configuring vue AppConfig Sep 9, 2024
@danielroe danielroe changed the title feat(nuxt): allow configuring vue AppConfig feat(nuxt,schema): allow configuring vue AppConfig Sep 9, 2024
@danielroe danielroe merged commit 58ae53b into main Sep 19, 2024
38 checks passed
@danielroe danielroe deleted the feat/configurable-id-prefix branch September 19, 2024 13:59
@github-actions github-actions bot mentioned this pull request Sep 19, 2024
@github-actions github-actions bot mentioned this pull request Nov 27, 2024
Kamsou pushed a commit to Kamsou/nuxt that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Later
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy