Skip to content

Latest commit

 

History

History
289 lines (187 loc) · 14.7 KB

CHANGELOG.md

File metadata and controls

289 lines (187 loc) · 14.7 KB

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.9.0 (2024-08-26)

⚠ BREAKING CHANGES

  • query-cache: To better match the arguments, the setQueryState action has been renamed to setEntryState.

Features

  • mutations: add variables (2e03a93)
  • query-cache: Rename setQueryState to setEntryState (f481eb0)
  • warn: warn about reused keys (7375a19)

0.8.2 (2024-08-21)

Small performance improvements.

0.8.1 (2024-08-17)

Features

  • ssr: expose reviveTreeMap (32b4f17)

Bug Fixes

  • ssr: mark raw tree node in reviver (4ff13ad)

0.8.0 (2024-08-12)

This release contains many breaking changes to improve the library. If you find anything missing, please open a pull request or issue.

⚠ BREAKING CHANGES

  • isFetching from useQuery() is renamed to isLoading to better reflect that it's connected to asyncStatus.

  • 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 PiniaColada has this option, it has been removed from useQuery. Overall, the option still needs more thinking and will probably change in the future again.

  • plugins: The onSuccess, onError, and onSettled global hooks have been moved from PiniaPlugin to a Pinia Colada plugin: PiniaColadaQueryHooksPlugin

    +import { PiniaColada, PiniaColadaQueryHooksPlugin } from '@pinia/colada'
    
     app.use(PiniaColada, {
    +  plugins: [
    +    PiniaColadaQueryHooksPlugin({
           onSuccess() {},
           onError() {},
           onSettled() {},
    +    }),
    +  ],
     })
  • status state is split into two different status properties:

    • status is now just for the data 'pending' | 'success' | 'error'
    • asyncStatus tells if the query is still running or not with 'idle' | 'running'

    Note this affects both useQuery() and useMutation()

  • refetch, refresh and similar methods now resolve the state property without rejecting. This is usually more convenient.

  • The QueryStatus type has been split into DataStateStatus and OperationStateStatus.

  • 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

    • refetch -> fetch
    • invalidateEntry -> invalidate
    • ensureEntry -> ensure

    Their arguments have changed as well. This is part of a bigger refactor to empower plugins and make the cache store more flexible.

  • This release removes the deprecated QueryPlugin. Use PiniaColada instead.

Features

  • add a state property to useQuery for type narrowing (22f3e21)

  • mutation: refetch active queries (#65) (3ebc734)

  • plugins: Refactor query global hooks into a plugin (bbe5199)

  • query: add active property to query entry (994db63), closes #65

  • split useMutation status like useQuery (6c6078f)

  • rename isFetching to isLoading (003f7a1)

  • rename cache store actions (792ec6e)

  • Replace QueryPlugin with PiniaColada (2a3f3d9)

  • useQuery setup option now receives the options as the second argument (a86b41d)

0.7.1 (2024-07-30)

Bug Fixes

  • hmr: always update options (a6a6b7a)

0.7.0 (2024-07-26)

⚠ BREAKING CHANGES

  • rename type UseEntryKey to EntryKey
  • the exported type 'UseQueryKey' is replaced by the more generic type 'UseEntryKey', which will be also used to type mutations

Features

  • debug plugin (8fde25b)
  • expose plugin types (83ef198)
  • mutation: allow passing mutation variables to mutation key getter (bc8a47f)
  • retry plugin (0d837a2)
  • support plugins and deprecate QueryPlugin in favor of PiniaColada (bde53d9)
  • use-query: Add enabled option (#43) (1b755c5)
  • wip: add gcTime (#29) (56659d1)

Bug Fixes

  • gcTime on defined queries (#50) (82df409)

  • query: query refresh on defineQuery output composable call (28a3ec1)

  • trigger nested actions (7e3a9f6)

  • rename type 'UseQueryKey' to 'UseEntryKey' (6a32d89)

  • rename type UseEntryKey to EntryKey (8110feb)

0.6.0 (2024-04-02)

⚠ BREAKING CHANGES

  • mutation: Rename type UseQueryStatus to QueryStatus
  • mutation: mutate no longer returns a promise and catches errors to be safely used in templates. The old behavior remains the same with mutateAsync
  • mutation: the mutation option in useMutation() 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 (6b6195f)

  • allow typing the error with transformError (fd35f6f)

  • mutation: add mutateAsync (5c97b69)

  • mutation: allow passing the context to mutation (b9acca0)

  • mutation: defineMutation wip (5866907)

  • mutation: require one argument only for useMutation (86b5996)

  • query: add data and errors to global hooks (b4caeca)

  • query: defineQuery (e0f7768)

  • return promise when invalidating query (c431284)

  • useMutation: add hook context (0894a81)

  • useMutation: add hooks (c44af13)

  • mutation: rename UseQueryStatus to QueryStatus (ff0067a)

0.5.3 (2024-02-21)

Bug Fixes

0.5.2 (2024-02-20)

Bug Fixes

  • allow writing to entries (8e9ac7e)

0.5.1 (2024-02-19)

Features

  • types: allow default error type (68c2f8d)

Bug Fixes

0.5.0 (2024-02-19)

⚠ BREAKING CHANGES

  • remove internal global defaults
  • force array of keys to avoid easy mistakes

Features

  • pass signal to query (bf1666c)

  • force array of keys to avoid easy mistakes (7d95da0)

  • remove internal global defaults (53ce0bc)

0.4.3 (2024-02-11)

Features

0.4.2 (2024-02-08)

Bug Fixes

  • avoid warn onScopeDispose (47ac1a6)

0.4.1 (2024-02-07)

  • logs

0.4.0 (2024-02-06)

⚠ BREAKING CHANGES

  • rename data fetching store
  • replace class usage
  • add QueryPlugin to configure useQuery()
  • status property, isPending, isFetching are now a bit different.

Features

  • ssr: wip initial version (8e6cbf6)

  • adapt status (2d5625c)

  • add QueryPlugin to configure useQuery() (67cb2d3)

  • rename data fetching store (b9ef0fb)

  • replace class usage (9bf1fd9)

0.3.1 (2024-02-03)

Bug Fixes

0.3.0 (2024-02-03)

⚠ BREAKING CHANGES

  • The option fetcher for useQuery() has been renamed to query. The option mutator for useMutation() has been renamed mutation.

  • rename options for useQuery and useMutation (28ecc75)

0.2.0 (2024-01-16)

⚠ BREAKING CHANGES

  • remove iife version

Features

  • accept function in setEntryData (2abb7c0)
  • allow array of keys (7be2e80)
  • do not refresh by default outside of components (b6e45fb)
  • traverse tree map (b12547f)
  • wip tree map (b87bff4)

Bug Fixes

  • only use onServerPrefetch in components (445921a)
  • recompute based on key (c9d739f)

build

0.1.0 (2023-12-25)

⚠ BREAKING CHANGES

  • rename options

Bug Fixes

  • swallow error in automatic refreshes (d955754)

  • rename options (f6d01c5)

0.0.1 (2023-12-20)

Features