Skip to content
Closed
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
2 changes: 2 additions & 0 deletions cspell-allow-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ behaviour
behaviours
beyang
bgwriter
bingbot
binutils
bitbucketcloud
bitbucketserver
Expand Down Expand Up @@ -412,6 +413,7 @@ pooler
PREEMPTIBLE
preg
premade
prerender
Príncipe
privkey
projectname
Expand Down
46 changes: 46 additions & 0 deletions dev/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# TODO

Vercel project `sourcegraph-docs`. One PR per task; delete a task when
its PR merges.

## 1. Node 20 build image is deprecated (separate thread)

Node 20.x deployments fail after 2026-10-01. `contentlayer` 0.3.4 emits
`assert { type: 'json' }`, which Node ≥ 22 rejects. Migrate to
`contentlayer2` / `next-contentlayer2` ≥ 0.5.0, then set Node 22 in
`.tool-versions` and `package.json#engines`.

## 2. 24 MB shared JS chunk on every page

`src/components/Toc.tsx` and `src/components/ContentTabs.jsx` are
`'use client'` and import `allPosts`, so every post's raw and compiled
body ships in one client chunk (`7180-*.js`: 24.4 MB raw, 2.78 MB gzip,
re-downloaded after every deploy). Fix: resolve the post on the server
in `src/app/[...slug]/page.tsx` and pass only what each component needs
as props (`Toc`: the post `_id`; `ContentTabs`: the rendered fallback
tab), then drop the `allPosts` imports.

## 5. Runtime

- Skip builds for non-site changes: #1901.
- Prerender `/api/md/[...slug]`, enable Fluid compute: #1912 (stacked on

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prerender is not in the dictionary.

Did you mean prepender?

Suggested change
- Prerender `/api/md/[...slug]`, enable Fluid compute: #1912 (stacked on
- prepender `/api/md/[...slug]`, enable Fluid compute: #1912 (stacked on

Please correct the spelling, or add the word to cspell-allow-list.txt if it is correct.

#1901; retarget to `main` after it merges).
- Static redirects out of middleware: draft #1907 (rebase on `main` now
that #1908 merged).

## 6. Build

- Lint warnings and stale `caniuse-lite`: draft #1909.

## 7. Doubled base path 404s and wrong canonical

`sourcegraph.com/docs/docs/_next/...` 404s are bingbot following the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bingbot is not in the dictionary.

Did you mean bigot?

Suggested change
`sourcegraph.com/docs/docs/_next/...` 404s are bingbot following the
`sourcegraph.com/docs/docs/_next/...` 404s are bigot following the

Please correct the spelling, or add the word to cspell-allow-list.txt if it is correct.

Cloudflare **302** from `docs.sourcegraph.com/<page>` and resolving the
page's `/docs/_next/...` asset URLs against the old host.

- Cloudflare: make the `docs.sourcegraph.com` redirect a 301, and
redirect `docs.sourcegraph.com/docs/*` to `sourcegraph.com/docs/$1`
without doubling the prefix.
- Repo: every page emits `<link rel="canonical" href="https://sourcegraph.com/docs">`
(`src/app/layout.tsx` `alternates.canonical: '/docs'`). Set a per-page
canonical in `src/app/[...slug]/page.tsx#generateMetadata`.