Skip to content

Releases: klis87/redux-requests

@redux-requests/core v0.29.1

23 May 13:35
Compare
Choose a tag to compare
  • fixed onRequest which did not work properly for FSA actions (when you have action.payload.request not action.request)
  • removed babel regenerator-runtime from all packages so bundles for some packages are smaller

@redux-requests/core v0.29.0

17 May 00:29
Compare
Choose a tag to compare
  • added pristine flag to queries - you could see it with getQuery for instance, it was added to distinguish between situations where data is null because no request for a given query was made yet or because truly server response is null
  • resetRequests also resets pristine to true
  • improved SSR, now you can have mutliple error actions on the server, so for instance you can have 404 error, still render React on the server and error will be passed to the client, it might require onError interceptor to adjust how errors are structured, because error has to be serializable in order to pass it to the client

@redux-requests/core v0.28.2

14 May 00:17
Compare
Choose a tag to compare

Dispatch of requests actions now rejects promise in case of a syntax error (not related to network issues) not to swallow those errors. Now they should be visible in console.

@redux-requests/promise v0.1.1

29 Apr 18:13
Compare
Choose a tag to compare

A new driver, useful if you connect if an API with a promise based libraries or functions. See https://github.com/klis87/redux-requests/tree/master/packages/redux-requests-promise

@redux-requests/core v0.28.1

29 Apr 19:06
Compare
Choose a tag to compare

Fixed some problems with FSA actions after removing sagas.

@redux-requests/core v0.28.0

29 Apr 18:30
Compare
Choose a tag to compare

As you probably noticed, we just moved to scoped npm packages. Also, we removed redux-saga from dependencies! So you don't have to use redux-saga anymore with this project, albeit it is totally compatible with redux-saga.

What changed:

  • the library logic no longer uses sagas, now it is based only on pure promises and redux middleware
  • due to migration to scoped packages, you need to replace redux-saga-requests with @redux-requests/core, redux-saga-requests-axios with @redux-requests/axios and so on
  • new promise driver, thx @strdr4605 for the idea and implementation and very clever idea to use AbortController to make it abortable!
  • because sagas were removed, sendRequest does not exist anymore, but it is not needed, just dispatch request action, and if you need a response, await promise to be resolved, also all interceptor based options etc are handled by action.meta
  • again, due to removing sagas, handleRequests does not return requestsSagas anymore
  • changed interceptors to be promised based
  • added local interceptors, so for instance you can have action.meta.onResponse interceptor only for a specific action
  • meta.getData has currentData passed as 2nd argument in case you need it
  • pending counter for cached and ssr actions is not updated, which improves performance and prevents ssr flickering
  • removed meta.asPromise, promisify and autoPromisify from handleRequests, because all requests are always promisified, this doesn't hurt, simplifies API and allows you to dispatch actions instead of sendRequest without any worry
  • related to above, no matter what result, whether success, error or abort, dispatching of request actions always returns promise which will be resolved, never rejected, see https://github.com/klis87/redux-requests#promisified-dispatches for usage and justification
  • added new abortRequests action and at the same time removed onAbort
  • resetRequests aborts actions by default, you can change this by passing false as 2nd argument
  • fixed TS type for getQuerySelector and getMutationSelector

redux-saga-requests v0.27.0

22 Mar 16:11
Compare
Choose a tag to compare

It was a long time since the last release, it was for a reason. This is a very big release,
which is the first step to achieve 1.0 version. It was not splited into smaller releases
not to trouble you constantly with breaking changes plus many things depended on each other.

The easiest way to see what changed is just to quickly read new Readme actually.
But to give you some hints, those are most notable changes:

  • removed watchRequests, requestsReducer, networkReducer, all middleware from public API, it was replaced
    by handleRequests function which returns all the necessary pieces like reducer, saga, middleware in the right order etc, which simplifies usage, and requires less documentation
  • handleRequests returns requestsReducer, but this is actually old networkReducer, old requestsReducer is not supported anymore, in order to support new features it had to be removed, not to mention supporting two different APIs was very bad for maintenance and docs
  • added automatic but optional data normalisation, similar to GraphQL Apollo but for any API, including REST!
  • refactored drivers to simple promises (actually cancellable promises like in Bluebird)
  • getQuery and getMutation are actually selectors now, not selector creators, selector creators are available as
    getQuerySelector and getMutationSelector
  • query and mutation selectors are memoized per action type and even request key, you don't need to worry about using selectors in multiple places or in components directly anymore, there is just not possible to invalidate cache by accident
  • removed meta.resetOn, replaced it with resetRequests action
  • simplified meta.getData and meta.updateData payload, see docs or examples for current usage
  • cache and SSR state is kept in reducer, so usage is simplified and for instance cache is compatible with SSR
  • mutations work for cached queries and together with requestKey
  • reducer is pure function now, it doesn't have any internal state, so time travel works now and also
    you can use JS closures in meta.getData etc in request actions
  • removed meta.mutations[TYPE].getRequestKey and replaced it with meta.requestKey
  • meta.requestKey is also possible for queries, so you can store data for query with the same type independently
  • meta.cacheKey was removed, as meta.requestKey serves the same purpose, but with or without cache
  • replaced meta.cacheSize with meta.requestsCapacity due to the same reason
  • sendRequest usage is encouraged only in intereceptors, also dispatchRequestAction default is true
  • successful response contains only data for now, no headers or status, usually we care about those
    in error responses, possibly this will be updated in the furure, for now it had to be standardized for cache feature

redux-saga-requests-react v0.3.0

22 Mar 16:12
Compare
Choose a tag to compare

See redux-saga-requests v0.27.0

redux-saga-requests-mock v0.2.0

22 Mar 16:12
Compare
Choose a tag to compare

See redux-saga-requests v0.27.0

redux-saga-requests-graphql v0.3.0

22 Mar 16:13
Compare
Choose a tag to compare

See redux-saga-requests v0.27.0