Files
supabase/apps/www/pages/launch-week/15/index.tsx
anthony lio b610d677c5 feat(www): lw16 launch week rewrite (#54315)
## Problem

- supabase.com/launch-week shows the lw15 page, and the lw16 card app
runs as a separate vercel app
- a forward rule for all of `/launch-week/*` also covers the www pages
of past launch weeks, and www does not add its security headers to
forwarded paths

## Solution

- moves the lw15 page to `/launch-week/15`
- adds rewrites that forward `/launch-week` and its other paths to the
lw16 card app at `launch-week-16.vercel.app/launch-week/`
- changes the root rule to target `/launch-week/` directly because www
removes the trailing slash and the app adds it, a loop otherwise
- keeps `/launch-week/7`, `/8`, `/15`, `/ticket` and `/tickets/*` on www
with the www security headers
- adds the launch week paths to the security header tests
- adds `/launch-week` to the paths that the redirect checks leave to
other apps

## Preview links

| Site | Live | Preview | Search for |
| ---- | ---- | ------- | ---------- |
| WWW | [/launch-week](https://supabase.com/launch-week) |
[/launch-week](https://zone-www-dot-com-git-antlio-lw16-launch-week-rewrite-supabase.vercel.app/launch-week)
| Claim your card |
| WWW | [/launch-week/15](https://supabase.com/launch-week/15) |
[/launch-week/15](https://zone-www-dot-com-git-antlio-lw16-launch-week-rewrite-supabase.vercel.app/launch-week/15)
| Launch Week 15 |

## Review instructions

1. run `pnpm --filter www exec vitest run lib/security-headers.test.ts`
and make sure that all tests pass
2. open the preview
[/launch-week](https://zone-www-dot-com-git-antlio-lw16-launch-week-rewrite-supabase.vercel.app/launch-week)
and make sure that the lw16 card page loads with no redirect loop
3. open the preview
[/launch-week/](https://zone-www-dot-com-git-antlio-lw16-launch-week-rewrite-supabase.vercel.app/launch-week/)
and make sure that www redirects it to `/launch-week` once

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-12-01 14:45:55 -06:00

103 lines
3.1 KiB
TypeScript

import dynamic from 'next/dynamic'
import { NextSeo } from 'next-seo'
import { LW15_DATE, LW15_TITLE, LW15_URL, SITE_ORIGIN } from 'lib/constants'
import { useRouter } from 'next/router'
import DefaultLayout from 'components/Layouts/Default'
import LW15Heading from 'components/LaunchWeek/15/LW15Heading'
import LW15MainStage from 'components/LaunchWeek/15/LW15MainStage'
import type { GetServerSideProps } from 'next'
import type { LumaEvent } from 'app/api-v2/luma-events/route'
const LW15BuildStage = dynamic(() => import('components/LaunchWeek/15/LW15BuildStage'))
const LW15Hackathon = dynamic(() => import('components/LaunchWeek/15/LW15Hackathon'))
const LW15Meetups = dynamic(() => import('components/LaunchWeek/15/LW15Meetups'))
interface Props {
meetups: LumaEvent[]
}
const Lw15Page = ({ meetups }: Props) => {
const TITLE = `${LW15_TITLE} | ${LW15_DATE}`
const DESCRIPTION = 'Join us for a week of announcing new features, every day at 8AM PT.'
const OG_IMAGE = `${SITE_ORIGIN}/images/launchweek/15/lw15-og.png?lw=15`
const { query } = useRouter()
const ticketNumber = query.ticketNumber?.toString()
const defaultUserData = {
id: query.id?.toString(),
ticket_number: ticketNumber ? parseInt(ticketNumber, 10) : undefined,
name: query.name?.toString(),
username: query.username?.toString(),
platinum: !!query.platinum,
}
return (
<>
<NextSeo
title={TITLE}
description={DESCRIPTION}
openGraph={{
title: TITLE,
description: DESCRIPTION,
url: `${LW15_URL}/15`,
images: [
{
url: OG_IMAGE,
},
],
}}
/>
<div
style={{
fontFamily:
"SuisseIntl-Book, custom-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
}}
>
<DefaultLayout className="dark:bg-black">
<LW15Heading />
<LW15MainStage />
<LW15BuildStage />
<LW15Hackathon />
<LW15Meetups meetups={meetups} />
</DefaultLayout>
</div>
</>
)
}
export const getServerSideProps: GetServerSideProps = async () => {
try {
// Date range for Launch Week 15: July 14th, 2025 to September 1st, 2025
const afterDate = '2025-07-14T00:00:00.000Z'
const beforeDate = '2025-09-01T23:59:59.999Z'
const url = new URL(`${SITE_ORIGIN}/api-v2/luma-events`)
url.searchParams.append('after', afterDate)
url.searchParams.append('before', beforeDate)
const res = await fetch(url.toString())
const data = await res.json()
if (data.success) {
return {
props: {
meetups: data.events.filter((event: LumaEvent) =>
event.name?.toLowerCase().includes('lw15')
),
},
}
} else {
console.error('Failed to fetch meetups:', data.error)
return { props: { meetups: [] } }
}
} catch (error) {
console.error('Error fetching meetups:', error)
return { props: { meetups: [] } }
}
}
export default Lw15Page