]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: list all deprecations
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Nov 2021 14:18:45 +0000 (15:18 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Nov 2021 14:18:45 +0000 (15:18 +0100)
packages/docs/cookbook/migration-v1-v2.md
packages/pinia/src/types.ts

index a7fcb2d71aa50f0b0f0488763a387fee54018592..23a6239b5a4b45813d285926c6af668dc3458d02 100644 (file)
@@ -16,6 +16,9 @@ If you are using ESLint, consider using [this plugin](https://github.com/gund/es
 
 - `createStore()` becomes `defineStore()`
 - In subscriptions, `storeName` becomes `storeId`
+- `PiniaPlugin` was renamed `PiniaVuePlugin` (Pinia plugin for Vue 2)
+- `$subscribe()` no longer accepts a _boolean_ as second parameter, pass an object with `detached: true` instead.
+- Pinia plugins no longer directly receive the `id` of the store. Use `store.$id` instead.
 
 ## Breaking changes
 
@@ -52,12 +55,28 @@ If you were writing plugins, using TypeScript, and extending the type `DefineSto
 -  export interface DefineStoreOptions<S, Store> {
 +  export interface DefineStoreOptionsBase<S, Store> {
      debounce?: {
-       [k in keyof A]?: number
+       [k in keyof StoreActions<Store>]?: number
      }
    }
  }
 ```
 
+## `PiniaStorePLugin` was renamed
+
+The type `PiniaStorePlugin` was renamed to `PiniaPlugin`
+
+```diff
+-import { PiniaStorePlugin } from 'pinia'
++import { PiniaPlugin } from 'pinia'
+
+-const piniaPlugin: PiniaStorePlugin = () => {
++const piniaPlugin: PiniaPlugin = () => {
+   // ...
+ }
+```
+
+**Note this change can only be done after upgrading to the latest version of Pinia without deprecations**.
+
 ## `@vue/composition-api` version
 
 Since pinia now relies on `effectScope()`, you must use at least the version `1.1.0` of `@vue/composition-api`:
index 31d192ac862dbba570a82c4d5ab22b6ff3c1659e..1f0c25f3aa2441aee0b3466c8778b4487d2ebabf 100644 (file)
@@ -359,7 +359,6 @@ export interface _StoreWithState<
   ): () => void
 
   /**
-   * @alpha Please send feedback at https://github.com/posva/pinia/issues/240
    * Setups a callback to be called every time an action is about to get
    * invoked. The callback receives an object with all the relevant information
    * of the invoked action: