diff --git a/patchnotes-web/src/api/hooks.ts b/patchnotes-web/src/api/hooks.ts index 81f521a2..3a3c7c54 100644 --- a/patchnotes-web/src/api/hooks.ts +++ b/patchnotes-web/src/api/hooks.ts @@ -38,7 +38,7 @@ import { useTriggerPackageSync, getGetPackagesHealthQueryKey, } from './generated/admin-packages/admin-packages' -import { useGetFeed } from './generated/feed/feed' +import { useGetFeed, getGetFeedQueryOptions } from './generated/feed/feed' import { GetFeedResponse } from './generated/feed/feed.zod' import { @@ -401,3 +401,5 @@ export function useFeed(options?: FeedOptions) { }, }) } + +export { getGetFeedQueryOptions } diff --git a/patchnotes-web/src/routeTree.gen.ts b/patchnotes-web/src/routeTree.gen.ts index 51a25daf..1147714c 100644 --- a/patchnotes-web/src/routeTree.gen.ts +++ b/patchnotes-web/src/routeTree.gen.ts @@ -33,7 +33,7 @@ const WatchlistRoute = WatchlistRouteImport.update({ id: '/watchlist', path: '/watchlist', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/watchlist.lazy').then((d) => d.Route)) const SubscriptionSuccessRoute = SubscriptionSuccessRouteImport.update({ id: '/subscription-success', path: '/subscription-success', @@ -48,32 +48,32 @@ const SettingsRoute = SettingsRouteImport.update({ id: '/settings', path: '/settings', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/settings.lazy').then((d) => d.Route)) const PrivacyRoute = PrivacyRouteImport.update({ id: '/privacy', path: '/privacy', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/privacy.lazy').then((d) => d.Route)) const PricingRoute = PricingRouteImport.update({ id: '/pricing', path: '/pricing', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/pricing.lazy').then((d) => d.Route)) const OnboardingRoute = OnboardingRouteImport.update({ id: '/onboarding', path: '/onboarding', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/onboarding.lazy').then((d) => d.Route)) const LoginRoute = LoginRouteImport.update({ id: '/login', path: '/login', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/login.lazy').then((d) => d.Route)) const AuthenticateRoute = AuthenticateRouteImport.update({ id: '/authenticate', path: '/authenticate', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/authenticate.lazy').then((d) => d.Route)) const AdminRoute = AdminRouteImport.update({ id: '/admin', path: '/admin', @@ -83,12 +83,12 @@ const AboutRoute = AboutRouteImport.update({ id: '/about', path: '/about', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/about.lazy').then((d) => d.Route)) const IndexRoute = IndexRouteImport.update({ id: '/', path: '/', getParentRoute: () => rootRouteImport, -} as any) +} as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route)) const ReleasesReleaseIdRoute = ReleasesReleaseIdRouteImport.update({ id: '/releases/$releaseId', path: '/releases/$releaseId', diff --git a/patchnotes-web/src/routes/about.lazy.tsx b/patchnotes-web/src/routes/about.lazy.tsx new file mode 100644 index 00000000..2029a762 --- /dev/null +++ b/patchnotes-web/src/routes/about.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { About } from '../pages/About' + +export const Route = createLazyFileRoute('/about')({ + component: About, +}) diff --git a/patchnotes-web/src/routes/about.tsx b/patchnotes-web/src/routes/about.tsx index 2fa8c8a7..df6a41ea 100644 --- a/patchnotes-web/src/routes/about.tsx +++ b/patchnotes-web/src/routes/about.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { About } from '../pages/About' import { seoHead } from '../seo' export const Route = createFileRoute('/about')({ - component: About, head: () => ({ ...seoHead({ title: 'About | My Release Notes', diff --git a/patchnotes-web/src/routes/authenticate.lazy.tsx b/patchnotes-web/src/routes/authenticate.lazy.tsx new file mode 100644 index 00000000..494ac982 --- /dev/null +++ b/patchnotes-web/src/routes/authenticate.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { Authenticate } from '../pages/Authenticate' + +export const Route = createLazyFileRoute('/authenticate')({ + component: Authenticate, +}) diff --git a/patchnotes-web/src/routes/authenticate.tsx b/patchnotes-web/src/routes/authenticate.tsx index 6ccae284..c5a84e6d 100644 --- a/patchnotes-web/src/routes/authenticate.tsx +++ b/patchnotes-web/src/routes/authenticate.tsx @@ -1,6 +1,3 @@ import { createFileRoute } from '@tanstack/react-router' -import { Authenticate } from '../pages/Authenticate' -export const Route = createFileRoute('/authenticate')({ - component: Authenticate, -}) +export const Route = createFileRoute('/authenticate')({}) diff --git a/patchnotes-web/src/routes/index.lazy.tsx b/patchnotes-web/src/routes/index.lazy.tsx new file mode 100644 index 00000000..0ed2a4c6 --- /dev/null +++ b/patchnotes-web/src/routes/index.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { HomePage } from '../pages/HomePage' + +export const Route = createLazyFileRoute('/')({ + component: HomePage, +}) diff --git a/patchnotes-web/src/routes/index.tsx b/patchnotes-web/src/routes/index.tsx index 58bcab3f..260dba28 100644 --- a/patchnotes-web/src/routes/index.tsx +++ b/patchnotes-web/src/routes/index.tsx @@ -1,9 +1,13 @@ import { createFileRoute } from '@tanstack/react-router' -import { HomePage } from '../pages/HomePage' +import { getGetFeedQueryOptions } from '../api/hooks' import { seoHead } from '../seo' export const Route = createFileRoute('/')({ - component: HomePage, + loader: ({ context: { queryClient } }) => { + queryClient.ensureQueryData( + getGetFeedQueryOptions({ excludePrerelease: true }) + ) + }, head: () => ({ ...seoHead({ title: 'My Release Notes - Track GitHub Releases | myreleasenotes.ai', diff --git a/patchnotes-web/src/routes/login.lazy.tsx b/patchnotes-web/src/routes/login.lazy.tsx new file mode 100644 index 00000000..ea98f5bb --- /dev/null +++ b/patchnotes-web/src/routes/login.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { Login } from '../pages/Login' + +export const Route = createLazyFileRoute('/login')({ + component: Login, +}) diff --git a/patchnotes-web/src/routes/login.tsx b/patchnotes-web/src/routes/login.tsx index 8f58edd4..0987f70f 100644 --- a/patchnotes-web/src/routes/login.tsx +++ b/patchnotes-web/src/routes/login.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { Login } from '../pages/Login' import { seoHead } from '../seo' export const Route = createFileRoute('/login')({ - component: Login, validateSearch: (search: Record) => ({ returnUrl: typeof search.returnUrl === 'string' ? search.returnUrl : undefined, diff --git a/patchnotes-web/src/routes/onboarding.lazy.tsx b/patchnotes-web/src/routes/onboarding.lazy.tsx new file mode 100644 index 00000000..a8c32705 --- /dev/null +++ b/patchnotes-web/src/routes/onboarding.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { OnboardingPage } from '../pages/OnboardingPage' + +export const Route = createLazyFileRoute('/onboarding')({ + component: OnboardingPage, +}) diff --git a/patchnotes-web/src/routes/onboarding.tsx b/patchnotes-web/src/routes/onboarding.tsx index eb7daa94..af256930 100644 --- a/patchnotes-web/src/routes/onboarding.tsx +++ b/patchnotes-web/src/routes/onboarding.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { OnboardingPage } from '../pages/OnboardingPage' import { seoHead } from '../seo' export const Route = createFileRoute('/onboarding')({ - component: OnboardingPage, head: () => ({ ...seoHead({ title: 'Get Started | My Release Notes', diff --git a/patchnotes-web/src/routes/pricing.lazy.tsx b/patchnotes-web/src/routes/pricing.lazy.tsx new file mode 100644 index 00000000..ee24ea5f --- /dev/null +++ b/patchnotes-web/src/routes/pricing.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { Pricing } from '../pages/Pricing' + +export const Route = createLazyFileRoute('/pricing')({ + component: Pricing, +}) diff --git a/patchnotes-web/src/routes/pricing.tsx b/patchnotes-web/src/routes/pricing.tsx index 63f7f9ae..ae72cf2a 100644 --- a/patchnotes-web/src/routes/pricing.tsx +++ b/patchnotes-web/src/routes/pricing.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { Pricing } from '../pages/Pricing' import { seoHead } from '../seo' export const Route = createFileRoute('/pricing')({ - component: Pricing, head: () => ({ ...seoHead({ title: 'Pricing | My Release Notes', diff --git a/patchnotes-web/src/routes/privacy.lazy.tsx b/patchnotes-web/src/routes/privacy.lazy.tsx new file mode 100644 index 00000000..36906022 --- /dev/null +++ b/patchnotes-web/src/routes/privacy.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { Privacy } from '../pages/Privacy' + +export const Route = createLazyFileRoute('/privacy')({ + component: Privacy, +}) diff --git a/patchnotes-web/src/routes/privacy.tsx b/patchnotes-web/src/routes/privacy.tsx index e4672559..b9ce2bce 100644 --- a/patchnotes-web/src/routes/privacy.tsx +++ b/patchnotes-web/src/routes/privacy.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { Privacy } from '../pages/Privacy' import { seoHead } from '../seo' export const Route = createFileRoute('/privacy')({ - component: Privacy, head: () => ({ ...seoHead({ title: 'Privacy Policy | My Release Notes', diff --git a/patchnotes-web/src/routes/settings.lazy.tsx b/patchnotes-web/src/routes/settings.lazy.tsx new file mode 100644 index 00000000..4e1bf220 --- /dev/null +++ b/patchnotes-web/src/routes/settings.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { Settings } from '../pages/Settings' + +export const Route = createLazyFileRoute('/settings')({ + component: Settings, +}) diff --git a/patchnotes-web/src/routes/settings.tsx b/patchnotes-web/src/routes/settings.tsx index 111e4ff9..e77f1af2 100644 --- a/patchnotes-web/src/routes/settings.tsx +++ b/patchnotes-web/src/routes/settings.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { Settings } from '../pages/Settings' import { seoHead } from '../seo' export const Route = createFileRoute('/settings')({ - component: Settings, head: () => ({ ...seoHead({ title: 'Settings | My Release Notes', diff --git a/patchnotes-web/src/routes/watchlist.lazy.tsx b/patchnotes-web/src/routes/watchlist.lazy.tsx new file mode 100644 index 00000000..647b6fe2 --- /dev/null +++ b/patchnotes-web/src/routes/watchlist.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from '@tanstack/react-router' +import { WatchlistPage } from '../pages/WatchlistPage' + +export const Route = createLazyFileRoute('/watchlist')({ + component: WatchlistPage, +}) diff --git a/patchnotes-web/src/routes/watchlist.tsx b/patchnotes-web/src/routes/watchlist.tsx index daecaa8b..38fd76c6 100644 --- a/patchnotes-web/src/routes/watchlist.tsx +++ b/patchnotes-web/src/routes/watchlist.tsx @@ -1,9 +1,7 @@ import { createFileRoute } from '@tanstack/react-router' -import { WatchlistPage } from '../pages/WatchlistPage' import { seoHead } from '../seo' export const Route = createFileRoute('/watchlist')({ - component: WatchlistPage, head: () => ({ ...seoHead({ title: 'Watchlist | My Release Notes',