Skip to content

ref(webvitals): Break circular import by moving ORDER constant to types#111487

Merged
evanpurkhiser merged 2 commits intomasterfrom
scttcper/fix-circular-import-order-constant
Mar 25, 2026
Merged

ref(webvitals): Break circular import by moving ORDER constant to types#111487
evanpurkhiser merged 2 commits intomasterfrom
scttcper/fix-circular-import-order-constant

Conversation

@scttcper
Copy link
Member

@scttcper scttcper commented Mar 24, 2026

Breaks a circular import chain by moving the ORDER constant from performanceScoreChart.tsx to the shared types.tsx module (where WebVitals is already defined).

The cycle

  1. withProjectprojectContext
  2. projectContextthirds
  3. thirdsprimaryNavigationContext
  4. primaryNavigationContextnavigationTour
  5. navigationTourexplore/utils
  6. explore/utilsdiscover/eventView
  7. discover/eventViewdiscover/utils
  8. discover/utilsconvertWidgetToBuilderStateParams
  9. convertWidgetToBuilderStateParamsuseWidgetBuilderState
  10. useWidgetBuilderStatedatasetConfig/base
  11. datasetConfig/basedatasetConfig/spans
  12. datasetConfig/spanstransformPerformanceScoreBreakdownSeries
  13. transformPerformanceScoreBreakdownSeriesperformanceScoreChart ← broken here
  14. performanceScoreChartperformanceScoreBreakdownChartWidget
  15. performanceScoreBreakdownChartWidgetinsightsTimeSeriesWidget
  16. insightsTimeSeriesWidgetchartActionDropdown
  17. chartActionDropdownfeature
  18. featurewithProject 🔄

fixes a loading issue on sentry devserver

scttcper and others added 2 commits March 24, 2026 15:40
Move the ORDER constant from performanceScoreChart.tsx to the shared
types.tsx module. The constant was causing a circular import chain:

  withProject → projectContext → thirds → primaryNavigationContext →
  navigationTour → explore/utils → eventView → discover/utils →
  convertWidgetToBuilderStateParams → useWidgetBuilderState →
  datasetConfig/base → datasetConfig/spans →
  transformPerformanceScoreBreakdownSeries → performanceScoreChart →
  performanceScoreBreakdownChartWidget → insightsTimeSeriesWidget →
  chartActionDropdown → feature → withProject

Moving ORDER to types.tsx (where WebVitals is already defined) breaks
the cycle at the transformPerformanceScoreBreakdownSeries →
performanceScoreChart link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update the relative import of ORDER to use the new types module location.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 24, 2026
@scttcper scttcper marked this pull request as ready for review March 24, 2026 22:45
@scttcper scttcper requested review from a team as code owners March 24, 2026 22:45
@scttcper scttcper requested a review from a team March 24, 2026 23:01
@cameroncooke
Copy link
Contributor

This fixes the issue for me, thank you!

@evanpurkhiser evanpurkhiser merged commit 399c51a into master Mar 25, 2026
81 checks passed
@evanpurkhiser evanpurkhiser deleted the scttcper/fix-circular-import-order-constant branch March 25, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants