HospitalRun / hospitalrun-frontend

Frontend for HospitalRun
https://staging.hospitalrun.io
MIT License
6.81k stars 2.18k forks source link

chore(deps): bump @reduxjs/toolkit from 1.7.2 to 1.8.1 #2903

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps @reduxjs/toolkit from 1.7.2 to 1.8.1.

Release notes

Sourced from @​reduxjs/toolkit's releases.

v1.8.1

This release updates RTK's peer dependencies to accept React 18 as a valid version. This should fix installation errors caused by NPM's "install all the peer deps and error if they don't match" behavior.

React-Redux and React 18

Note: If you are now using React 18, we strongly recommend using the React-Redux v8 beta instead of v7.x!. v8 has been rewritten internally to work correctly with React 18's Concurrent Rendering capabilities. React-Redux v7 will run and generally work okay with existing code, but may have rendering issues if you start using Concurrent Rendering capabilities in your code.

Now that React 18 is out, we plan to finalize React-Redux v8 and release it live within the next couple weeks. We would really appreciate final feedback on using React-Redux v8 beta with React 18 before we publish the final version.

v1.8.0

This release adds the new "listener" middleware, updates configureStore's types to better handle type inference from middleware that override dispatch return values, and updates our TS support matrix to drop support for TS < 4.1.

Changelog

New "Listener" Side Effects Middleware

RTK has integrated the thunk middleware since the beginning. However, thunks are imperative functions, and do not let you run code in response to dispatched actions. That use case has typically been covered with libraries like redux-saga (which handles side effects with "sagas" based on generator functions), redux-observable (which uses RxJS observables), or custom middleware.

We've added a new "listener" middleware to RTK to cover that use case. The listener middleware is created using createListenerMiddleware(), and lets you define "listener" entries that contain an "effect" callback with additional logic and a way to specify when that callback should run based on dispatched actions or state changes.

Conceptually, you can think of this as being similar to React's useEffect hook, except that it runs logic in response to Redux store updates instead of component props/state updates.

The listener middleware is intended to be a lightweight alternative to more widely used Redux async middleware like sagas and observables. While similar to thunks in level of complexity and concept, it can replicate some common saga usage patterns. We believe that the listener middleware can be used to replace most of the remaining use cases for sagas, but with a fraction of the bundle size and a much simpler API.

Listener effect callbacks have access to dispatch and getState, similar to thunks. The listener also receives a set of async workflow functions like take, condition, pause, fork, and unsubscribe, which allow writing more complex async logic.

Listeners can be defined statically by calling listenerMiddleware.startListening() during setup, or added and removed dynamically at runtime with special dispatch(addListener()) and dispatch(removeListener()) actions.

The API reference is available at:

https://redux-toolkit.js.org/api/createListenerMiddleware

Huge thanks to @​FaberVitale for major contributions in refining the middleware API and implementing key functionality.

Basic usage of the listener middleware looks like:

import { configureStore, createListenerMiddleware } from '@reduxjs/toolkit'

import todosReducer, { todoAdded, todoToggled, todoDeleted, } from '../features/todos/todosSlice'

// Create the middleware instance and methods const listenerMiddleware = createListenerMiddleware()

// Add one or more listener entries that look for specific actions. // They may contain any sync or async logic, similar to thunks. </tr></table>

... (truncated)

Commits
  • 5492281 Release 1.8.1
  • 6c8ef77 Tweak listener middleware example
  • 1e85331 Bump React peerdep to 18
  • ec628ac Merge pull request #2172 from bryndyment/patch-1
  • cd32f6e Update customizing-queries.mdx
  • de82d4d Merge pull request #2152 from val1984/patch-1
  • 038ce67 feat(toolkit): add new test for take
  • e263d4d fix: take return type should have predicate action type
  • 1751eb9 Merge pull request #2148 from kyletsang/improve-listener-docs
  • 29c3c37 Fix some issues in listener middleware docs
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/9xRYpJwQfW2yB9ZZCEqPRZGQ1bAY
✅ Preview: https://hospitalrun-frontend-git-dependabot-npmandya-206fdc-hospitalrun.vercel.app

dependabot[bot] commented 2 years ago

Superseded by #2928.