Upgrade outdated frontend dependencies
87 of our direct frontend dependencies (in package.json and viz-lib/package.json) are behind their latest release, and 59 of those are a major version behind. The core of the app is several generations old: React 16.14, antd 4.4.3 (July 2020) and d3 3. This issue tracks the plan. Each step is its own PR, and the PRs are stacked in the order below, each based on the one before it.
Target: React 18 + antd 4.24. That's as far as we can go without moving off antd 4. antd 4.24 supports React 18, but React 19 removes findDOMNode, which antd 4 depends on. Going past this point means either migrating to antd 5+ or switching to a different component library, and we'll decide that separately (see "Later" below).
We're also replacing ESLint and Prettier with Biome (step 4).
This replaces the individual dependency PRs we closed (dependabot's and #7692, #7720, #7727, #7735–#7742). Their changes are folded into the steps below.
PRs
CI for the whole stack runs on the draft #7852.
- 1. #7849
- 2. #7850
- 3. #7851
- 4. #7854
- 5. #7855
- 6. #7856
- 7. #7857
- 8. #7858
- 9. #7859
- 10. #7860
- 11. #7861
- 12. #7862
- 13. #7863
Blockers
| Blocker | What it holds back | Resolution |
|---|---|---|
antd 4 calls findDOMNode (e.g. antd/lib/_util/wave.js and many rc-* packages), which React 19 removes |
React 19 | Stop at React 18. antd 4.24 supports it. |
eslint-config-react-app 7 (unmaintained since 2022) requires eslint@^8 |
any ESLint upgrade | Replace ESLint with Biome (step 4) |
| Babel 8, webpack-dev-server 6 and less-loader 13 require Node 22+ | those upgrades | Raise the Node floor to 22.18 (step 1). CI and the Dockerfile already use Node 24. |
| enzyme has no adapter for React 17 or later (and is unmaintained) | React 18 | Move tests to React Testing Library (step 9) |
react-sortable-hoc 2.0 (unmaintained since 2022) allows only React 16/17 |
React 18 | Replace it with @dnd-kit/sortable (step 10) |
react-plotly.js 4 requires React 18 |
react-plotly.js 4 | Upgrade it together with React 18 (step 12) |
Steps
- Node floor and cleanup. Raise
engines.nodefrom>=18to>=22.18. Remove dependencies we don't use or that are obsolete:elliptic: nothing imports itts-migrate: a one-off migration tool; only its old@ts-expect-errorcomments remain@types/classnames: deprecated, since classnames ships its own types@types/dompurify: deprecated, since dompurify 3 ships its own types (it goes along with step 3)
- Upgrades that need no code changes. Minor and patch releases (webpack, jest, ace-builds, lodash 4.18, dayjs, html-webpack-plugin, …), plus the majors that upgrade cleanly: debug 4, mockdate 3, react-ace 15, webpack-cli 7, webpack-dev-server 6, copy-webpack-plugin 14 and less-loader 13.
- less 3 → 4 for the client (viz-lib already uses 4): less 4 no longer computes
a / boutside parentheses by default. Setmath: "always"or fix the divisions.
- less 3 → 4 for the client (viz-lib already uses 4): less 4 no longer computes
- Security-relevant runtime libraries:
- dompurify 3 (sanitizes user HTML in
viz-lib/src/services/sanitize.ts) - axios 1 + axios-auth-refresh 5. axios-auth-refresh 3.3.6 accepts only axios 0.x, so they have to move together; #7692 did this for viz-lib only.
markdown0.5 →marked.markdownis unmaintained and used in 4 files; #7735 already did this.- mustache 2 → 4
- dompurify 3 (sanitizes user HTML in
- Replace ESLint and Prettier with Biome. This removes
eslint,eslint-config-react-app, everyeslint-plugin-*,@typescript-eslint/*,eslint-config-prettier,eslint-webpack-pluginandprettier.- Match our current rules with Biome's equivalents: its a11y group (for jsx-a11y),
useExhaustiveDependenciesanduseHookAtTopLevel(for react-hooks), andnoFocusedTests(for no-only-tests). - We lose
eslint-plugin-compat(checks browser APIs against browserslist). Biome has no equivalent. - Update the
lint,lint:ci(Biome has ajunitreporter) andprettierscripts, and removeeslint-webpack-pluginfromwebpack.config.js. In.restyled.yaml, replace the Prettier restyler with Biome, or drop it in favor of abiome cicheck. - Biome's formatter aims to match Prettier, but expect some formatting changes. Commit them separately and add a
.git-blame-ignore-revsfile listing that commit. Biome doesn't format Less; neither does our current Prettier setup.
- Match our current rules with Biome's equivalents: its a11y group (for jsx-a11y),
- TypeScript 6.0.
client/tsconfig.jsonusesmoduleResolution: "node"andbaseUrl, which TypeScript 6 deprecates. Move tomoduleResolution: "bundler"and plainpaths. Also update the viz-lib tsconfig and@types/jest(26 → 30). With typescript-eslint gone after step 4, nothing caps us at TypeScript 6. TypeScript 7 can be a follow-up once 6.0 is clean. - Babel 8 and browser targets. Babel 8 requires Node
^22.18 || >=24.11.client/.babelrcinjects core-js 2 polyfills (useBuiltIns: "usage"), but core-js isn't a declared dependency (that's what #7727 was about). Our browserslist still targets Chrome 55 / Safari 10.1. Update browserslist to current browsers (the exact targets are proposed in the PR), switch to core-js 3 or drop polyfills, and remove plugins that are probably no longer needed (babel-plugin-transform-builtin-extend,@babel/plugin-transform-object-assign). babel-plugin-istanbul 8 moves in this step too. - Routing and small utility libraries:
- universal-router 8 → 10 and path-to-regexp 3 → 8 (
client/app/services/routes.ts,Router.jsx). path-to-regexp 8 changed the route syntax: optional parameters are written as{/:param}, and there are no inline regex parameters. history stays on 4: history 5'sblock()always installs abeforeunloadprompt, which breaks the query editor's conditional unsaved-changes alert. - query-string 6 → 9 (ESM-only; Jest needs to transform it)
- use-debounce 3 → 10 (23 files use
useDebouncedCallback, which from v5 returns a function instead of an array) - chroma-js 1 → 3 and leaflet 1.3 → 1.9 (check the markercluster, fullscreen and beautifymarker plugins)
- universal-router 8 → 10 and path-to-regexp 3 → 8 (
- d3 3 → 7 (10 viz-lib files plus
client/app/components/Resizable). Plotly no longer holds this back: since plotly.js 2 (#7359), it depends on individual d3 modules rather than thed3package. d3 4 split the library into modules and renamed most APIs (d3.scale.*,d3.layout.partition,d3.svg.*,d3.geo.*,d3.functor,d3.timer.flush), so the sankey, sunburst, box plot, word cloud, pie/heatmap and choropleth visualizations need porting. Consider replacing our ownd3sankey.tswithd3-sankey. Also upgrade@types/d3to 7. - Replace enzyme with React Testing Library. 22 test files use enzyme, and the snapshots use
enzyme-to-json. Also dropreact-test-renderer. - Replace react-sortable-hoc with
@dnd-kit/sortable(3 files). - antd 4.4.3 → 4.24.16 (the last 4.x release). It's the same major version with the same Less theming, but it adds deprecation warnings (e.g.
visible→open, Dropdownoverlay→menu). Fixing those is optional here but makes any future move to antd 5 smaller. 157 files import antd. @ant-design/icons stays on 4.x. - React 18.
- Replace
ReactDOM.renderwithcreateRootinclient/app/index.js,DialogWrapper.jsxand the choroplethinitChoropleth.tsx. - Drop the
@types/react/@types/react-dom^17pnpm override. With@types/react18,childrenis no longer an implicit prop, so expect type errors. - Upgrade react-grid-layout to 2 (through its
legacyentry point; 1.5 breaks auto-height and throws on fast drags undercreateRoot), react-resizable to 3 and react-plotly.js to 4, and update the viz-libpeerDependencies. plotly.js stays on 3 (see below). - React 18 batches state updates automatically, which can change behavior in code that relies on synchronous re-renders.
- Replace
- plotly.js 3.3.1 → 3.7.0, the latest 3.x release (fixes and additions only).
Out of scope
- Cypress and Percy are being replaced by Playwright separately, so this plan leaves them alone. Once that lands, we'll rebase this stack onto it and add visual diff tests to check the upgrade.
- sql-formatter stays on our fork (
getredash/sql-formatter). Upstream is at a much newer major version with a different API.
Later (not part of this plan)
UI components: antd 5/6, or a different library. Staying on antd 4 caps us at React 18. If we stay with antd, antd 5 is mostly a styling change:
- about 30 Less theme variables in
inc/ant-variables.lessbecome theme tokens - 141
.ant-*override selectors across 38 Less files need visual checking - the 5 date and time picker components move to dayjs, and
momentbecomes a direct dependency (today it's only installed through antd 4)
Most component APIs carry over, and deprecated props keep working until antd 6. React 19 would follow, which ignores defaultProps on function components (141 files use defaultProps) and needs a check of react-pivottable (through findDOMNode); react-grid-layout 2 already landed in step 12.
Follow-ups found during the upgrade
- plotly.js 4: switches its color parser (stricter CSS parsing, no
hsv(),rgb(r, g, b, a)becomes transparent, label contrast colors picked by WCAG ratio), makes geo maps fit their data by default and removes the*mapboxtrace types. We already hide its new "Upload to Cloud" button. Gains: 4.0 bug fixes (histogram binning, tick label formatting, category sorting with nulls, colorbar crash) and maplibre-gl 6 in 4.1.1, which addresses a CVE in the map engine that 3.x bundles. Do it as its own step once visual diff testing is in place, with release notes warning custom chart users about the removed traces and stricter colors. - TypeScript 7: no longer blocked. The client type-checks cleanly; viz-lib has 2 errors in
visualizations/Renderer.tsx. - viz-lib
lib/as ES modules:lib/is CommonJS, so webpack can't tree-shake d3 7 (and lodash etc.) out of the bundle. Switching needs the client's Jest setup to handle ESM from viz-lib. - Lint viz-lib: Biome lints
client/only, as ESLint did. - antd and React deprecations (development warnings):
visible→open, Dropdownoverlay→menu, Menu/Tabs/Steps children →items, anddefaultPropson function components. All still work; they matter for antd 5 and React 19.
Unmaintained, with no replacement planned here
bootstrap 3 (Less only), font-awesome 4 (47 files), material-design-iconic-font (26 files), numeral.
Source: getredash/redash