Skip to content

Upgrade Downloads Graph Dependencies#23040

Open
Sewer56 wants to merge 1 commit intomasterfrom
react-17-download-graph-v2
Open

Upgrade Downloads Graph Dependencies#23040
Sewer56 wants to merge 1 commit intomasterfrom
react-17-download-graph-v2

Conversation

@Sewer56
Copy link
Copy Markdown
Member

@Sewer56 Sewer56 commented May 6, 2026

fixes LAZ-199

Summary

DownloadGraph blocks the React 17 migration because it depends on
react-resize-detector@4.2.3 and recharts@1.8.6, both of which only support
React 16 as a peer dependency.

This PR updates/replaces those dependencies without changing Downloads page
behaviour (expand/collapse, resize handling, recent speed history, bandwidth-limit line).

See LAZ-199 for details.

Changes

Dependency updates

  • Remove react-resize-detector from catalog, src/main/package.json, and src/renderer/package.json
  • Upgrade recharts from ^1.8.5^2.15.4 (React 17 support since 2.0.3)

DownloadGraph.tsx

  • Replace react-resize-detector with native ResizeObserver
  • Update setRef to store container ref and observe resize via ResizeObserver
  • Remove truthy import (no longer needed)

charts.scss

  • Update .recharts-area selectors: use .recharts-area-area / .recharts-area-curve class names instead of :first-child / :last-child pseudo-selectors (recharts 2.x changed markup structure)

Test coverage

  • Add DownloadGraph.test.tsx covering:
    • ResizeObserver triggers chart width update
    • disconnect() called on unmount
    • Bandwidth limit label rendered when maxBandwidth constrains the graph

Config

  • Add vitest.config.mts glob to vitest.config.ts projects

Acceptance criteria

  • No active dependency path for the Downloads graph uses react-resize-detector@4.2.3 or recharts@1.8.6
  • Graph still renders above the downloads table, expands/collapses, resizes with container, updates from speedHistory, shows bandwidth-limit line
  • Current no-animation behaviour preserved
  • Build, test, lint, format pass
  • Manual smoke-test of Downloads page graph

@Sewer56 Sewer56 requested a review from a team as a code owner May 6, 2026 20:22
- Replace react-resize-detector with native ResizeObserver
- Upgrade recharts ^1.8.5 → ^2.15.4 for React 17 peer support
- Update chart SCSS selectors for recharts 2.x markup
- Add DownloadGraph test coverage (ResizeObserver + bandwidth-limit line)
- Remove react-resize-detector from catalog and package manifests
@Sewer56 Sewer56 force-pushed the react-17-download-graph-v2 branch from cf3d77a to 4f3382f Compare May 6, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant