Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Migrates usage of deprecatedRouteProps for VitalDetail - sentry/views/performance/vitalDetail.

https://www.notion.so/sentry/Frontend-TSC-Project-Remove-all-uses-of-deprecatedRouteProps-true-26a8b10e4b5d8015a6a2dd14f9d41dd7


Copied from getsentry#100923
Original PR: getsentry#100923

Copy link

Remove Usage of deprecatedRouteProps from VitalDetail View

This pull request removes all instances of deprecatedRouteProps from the VitalDetail view under sentry/views/performance/vitalDetail. The refactor transitions the view components and associated tests to modern routing and context patterns, eliminates legacy router usage, and introduces hooks-based context retrieval for organization, projects, and related data. Test utilities and props are updated to match the new hooks approach and route initialization logic, aligning the code with frontend modernization efforts.

Key Changes

• Eliminated usage of deprecatedRouteProps in the main VitalDetail route definition within static/app/routes.tsx.
• Refactored static/app/views/performance/vitalDetail/index.tsx and vitalDetailContent.tsx to use hooks such as useOrganization, useProjects, usePageFilters, and useLocation instead of props or HOCs.
• Removed all usage of InjectedRouter, withOrganization, withProjects, and related HOCs in favor of hooks.
• Updated tests in index.spec.tsx to use initialRouterConfig and hooks-based context, removing dependencies on the legacy router and deprecated mocks.
• All navigation logic switched to use the navigate hook instead of browserHistory or router.push.
• Removed prop drilling and outdated type definitions related to the legacy router and project selection.

Affected Areas

static/app/routes.tsx (route props and structure)
static/app/views/performance/vitalDetail/index.tsx (component implementation, routing, context)
static/app/views/performance/vitalDetail/vitalDetailContent.tsx (context, navigation, alert creation)
static/app/views/performance/vitalDetail/index.spec.tsx (test harness and mocks)

This summary was automatically generated by @propel-code-bot

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