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

Bump @reduxjs/toolkit from 1.9.7 to 2.0.1 #1236

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 1, 2024

Bumps @reduxjs/toolkit from 1.9.7 to 2.0.1.

Release notes

Sourced from @​reduxjs/toolkit's releases.

v2.0.0

This major release :

  • Removes the deprecated object syntax from createSlice and createReducer
  • Removes other deprecated options
  • Updates the middleware and enhancers options of configureStore to require callbacks
  • Updates the packaging for better ESM/CJS compatibility and modernizes the build output
  • Includes all changes to Redux core 5.0, Reselect 5.0, and Redux Thunk 3.0
  • Updates RTKQ default subscription behavior
  • Adds a new combineSlices method with support for lazy-loading slice reducers
  • Adds a new "dynamic middleware" middleware with support for adding middleware at runtime
  • Adds a new callback syntax to createSlice.reducers, with optional support for defining thunks inside of createSlice
  • Adds the autoBatchEnhancer to configureStore by default
  • Has many additional TS tweaks and improvements

This release has breaking changes. (Note: v2.0.1 was released with a couple hotfixes for Reselect and Redux Thunk right as this was being finalized.)

This release is part of a wave of major versions of all the Redux packages: Redux Toolkit 2.0, Redux core 5.0, React-Redux 9.0, Reselect 5.0, and Redux Thunk 3.0.

For full details on all of the breaking changes and other significant changes to all of those packages, see the "Migrating to RTK 2.0 and Redux 5.0" migration guide in the Redux docs.

[!NOTE] The Redux core, Reselect, and Redux Thunk packages are included as part of Redux Toolkit, and RTK users do not need to manually upgrade them - you'll get them as part of the upgrade to RTK 2.0. (If you're not using Redux Toolkit yet, please start migrating your existing legacy Redux code to use Redux Toolkit today!)

# RTK
npm install @reduxjs/toolkit
yarn add @reduxjs/toolkit

Changelog

Object syntax for createSlice.extraReducers and createReducer removed

RTK's createReducer API was originally designed to accept a lookup table of action type strings to case reducers, like { "ADD_TODO": (state, action) => {} }. We later added the "builder callback" form to allow more flexibility in adding "matchers" and a default handler, and did the same for createSlice.extraReducers.

We have removed the "object" form for both createReducer and createSlice.extraReducers in RTK 2.0, as the builder callback form is effectively the same number of lines of code, and works much better with TypeScript.

As an example, this:

const todoAdded = createAction('todos/todoAdded')
createReducer(initialState, {
[todoAdded]: (state, action) => {},
})
createSlice({
name,
initialState,
</tr></table>

... (truncated)

Commits

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 show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @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)

@dependabot dependabot bot added the type:dependencies Pull requests that update a dependency file label Jan 1, 2024
Copy link

github-actions bot commented Jan 1, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-01_04-17-38/ .
It might take a few minutes for it to become available.

Copy link

github-actions bot commented Jan 3, 2024

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions github-actions bot added the status:conflicts Conflicts with another pull request or issue label Jan 3, 2024
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/reduxjs/toolkit-2.0.1 branch from 240f674 to 1a9dbc3 Compare January 3, 2024 11:20
@github-actions github-actions bot removed the status:conflicts Conflicts with another pull request or issue label Jan 3, 2024
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/reduxjs/toolkit-2.0.1 branch from 1a9dbc3 to d5c01d3 Compare January 3, 2024 11:21
Copy link

github-actions bot commented Jan 3, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-03_11-26-33/ .
It might take a few minutes for it to become available.

Copy link

github-actions bot commented Jan 3, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-03_11-26-59/ .
It might take a few minutes for it to become available.

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/reduxjs/toolkit-2.0.1 branch 2 times, most recently from 84ed985 to 645aa60 Compare January 3, 2024 13:10
Copy link

github-actions bot commented Jan 3, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-03_13-10-18/ .
It might take a few minutes for it to become available.

Copy link

github-actions bot commented Jan 3, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-03_13-10-46/ .
It might take a few minutes for it to become available.

Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 1.9.7 to 2.0.1.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](reduxjs/redux-toolkit@v1.9.7...v2.0.1)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/reduxjs/toolkit-2.0.1 branch from 645aa60 to 37b2cb1 Compare January 4, 2024 08:29
Copy link

github-actions bot commented Jan 4, 2024

This pull request is deployed at test.editor.opencast.org/1236/2024-01-04_08-29-48/ .
It might take a few minutes for it to become available.

Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 18, 2024

Looks like @reduxjs/toolkit is up-to-date now, so this is no longer needed.

@dependabot dependabot bot closed this Jan 18, 2024
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/reduxjs/toolkit-2.0.1 branch January 18, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants