You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/05/11 16:57:16 UTC
[PR] chore(frontend): export typed useAppDispatch / useAppSelector hooks [superset]
rusackas opened a new pull request, #40027:
URL: https://github.com/apache/superset/pull/40027
### SUMMARY
First step of #39927 (the react-redux v7 → v8 migration spun off from #39890).
Adds typed Redux hooks alongside the existing store export in \`src/views/store.ts\`:
\`\`\`ts
export type AppDispatch = typeof store.dispatch;
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
\`\`\`
This is **purely additive** — no existing call sites changed. The hooks work identically under react-redux v7 (current) and v8 (target). Landing them now means subsequent PRs can migrate \`useDispatch\` → \`useAppDispatch\` one feature area at a time, instead of one mega-PR alongside the v8 bump.
### Why now
The eventual v8 bump tightens \`useDispatch\` / \`connect\` typing so thunks no longer auto-resolve against \`Dispatch<AnyAction>\`. A spot-check from #39927 surfaced ~50 new TS errors in just three SqlLab files; the real migration surface is hundreds of call sites. Defining the typed hooks first lets that migration happen incrementally and reversibly.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — no runtime change; typed-hook exports only.
### TESTING INSTRUCTIONS
1. Pre-commit Type-Checking hook passes (\`pre-commit run --files superset-frontend/src/views/store.ts\`).
2. \`useAppDispatch\` and \`useAppSelector\` are importable from \`src/views/store\`. Try in a scratch file:
\`\`\`ts
import { useAppDispatch, useAppSelector } from 'src/views/store';
\`\`\`
3. No existing test should change behavior — diff is additive only.
### ADDITIONAL INFORMATION
- [x] Has associated issue: #39927 (sub-issue of #39890)
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore(frontend): export typed useAppDispatch / useAppSelector hooks [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #40027:
URL: https://github.com/apache/superset/pull/40027#issuecomment-4422909195
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore(frontend): export typed useAppDispatch / useAppSelector hooks [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #40027:
URL: https://github.com/apache/superset/pull/40027#issuecomment-4423326520
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/40027?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 63.87%. Comparing base ([`d83b0c5`](https://app.codecov.io/gh/apache/superset/commit/d83b0c5ce33433aeb6fbdef141e64f14e1e171f2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3b8cf35`](https://app.codecov.io/gh/apache/superset/commit/3b8cf35f3ebec64915cbccd83f8138c3b5e3ff6c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 25 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #40027 +/- ##
==========================================
+ Coverage 63.83% 63.87% +0.04%
==========================================
Files 2589 2589
Lines 137815 137872 +57
Branches 31921 31963 +42
==========================================
+ Hits 87973 88068 +95
+ Misses 48325 48287 -38
Partials 1517 1517
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/40027/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/40027/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `66.60% <100.00%> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/40027?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore(frontend): export typed useAppDispatch / useAppSelector hooks [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #40027:
URL: https://github.com/apache/superset/pull/40027#issuecomment-4423640628
**Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore(frontend): export typed useAppDispatch / useAppSelector hooks [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #40027:
URL: https://github.com/apache/superset/pull/40027
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org