-
Notifications
You must be signed in to change notification settings - Fork 10
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
Upgrade to Rect Redux 8 & Redux Toolkit #64
Conversation
be6336d
to
295eb53
Compare
This is going to need a couple of changes in our code. I've started with crafting a patch, but I'll leave this blocked for now. |
295eb53
to
add1ce9
Compare
add1ce9
to
36689a1
Compare
07aac2d
to
69e655d
Compare
26ed720
to
e2f35a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the affected code and converted our reducers to use Redux Toolkit. However, the gating tests page reducer seems to have got broken, so I'm blocking this for now.
In general I feel strange about this PR. I think, that in this PR should be code that resolves update redux from 7 to 8 |
Created a jira-ticket for this: https://issues.redhat.com/browse/OSCI-4547 |
e2f35a7
to
e7b23cb
Compare
7129abf
to
23799c7
Compare
@Andrei-Stepanov I think this is ready for review. I've split the changes so that there's one commit per slice/reducers, so it will be easier to review going through the commits one by one. |
src/reducers/queryStringSlice.ts
Outdated
return state; | ||
} | ||
}; | ||
state.queryString = newQueryString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this actually work? Without update
?
import update from 'immutability-helper';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Redux Toolkit uses the Immer library to handle in-place state updates. So we can now write code like in the old times, but it's still sort of immutable in the background.
@mgrabovsky looks good. |
Bumps [react-redux](https://github.com/reduxjs/react-redux) from 7.2.8 to 8.0.5. - [Release notes](https://github.com/reduxjs/react-redux/releases) - [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md) - [Commits](reduxjs/react-redux@v7.2.8...v8.0.5) --- updated-dependencies: - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
@Andrei-Stepanov See my response above. Redux Toolkit uses Immer under the hood, which watches for mutations on the state and automatically creates an immutable copy with the changes applied in the background. This means that we don't have to call |
The `redux-thunk` library is no longer needed when using Redux Toolkit. See the [documentation][1]. Moreover, the Redux DevTools are set up automatically as well so there's no need for dedicated code. [1]: https://redux-toolkit.js.org/usage/usage-guide#using-middleware-to-enable-async-logic
Follow the new nomeclature of Redux Toolkit where both reducers and actions stem from slices.
23799c7
to
93807f8
Compare
I have now added the clarifying comment as requested above. |
Thank you! Please merge. |
Use the specialized `useAppDispatch()` and `useAppSelector()` hooks everywhere. Follow-up to #64
Use the specialized `useAppDispatch()` and `useAppSelector()` hooks everywhere. Follow-up to #64
Use the specialized `useAppDispatch()` and `useAppSelector()` hooks everywhere. Follow-up to #64
Bumps react-redux from 7.2.8 to 8.0.5.
Release notes
Sourced from react-redux's releases.
... (truncated)
Commits
8d03182
Release 8.0.532e40e4
Merge pull request #1928 from marconi1992/fix/1927ff7d96b
fix: type when passing nullish mapDispathToProps5082af7
Merge pull request #1965 from reduxjs/draft/amazing-rosalindbafe55e
Add typetestsfc3954a
Update test matrix to Node 16 and TS 4.9401250e
also update TypedUseSelectorHook3b06061
wrap type inad40b97
Merge pull request #1960 from OliverJAsh/patch-18cf538c
Merge pull request #1966 from ethen001/chores/custom-equality-fn-docsDependabot 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)