Update @reduxjs/toolkit to v2 (with opt-in and v1 fallback)#235577
Draft
walterra wants to merge 14 commits intoelastic:mainfrom
Draft
Update @reduxjs/toolkit to v2 (with opt-in and v1 fallback)#235577walterra wants to merge 14 commits intoelastic:mainfrom
walterra wants to merge 14 commits intoelastic:mainfrom
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces renovate PRs #206187 and #235548.
Fixes #239863.
Redux Toolkit V2 includes some breaking changes that will be quite an effort to fix in just one PR. Overall the use of redux and RTK is quite fragmented! Some parts use legacy redux style and might bring in other packages for selectors and alternatives to redux-thunk. Luckily there are more modern usages of RTK too.
Some new features/breaking changes:
Some of Kibana’s code base uses legacy redux style and that code might also be in maintenance mode with the aim to remove it at some point. We’d like to avoid spending lots of time updating that code base to use Redux Toolkit. Considering that, it might be worth enabling support for both RTK V1 and V2 for the time being. This would also allow teams to migrate gradually like we are able to do with React V18 concurrent mode.
This PR tries to do the following: Keep RTK V1 for the time being and allow to opt in to migrate to V2. This will have good developer experience for teams, since everyone can update their code base with separate PRs. The drawback is that we’d have to maintain packages aliases for RTK and all accompanying packages mentioned above until all legacy redux code is either removed or migrated. To have both versions will add 20-25Kbyte bundle size.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.