richardfogaca opened a new pull request, #40591: URL: https://github.com/apache/superset/pull/40591
### SUMMARY Fixes `TypeError: o.useAppDispatch is not a function` when loading SQL Lab in Module Federation deployments where the host shell shares an older `src/views/store` singleton. The SQL Lab remote can be built from a version that expects `useAppDispatch`, while the host shell may provide a shared store module built before that export existed. This PR routes SQL Lab dispatch usage through a SQL Lab-local shim that falls back to `react-redux`'s `useDispatch`, so SQL Lab does not crash under that version skew. The shim imports `AppDispatch` as a type only and avoids runtime imports from `src/views/store`. That keeps the fix isolated to SQL Lab without introducing a store bootstrap cycle through `store.ts -> persistSqlLabStateEnhancer -> EditorAutoSync -> useAppDispatch`. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable. ### TESTING INSTRUCTIONS Manual verification: 1. Build/run a deployment where the shell provides a `src/views/store` shared singleton from before `useAppDispatch` was exported. 2. Open SQL Lab. 3. Confirm SQL Lab loads without `TypeError: useAppDispatch is not a function`. 4. Confirm dashboard/list pages still complete app bootstrap and do not remain stuck on the loading spinner. Local checks run: - `npm run lint -- src/SqlLab/hooks/useAppDispatch.ts` - `git diff --check` ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
