Commit Graph
5 Commits
Author SHA1 Message Date
Sean OliverandDanny White f9fd4a2a9f feat(www,docs,kb): show Do Not Sell or Share footer link to US visitors (#53490)
## Problem

US visitors need a "Do Not Sell or Share My Personal Information" footer
link, and no site reads the visitor's country
([GROWTH-1369](https://linear.app/supabase/issue/GROWTH-1369)).

## Solution

- The www proxy copies the `x-vercel-ip-country` header into a
`_sb_country` cookie, which the footers read client-side. Docs and kb
route through www, so that covers all three.
- US visitors and unknown countries see the opt-out label. Everyone else
keeps "Privacy Settings". Both open the same modal.
- The link sits on each footer's copyright line, and the label stays
hidden until the cookie is read.
- Out of scope: GPC
([GROWTH-1373](https://linear.app/supabase/issue/GROWTH-1373)) and modal
copy ([GROWTH-1370](https://linear.app/supabase/issue/GROWTH-1370)).
- Tests cover US, non-US, unknown countries, and the cookie write.
Screenshots used a hand-set cookie.

**www**

| | Before | US | DE |
|---|---|---|---|
| 375px | <img
src="https://github.com/user-attachments/assets/1bd8bcb8-6692-4fe9-90a0-5343b0364053"
width="200"> | <img
src="https://github.com/user-attachments/assets/0514a0bd-ad1c-4773-b889-de941f5466b5"
width="200"> | <img
src="https://github.com/user-attachments/assets/328ca1b4-9698-492e-8045-a15d884108f2"
width="200"> |
| 1440px | <img
src="https://github.com/user-attachments/assets/3cb3e7d7-62ab-4d34-841c-23d50d7d1cd5"
width="300"> | <img
src="https://github.com/user-attachments/assets/caf75b29-7286-404a-b1ea-7dfa5022912c"
width="300"> | <img
src="https://github.com/user-attachments/assets/2c067209-39cd-4ad8-9987-4f8763d70660"
width="300"> |

**docs**

| | Before | US | DE |
|---|---|---|---|
| 375px | <img
src="https://github.com/user-attachments/assets/37248b4a-436b-4d2d-b2d3-3966117abf9e"
width="200"> | <img
src="https://github.com/user-attachments/assets/0b109a0d-7618-46f8-ade0-8ba17e390b56"
width="200"> | <img
src="https://github.com/user-attachments/assets/0047b2b8-7047-40df-8d9c-09f51e538fa4"
width="200"> |
| 1440px | <img
src="https://github.com/user-attachments/assets/0a7d6a65-e964-43dc-911e-0ea033cb1e91"
width="300"> | <img
src="https://github.com/user-attachments/assets/27922348-661c-4246-b3fc-44ac054bd084"
width="300"> | <img
src="https://github.com/user-attachments/assets/30afb171-1023-43ff-b77e-89f341128377"
width="300"> |

**kb**

| | Before | US | DE |
|---|---|---|---|
| 375px | <img
src="https://github.com/user-attachments/assets/cd4fb8d1-8827-4b1a-8d13-c2a5d4f97378"
width="200"> | <img
src="https://github.com/user-attachments/assets/2706ae24-3df8-4149-9a51-75abb0456734"
width="200"> | <img
src="https://github.com/user-attachments/assets/7afb8731-b487-4e48-ae83-a3a6bde36bee"
width="200"> |
| 1440px | <img
src="https://github.com/user-attachments/assets/3b2bdc17-fee7-4ec0-bd24-d35a0367a6ca"
width="300"> | <img
src="https://github.com/user-attachments/assets/479b03e6-6890-4714-bbbb-ab122f46e786"
width="300"> | <img
src="https://github.com/user-attachments/assets/252f4e0f-5bcc-4b43-aeda-784df9f000ca"
width="300"> |

## Review instructions

1. From a US IP, click the footer link on the www preview. The modal
opens.
2. From a non-US IP, see "Privacy Settings".

## Checklist

- [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)

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-11-20 16:44:17 +09:00
Alaister YoungandAlaister Young 42bf16cdce fix(www): skip proxy for Studio assets and API requests (#52743)
Stops the www proxy from running on Studio's non-document traffic. Each
chunk, server function and API request under `/dashboard` currently
invokes it, and a cold Studio load preloads a few hundred chunks through
this path.

**Changed:**
- The proxy matcher now skips `/dashboard/_vercel/`,
`/dashboard/_serverFn/` and `/dashboard/api/`
- Studio documents still match, so direct `/dashboard` landings keep
getting the `_sb_first_referrer` cookie and the paid-traffic refresh

**Added:**
- Matcher tests using Next's `unstable_doesMiddlewareMatch`. The three
skip cases fail against the old matcher

A quick single-region TTFB probe on production showed a www static file
that goes through the proxy about 15ms slower than one that skips it.
Rerun that comparison on this preview if you want a before/after.

## To test

On the www preview, replacing `<chunk>` with a real chunk path from the
page source:

- `curl -sI -H 'Referer: https://www.google.com/'
<preview>/dashboard/_vercel/immutable/<chunk>`: 200 with no `set-cookie:
_sb_first_referrer`
- `curl -sI -H 'Referer: https://www.google.com/'
<preview>/dashboard/sign-in`: still has `set-cookie: _sb_first_referrer`
- Load `/dashboard` in a browser and check Studio renders with no failed
chunk or API requests
- `curl -sI -H 'Accept: text/markdown' <preview>/pricing`: markdown
negotiation on www pages is unchanged

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-04 11:31:25 +08:00
Ivan VasilovandClaude Sonnet 5.5 710f4c8bed fix(www): revert Next.js 15 router state header guard in proxy (#52136)
## Problem

#52071 added a guard in the www proxy that rejects Next.js 15 router
state headers, because the docs zone still ran Next.js 15. The docs
upgrade to Next.js 16 (#52045) has merged, so the guard is no longer
needed. Resolves
[FE-4685](https://linear.app/supabase/issue/FE-4685/revert-nextjs-15-router-header-guard-after-pr-52045-merges).

## Solution

Reverts #52071: removes the legacy router state tree check and the
`OTHER_ZONE_PREFIXES` list from `apps/www/proxy.ts`, along with its
tests in `apps/www/proxy.test.ts`.

## Review instructions

1. Confirm the diff matches the inverse of #52071.
2. Run `pnpm --filter=www exec vitest run proxy.test.ts` and see it
pass.

## 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)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 22:42:46 +11:00
Ivan VasilovandClaude Sonnet 5.5 3383f7edbd fix(www): reject Next.js 15 router state headers in proxy (#52071)
## Problem

After upgrading `www` to Next.js 16, Sentry reports `The router state
header was sent but could not be parsed` (WWW-63) on RSC requests such
as `/blog?_rsc=…`. Next 15 clients (the `docs` zone, which is still on
Next 15 and served under `/docs`, plus tabs opened before the deploy)
send a `Next-Router-State-Tree` header whose fifth element is a boolean,
while Next 16 requires a number, so the renderer throws and returns a
500.

## Solution

`proxy.ts` now detects the Next 15-shaped router state header and
returns a cheap `400` (`no-store`) before it reaches the renderer, for
paths www serves itself. Paths rewritten to other zones (`/docs`,
`/dashboard`, `/kb`, …) are exempt, because the docs zone is Next 15 and
its own client navigations must pass through untouched. The Next 15
router falls back to a full page load on any non-RSC response, which is
the same outcome users get today after the 500, minus the error noise
and wasted renders. Unit tests cover the v15 shape, the v16 shape, a
missing header and a malformed header. The proper long-term fix is
upgrading `apps/docs` to Next 16, after which this guard can be removed.

## Review instructions

1. Run `pnpm --filter=www test proxy.test.ts` and confirm the new
`Next.js 15 router state tree` tests pass.
2. After deploy, confirm WWW-63 stops receiving new events.

## 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)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 13:30:08 +02:00
Ivan VasilovandClaude Sonnet 5.5 ced4ff82a4 feat(www): upgrade to Next.js 16 (#52001)
## Problem

The marketing site (`apps/www`) is still on Next.js 15. Resolves
FE-4673.

## Solution

Upgrades `apps/www` to Next.js 16.3.6 (`next` now uses the workspace
catalog; `@next/mdx` and `@next/bundle-analyzer` are bumped to match).
Fixes for breaking changes: `middleware.ts` renamed to `proxy.ts`,
removed the `eslint` key from `next.config.mjs`, moved Sentry options
under `webpack`, and added `images.localPatterns` and
`images.qualities`. `dev` and `build:next` now run with `--webpack`,
because the MDX remark plugins have non-serializable options and
`esmExternals: 'loose'` is ignored by Turbopack.

## Review instructions

1. Run `pnpm --filter=www typecheck` and `pnpm --filter=www test`.
2. Run `pnpm dev:www` and open `/pricing` and `/blog/vector-buckets`;
both should render, including images.
3. Check the Vercel preview build. Locally, `next build` needed
`NODE_OPTIONS=--max-old-space-size=8192`, so confirm memory is
sufficient. `proxy.ts` now runs on the Node.js runtime instead of edge.

## Checklist

Check all before review:

- [ ] 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)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 12:28:35 +02:00