Skip to content

react-router v6 flip (2/3): route remaining imports through routerCompat - #495

Merged
cigamit merged 3 commits into
ctrliq:mainfrom
blaipr:feature/router-compat-2
Jun 22, 2026
Merged

react-router v6 flip (2/3): route remaining imports through routerCompat#495
cigamit merged 3 commits into
ctrliq:mainfrom
blaipr:feature/router-compat-2

Conversation

@blaipr

@blaipr blaipr commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
SUMMARY

Part 2 of 3 of the react-router v5-compatv6 flip (continues #494).

Retargets the remaining react-router-dom-v5-compat importers (the second half of the screens — 166 files) to import from src/routerCompat instead.

Still behaviour-preserving: routerCompat re-exports the same v6 API from react-router-dom-v5-compat, so the app stays on react-router-dom v5 + the <CompatRouter> bridge with no API or routing change.

After this PR the only direct react-router-dom-v5-compat importers left are:

  • routerCompat.js itself (the re-export source),
  • App.js (CompatRouter — no v6 equivalent),
  • the two TopologyView RTL test harnesses that wrap with <CompatRouter>.

All three are handled in the final part, which repoints routerCompat at react-router-dom v6.

Depends on #494 (part 1). Review/merge that first.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • UI
ASCENDER VERSION
awx: 25.4.1.dev113+g<part2>
ADDITIONAL INFORMATION
  • npm --prefix awx/ui run lint clean; npm --prefix awx/ui run test552 suites / 2908 tests green (3 documented skips). Pure indirection, suite passes unchanged.

blaipr added 2 commits June 19, 2026 08:36
First step of splitting the react-router v5-compat -> v6 flip into reviewable
pieces. Because react-router-dom-v5-compat peer-requires react-router-dom v4/5,
the package bump and every import retarget are otherwise one atomic 370-file
change that exceeds tooling review limits.

Introduce `src/routerCompat.js`, a single re-export point for the react-router
API the app uses, and retarget the first ~half of the v5-compat importers
(components, contexts, hooks, and the first block of screens) to import from it.

`routerCompat` currently re-exports from react-router-dom-v5-compat, so this is
a behaviour-preserving indirection: no API or routing change, the app still runs
on react-router-dom v5 + the compat bridge. The final part of the split repoints
`routerCompat` at react-router-dom once the package is on v6, flipping every
consumer at once. App.js keeps importing CompatRouter directly (no v6 equivalent)
until that final step.
Retarget the remaining react-router-dom-v5-compat importers (the second half
of the screens) to import from `src/routerCompat` instead, continuing part 1.

Still behaviour-preserving: `routerCompat` re-exports the same v6 API from
react-router-dom-v5-compat, so the app remains on react-router-dom v5 + the
compat bridge with no API or routing change. After this PR the only direct
react-router-dom-v5-compat importers left are `routerCompat` itself, `App.js`
(CompatRouter, no v6 equivalent), and the two TopologyView RTL test harnesses
that wrap with <CompatRouter> -- all handled in the final part.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@cigamit

cigamit commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Reviewed, will merge once conflicts are resolved.

# Conflicts:
#	awx/ui/src/components/AddRole/AddResourceRole.js
#	awx/ui/src/components/ContentError/ContentError.js
#	awx/ui/src/components/LaunchButton/LaunchButton.js
#	awx/ui/src/components/Lookup/CredentialLookup.js
#	awx/ui/src/components/Lookup/HostFilterLookup.js
#	awx/ui/src/components/Lookup/InstanceGroupsLookup.js
#	awx/ui/src/components/Lookup/InventoryLookup.js
#	awx/ui/src/components/Lookup/Lookup.js
#	awx/ui/src/components/Lookup/MultiCredentialsLookup.js
#	awx/ui/src/components/Lookup/OrganizationLookup.js
#	awx/ui/src/components/Lookup/PeersLookup.js
#	awx/ui/src/components/Lookup/ProjectLookup.js
#	awx/ui/src/components/Schedule/ScheduleEdit/ScheduleEdit.js
#	awx/ui/src/screens/Host/HostEdit/HostEdit.js
#	awx/ui/src/screens/InstanceGroup/Instances/InstanceListItem.js
#	awx/ui/src/screens/Inventory/AdvancedInventoryHosts/AdvancedInventoryHosts.js
#	awx/ui/src/screens/Inventory/InventoryEdit/InventoryEdit.js
#	awx/ui/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.js
#	awx/ui/src/screens/Inventory/InventoryHostEdit/InventoryHostEdit.js
#	awx/ui/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupListItem.js
#	awx/ui/src/screens/Inventory/SmartInventoryEdit/SmartInventoryEdit.js
#	awx/ui/src/screens/Inventory/shared/InventoryGroupsDeleteModal.js
#	awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js
#	awx/ui/src/screens/NotificationTemplate/NotificationTemplateEdit/NotificationTemplateEdit.js
#	awx/ui/src/screens/Organization/OrganizationEdit/OrganizationEdit.js
#	awx/ui/src/screens/Team/TeamEdit/TeamEdit.js
@blaipr

blaipr commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Merge conflicts with main have been resolved.

@cigamit
cigamit merged commit 51b9724 into ctrliq:main Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants