From 57bec95d45da9b9c3fb5ae90b7a9b1a70d533862 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 18 Aug 2025 09:20:18 +0200 Subject: [PATCH] docs: remove old mentions of Vue 2 --- README.md | 2 +- packages/docs/ssr/nuxt.md | 57 +-------------------------------------- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index c2c52c6a..0ccba884 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ app.use(pinia) app.mount('#app') ``` -For more detailed instructions, including [Nuxt configuration](https://pinia.vuejs.org/ssr/nuxt.html#nuxt-js), check the [Documentation](https://pinia.vuejs.org). +For more detailed instructions, including [Nuxt configuration](https://pinia.vuejs.org/ssr/nuxt.html), check the [Documentation](https://pinia.vuejs.org). ### Create a Store diff --git a/packages/docs/ssr/nuxt.md b/packages/docs/ssr/nuxt.md index 49aa7998..a6d8013b 100644 --- a/packages/docs/ssr/nuxt.md +++ b/packages/docs/ssr/nuxt.md @@ -5,7 +5,7 @@ title="Learn about SSR best practices" /> -Using Pinia with [Nuxt](https://nuxt.com/) is easier since Nuxt takes care of a lot of things when it comes to _server side rendering_. For instance, **you don't need to care about serialization nor XSS attacks**. Pinia supports Nuxt Bridge, Nuxt 3 and Nuxt 4. For bare Nuxt 2 support, [see below](#nuxt-2-without-bridge). +Using Pinia with [Nuxt](https://nuxt.com/) is easier since Nuxt takes care of a lot of things when it comes to _server side rendering_. For instance, **you don't need to care about serialization nor XSS attacks**. Pinia supports Nuxt 3 and 4. @@ -104,58 +104,3 @@ export default defineNuxtConfig({ ``` Note the folders are relative to the root of your project. If you change the `srcDir` option, you need to adapt the paths accordingly. - -## Nuxt 2 without bridge - -Pinia supports Nuxt 2 until `@pinia/nuxt` v0.2.1. Make sure to also install [`@nuxtjs/composition-api`](https://composition-api.nuxtjs.org/) alongside `pinia`: - -```bash -yarn add pinia @pinia/nuxt@0.2.1 @nuxtjs/composition-api -# or with npm -npm install pinia @pinia/nuxt@0.2.1 @nuxtjs/composition-api -``` - -We supply a _module_ to handle everything for you, you only need to add it to `buildModules` in your `nuxt.config.js` file: - -```js -// nuxt.config.js -export default { - // ... other options - buildModules: [ - // Nuxt 2 only: - // https://composition-api.nuxtjs.org/getting-started/setup#quick-start - '@nuxtjs/composition-api/module', - '@pinia/nuxt', - ], -} -``` - -### TypeScript - -If you are using Nuxt 2 (`@pinia/nuxt` < 0.3.0) with TypeScript or have a `jsconfig.json`, you should also add the types for `context.pinia`: - -```json -{ - "types": [ - // ... - "@pinia/nuxt" - ] -} -``` - -This will also ensure you have autocompletion 😉 . - -### Using Pinia alongside Vuex - -It is recommended to **avoid using both Pinia and Vuex** but if you need to use both, you need to tell pinia to not disable it: - -```js -// nuxt.config.js -export default { - buildModules: [ - '@nuxtjs/composition-api/module', - ['@pinia/nuxt', { disableVuex: false }], - ], - // ... other options -} -``` -- 2.47.2