chore(deps): upgrade to Redux Toolkit 2 and react-redux 9 - #8139
chore(deps): upgrade to Redux Toolkit 2 and react-redux 9#8139talissoncosta wants to merge 1 commit into
Conversation
react-redux 8 only declares support up to React 18, and we run React 19, so the pairing was already unsupported. RTK 2 also brings skipPollingIfUnfocused, which the onboarding verify console needs to stop polling an abandoned tab. The store needed no changes: configureStore already used the middleware callback form, no slice uses extraReducers, and nothing calls connect(). - service.ts and useInfiniteScroll.ts imported types from @reduxjs/toolkit/dist and /src, which RTK 2 no longer ships. Both now use the public /query and /query/react entries. Importing from /src had pulled RTK's own uncompiled source into our programme, producing errors inside node_modules. - UseQuery is no longer exported; TypedUseQuery is the public equivalent. - CreateSAML falls back for two optional response fields. RTK 2 makes mutation results narrowable, which removed 10 pre-existing errors in that file and exposed these 4 shallower ones. Typecheck goes from 951 errors to 934 with no new failures. Unit tests (284) and the production bundle both pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughUpdates frontend Redux Toolkit and React Redux dependency versions, replaces internal RTK Query imports with public exports, and changes Estimated code review effort: 2 (Simple) | ~10 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Docker builds report
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ac3e1184-3a5f-49ee-a31d-f023dbd0e806
⛔ Files ignored due to path filters (1)
frontend/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
frontend/common/service.tsfrontend/common/useInfiniteScroll.tsfrontend/package.jsonfrontend/web/components/pages/organisation-settings/tabs/sso/saml/modals/CreateSAML.tsx
| import { PagedRequest } from './types/requests' | ||
| import { PagedResponse } from './types/responses' |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Use the configured frontend import aliases.
Replace the local relative imports with common/ paths to comply with the repository guideline.
Proposed fix
-import { PagedRequest } from './types/requests'
-import { PagedResponse } from './types/responses'
+import { PagedRequest } from 'common/types/requests'
+import { PagedResponse } from 'common/types/responses'
-import useDebounce from './useDebounce'
+import useDebounce from 'common/useDebounce'Also applies to: 8-8
Source: Coding guidelines
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #18796 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #18796 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #18796 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #18796 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #18793 (attempt 2)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #18793 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #18793 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #18793 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
❌ oss · depot-ubuntu-latest-arm-16 — run #18793 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Failed testsfirefox › tests/segment-test.pw.ts › Segment test 4 - Create ANY rule type segment and verify match changes when rule is updated @oss |
Visual Regression19 screenshots compared. See report for details. |
docs/if required so people know about the feature.Changes
Closes #8140.
@reduxjs/toolkit1.9.1 → 2.12.0,react-redux8.0.2 → 9.3.0,redux4 → 5.Why now:
react-redux@8supports React up to 18 and we run 19.2, and RTK 2 addsskipPollingIfUnfocused, which #8132's verify console needs.No store changes were needed. Three files:
common/service.ts,common/useInfiniteScroll.ts: import from@reduxjs/toolkit/queryand/query/react, replacing thedistandsrcpaths RTK 2 no longer ships.UseQueryis no longer exported, soTypedUseQueryreplaces it.CreateSAML.tsx: fallbacks foridp_metadata_xmlandallow_idp_initiated, both optional onSAMLConfiguration.How did you test this code?
typecheck: 951 errors on main → 934, no new failures (baseline diffed per error, since it isn't clean)test:unit: 284 passbundle: compileslint: clean on the changed filesManual checks on the preview, covering the store paths types can't:
redux-persistrehydration)useInfiniteScroll)