-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat!(nuxt): upgrade nuxt module #1435
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
✅ Deploy Preview for pinia-official canceled.
|
Codecov Report
@@ Coverage Diff @@
## v2 nuxt/nuxt.js#12596 +/- ##
=======================================
Coverage 97.59% 97.59%
=======================================
Files 9 9
Lines 416 416
Branches 109 109
=======================================
Hits 406 406
Misses 5 5
Partials 5 5 Continue to review full report at Codecov.
|
I force pushed because due to conflicts in pnpm-lock |
The types never worked on my end. It's as if vue-tsc didn't pick up the correct tsconfig so I removed them from CI |
So I tested and this only works with Nuxt 3 😓
and
|
Thanks for the review @posva. I will rebase and check last changes on bridge. |
BREAKING CHANGE: in Nuxt 3, `$nuxt` is no longer available in stores. This is because it was removed in Nuxt 3 and it is no longer the _context_ as it used to be. Most of the features used there, like `$fetch` are now globally available and therefore remove the need of it. You can also use [`useNuxtApp()`](https://v3.nuxtjs.org/bridge/bridge-composition-api/) when necessary.
BREAKING CHANGE: Starting on this version, `@pinia/nuxt` only works with Nuxt 2 + Bridge and Nuxt 3, it no longer works with Nuxt 2 only. This is necessary to have one single plugin that works well with the different versions of Nuxt. If you aren't using bridge with Nuxt 2, check out the [migration guide](https://v3.nuxtjs.org/bridge/overview) or pin your `@pinia/nuxt` dependency in your: ```diff - "@pinia/nuxt": "^0.2.1", + "@pinia/nuxt": "0.2.1", ``` The `$nuxt` context usage should be replaced with globals like `$fetch()` and `useNuxtApp()`. You can find more information about this in Nuxt documentation: - https://v3.nuxtjs.org/bridge/bridge-composition-api/ - https://v3.nuxtjs.org/bridge/overview
BREAKING CHANGE: `$nuxt` usage in stores defaults to type `any` unless you install the `@nuxt/types` package. This is because that package is quite heavy and can cause conflicts in projects not requiring it. Note `$nuxt` is deprecated and shouldn't be used (cf the other breaking changes notes).
Rework of #791
ctx.pinia
nuxi typecheck
for tpyechecking modulevue-demi
is removed for vue2 support since bridge is in placedefinePiniaStore()
andusePinia()
exposed)Breaking changes:
$pinia
injection is available which can be accessed usingusePinia()
(oruseNuxtApp().$pinia
)$nuxt
from store can be accessed usinguseNuxtApp()
composableTo be tested: