Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/www/public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/assets/*
Cache-Control: public, max-age=31536000, immutable

/fonts/*
Cache-Control: public, max-age=31536000, immutable

/*.html
Cache-Control: public, max-age=60, must-revalidate
17 changes: 12 additions & 5 deletions apps/www/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ import { Toaster } from '@gbfm/ui'
import { FPSMeter } from '@overengineering/fps-meter'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createRootRouteWithContext, HeadContent, Outlet } from '@tanstack/react-router'
import { Suspense } from 'react'
import { lazy, Suspense } from 'react'
import { VerifyEmailBanner } from '@/components/Auth/VerifyEmailBanner'
import { AuthPromptDialog } from '@/components/AuthPromptDialog'
import { ErrorBoundary } from '@/components/ErrorBoundary'
import AppShell from '@/components/Layout/AppShell'
import { OfflineBanner } from '@/components/OfflineBanner'
import { WelcomeModal } from '@/components/onboarding/WelcomeModal'
import { ThemeProvider } from '@/components/ThemeProvider'
import { env } from '@/env'

const AuthPromptDialog = lazy(() =>
import('@/components/AuthPromptDialog').then((m) => ({ default: m.AuthPromptDialog }))
)
const WelcomeModal = lazy(() =>
import('@/components/onboarding/WelcomeModal').then((m) => ({ default: m.WelcomeModal }))
)
export interface MyRouterContext {
auth: {
user: {
Expand Down Expand Up @@ -61,8 +66,10 @@ export const Route = createRootRouteWithContext<MyRouterContext>()({
)}
<OfflineBanner />
<VerifyEmailBanner />
<WelcomeModal />
<AuthPromptDialog />
<Suspense fallback={null}>
<WelcomeModal />
<AuthPromptDialog />
</Suspense>
<Outlet />
</AppShell>
</QueryClientProvider>
Expand Down
3 changes: 1 addition & 2 deletions infra/www.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { secret } from './secret'
import { isLocal } from './stage'
import { vps_gateway } from './vps'

export const www = new sst.aws.StaticSite('gbfm-www', {
export const www = new sst.cloudflare.StaticSiteV2('gbfm-www', {
path: './apps/www',
build: {
command: 'bun run build',
Expand All @@ -18,7 +18,6 @@ export const www = new sst.aws.StaticSite('gbfm-www', {
},
domain: {
name: `www.${domain}`,
dns: sst.cloudflare.dns({ proxy: true }),
...($app.stage === 'prod' ? { aliases: [domain] } : {})
}
})
Expand Down
2 changes: 1 addition & 1 deletion sst-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ declare module "sst" {
"value": string
}
"gbfm-www": {
"type": "sst.aws.StaticSite"
"type": "sst.cloudflare.StaticSite"
"url": string
}
"gbfm_network": {
Expand Down