Skip to content

Several docs cleanups - #1430

Merged
eseliger merged 8 commits into
mainfrom
es/cleanup-docs
Nov 24, 2025
Merged

Several docs cleanups#1430
eseliger merged 8 commits into
mainfrom
es/cleanup-docs

Conversation

@eseliger

Copy link
Copy Markdown
Member

See individual commits

@vercel

vercel Bot commented Nov 16, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sourcegraph-docs Ready Ready Preview Comment Nov 24, 2025 8:44pm

@ErikaRS

ErikaRS commented Nov 16, 2025

Copy link
Copy Markdown

Yo. (I have nothing real to add, but I was still getting notifications for all of our public repos—now on my personal email! Now I'm not, but consider this one last goodbye from the beyond.)

@eseliger

Copy link
Copy Markdown
Member Author

always feel free to lurk or leave a meme :) hi from the bay area!

@eseliger
eseliger marked this pull request as ready for review November 16, 2025 01:24
@eseliger
eseliger enabled auto-merge (squash) November 16, 2025 01:24
@eseliger
eseliger merged commit 7a81737 into main Nov 24, 2025
2 of 3 checks passed
@eseliger
eseliger deleted the es/cleanup-docs branch November 24, 2025 20:42
marcleblanc2 added a commit that referenced this pull request Sep 7, 2026
Follow-up to 7a81737 (#1430), which deleted the commented-out
next.config.js redirects() block. Since 578a3ae (#880) redirects are
served by src/middleware.ts, which only reads source and destination
and always responds 307, so permanent has been unused for ~19 months.
Five entries had it misspelled as permanant, which nothing caught
because nothing reads it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a07558-075c-743f-b255-c080ca6b5cc7
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit that referenced this pull request Sep 7, 2026
Follow-up to 7a81737 (#1430), which deleted the commented-out
`redirects()` block from `next.config.js`.

## Why

`permanent` on redirect entries has been dead data since 578a3ae (#880,
Jan 2025) moved redirects into `src/middleware.ts`. The middleware only
reads `source` and `destination`, and calls `NextResponse.redirect()`
with no status, so every redirect is a 307 regardless of the field:

```ts
const redirect = updatedRedirectsData.find((r: any) => r.source === pathWithoutBase);
if (redirect) {
    return NextResponse.redirect(createRedirectUrl(request, redirect.destination, path));
}
```

The field was only functional while Next's built-in `redirects()`
consumed the list (cfeed16, Dec 2023 → 578a3ae, Jan 2025). Nothing has
read it since, which is why five entries added in #1620 with the key
misspelled as `permanant` went unnoticed.

## What

- Remove `permanent` / `permanant` from all 1325 entries in
`src/data/redirects.ts`
- Remove the `permanent: redirect.permanent` pass-through in
`updatedRedirectsData`
- No behaviour change: matching and destinations are untouched

## Verification

- `rg -o "^\t\t\w+:" src/data/redirects.ts | sort | uniq -c` → 1325
`source`, 1325 `destination`, nothing else
- `npx tsc --noEmit` reports no errors in `redirects.ts` or
`middleware.ts` (the remaining errors are the pre-existing missing
`contentlayer/generated` build output)
- `prettier --check` on `redirects.ts` fails the same way it does on
`main` (line-join nits at exactly 80 chars); left as-is to avoid
unrelated churn

If we ever want 308s back, the fix is in `middleware.ts` (pass a status
to `NextResponse.redirect`), and at that point the key can be
reintroduced with the entries that actually need it.

Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants