Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 5, 2025

This PR fixes the TypeScript compilation errors introduced by the Recharts v3 upgrade in PR #52. The breaking change affected the LabelList component's formatter prop signature.

Problem

Recharts v3 changed the LabelList formatter API:

  • v2: formatter?: (value: number) => string
  • v3: formatter?: (label: ReactNode) => ReactNode

This caused 4 TypeScript errors across the dashboard:

error TS2322: Type '(value: number) => string' is not assignable to type '(label: ReactNode) => ReactNode'

Solution

Updated all LabelList formatter functions to use the new v3 API:

  1. MinificationBenchmarks.tsx (2 instances):

    • Time chart: formatter={(label: React.ReactNode) => \${label}ms`}`
    • Compression chart: formatter={(label: React.ReactNode) => \${label}%`}`
  2. RolldownStats.tsx (2 instances):

    • Bundle size diff chart: Added proper type handling for complex logic
    • Build time chart: formatter={(label: React.ReactNode) => \${label}ms`}`

The changes maintain full backward compatibility while ensuring type safety with the new Recharts v3 API.

Verification

  • ✅ TypeScript compilation passes
  • ✅ All charts render correctly with proper labels
  • ✅ No runtime errors
  • ✅ Both dashboard pages function as expected

Rolldown Stats Dashboard

Minification Benchmarks

Fixes #56.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Fix PR https://github.com/voidzero-dev/vibe-dashboard/pull/52 Fix Recharts v3 compatibility issues for LabelList formatter API Sep 5, 2025
Copilot AI requested a review from Boshen September 5, 2025 02:49
@Boshen Boshen marked this pull request as ready for review September 5, 2025 05:21
@Boshen Boshen merged commit 3613c47 into main Sep 5, 2025
1 check passed
@Boshen Boshen deleted the copilot/fix-56 branch September 5, 2025 05:22
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.

Fix PR https://github.com/voidzero-dev/vibe-dashboard/pull/52

2 participants