-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟🔧 Refactor frontend destination routing #19120
Conversation
<Route path={RoutePaths.Destination}> | ||
<Route index element={<AllDestinationsPage />} /> | ||
<Route path={DestinationPaths.NewDestination} element={<CreateDestinationPage />} /> | ||
<Route path={DestinationPaths.NewConnection} element={<CreationFormPage />} /> | ||
<Route path={DestinationPaths.Root} element={<DestinationItemPage />}> | ||
<Route path={DestinationPaths.Settings} element={<DestinationSettingsPage />} /> | ||
<Route index element={<DestinationOverviewPage />} /> | ||
</Route> | ||
</Route> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main improvement introduced in this PR - we can see the route structure clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the work being done here! Did some light testing, clicking around in OSS and that all seems to work 👍
* move components out of pages directory * flatten destination routes
What
This PR refactors the routes nested in the destination path:
/workspaces/:workspaceId/destination
With the aim of:
pages
and into thecomponents
directoryroutes.tsx
file for less nesting and better discoverability<Route>
components) from application specific componentsPart of a larger effort to clean up our frontend routing logic.
How
src/components/destination
<Route>
components have been moved up toroutes.tsx
so that the whole route tree becomes more visible (see these changes)<Routes>
have been replaced with react-router's <Outlet> componentRecommended reading order
routes.tsx
androutePaths.tsx
to see the broad picturepages/destination
to see the purely routing componentssrc/components/destination
to see the application components related to thedestination
app domainNext steps
A similar refactor will be done for sources, connections and settings so that we do not have so many deeply nested and conditional
<Route>
components.