Skip to content

feat(docs): favor turbopack - #53787

Merged
antlio merged 3 commits into
masterfrom
antlio/feat-docs-turbopack
Nov 24, 2026
Merged

antlio merged 3 commits into
masterfrom
antlio/feat-docs-turbopack

Conversation

@antlio

@antlio antlio commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Problem

  • docs dev server runs on webpack making a css or tailwind edit takes 6 to 9 seconds to show in the browser
  • next 16 uses turbopack by default but the dev and build scripts in apps/docs still pass --webpack

Solution

  • changes the dev script to turbopack + keeps build on webpack
  • adds turbopack rules for .include and yaml imports because next-plugin-yaml only changes the webpack config
  • changes the mdx plugins to module names because turbopack loader options must be serializable
  • changes the spec dynamic imports to a static prefix and suffix because turbopack ignores webpackInclude

Review instructions

  1. run pnpm install and pnpm dev:docs
  2. open http://localhost:3001/docs/guides/getting-started
  3. add a css change for instance in apps/docs/styles/globals.css
  4. open http://localhost:3001/docs/guides/local-development/cli/config and make sure that the config sections from the yaml spec show
  5. open http://localhost:3001/docs/reference/cli/introduction and make sure that the sidebar shows the cli sections
  6. open /docs/reference/cli/introduction on the preview and make sure that the webpack build shows the same sidebar

Checklist

Check all before review:

  • I have read 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

@antlio antlio self-assigned this Nov 21, 2026
@antlio
antlio requested a review from a team as a code owner November 21, 2026 13:11
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview, v0 Nov 21, 2026 1:11pm UTC
7 Skipped Deployments
Project Deployment Actions Updated
studio Ignored Ignored Nov 21, 2026 1:11pm UTC
design-system Skipped Skipped Nov 21, 2026 1:11pm UTC
kb Skipped Skipped Nov 21, 2026 1:11pm UTC
studio-self-hosted Skipped Skipped Nov 21, 2026 1:11pm UTC
studio-staging Skipped Skipped Nov 21, 2026 1:11pm UTC
ui-library Skipped Skipped Nov 21, 2026 1:11pm UTC
zone-www-dot-com Skipped Skipped v0 Nov 21, 2026 1:11pm UTC

Request Review

@supabase

supabase Bot commented Nov 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 21, 2026
@antlio antlio changed the title Antlio/feat docs turbopack feat(docs): favor turbopack Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The docs app updates its MDX and Turbopack loader configuration, narrows navigation spec imports to defined filename patterns, and removes --webpack from its development command.

Changes: Docs app configuration

Layer / File(s) Summary
Development and loader configuration
apps/docs/package.json, apps/docs/next.config.mjs
The development command drops --webpack. The Next.js config uses MDX plugin module names and adds Turbopack rules for .include and YAML files.
Navigation spec import patterns
apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts
useCommonSections builds its import path from filenames matching common-<name>.json. useSpec builds its import path from filenames matching supabase_<name>.yml.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: ivasilov, kodster28, jeremenichelli

Merge Risk: Minimal · up to 5ce51

The change switches docs development to Turbopack while retaining Webpack production builds. No merge-blocking issue was identified; the requested local development and preview checks remain unverified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description covers the Problem and Solution sections, and it includes review instructions. It explains why the change is needed (webpack dev server slowness, Next 16 defaults) and what changed (de…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title "feat(docs): favor turbopack" matches the main change. The PR runs the docs development server on Turbopack, adds Turbopack rules for .include and YAML imports, and narrows spec dynamic impo…
Full details: Description check

Explanation

The description covers the Problem and Solution sections, and it includes review instructions. It explains why the change is needed (webpack dev server slowness, Next 16 defaults) and what changed (dev script, turbopack rules, MDX plugin names, spec import prefix/suffix). The Preview links section was left as the template comment, which is optional. The docs style-guide checkbox is unchecked, and no linked issue is provided. These gaps are non-critical.

Full details: Title check

Explanation

The title "feat(docs): favor turbopack" matches the main change. The PR runs the docs development server on Turbopack, adds Turbopack rules for .include and YAML imports, and narrows spec dynamic imports for Turbopack. The title names the primary intent. It does not mention the production build stays on Webpack, but that detail is secondary and not required.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4ead4b0 and 5ce51f6.

Files selected for processing: 3

  • apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts
  • apps/docs/next.config.mjs
  • apps/docs/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@antlio
antlio merged commit 6697bd8 into master Nov 24, 2026
46 of 47 checks passed
@antlio
antlio deleted the antlio/feat-docs-turbopack branch November 24, 2026 07:43
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1795506394)

Score Average Improvements Regressions
Completeness 93.6% (+3pp) 8 🟢 3 🔴
Conciseness 62.2% (-4pp) 12 🟢 25 🔴
Correctness 76.3% (0pp) 10 🟢 11 🔴
Docs Faithfulness 49.5% (-4pp) 4 🟢 5 🔴
Goal Completion 78.6% (+2pp) 14 🟢 7 🔴
Knowledge Usage 97.6% (-2pp) - 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 95% (+0pp) 1 🟢 1 🔴
Tool Usage 88.9% (+0pp) 3 🟢 2 🔴
URL Validity 100% (+0pp) - -
Time_to_first_token 2.04tok (+0.03tok) 34 🟢 44 🔴
Llm_calls 10.45 (+0.29) 31 🟢 19 🔴
Tool_calls 3.38 (+0.14) 34 🟢 21 🔴
Errors 0.01 (0) 1 🟢 -
Llm_errors 0 (+0) - -
Tool_errors 0.01 (0) 1 🟢 -
Prompt_tokens 69692.32tok (+5762.31tok) 28 🟢 45 🔴
Prompt_audio_tokens 0tok (+0tok) - -
Prompt_cached_tokens 51106.72tok (+5728.79tok) 48 🟢 28 🔴
Prompt_cache_creation_tokens 18567.01tok (+32.62tok) 39 🟢 39 🔴
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 1538.16tok (+126.56tok) 30 🟢 47 🔴
Completion_reasoning_tokens 455.18tok (+44.41tok) 31 🟢 44 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 71230.48tok (+5888.86tok) 32 🟢 45 🔴
Estimated_cost 0$ (+0$) 26 🟢 38 🔴
Duration 10.6s (+0.92s) 24 🟢 54 🔴
Llm_duration 19.94s (+1.78s) 26 🟢 52 🔴

nrichers added a commit that referenced this pull request Nov 26, 2026
## I have read the CONTRIBUTING.md file.

YES

## What kind of change does this PR introduce?

**Skill fix + drift check.** This PR fixes stale facts in the
`ask-the-docs` skill after the Next.js 16 upgrade and the AI layout
work. It also gives the skill a cheap way to notice its own drift: each
checked reference file records the commit it was verified at, and the
agent runs one `git log` against that commit before it answers.
Follow-up to #54082.

## What is the current behavior?

- `app-map.md` says the docs app is Next.js 15. It is Next.js 16
(#52045).
- `app-map.md` and `llm-agent-surface.md` point to
`apps/docs/middleware.ts` and `apps/www/middleware.ts`. Both files are
now `proxy.ts` (#52045).
- The skill doesn't say that dev uses Turbopack while the build uses
webpack (#53787), so a loader change can work in dev and fail in the
build.
- The skill doesn't mention layout v2 (#52971 to #52976) or
`apps/docs/style-guide/`.
- No reference file records when it was last checked, so an agent can't
tell an old fact from a new one.

## What is the new behavior?

| File | Change |
| --- | --- |
| `SKILL.md` | New step 1, **Check for drift**: run `git log <Verified
at>..HEAD` for each reference file the answer uses. A file with no stamp
is unverified. New rule: list stale facts under **Skill corrections**
and, with the user's approval, fix them in the user's open PR if it
changes `apps/docs`, else in a new PR. |
| `reference/app-map.md` | Next.js version removed, `proxy.ts`, a
`style-guide/` row, and a short **Layout v2** section (variant, flag,
override, shell files). |
| `reference/llm-agent-surface.md` | Each `middleware.ts` is now
`proxy.ts` (docs and www), including the Mermaid node. A stale line
range is removed. |
| `reference/build-pipeline.md` | Dev uses Turbopack, the build uses
`--webpack`, and a loader change must work in both. |

Only these 3 reference files get a `Verified at: 3089aa3
(2026-11-25).` line, because they are the only ones checked claim by
claim. The other 11 files get a stamp when someone checks them.

## Additional context

- **Proof:** none needed. This PR changes skill reference files only,
with no rendered output.
- **Verification:** each changed fact was checked against the code at
this branch's base.

| Fact | Evidence |
| --- | --- |
| Next.js 16 | `pnpm-workspace.yaml` catalog: `next: ^16.4.3` |
| `proxy.ts` | `apps/docs/proxy.ts` and `apps/www/proxy.ts` exist,
`middleware.ts` doesn't |
| Turbopack in dev, webpack in build | `apps/docs/package.json` `build`:
`next build --webpack`; `next.config.mjs` has `webpack` and `turbopack`
blocks |
| `layout-v2:` variant | `apps/docs/styles/globals.css:25` |
| Flag and override | `apps/docs/features/IaNav/constants.ts`
(`docs-ia-mvp-v1`, `option-1`, URL override) |

- `app-map.md` still lists `content/troubleshooting/` on `master`.
#54082 removes it, so this PR leaves those lines alone. The two PRs
touch different lines and can merge in either order.

### Test plan

- [ ] Each fact in the table above matches the code
- [ ] Ask the skill a question about `apps/docs/proxy.ts` and confirm it
runs the drift check first
- [ ] `grep -rn "middleware.ts" .agents/skills/ask-the-docs` returns
nothing

---------

Co-authored-by: Nik Richers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants