Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency redux-saga to v1 #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jan 20, 2019

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
redux-saga (source) 0.12.1 -> 1.1.3 age adoption passing confidence

Release Notes

redux-saga/redux-saga

v1.1.3

Compare Source

v1.1.2

Compare Source

v1.1.1

Compare Source

Fixes resolving TS types for redux-saga/effects

v1.1.0

Compare Source

This release is bringing improved TS typings - allowed by [email protected]. Thanks, @​gilbsgilbs for working on this 👍

For more on this please read #​1892 (comment)

v1.0.5

Compare Source

v1.0.4

Compare Source

v1.0.3

Compare Source

v1.0.2

Compare Source

v1.0.1

Compare Source

v1.0.0

Compare Source

During work on v1, we made several breaking changes

Breaking changes
  • errors thrown during put execution are no longer caught and swallowed, you need to catch them manually
  • errors thrown during cancellation process are no longer swallowed, you need to keep finally block fail-safe
  • removed some deprecated APIs - takeEvery, takeLatest, throttle from the redux-saga entry point (they are and were importable from redux-saga/effects). put.sync and takem were removed.
  • removing execution of an array of effects yield [...]. use all effect instead.
  • delay became an effect, old delay function (not effect!) can be imported from @redux-saga/delay-p
  • put.resolve was changed to putResolve
  • take.maybe was changed to takeMaybe
  • changed API of runSaga - it no longer accepts subscribe option, you should create a channel (preferably stdChannel), pass it as channel argument to the runSaga API and communicate with through it with take and put methods
  • task.done getter was changed to be task.toPromise method
  • onError doesn't extend error with additional field sagaStack, but pass it as a property of second argument. before: onError: (e: Error), after: onError(e: Error, { sagaStack })
  • Effect shape, yielded to redux-saga middleware, is stabilized and declared now as a plain JavaScript object
  • channels private getters (takers and closed) got removed
  • {effects, utils} aren't imported from 'redux-saga' anymore. imports them from redux-saga/effects, redux-saga/utils
  • is helper should be imported from @redux-saga/is.
  • createMockTask, cloneableGenerator should be imported from @redux-saga/testing-utils
  • now race should be finished if any of effects resolved with END (by analogy with all)
  • cancel and join cannot receive variadic arguments anymore. so you have to rewrite cancel(...[tasks]) and join(...[tasks]) to cancel([tasks]) and join([tasks]) respectively. also calling cancel(...) returns a cancel-effect (before it may return an all effect), and calling join(...) returns a join-effect.
  • refactor effect structure from {[IO]: true, [type]: payload } to { [IO]: true, type, payload } to get rid of dynamic type property. Could affect you if implement custom monitor for saga effects.
  • channel and actionChannel have default buffer of buffers.expanding()
  • eventChannel does no longer accept matcher argument.
  • exported util of arrayOfDeffered got renamed to the correct arrayOfDeferred
New functionality
  • multicastChannel - no buffering, notify all pending takers, multicastChannel#take(cb, matcher = matchers.wildcard)
  • support for yield take(multicastChannel, pattern)
  • internal stdChannel got reworked to be a singleton object (it is wrapped multicastChannel's instance'), also it is an exported API to support new runSaga's signature - this should also result in being a small perf boost
  • effectMiddlewares - useful especially for testing, you can intercept/hijack any effect and resolve it on your own - passing it very redux-style to the next middleware (last being redux-saga itself). How it might be used can be checked here. Many thanks to @​eloytoro for this feature
  • takeLeading helper. It takes "leading" action and ignores all incoming ones of the same type while the "leading" is still handled (useful for things debouncing)
  • retry helper. Receives a function and executes it (with blocking call). In case of failure will try to make another call after delayLength milliseconds, if a number of attempts < maxTries parameter
  • add debounce helper. Spawns a saga on an action dispatched to the Store that matches pattern. Saga will be called after it stops taking pattern actions for ms milliseconds. Purpose of this is to prevent calling saga until the actions are settled off.

v0.16.2

Compare Source

v0.16.1

Compare Source

v0.16.0

Compare Source

During work on v1, we made several breaking changes

Breaking changes
  • errors thrown during put execution are no longer caught and swallowed, you need to catch them manually
  • errors thrown during cancellation process are no longer swallowed, you need to keep finally block fail-safe
  • removed some deprecated APIs - takeEvery, takeLatest, throttle from the redux-saga entry point (they are and were importable from redux-saga/effects). put.sync and takem were removed.
  • removing execution of an array of effects yield [...]. use all effect instead.
  • delay became an effect, old delay function (not effect!) can be imported from @redux-saga/delay-p
  • put.resolve was changed to putResolve
  • take.maybe was changed to takeMaybe
  • changed API of runSaga - it no longer accepts subscribe option, you should create a channel (preferably stdChannel), pass it as channel argument to the runSaga API and communicate with through it with take and put methods
  • task.done getter was changed to be task.toPromise method
  • onError doesn't extend error with additional field sagaStack, but pass it as a property of second argument. before: onError: (e: Error), after: onError(e: Error, { sagaStack })
  • Effect shape, yielded to redux-saga middleware, is stabilized and declared now as a plain JavaScript object
  • channels private getters (takers and closed) got removed
  • {effects, utils} aren't imported from 'redux-saga' anymore. imports them from redux-saga/effects, redux-saga/utils
  • is helper should be imported from @redux-saga/is.
  • createMockTask, cloneableGenerator should be imported from @redux-saga/testing-utils
  • now race should be finished if any of effects resolved with END (by analogy with all)
  • cancel and join cannot receive variadic arguments anymore. so you have to rewrite cancel(...[tasks]) and join(...[tasks]) to cancel([tasks]) and join([tasks]) respectively. also calling cancel(...) returns a cancel-effect (before it may return an all effect), and calling join(...) returns a join-effect.
  • refactor effect structure from {[IO]: true, [type]: payload } to { [IO]: true, type, payload } to get rid of dynamic type property. Could affect you if implement custom monitor for saga effects.
  • channel and actionChannel have default buffer of buffers.expanding()
  • eventChannel does no longer accept matcher argument.
  • exported util of arrayOfDeffered got renamed to the correct arrayOfDeferred
New functionality
  • multicastChannel - no buffering, notify all pending takers, multicastChannel#take(cb, matcher = matchers.wildcard)
  • support for yield take(multicastChannel, pattern)
  • internal stdChannel got reworked to be a singleton object (it is wrapped multicastChannel's instance'), also it is an exported API to support new runSaga's signature - this should also result in being a small perf boost
  • effectMiddlewares - useful especially for testing, you can intercept/hijack any effect and resolve it on your own - passing it very redux-style to the next middleware (last being redux-saga itself). How it might be used can be checked here. Many thanks to @​eloytoro for this feature
  • takeLeading helper. It takes "leading" action and ignores all incoming ones of the same type while the "leading" is still handled (useful for things debouncing)
  • retry helper. Receives a function and executes it (with blocking call). In case of failure will try to make another call after delayLength milliseconds, if a number of attempts < maxTries parameter
  • add debounce helper. Spawns a saga on an action dispatched to the Store that matches pattern. Saga will be called after it stops taking pattern actions for ms milliseconds. Purpose of this is to prevent calling saga until the actions are settled off.

v0.15.6

Compare Source

TS Typings

  • made take and put effects redeclarable (thanks to @​Rokt33r)
  • marked overloaded put.sync as deprecated

v0.15.5

Compare Source

TS Typings

  • optional cancel property on CpsCallback (thanks to @​dannsam)
  • support for non-strict effect combinators (thanks to @​aikoven
  • type definitions for util's cloneableGenerator function (thanks to @​zyml)

v0.15.4

Compare Source

  • added pure functions annotations (for few deprecation warnings) so they can be better tree-shaken now. more can be read here, thanks to @​iamakulov

v0.15.3

Compare Source

  • fixed middleware's context not being passed to the root sagas (thanks @​VictorQueiroz)

v0.15.2

Compare Source

  • fixed problem with yielding falsy values - normally all non-interpretable yields are just injected back to your saga (const two = yield 2), however yielding falsy values prevented yielding saga to continue

v0.15.1

Compare Source

  • reverted using Symbols for some internal properties - this caused 2 redux-saga version to be incompatible, effects from one couldnt be interpreted by the other one

v0.15.0

Compare Source

Things published already under recent patch versions, but without public release noted:

  • got redux-saga/effects and redux-saga/utils working properly for webpack2 and rollup users (or any other bundle which recognizes jsnext:main/module entry). Thanks to @​Ephys. How was it achieved can be seen here. Neat trick which I think is not publicly known and it was an issue for quite some time and also allowed me to help fixing this in some other libraries.
  • fixed join(...tasks) implementation, its not accepting an array of tasks, but rather a variadic number of tasks as arguments
  • implemented cancel(...tasks) in similar manner
  • implemented possibility for self cancellation, this means you can now yield cancel() inside a task and handle both cancel(task) + self cancellation via cancel() within the same finally block
  • fixed internal scheduler and its recursive nature, now its trampolining and cannot cause stack's overflow, thanks to @​pbadenski and @​wilsaj
  • added getContext and setContext effects (thanks for the idea to @​aikoven). It's not properly documented yet, but its a feature which allows sharing context properties across tasks without need to import them in each file or passing them explicitly through arguments. The feature is implemented as dynamic scoping which should sounds familiar for JS devs. In general you cannot share a context property from a child task to the parent, its only passed 'down'. You can read more in related issue and PR till its not documented.
  • got rid of createSagaMiddleware({ onerror }) which got into library because of a typo and we have supported it for some time, please use onError instead

New in this release:

  • refactored runSaga API, runSaga(iterator, storeInterface) got depreacted in favor of runSaga(storeInterface, saga, ...args). It allowed us to leverage the change internally so now sagaMiddleware.run became partially applied runSaga, they wont now go out of sync (in the past changes and bug fixes had to implemented in both of them).
  • cloneableGenerator utils, which can ease ur unit testing when logic branching is needed, thanks to @​nihaux
  • call([obj, 'method']) - now you can pass a string as method's name which should be called on the passed context
  • all effect - explicit effect for parallel effects, which is exactly what we had been supporting by accepting yielded arrays, so the latter is become deprecated now in favor of this explicitness which nicely maps to the Promise.all API. Please use this from now on
  • improved TS typings, thanks to @​aikoven for his continous support in this matter

Bug fixes:

  • fixed issue with eventChannels not closing automatically upon emitting END, thanks to @​baldwmic

In the meantime we have also:

v0.14.8

Compare Source

v0.14.7

Compare Source

v0.14.6

Compare Source

v0.14.5

Compare Source

v0.14.4

Compare Source

Fixes
  • take effect supporting Symbol types again - thanks to @​iMoses

v0.14.3

Compare Source

This small update allows you to integrate better with some other redux libraries, like redux-actions and redux-act.

For the users of those it is now possible to omit maintaining action constants only for the sake's of redux-saga and they can use created actions as patterns for the take effect like this:

import { createAction } from 'redux-actions'

const increment = createAction('INCREMENT', amount => amount) // typeof increment === 'function'

// ...
yield take(increment)

It means that you can pass an action creator function with custom .toString() method on it and it can be checked by redux-saga against dispatched actions' types.

Special thanks for this goes to @​thezanke

Also - finally the build for rollup should be fixed (public export of CHANNEL_END got fixed).

v0.14.2

Compare Source

This small update allows you to integrate better with some other redux libraries, like redux-batched-actions.

From now on you can intercept what's being dispatched before it's emitted into the saga, which will allow for using take just like everybody else, instead of playing with the pattern argument.

The argument you need to pass to the middleware is a higher-order function which will first take out built-in emit function as the argument and return a 'middleware' function to process dispatched actions.

Example usage:

createSagaMiddleware({
 emitter: emit => action => {
   if (Array.isArray(action)) {
     action.forEach(emit);
     return
   }
   emit(action)
 }
});

More can be read in our docs

Great thanks to the @​pbadenski for implementing the feature.

v0.14.1

Compare Source

Just a small patch version with:

  • join(...tasks) - this effect creator will accept array of tasks from now on, it's just a shorthand (more obvious one) for tasks.map(join)
  • take(array) - array can be now of mixed types - strings and predicate functions so this is possible now yield take(['ACTION_A', ac => ac.payload])
  • added TS typings for helpers' effect creators from the redux-saga/effects, that means takeEvery, takeLatest, throttle (thanks to @​mcrawshaw)

v0.14.0

Compare Source

This release contains mostly deprecations, but only a mild ones. Mainly few things got better, more descriptive names to indicate their behaviour and helpers got their way into effects. Of course as those are deprecations only, we are still planning to support old APIs for a time being, but as those do not require much change in the code they old versions will get removed eventually.

New features:

  • permitting saga monitors to only hook the functions they want (thanks to @​skellock)

Fixes:

  • refactored moment of actions emitting to saga internals, so not only standard middleware benefits from the recent (and possibly future) scheduling fixed, but also the runSaga API

Deprecations:

  • put.sync got renamed to put.resolve
  • takem got renamed to take.maybe
  • createSagaMiddleware({ onerror }) got fixed in the code (was documented as onError) and should be used from now on as docs suggested - createSagaMiddleware({ onError }) (thanks to @​kuy)
  • all built-in helpers (takeEvery, takeLatest, throttle) got their respective counterparts in redux-saga/effects module, which should confuse people less and be more newcomers-friendly
import { takeEvery } from 'redux-saga/effects'
// ...
yield* takeEvery('ACTION', worker) // this WON'T work, as effect is just an object
const task = yield takeEvery('ACTION', worker) // this WILL work like charm

-----

import { takeEvery } from 'redux-saga'
// ...
yield* takeEvery('ACTION', worker) // this will continue to work for now
const task = yield takeEvery('ACTION', worker) // and so will this

Also few typings were fixed, thanks to @​yenshih, @​CarsonF and @​aikoven for veryfing.

And last (but not least) great thanks and much appreciation to everyone who has contributed to improving the docs!

Happy Christmas.

v0.13.0

Compare Source

This release includes an Improved saga monitor API (see #​609).

  • notifies the monitor when root sagas are started by sagaMiddleware.run or runSaga.
  • added actionDispatched trigger to the monitor contract. We need this in order to figure out saga/take effects that reacted to a given action. Also added a silent flag SAGA_ACTION (non enumerable property) added to distinguish actions dispatched by sagas from others.

Other changes


Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant