Skip to content

feat: export ActiveDotProps and DotItemDotProps from main entry#6657

Merged
ckifer merged 1 commit intorecharts:mainfrom
simaks:feat/export-dot-props-types
Nov 22, 2025
Merged

feat: export ActiveDotProps and DotItemDotProps from main entry#6657
ckifer merged 1 commit intorecharts:mainfrom
simaks:feat/export-dot-props-types

Conversation

@simaks
Copy link
Contributor

@simaks simaks commented Nov 19, 2025

Allows importing types directly from 'recharts' instead of 'recharts/types/util/types' for better DX.

Description

Export ActiveDotProps and DotItemDotProps from the main recharts entry (src/index.ts), so they are available from the package root.
Update the CustomizedDotLineChart website example to use the new top-level DotItemDotProps export instead of the deep recharts/types/util/types path.

Related Issue

No open issue; this is a small DX-focused improvement.
Happy to link or open an issue if required.

Motivation and Context

Consumers currently need to rely on a deep import (recharts/types/util/types) to get ActiveDotProps and DotItemDotProps, which is brittle and not clearly part of the public API.
Exporting these types from the main recharts entry aligns them with other public types and makes type discovery and imports simpler and more ergonomic.

How Has This Been Tested?

  • npm run lint
  • npm run test -- test/cartesian/Line.spec.tsx
  • npm run test -- test/cartesian/Area.spec.tsx
  • npm run check-types-website

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes.

Summary by CodeRabbit

  • New Features

    • Exposed additional type definitions to enable enhanced customization options for library consumers.
  • Refactor

    • Consolidated and streamlined internal import statements for improved code organization.

Allows importing types directly from 'recharts' instead of
'recharts/types/util/types' for better DX.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

The pull request adds a new type export ActiveDotProps from the utilities module to the main entry point and updates an example component to use the consolidated import path instead of a separate types import.

Changes

Cohort / File(s) Summary
Type Export Addition
src/index.ts
Exports new public type ActiveDotProps from ./util/types alongside existing DotProps exports.
Import Consolidation
www/src/docs/exampleComponents/LineChart/CustomizedDotLineChart.tsx
Merges DotItemDotProps into the main recharts import, removing separate import from recharts/types/util/types.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • ckifer

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: exporting ActiveDotProps and DotItemDotProps from the main entry point.
Description check ✅ Passed The PR description comprehensively covers all major template sections with sufficient detail: motivation, context, testing performed, and change type selection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2ff4b6 and b3fe4c5.

📒 Files selected for processing (2)
  • src/index.ts (1 hunks)
  • www/src/docs/exampleComponents/LineChart/CustomizedDotLineChart.tsx (1 hunks)
🔇 Additional comments (3)
src/index.ts (2)

42-42: LGTM! Good DX improvement.

The new ActiveDotProps export is well-placed alongside the related DotProps and DotItemDotProps exports, making it discoverable and easier to import from the main package entry point.


42-43: ****

The review comment assumes that files using the deep import path 'recharts/types/util/types' should be updated to use the newly exported types. However, verification shows this doesn't apply:

  • Only 2 files use the deep import pattern: www/src/docs/exampleComponents/LineChart/LineChartAxisInterval.tsx (imports AxisInterval) and www/src/docs/exampleComponents/Legend/LegendEffectOpacity.tsx (imports DataKey)
  • These types are not part of the new exports (ActiveDotProps, DotItemDotProps), so they cannot be imported from the main entry point
  • The newly exported types have no matches in the deep import search, meaning other files aren't using them via the deep path

The suggestion conflates the mere existence of type exports with the applicability of updating existing imports elsewhere. Since the types being imported via the deep path aren't exported from the main entry point, there's no actionable refactoring here.

Likely an incorrect or invalid review comment.

www/src/docs/exampleComponents/LineChart/CustomizedDotLineChart.tsx (1)

1-1: LGTM! Clean import consolidation.

The consolidation of DotItemDotProps into the main import from 'recharts' nicely demonstrates the DX improvement from exposing these types at the package root. This eliminates the need for a separate deep import path.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.26%. Comparing base (d2ff4b6) to head (b3fe4c5).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6657   +/-   ##
=======================================
  Coverage   94.26%   94.26%           
=======================================
  Files         496      496           
  Lines       42442    42442           
  Branches     4859     4859           
=======================================
  Hits        40009    40009           
  Misses       2428     2428           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ckifer ckifer merged commit 652a08c into recharts:main Nov 22, 2025
22 checks passed
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.

4 participants