rusackas opened a new issue, #39890:
URL: https://github.com/apache/superset/issues/39890

   Now that #38563 has landed React 18, none of the concurrent-rendering APIs 
are actually being used yet. This is a tracking issue for adopting the features 
that move the needle on Superset's perceived performance and forward-compat.
   
   Priorities are ordered roughly by ROI / dependency order — earlier items 
unblock or de-risk later ones.
   
   ## Foundation
   
   - [ ] **Enable `<StrictMode>` at the root** 
(`superset-frontend/src/views/index.tsx`). Currently absent. R18 concurrent 
rendering will eventually surface the same effect-cleanup / 
non-idempotent-render bugs that StrictMode's dev-time double-invocation 
catches; better to find and fix them deliberately. Expect a follow-up wave of 
small fixes once it's on.
   - [ ] **Upgrade `react-redux` v7.2.9 → v8+**. v8 uses `useSyncExternalStore` 
internally, which gives tearing-free store reads under concurrent rendering. 
Without this, future `useTransition` adoption risks stale UI mid-render. No 
app-level code changes required for the upgrade itself, but the test suite 
should be exercised carefully.
   
   ## Concurrent-rendering wins
   
   - [ ] **Replace `useDebounceValue` with `useDeferredValue`** in inputs that 
filter large client-side lists. `useDeferredValue` is strictly better than a 
fixed-delay debounce: deferred updates get interrupted on each keystroke and 
run at low priority. Targets:
     - `SqlLab/components/TableExploreTree/index.tsx:317` (PR #39489 introduced 
the debounce — this is the natural follow-up)
     - `explore/components/DatasourcePanel/index.tsx:163` (column search)
     - `packages/superset-ui-core/src/components/Select/Select.tsx:387` (used 
app-wide)
     - `explore/components/controls/TextControl/index.tsx:90`
     - `filters/components/Select/SelectFilterPlugin.tsx:265`
     - `dashboard/components/nativeFilters/FilterBar/index.tsx:97` 
(`publishDataMask`)
   - [ ] **Wrap heavy cascading Redux dispatches in `startTransition`** so the 
input that triggered them stays responsive. Highest-impact site: native filter 
application (changing a filter today blocks the input on chart re-renders). 
Pair with `useTransition`'s `isPending` to drive a subtle "applying…" indicator 
on affected chart cards.
     - `dashboard/components/nativeFilters/FilterBar/index.tsx:268` 
(`updateDataMask`)
     - `dashboard/components/nativeFilters/FilterBar/index.tsx:455` 
(`saveChartCustomization`)
     - `explore/components/ExploreViewContainer/index.tsx:468` (`triggerQuery` 
after control change)
     - `SqlLab/components/TabbedSqlEditors/index.tsx:145` (tab switch)
   
   ## Lower-priority / opportunistic
   
   - [ ] **`useId` audit** — most `nanoid` usage in the codebase is for 
persistent data keys (correct, leave alone). The few real DOM-id sites (e.g. 
`DateFilterLabel.tsx:374-375`) could move to `useId` for hygiene but aren't 
urgent.
   - [ ] **Suspense coverage** — already ~95% on lazy boundaries. Skip unless a 
specific gap appears.
   
   ## Notes / risks
   
   - **StrictMode rollout**: turning it on may surface failures in component 
tests that assume effects run exactly once. Plan for a cleanup pass; don't 
merge alongside other work.
   - **Selector hygiene under concurrent rendering**: selectors returning a new 
object reference per call (`useSelector(state => ({a, b}))`) become a tearing 
risk. Worth a sweep alongside the react-redux v8 bump.
   - **Measurement**: profile each concurrent-feature PR with React DevTools 
Profiler before/after. The wins are perceptual; numbers help defend the change.
   
   ## Suggested PR sequencing
   
   1. StrictMode + the resulting effect fixes
   2. `react-redux` v8 bump
   3. `useDeferredValue` migration (SQL Lab tree + core Select first)
   4. `startTransition` around native filter apply, with `isPending` indicator
   
   PRs should reference this issue. Happy to break any item out into its own 
discussion if it gets nuanced.


-- 
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]

Reply via email to