@pinia/colada
1.4.9 · 30 Oct 2026MIT207.8k / weekRepositoryHomepagenpmAtom feed
83 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.13.x
0.13.6
12 Feb 2025Add devtools
Apply multiple filters to getEntries
0.13.5
6 Feb 2025Add experimental useInfiniteQuery
Avoid clearing timeouts early
Correctly track new define queries when switching pages
Features
Add experimental useInfiniteQuery
Bug Fixes
Avoid clearing timeouts early
Correctly track new define queries when switching pages
Make the cache watchable
Trigger updates on untrack
0.13.4
31 Jan 2025plugins: toCacheKey
types: expose QueryCache
0.13.0
26 Nov 2024- Breaking
types: placeholderData no longer allows returning
null, onlyundefined. This won't affect most use cases and enables better type inference. types: remove undefined with initialData and placeholderData
- 0.12.x
0.12.1
9 Nov 2024staleTime of Infinity should still be stale
0.12.0
6 Nov 2024- Breaking
transformErrorwas never fully implemented so they are being removed and might come back if they is a real-word use case for them - Breaking
If you were using the
delayLoadingRefutil, use the@pinia/colada-plugin-delayinstead. - Breaking
Renaming
ErrortodefaultErrorallows to differentiate the property from the existing global Error class. Upgrading should be straightforward.
Breaking changes
- Breaking
transformErrorwas never fully implemented so they are being removed and might come back if they is a real-word use case for them - Breaking
If you were using the
delayLoadingRefutil, use the@pinia/colada-plugin-delayinstead. - Breaking
Renaming
ErrortodefaultErrorallows to differentiate the property from the existing global Error class. Upgrading should be straightforward.
Features
Add initial delay plugin
Add track and untrack actions for plugins
Allow dynamic values for auto refetches
Allow extending useQuery return
Expose more types
plugins: pass scope for added variables
Work without the plugin
Bug Fixes
- 0.11.x
0.11.1
28 Oct 2024Allow refetches to throw on erorr
Allow setting data for unexisting queries
Allow gcTime to never be set
Features
Allow refetches to throw on erorr
Allow setting data for unexisting queries
Bug Fixes
Allow gcTime to never be set
Eagerly change asyncStatus on cancel
staleTime of 0 always refreshes
0.11.0
25 Oct 2024- Breaking
mutations: This wasn't needed as instead, one can use
useQueryCache()outside. It could be added back if needed but it's more pragmatic to start without it. - Breaking
query: The
queryCache.cancelQuery()is renamed toqueryCache.cancel()to better match the other functions naming. A new functionqueryCache.cancelQueries()is added to actually cancel one or multiple queries instead of just one. - Breaking
plugins: In plugins,
cacheis renamed toqueryCachefor consistency.
Breaking changes
- Breaking
mutations: This wasn't needed as instead, one can use
useQueryCache()outside. It could be added back if needed but it's more pragmatic to start without it. - Breaking
query: The
queryCache.cancelQuery()is renamed toqueryCache.cancel()to better match the other functions naming. A new functionqueryCache.cancelQueries()is added to actually cancel one or multiple queries instead of just one. - Breaking
plugins: In plugins,
cacheis renamed toqueryCachefor consistency. - Breaking
This makes it clearer that
queryCacheis the result ofuseQueryCache().
Features
Add mutation store
hmr: warn against bugs
nuxt: add auto imports
nuxt: support colada.options
Predicate in filter
query: add cancelQueries
Run defined mutations in effect scope
Bug Fixes
nuxt: plugins
Performance Improvements
Tree shake unused stores
- 0.10.x
0.10.0
4 Oct 2024- Breaking
This change is mainly to simplify migration from TanStack Query.
- Breaking
Caches.invalidateQueries only fetches active queries
- Breaking
The
keysoption that automatically invalidate keys has been renamed toinvalidateKeysand moved to a plugin. This is in practice not needed. It's just an opinionated convenience that can be replaced by directly invalidating queries in the cache with theonSettled()hook inuseMutation():
Breaking changes
- Breaking
This change is mainly to simplify migration from TanStack Query.
- Breaking
Caches.invalidateQueries only fetches active queries
- Breaking
The
keysoption that automatically invalidate keys has been renamed toinvalidateKeysand moved to a plugin. This is in practice not needed. It's just an opinionated convenience that can be replaced by directly invalidating queries in the cache with theonSettled()hook inuseMutation():
const { mutate } = useMutation({ onSettled({ caches, vars: { id } }) { caches.invalidateQueries({ key: ['contacts-search'] }) caches.invalidateQueries({ key: ['contacts', id] }) }, mutation: (contact) => patchContact(contact), })Features
Caches.invalidateQueries only fetches active queries
- 0.9.x
0.9.0
26 Aug 2024- Breaking
query-cache: To better match the arguments, the
setQueryStateaction has been renamed tosetEntryState. mutations: add variables
query-cache: Rename
setQueryStatetosetEntryState
Breaking changes
- Breaking
query-cache: To better match the arguments, the
setQueryStateaction has been renamed tosetEntryState.
Features
mutations: add variables
query-cache: Rename
setQueryStatetosetEntryStatewarn: warn about reused keys
- 0.8.x
0.8.2
21 Aug 2024Skip reactivity traversal in store
0.8.1
17 Aug 2024ssr: expose reviveTreeMap
ssr: mark raw tree node in reviver
0.8.0
12 Aug 2024- Breaking
isFetchingfromuseQuery()is renamed toisLoadingto better reflect that it's connected toasyncStatus. - Breaking
The setup option in useQuery now receives the options as the second argument instead of a context object with the query return value and the options. This allows the setup function to have a more predictable signature and makes it easier to type. Only
PiniaColadahas this option, it has been removed from useQuery. Overall, the option still needs more thinking and will probably change in the future again. - Breaking
plugins: The
onSuccess,onError, andonSettledglobal hooks have been moved fromPiniaPluginto a Pinia Colada plugin:PiniaColadaQueryHooksPluginapp.use(PiniaColada, { + plugins: [ + PiniaColadaQueryHooksPlugin({ onSuccess() {}, onError() {}, onSettled() {}, + }), + ], })
Breaking changes
- Breaking
isFetchingfromuseQuery()is renamed toisLoadingto better reflect that it's connected toasyncStatus. - Breaking
The setup option in useQuery now receives the options as the second argument instead of a context object with the query return value and the options. This allows the setup function to have a more predictable signature and makes it easier to type. Only
PiniaColadahas this option, it has been removed from useQuery. Overall, the option still needs more thinking and will probably change in the future again. - Breaking
plugins: The
onSuccess,onError, andonSettledglobal hooks have been moved fromPiniaPluginto a Pinia Colada plugin:PiniaColadaQueryHooksPluginapp.use(PiniaColada, { + plugins: [ + PiniaColadaQueryHooksPlugin({ onSuccess() {}, onError() {}, onSettled() {}, + }), + ], }) - Breaking
This feature splits up the
statusstate into two different status properties: - Breaking
statusis now just for the data'pending' | 'success' | 'error' - Breaking
queryStatustells if the query is still running or not with'idle' | 'running' - Breaking
refetch,refreshand similar methods now resolve thestateproperty without rejecting. This is usually more convenient. - Breaking
The
QueryStatustype has been split intoDataStateStatusandOperationStateStatus. - Breaking
The cache store is going through a refactor to empower plugins. This change shouldn't affect end users unless you are directly using the cache store. As a result a lot of the actions have been renamed
- Breaking
Refetch -> fetch
- Breaking
invalidateEntry -> invalidate
- Breaking
ensureEntry -> ensure
Their arguments have changed as well.
- Breaking
This release removes the deprecated
QueryPlugin. UsePiniaColadainstead.
Features
- 0.7.x
0.7.1
30 Jul 2024hmr: always update options
0.7.0
26 Jul 2024- Breaking
Rename type
UseEntryKeytoEntryKey - Breaking
The exported type 'UseQueryKey' is replaced by the more generic type 'UseEntryKey', which will be also used to type mutations
- Deprecated
Support plugins and deprecate
QueryPluginin favor ofPiniaColada
Breaking changes
- Breaking
Rename type
UseEntryKeytoEntryKey - Breaking
The exported type 'UseQueryKey' is replaced by the more generic type 'UseEntryKey', which will be also used to type mutations
Features
Debug plugin
Expose plugin types
mutation: allow passing mutation variables to mutation key getter
Retry plugin
- Deprecated
Support plugins and deprecate
QueryPluginin favor ofPiniaColada use-query: Add enabled option
wip: add gcTime
Bug Fixes
gcTime on defined queries
query: query refresh on defineQuery output composable call
Trigger nested actions
- 0.6.x
0.6.0
2 Apr 2024- Breaking
mutation: Rename type
UseQueryStatustoQueryStatus - Breaking
mutation:
mutateno longer returns a promise and catches errors to be safely used in templates. The old behavior remains the same withmutateAsync - Breaking
mutation: the
mutationoption inuseMutation()now only accepts one argument for the variables. This allows to add extra parameters in the future like a signal, an extra context, etc
Breaking changes
- Breaking
mutation: Rename type
UseQueryStatustoQueryStatus - Breaking
mutation:
mutateno longer returns a promise and catches errors to be safely used in templates. The old behavior remains the same withmutateAsync - Breaking
mutation: the
mutationoption inuseMutation()now only accepts one argument for the variables. This allows to add extra parameters in the future like a signal, an extra context, etc
Features
Abort pending query signal on new query
Allow typing the error with transformError
mutation: add mutateAsync
mutation: allow passing the context to mutation
mutation: defineMutation wip
mutation: require one argument only for useMutation
query: add data and errors to global hooks
query: defineQuery
Return promise when invalidating query
useMutation: add hook context
useMutation: add hooks
- 0.5.x
0.5.3
21 Feb 2024onScopeDispose guard
0.5.2
20 Feb 2024Allow writing to entries
0.5.1
19 Feb 2024types: allow default error type
Avoid computed warns
0.5.0
19 Feb 2024- Breaking
Remove internal global defaults
- Breaking
Force array of keys to avoid easy mistakes
Pass signal to query
Breaking changes
- Breaking
Remove internal global defaults
- Breaking
Force array of keys to avoid easy mistakes
Features
Pass signal to query
- 0.4.x
0.4.3
11 Feb 2024Add delayLoadingRef
0.4.2
8 Feb 2024Avoid warn onScopeDispose
0.4.1
7 Feb 20240.4.0
6 Feb 2024- Breaking
Rename data fetching store
- Breaking
Replace class usage
- Breaking
Add
QueryPluginto configure useQuery()
Breaking changes
- Breaking
Rename data fetching store
- Breaking
Replace class usage
- Breaking
Add
QueryPluginto configure useQuery() - Breaking
statusproperty,isPending,isFetchingare now a bit different.
Features
ssr: wip initial version
- 0.3.x
0.3.1
3 Feb 2024useMutation: options
0.3.0
3 Feb 2024- Breaking
The option
fetcherforuseQuery()has been renamed toquery. The optionmutatorforuseMutation()has been renamedmutation.
Breaking changes
- Breaking
The option
fetcherforuseQuery()has been renamed toquery. The optionmutatorforuseMutation()has been renamedmutation.
- 0.2.x
0.2.0
16 Jan 2024- Breaking
Remove iife version
Accept function in setEntryData
Allow array of keys
Breaking changes
- Breaking
Remove iife version
Features
Accept function in setEntryData
Allow array of keys
Do not refresh by default outside of components
Traverse tree map
Wip tree map
Bug Fixes
Only use onServerPrefetch in components
Recompute based on key
Performance Improvements
Avoid creating children on tree
Use shallowRef for internal primitives
- 0.1.x
0.1.0
25 Dec 2023- Breaking
Rename options
Swallow error in automatic refreshes
Breaking changes
- Breaking
Rename options
Bug Fixes
Swallow error in automatic refreshes
- 0.0.x
0.0.1
20 Dec 2023Initial version
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.