Skip to content

Upgrading pinia 0.3 to 0.4

Unknown0.3.1 → 0.4.1

Fetching 2 releases from GitHub…0 / 2
UnknownUpgrade verdict

DepDelta is still reading the notes for this range, so breaking changes can't be ruled out yet.

  • DepDelta is still reading the release notes in this range, so it can't rule out breaking changes yet.
  • This page updates as the notes come in.
Still reading release notes

DepDelta is still reading the release notes in this range. This updates as they come in.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: declare global
  • added: export { DefineStoreOptions } from './types'
  • added: export { GenericStore } from './types'
  • added: export { GettersTree } from './types'
  • added: export { PiniaPluginContext } from './rootStore'
  • added: export { StoreDefinition } from './types'
  • added: export { _MapActionsObjectReturn } from './mapHelpers'
  • added: export { _MapActionsReturn } from './mapHelpers'
  • added: export { _MapStateObjectReturn } from './mapHelpers'
  • added: export { _MapStateReturn } from './mapHelpers'
  • added: export { _MapWritableStateObjectReturn } from './mapHelpers'
  • added: export { _MapWritableStateReturn } from './mapHelpers'
  • added: export { _Method } from './types'
  • added: export { _Spread } from './mapHelpers'
  • added: export { _StoreObject } from './mapHelpers'
  • changed: function mapActions<Id extends string, S extends StateTree, G, A, KeyMapper extends Record<string, keyof A>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): MapActionsObjectReturn<A, KeyMapper> → function mapActions<Id extends string, S extends StateTree, G extends GettersTree<S>, A, KeyMapper extends Record<string, keyof A>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapActionsObjectReturn<A, KeyMapper>
  • changed: function mapActions<Id extends string, S extends StateTree, G, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof A>): MapActionsReturn<A> → function mapActions<Id extends string, S extends StateTree, G extends GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof A>): _MapActionsReturn<A>
  • changed: function mapState<Id extends string, S extends StateTree, G, A, KeyMapper extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): MapStateObjectReturn<Id, S, G, A, KeyMapper> → function mapState<Id extends string, S extends StateTree, G extends GettersTree<S>, A, KeyMapper extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapStateObjectReturn<Id, S, G, A, KeyMapper>
  • changed: function mapState<Id extends string, S extends StateTree, G, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof S | keyof G>): MapStateReturn<S, G> → function mapState<Id extends string, S extends StateTree, G extends GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof S | keyof G>): _MapStateReturn<S, G>
  • changed: function mapStores<Stores extends GenericStoreDefinition[]>(...stores: [...Stores]): Spread<Stores> → function mapStores<Stores extends any[]>(...stores: [...Stores]): _Spread<Stores>
  • changed: function mapWritableState<Id extends string, S extends StateTree, G, A, KeyMapper extends Record<string, keyof S>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): MapWritableStateObjectReturn<S, KeyMapper> → function mapWritableState<Id extends string, S extends StateTree, G extends GettersTree<S>, A, KeyMapper extends Record<string, keyof S>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapWritableStateObjectReturn<S, KeyMapper>
  • changed: function mapWritableState<Id extends string, S extends StateTree, G, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof S>): MapWritableStateReturn<S> → function mapWritableState<Id extends string, S extends StateTree, G extends GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof S>): _MapWritableStateReturn<S>
  • added: type _MapActionsObjectReturn<A, T extends Record<string, keyof A>> = { [key in keyof T]: Store<string, StateTree, {}, A>[T[key]] }
  • added: type _MapActionsReturn<A> = { [key in keyof A]: Store<string, StateTree, {}, A>[key] }
  • added: type _MapStateObjectReturn<Id extends string, S extends StateTree, G extends GettersTree<S>, A, T extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)>> = { [key in keyof T]: () => T[key] extends (store: GenericStore) => infer R ? R : T[key] extends keyof S | keyof G ? Store<Id, S, G, A>[T[key]] : never }
  • added: type _MapStateReturn<S extends StateTree, G extends GettersTree<S>> = { [key in keyof S | keyof G]: () => Store<string, S, G, {}>[key] }
  • added: type _MapWritableStateObjectReturn<S extends StateTree, T extends Record<string, keyof S>> = { [key in keyof T]: { get: () => Store<string, S, {}, {}>[T[key]]; set: (value: Store<string, S, {}, {}>[T[key]]) => any } }
  • added: type _MapWritableStateReturn<S extends StateTree> = { [key in keyof S]: { get: () => Store<string, S, {}, {}>[key]; set: (value: Store<string, S, {}, {}>[key]) => any } }
  • added: type _Spread<A extends readonly any[]> = A extends [infer L, ...infer R] ? _StoreObject<L> & _Spread<R> : unknown
  • added: type _StoreObject<S> = S extends StoreDefinition<infer Ids, infer State, infer Getters, infer Actions> ? { [Id in `${Ids}${'suffix' extends keyof MapStoresCustomization ? MapStoresCu…
  • changed: call PiniaStorePlugin(pinia: Pinia): Partial<PiniaCustomProperties> → call PiniaStorePlugin(context: PiniaPluginContext): Partial<PiniaCustomProperties> | void
  • changed: const storesMap: WeakMap<Pinia, Map<string, [StoreWithState<string, StateTree>, StateDescriptor<StateTree>]>> → const storesMap: WeakMap<Pinia, Map<string, [StoreWithState<string, StateTree>, StateDescriptor<StateTree>, InjectionKey<GenericStore>]>>
  • changed: method Pinia.use(plugin: PiniaStorePlugin): void → method Pinia.use(plugin: PiniaStorePlugin): Pinia
  • changed: property Pinia._p: Array<() => Partial<PiniaCustomProperties>> → property Pinia._p: PiniaStorePlugin[]
  • added: interface PiniaPluginContext<Id extends string = string, S extends StateTree = StateTree, G extends GettersTree<S> = GettersTree<S>, A = Record<string, _Method>>
  • added: property PiniaPluginContext.options: DefineStoreOptions<Id, S, G, A>
  • added: property PiniaPluginContext.pinia: Pinia
  • added: property PiniaPluginContext.store: Store<Id, S, G, A>
  • changed: function defineStore<Id extends string, S extends StateTree, G, A>(options: { id: Id; state?: () => S; getters?: G & ThisType<S & StoreWithGetters<G> & PiniaCustomProperties>; actions?: A & ThisType<A & S & StoreWithState<Id, S> & StoreWithGetters<G> & PiniaCustomProperties> }): StoreDefinition<Id, S, G, A> → function defineStore<Id extends string, S extends StateTree, G extends GettersTree<S>, A>(options: DefineStoreOptions<Id, S, G, A>): StoreDefinition<Id, S, G, A>
  • removed: declare global
  • removed: interface DevtoolHook
  • removed: method DevtoolHook.emit(event: string, ...payload: any[]): void
  • removed: method DevtoolHook.on(event: string, callback: (targetState: Record<string, StateTree>) => void): void
  • removed: type Method = (...args: any[]) => any
  • removed: type NonNullObject = Record<any, any>
  • changed: interface PiniaCustomProperties<Id extends string = string, S extends StateTree = StateTree, G = Record<string, Method>, A = Record<string, Method>> → interface PiniaCustomProperties<Id extends string = string, S extends StateTree = StateTree, G extends GettersTree<S> = GettersTree<S>, A = Record<string, _Method>>
  • changed: interface StoreDefinition<Id extends string, S extends StateTree, G, A> → interface StoreDefinition<Id extends string, S extends StateTree, G extends GettersTree<S>, A>
  • changed: method StoreWithState.$patch(stateMutator: (state: S) => void): void → method StoreWithState.$patch<F extends (state: S) => void>(stateMutator: ReturnType<F> extends Promise<any> ? never : F): void
  • changed: type GenericStore = Store<string, StateTree, Record<string, Method>, Record<string, Method>> → type GenericStore = Store<string, StateTree, GettersTree<StateTree>, Record<string, _Method>>
  • changed: type GenericStoreDefinition = StoreDefinition<string, StateTree, Record<string, Method>, Record<string, Method>> → type GenericStoreDefinition = StoreDefinition<string, StateTree, GettersTree<StateTree>, Record<string, _Method>>
  • changed: type Store<Id extends string, S extends StateTree, G, A> = StoreWithState<Id, S> & S & StoreWithGetters<G> & StoreWithActions<A> & PiniaCustomProperties<Id, S, G, A> → type Store<Id extends string, S extends StateTree, G extends GettersTree<S>, A> = StoreWithState<Id, S> & S & StoreWithGetters<G> & StoreWithActions<A> & PiniaCustomProperties<Id, S, G, A>
  • changed: type StoreWithGetters<G> = { [k in keyof G]: G[k] extends (this: infer This, store?: any) => infer R ? R : never } → type StoreWithGetters<G> = { readonly [k in keyof G]: G[k] extends (...args: any[]) => infer R ? R : never }
  • added: interface DefineStoreOptions<Id extends string, S extends StateTree, G extends GettersTree<S>, A>
  • added: property DefineStoreOptions.actions?: A & ThisType<A & S & StoreWithState<Id, S> & StoreWithGetters<G> & PiniaCustomProperties>
  • added: property DefineStoreOptions.getters?: G & ThisType<S & StoreWithGetters<G> & PiniaCustomProperties>
  • added: property DefineStoreOptions.id: Id
  • added: property DefineStoreOptions.state?: () => S
  • added: type GettersTree<S extends StateTree> = Record<string, ((state: S) => any) | (() => any)>
  • added: type _Method = (...args: any[]) => any