Skip to content

Commit 7165006

Browse files
committed
docs: new migration page
1 parent 6f2184b commit 7165006

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

packages/docs/.vitepress/config/en.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
132132
text: 'VSCode Snippets',
133133
link: '/cookbook/vscode-snippets.html',
134134
},
135+
{
136+
text: 'Migration from v2 to v3',
137+
link: '/cookbook/migration-v2-v3.html',
138+
},
135139
{
136140
text: 'Migration from v0/v1 to v2',
137141
link: '/cookbook/migration-v1-v2.html',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Migrating from v2 to v3
2+
3+
Pinia v3 is a _boring_ major release with no new features. It drops deprecated APIs and updates major dependencies. It only supports Vue 3. If you are using Vue 2, you can keep using v2. You can probably just update Pinia's version but this guide is here to help you in case you encounter any issues.
4+
5+
## Deprecations
6+
7+
### `defineStore({ id })`
8+
9+
The `defineStore()` signature that accepts an object with an `id` property is deprecated. You should use the `id` parameter instead:
10+
11+
```ts
12+
defineStore({ // [!code --]
13+
id: 'storeName', // [!code --]
14+
defineStore('storeName', { // [!code ++]
15+
// ...
16+
})
17+
```
18+
19+
### `PiniaStorePlugin`
20+
21+
This deprecated type alias has been removed in favor of `PiniaPlugin`.
22+
23+
## New versions
24+
25+
- Only Vue 3 is supported.
26+
- TypeScript 5 or newer is required.
27+
- The devtools API has been upgraded to [v7](https://devtools.vuejs.org).
28+
29+
## Nuxt
30+
31+
The Nuxt module has been updated to support Nuxt 3. If you are using Nuxt 2 or Nuxt bridge, you can keep using the old version of Pinia.

0 commit comments

Comments
 (0)