Skip to content

Fix circular axis selector imports#6581

Merged
ckifer merged 2 commits intomainfrom
fix/circular-axis-selector-imports
Nov 8, 2025
Merged

Fix circular axis selector imports#6581
ckifer merged 2 commits intomainfrom
fix/circular-axis-selector-imports

Conversation

@ckifer
Copy link
Member

@ckifer ckifer commented Nov 7, 2025

Description

Related Issue

#6578

Motivation and Context

There are circular imports in our axis selectors causing issues for next js users. Unconfirmed if this fixes the issue but its worth doing anyways

How Has This Been Tested?

N/A, green tests, etc.
Not worth testing if it fixes the issue

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

    • Added useTooltipAxisBandSize() hook to compute the tooltip axis band size based on current axis configuration, ticks, and scale settings.
  • Chores

    • Consolidated tooltip axis-related selectors into a single axis selectors module for improved organization.
    • Updated internal import paths across the codebase to reflect the new selector locations.
    • Reorganized axis type definitions for enhanced modularity.

@ckifer ckifer requested a review from PavelVanecek November 7, 2025 18:12
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Consolidates tooltip axis selectors from a dedicated module into axisSelectors.ts, removes the standalone selector file from build snapshots, adds a new useTooltipAxisBandSize() hook, relocates type definitions to selectTooltipAxisType.ts, and updates imports across multiple source and test files accordingly.

Changes

Cohort / File(s) Change Summary
Build snapshot updates
scripts/snapshots/es6Files.txt, scripts/snapshots/libFiles.txt, scripts/snapshots/typesFiles.txt
Removed references to selectTooltipAxis.js, selectTooltipAxis.d.ts from snapshot lists following file consolidation.
Selector consolidation
src/state/selectors/selectTooltipAxis.ts (deleted), src/state/selectors/axisSelectors.ts (updated)
Moved selectTooltipAxis and selectTooltipAxisDataKey selectors from dedicated module into axisSelectors.ts; removed now-redundant selector file.
Type refactoring
src/state/selectors/selectTooltipAxisType.ts
Redefined XorYType locally and added new XorYorZType export; removed import of XorYType from axisSelectors.
Hook enhancement
src/context/useTooltipAxis.ts
Added new public hook useTooltipAxisBandSize() computing tooltip axis band size; consolidated imports from axisSelectors.
Import path updates
src/state/selectors/tooltipSelectors.ts, src/state/selectors/radialBarSelectors.ts, src/state/selectors/selectors.ts
Updated imports to reference selectTooltipAxis and selectTooltipAxisDataKey from axisSelectors instead of dedicated module.
Test updates
test/component/Tooltip/Tooltip.payload.spec.tsx, test/component/Tooltip/Tooltip.visibility.spec.tsx, test/polar/Pie.spec.tsx
Updated import paths for selectTooltipAxis to reference axisSelectors module.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring extra attention:
    • Verify useTooltipAxisBandSize() hook logic in src/context/useTooltipAxis.ts correctly handles fallback cases for missing axis or scale
    • Confirm all selector consolidations in axisSelectors.ts maintain correct type signatures and selector composition
    • Validate type definitions in selectTooltipAxisType.ts (particularly XorYorZType with 'zAxis') align with axis handling requirements
    • Spot-check import paths across test files resolve correctly after module relocation

Suggested labels

enhancement

Suggested reviewers

  • PavelVanecek

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving selectors to resolve circular imports in axis-related modules.
Description check ✅ Passed The description addresses the motivation (circular imports affecting Next.js), references the related issue, and specifies the change type as a bug fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/circular-axis-selector-imports

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

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.17%. Comparing base (9dd5431) to head (46548df).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6581      +/-   ##
==========================================
- Coverage   91.18%   91.17%   -0.01%     
==========================================
  Files         492      491       -1     
  Lines       40999    41036      +37     
  Branches     4584     4585       +1     
==========================================
+ Hits        37384    37414      +30     
- Misses       3598     3605       +7     
  Partials       17       17              

☔ 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b94365a and cc77b81.

📒 Files selected for processing (12)
  • scripts/snapshots/es6Files.txt (1 hunks)
  • scripts/snapshots/libFiles.txt (1 hunks)
  • scripts/snapshots/typesFiles.txt (1 hunks)
  • src/context/useTooltipAxis.ts (1 hunks)
  • src/state/selectors/axisSelectors.ts (1 hunks)
  • src/state/selectors/polarScaleSelectors.ts (1 hunks)
  • src/state/selectors/selectAxisSettings.ts (1 hunks)
  • src/state/selectors/selectTooltipAxis.ts (1 hunks)
  • src/state/selectors/tooltipSelectors.ts (1 hunks)
  • test/cartesian/XAxis.spec.tsx (1 hunks)
  • test/cartesian/YAxis/YAxis.spec.tsx (2 hunks)
  • test/cartesian/YAxis/YAxis.ticks.spec.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode any user-facing strings or formatting choices in the library code; leave internationalization to library users

Files:

  • src/state/selectors/polarScaleSelectors.ts
  • src/state/selectors/tooltipSelectors.ts
  • src/state/selectors/selectAxisSettings.ts
  • src/state/selectors/selectTooltipAxis.ts
  • src/state/selectors/axisSelectors.ts
  • src/context/useTooltipAxis.ts
{test,www/test}/**

📄 CodeRabbit inference engine (DEVELOPING.md)

Place unit tests in the test directory; some tests may also live in www/test

Files:

  • test/cartesian/YAxis/YAxis.spec.tsx
  • test/cartesian/XAxis.spec.tsx
  • test/cartesian/YAxis/YAxis.ticks.spec.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Mock getBoundingClientRect using test/helper/MockGetBoundingClientRect.ts when rendering Recharts components (e.g., Tooltip, Legend, charts)
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : When testing selectors, verify render counts using the spy and rerenderSameComponent from createSelectorTestCase

Applied to files:

  • scripts/snapshots/es6Files.txt
  • test/cartesian/YAxis/YAxis.spec.tsx
  • test/cartesian/XAxis.spec.tsx
  • test/cartesian/YAxis/YAxis.ticks.spec.tsx
📚 Learning: 2025-10-25T07:36:02.229Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-25T07:36:02.229Z
Learning: Recharts aims for simple, declarative, and composable charts; prioritize consistency, usability, performance, and accessibility

Applied to files:

  • src/state/selectors/tooltipSelectors.ts
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Mock getBoundingClientRect using test/helper/MockGetBoundingClientRect.ts when rendering Recharts components (e.g., Tooltip, Legend, charts)

Applied to files:

  • src/state/selectors/tooltipSelectors.ts
  • test/cartesian/XAxis.spec.tsx
  • test/cartesian/YAxis/YAxis.ticks.spec.tsx
  • src/context/useTooltipAxis.ts
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Prefer using the createSelectorTestCase helper when writing or modifying tests

Applied to files:

  • test/cartesian/YAxis/YAxis.spec.tsx
  • test/cartesian/XAxis.spec.tsx
  • test/cartesian/YAxis/YAxis.ticks.spec.tsx
🧬 Code graph analysis (1)
src/state/selectors/selectAxisSettings.ts (5)
src/state/cartesianAxisSlice.ts (3)
  • XAxisSettings (74-78)
  • YAxisSettings (82-87)
  • AxisId (8-8)
src/state/polarAxisSlice.ts (2)
  • AngleAxisSettings (7-7)
  • RadiusAxisSettings (5-5)
src/state/store.ts (1)
  • RechartsRootState (94-94)
src/state/selectors/axisSelectors.ts (3)
  • XorYType (101-101)
  • selectXAxisSettings (139-145)
  • selectYAxisSettings (183-189)
src/state/selectors/polarAxisSelectors.ts (2)
  • selectAngleAxis (89-97)
  • selectRadiusAxis (99-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build, Test, Pack
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
scripts/snapshots/libFiles.txt (1)

163-163: LGTM!

The new module path is correctly added to the build artifacts snapshot in alphabetical order.

scripts/snapshots/typesFiles.txt (1)

163-163: LGTM!

The type declaration path is correctly added to the TypeScript artifacts snapshot.

scripts/snapshots/es6Files.txt (1)

163-163: LGTM!

The ES6 module path is correctly added, completing the consistent snapshot updates across all three build artifact types (lib, types, es6).

src/state/selectors/polarScaleSelectors.ts (1)

27-27: LGTM!

The import path for selectAxisSettings is correctly updated to reference the new dedicated module, which helps break the circular dependency. The remaining imports from axisSelectors are appropriately left unchanged.

src/state/selectors/selectTooltipAxis.ts (1)

6-6: LGTM!

Both AxisWithTicksSettings type and selectAxisSettings function are correctly imported from the new centralized module. The refactoring maintains type safety while resolving circular dependencies.

test/cartesian/YAxis/YAxis.ticks.spec.tsx (1)

7-9: LGTM!

The imports are correctly split between the two modules: axis-specific selectors remain in axisSelectors, while the centralized selectAxisSettings is imported from the new dedicated module. Test logic remains unchanged.

src/state/selectors/tooltipSelectors.ts (1)

86-86: LGTM!

The AxisWithTicksSettings type is correctly imported from the new module. The refactoring appropriately imports only the type needed in this file, while other axis selectors remain imported from axisSelectors.

test/cartesian/XAxis.spec.tsx (1)

52-52: LGTM!

The import for selectAxisSettings is correctly updated to reference the new dedicated module. The refactoring maintains test functionality while helping to resolve circular import issues.

Comment on lines +16 to +36
export const selectAxisSettings = (
state: RechartsRootState,
axisType: XorYType,
axisId: AxisId,
): AxisWithTicksSettings => {
switch (axisType) {
case 'xAxis': {
return selectXAxisSettings(state, axisId);
}
case 'yAxis': {
return selectYAxisSettings(state, axisId);
}
case 'angleAxis': {
return selectAngleAxis(state, axisId);
}
case 'radiusAxis': {
return selectRadiusAxis(state, axisId);
}
default:
throw new Error(`Unexpected axis type: ${axisType}`);
}
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Circular dependency still present

Relocating selectAxisSettings here doesn’t actually break the problematic cycle: this file pulls selectXAxisSettings/selectYAxisSettings from axisSelectors.ts, while axisSelectors.ts still imports selectTooltipAxis, which now imports this module. The graph is still axisSelectors → selectTooltipAxis → selectAxisSettings → axisSelectors, so Next.js will keep flagging the circular import and the SSR crash remains. Please restructure so the cartesian/polar selector helpers live in a module that has no dependency back into axisSelectors (or keep the implementation inside axisSelectors and avoid re-importing it), eliminating the runtime cycle.

🤖 Prompt for AI Agents
In src/state/selectors/selectAxisSettings.ts around lines 16 to 36, the current
refactor still creates a runtime circular import because this module imports
selectXAxisSettings/selectYAxisSettings from axisSelectors while axisSelectors
imports selectTooltipAxis which imports this module; break the cycle by moving
the cartesian/polar helper selector implementations (selectXAxisSettings,
selectYAxisSettings, selectAngleAxis, selectRadiusAxis) into a new independent
module (e.g., axisHelpers.ts) that does not import axisSelectors, or
alternatively inline the selectAxisSettings logic back inside axisSelectors so
no re-import occurs; update imports so axisSelectors and selectTooltipAxis
import only from the new independent helpers (or use the inlined version) to
ensure there is no import path that returns to axisSelectors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, you right 🙃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckifer No worries! Circular dependencies can be sneaky, especially when they span multiple files. 🐰

If you'd like, I can help map out the full dependency chain or verify the fix once you refactor. The two main approaches I suggested should work:

  1. Extract helpers to an independent module (e.g., axisSettingsHelpers.ts) that contains selectXAxisSettings, selectYAxisSettings, selectAngleAxis, and selectRadiusAxis without importing from axisSelectors
  2. Inline the logic back into axisSelectors.ts to avoid the re-import

Either way should break the cycle cleanly. Let me know if you need any help working through the refactor!

    /)_/)
   (='.'=)  Hang in there!
   (")_(")

@codecov
Copy link

codecov bot commented Nov 7, 2025

Bundle Report

Changes will decrease total bundle size by 717 bytes (-0.03%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.12MB -480 bytes (-0.04%) ⬇️
recharts/bundle-es6 965.33kB -237 bytes (-0.02%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
state/selectors/axisSelectors.js 187 bytes 52.48kB 0.36%
state/selectors/tooltipSelectors.js -38 bytes 12.99kB -0.29%
state/selectors/radialBarSelectors.js -38 bytes 11.2kB -0.34%
state/selectors/selectors.js -4 bytes 6.26kB -0.06%
context/useTooltipAxis.js -4 bytes 2.08kB -0.19%
state/selectors/selectTooltipAxisType.js 212 bytes 564 bytes 60.23% ⚠️
state/selectors/selectTooltipAxis.js (Deleted) -552 bytes 0 bytes -100.0% 🗑️
view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
state/selectors/axisSelectors.js 368 bytes 62.24kB 0.59%
state/selectors/tooltipSelectors.js -125 bytes 16.29kB -0.76%
state/selectors/radialBarSelectors.js -61 bytes 12.66kB -0.48%
state/selectors/selectors.js -12 bytes 7.87kB -0.15%
context/useTooltipAxis.js -12 bytes 2.38kB -0.5%
state/selectors/selectTooltipAxisType.js 211 bytes 757 bytes 38.64% ⚠️
state/selectors/selectTooltipAxis.js (Deleted) -849 bytes 0 bytes -100.0% 🗑️

@ckifer ckifer force-pushed the fix/circular-axis-selector-imports branch from cc77b81 to 46548df Compare November 7, 2025 19:59
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/state/selectors/selectors.ts (1)

29-29: Use type-only import for AxisRange to avoid runtime coupling

AxisRange is a type; importing it as a value can create unnecessary runtime edges. Split into a type-only import.

-import { AxisRange, selectTooltipAxisDataKey } from './axisSelectors';
+import type { AxisRange } from './axisSelectors';
+import { selectTooltipAxisDataKey } from './axisSelectors';
src/context/useTooltipAxis.ts (2)

3-3: Mark AxisWithTicksSettings as type-only

Prevents unnecessary value import and tight coupling.

-import { AxisWithTicksSettings, selectTooltipAxis } from '../state/selectors/axisSelectors';
+import type { AxisWithTicksSettings } from '../state/selectors/axisSelectors';
+import { selectTooltipAxis } from '../state/selectors/axisSelectors';

8-16: New hook logic is sound

Gracefully falls back when axis/scale are missing; uses existing helpers. Consider adding a brief JSDoc for public API clarity later.

src/state/selectors/axisSelectors.ts (1)

89-91: Prefer type-only import for unions to minimize runtime edges

These are types; import them with type-only to avoid accidental value imports.

-import { selectTooltipAxisType, XorYorZType, XorYType } from './selectTooltipAxisType';
+import { selectTooltipAxisType } from './selectTooltipAxisType';
+import type { XorYorZType, XorYType } from './selectTooltipAxisType';
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc77b81 and 46548df.

📒 Files selected for processing (13)
  • scripts/snapshots/es6Files.txt (0 hunks)
  • scripts/snapshots/libFiles.txt (0 hunks)
  • scripts/snapshots/typesFiles.txt (0 hunks)
  • src/context/useTooltipAxis.ts (1 hunks)
  • src/state/selectors/axisSelectors.ts (3 hunks)
  • src/state/selectors/radialBarSelectors.ts (1 hunks)
  • src/state/selectors/selectTooltipAxis.ts (0 hunks)
  • src/state/selectors/selectTooltipAxisType.ts (1 hunks)
  • src/state/selectors/selectors.ts (1 hunks)
  • src/state/selectors/tooltipSelectors.ts (2 hunks)
  • test/component/Tooltip/Tooltip.payload.spec.tsx (1 hunks)
  • test/component/Tooltip/Tooltip.visibility.spec.tsx (1 hunks)
  • test/polar/Pie.spec.tsx (1 hunks)
💤 Files with no reviewable changes (4)
  • scripts/snapshots/es6Files.txt
  • scripts/snapshots/typesFiles.txt
  • scripts/snapshots/libFiles.txt
  • src/state/selectors/selectTooltipAxis.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/state/selectors/tooltipSelectors.ts
🧰 Additional context used
📓 Path-based instructions (2)
{test,www/test}/**

📄 CodeRabbit inference engine (DEVELOPING.md)

Place unit tests in the test directory; some tests may also live in www/test

Files:

  • test/polar/Pie.spec.tsx
  • test/component/Tooltip/Tooltip.visibility.spec.tsx
  • test/component/Tooltip/Tooltip.payload.spec.tsx
src/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode any user-facing strings or formatting choices in the library code; leave internationalization to library users

Files:

  • src/state/selectors/selectors.ts
  • src/state/selectors/radialBarSelectors.ts
  • src/state/selectors/selectTooltipAxisType.ts
  • src/state/selectors/axisSelectors.ts
  • src/context/useTooltipAxis.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Mock getBoundingClientRect using test/helper/MockGetBoundingClientRect.ts when rendering Recharts components (e.g., Tooltip, Legend, charts)
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Mock getBoundingClientRect using test/helper/MockGetBoundingClientRect.ts when rendering Recharts components (e.g., Tooltip, Legend, charts)

Applied to files:

  • test/polar/Pie.spec.tsx
  • src/state/selectors/selectors.ts
  • test/component/Tooltip/Tooltip.visibility.spec.tsx
  • src/state/selectors/selectTooltipAxisType.ts
  • test/component/Tooltip/Tooltip.payload.spec.tsx
  • src/context/useTooltipAxis.ts
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Prefer using the createSelectorTestCase helper when writing or modifying tests

Applied to files:

  • test/polar/Pie.spec.tsx
  • test/component/Tooltip/Tooltip.visibility.spec.tsx
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : When testing selectors, verify render counts using the spy and rerenderSameComponent from createSelectorTestCase

Applied to files:

  • test/polar/Pie.spec.tsx
  • test/component/Tooltip/Tooltip.visibility.spec.tsx
  • test/component/Tooltip/Tooltip.payload.spec.tsx
📚 Learning: 2025-10-25T07:36:02.229Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-25T07:36:02.229Z
Learning: Recharts aims for simple, declarative, and composable charts; prioritize consistency, usability, performance, and accessibility

Applied to files:

  • src/state/selectors/selectTooltipAxisType.ts
🧬 Code graph analysis (1)
src/state/selectors/axisSelectors.ts (4)
src/state/store.ts (1)
  • RechartsRootState (94-94)
src/state/selectors/selectTooltipAxisType.ts (1)
  • selectTooltipAxisType (15-31)
src/state/selectors/selectTooltipAxisId.ts (1)
  • selectTooltipAxisId (4-4)
src/util/types.ts (1)
  • DataKey (58-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build, Test, Pack
🔇 Additional comments (6)
src/state/selectors/radialBarSelectors.ts (1)

11-11: Consolidated axis imports LGTM

Pulling BaseAxisWithScale/combineStackGroups/selectTooltipAxis from axisSelectors keeps axis logic centralized and reduces cycles.

test/component/Tooltip/Tooltip.visibility.spec.tsx (1)

91-91: Import consolidation LGTM

Matches the new public surface; no further changes needed here.

src/state/selectors/selectTooltipAxisType.ts (1)

4-14: Localizing axis type unions LGTM

Defining XorYorZType/XorYType here breaks cycles and keeps axisSelectors lean.

test/component/Tooltip/Tooltip.payload.spec.tsx (1)

77-77: Import refactor verified—no lingering references to removed modules

The script confirmed that all test files have been updated consistently. Test imports now reference individual selector modules (selectTooltipAxisId, selectTooltipAxisType) rather than any removed/old module, and the line 77 import to axisSelectors aligns with the broader refactor pattern across the codebase.

test/polar/Pie.spec.tsx (1)

57-57: Import consolidation verified and correct

The selectTooltipAxis.ts file does not exist, and all references to selectTooltipAxis across the codebase already import from axisSelectors. The change in line 57 is consistent with the rest of the codebase (radialBarSelectors.ts, useTooltipAxis.ts, and all test files). No other files require updates.

src/state/selectors/axisSelectors.ts (1)

586-596: Code changes verified and working correctly

The new selectors are properly implemented:

  • selectTooltipAxis correctly composes selectTooltipAxisType and selectTooltipAxisId without creating circular dependencies
  • selectTooltipAxisDataKey is correctly memoized with createSelector
  • Integration confirmed: tooltipSelectors imports and uses selectTooltipAxis extensively while individual modules remain acyclic
  • No circular import chains exist in the current structure

@PavelVanecek
Copy link
Collaborator

Looks like our builds got hit by rollup/rollup#6168

@PavelVanecek
Copy link
Collaborator

Can we have a new recharts-integ scenario to reproduce this problem and prevent regression?

@ckifer
Copy link
Member Author

ckifer commented Nov 8, 2025

lol! I thought my PR was bad

@ckifer
Copy link
Member Author

ckifer commented Nov 8, 2025

Can we have a new recharts-integ scenario to reproduce this problem and prevent regression?

I'm not that sure that 1. this solves the problem (though it is a problem) and that 2. I can reproduce it

This is "solving" it blindly.

I thought that the no-cycles eslint plugin was supposed to solve this but apparently it doesn't

@ckifer
Copy link
Member Author

ckifer commented Nov 8, 2025

#6578 (comment)

what this comment is saying could be true but I can't confirm because I can't reproduce either way.

If this fixes it then great, but it might not and no clue how to actually repro

@ckifer ckifer merged commit 0484543 into main Nov 8, 2025
32 of 47 checks passed
@ckifer ckifer deleted the fix/circular-axis-selector-imports branch November 8, 2025 04:07
This was referenced Dec 1, 2025
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.

2 participants