-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [M3-8762] -
only-export-components
for Tanstack routes (#…
…11142) * only-export-components fro routes * cleanup * moar cleanup * Added changeset: `only-export-components` for Tanstack routes
- Loading branch information
1 parent
f3d86c0
commit 82f3542
Showing
50 changed files
with
483 additions
and
404 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11142-tech-stories-1729715589096.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tech Stories | ||
--- | ||
|
||
`only-export-components` for Tanstack routes ([#11142](https://github.com/linode/manager/pull/11142)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const AccountRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<ProductInformationBanner bannerLocation="Account" /> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
20 changes: 4 additions & 16 deletions
20
packages/manager/src/routes/account.tsx → packages/manager/src/routes/account/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { NotFound } from 'src/components/NotFound'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
import { useFlags } from 'src/hooks/useFlags'; | ||
|
||
export const BetasRoute = () => { | ||
const flags = useFlags(); | ||
const { selfServeBetas } = flags; | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
{selfServeBetas ? <Outlet /> : <NotFound />} | ||
</React.Suspense> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { createRoute } from '@tanstack/react-router'; | ||
|
||
import { rootRoute } from '../root'; | ||
import { BetasRoute } from './BetasRoute'; | ||
|
||
const betasRoute = createRoute({ | ||
component: BetasRoute, | ||
getParentRoute: () => rootRoute, | ||
path: 'betas', | ||
}); | ||
|
||
const betaLandingRoute = createRoute({ | ||
getParentRoute: () => betasRoute, | ||
path: '/', | ||
}).lazy(() => | ||
import('src/features/Betas/BetasLanding').then((m) => m.betasLandingLazyRoute) | ||
); | ||
|
||
const betaSignupRoute = createRoute({ | ||
getParentRoute: () => betasRoute, | ||
path: 'signup/$betaId', | ||
}).lazy(() => | ||
import('src/features/Betas/BetaSignup').then((m) => m.betaSignupLazyRoute) | ||
); | ||
|
||
export const betaRouteTree = betasRoute.addChildren([ | ||
betaLandingRoute, | ||
betaSignupRoute, | ||
]); |
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
packages/manager/src/routes/cloudPulse/CloudPulseRoute.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { DocumentTitleSegment } from 'src/components/DocumentTitle'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const CloudPulseRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<DocumentTitleSegment segment="Cloud Pulse" /> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createRoute } from '@tanstack/react-router'; | ||
|
||
import { rootRoute } from '../root'; | ||
import { CloudPulseRoute } from './CloudPulseRoute'; | ||
|
||
const cloudPulseRoute = createRoute({ | ||
component: CloudPulseRoute, | ||
getParentRoute: () => rootRoute, | ||
path: 'monitor/cloudpulse', | ||
}); | ||
|
||
const cloudPulseLandingRoute = createRoute({ | ||
getParentRoute: () => cloudPulseRoute, | ||
path: '/', | ||
}).lazy(() => | ||
import('src/features/CloudPulse/CloudPulseLanding').then( | ||
(m) => m.cloudPulseLandingLazyRoute | ||
) | ||
); | ||
|
||
export const cloudPulseRouteTree = cloudPulseRoute.addChildren([ | ||
cloudPulseLandingRoute, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { DocumentTitleSegment } from 'src/components/DocumentTitle'; | ||
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const DatabasesRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<DocumentTitleSegment segment="Databases" /> | ||
<ProductInformationBanner bannerLocation="Databases" /> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
22 changes: 4 additions & 18 deletions
22
packages/manager/src/routes/databases.tsx → ...ges/manager/src/routes/databases/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const DomainsRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<ProductInformationBanner bannerLocation="Domains" /> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
20 changes: 4 additions & 16 deletions
20
packages/manager/src/routes/domains.tsx → packages/manager/src/routes/domains/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const EventsRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
18 changes: 4 additions & 14 deletions
18
packages/manager/src/routes/events.tsx → packages/manager/src/routes/events/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Outlet } from '@tanstack/react-router'; | ||
import React from 'react'; | ||
|
||
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner'; | ||
import { SuspenseLoader } from 'src/components/SuspenseLoader'; | ||
|
||
export const FirewallsRoute = () => { | ||
return ( | ||
<React.Suspense fallback={<SuspenseLoader />}> | ||
<ProductInformationBanner bannerLocation="Firewalls" /> | ||
<Outlet /> | ||
</React.Suspense> | ||
); | ||
}; |
Oops, something went wrong.