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

Remove window.__NUXT__ #25336

Open
3 of 4 tasks
manniL opened this issue Jan 19, 2024 · 3 comments
Open
3 of 4 tasks

Remove window.__NUXT__ #25336

manniL opened this issue Jan 19, 2024 · 3 comments

Comments

@manniL
Copy link
Member

manniL commented Jan 19, 2024

Describe the feature

Apparently it only exists for backwards-compat according to code comments:

// For backwards compatibility - TODO: remove later
window.__NUXT__ = nuxtApp.payload

Nuxt v4 might be a good point to remove it if that's the case.

PR: #19205

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@martinszeltins
Copy link
Contributor

I'm not familiar with internal Nuxt codebase but as a user of Nuxt, I kind of enjoy using window.__NUXT__ to access data when Vue devtools are not available. I often look at pinia store through window.__NUXT__.pinia. And even cooler is that it is also available on prod which makes debugging really pleasant.

@manniL
Copy link
Member Author

manniL commented Jan 20, 2024

@martinszeltins you can use window.useNuxtApp in Nuxt 3 for that 😋
Here is a link to the PR introducing it and to a video about it I made

@martinszeltins
Copy link
Contributor

@martinszeltins you can use window.useNuxtApp in Nuxt 3 for that 😋 Here is a link to the PR introducing it and to a video about it I made

Ah, I wasn't aware of window.useNuxtApp, I guess in that case window.__NUXT__ is indeed not needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Approved
Development

No branches or pull requests

3 participants