Skip to content

feat(platform): Move docs to next 16#16261

Open
chargome wants to merge 6 commits intomasterfrom
cg-next16-pls
Open

feat(platform): Move docs to next 16#16261
chargome wants to merge 6 commits intomasterfrom
cg-next16-pls

Conversation

@chargome
Copy link
Member

@chargome chargome commented Feb 4, 2026

  • Update next and eslint-config-next to ^16.1.6
  • Migrate middleware to proxy (renamed src/middleware.ts to src/proxy.ts per Next.js 16 convention)
  • Migrate ESLint to flat config format (eslint.config.mjs)
  • Add --webpack flag to dev/build scripts (We'll cover Turbopack at a later point)
  • Move src/pages/ to root pages/ (Next.js 16 requires app and pages at same level)
  • Add images.localPatterns config for query string support on local images
  • Fix component type errors for React 19 / Next.js 16 compatibility

@chargome chargome self-assigned this Feb 4, 2026
@vercel
Copy link

vercel bot commented Feb 4, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 18, 2026 0:53am
sentry-docs Error Error Feb 18, 2026 0:53am

Request Review

"start:dev": "NODE_ENV=development yarn build && yarn start",
"start": "next start",
"lint": "next lint",
"lint": "eslint \"{src,app,scripts}/**/*.{ts,tsx,js,jsx}\"",
Copy link

Choose a reason for hiding this comment

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

Lint commands exclude new pages/ directory

Medium Severity

The PR description says pages were moved to root pages/ directory for Next.js 16 compatibility, but the lint commands were changed from next lint (which auto-discovers directories) to explicit eslint "{src,app,scripts}/**/*" patterns. This means pages/_error.jsx and any future files in pages/ are now excluded from ESLint and Prettier checks.

Additional Locations (1)

Fix in Cursor Fix in Web

Comment on lines 951 to 957
},
{
from: '/platforms/android/manual-configuration/',
to: '/platforms/android/manual-setup/',
},
{
from: '/platforms/android/configuration/manual-init/',
to: '/platforms/android/manual-setup/',
to: '/platforms/android/configuration/manual-init/',
},
{
from: '/platforms/android/advanced-usage/',
Copy link

Choose a reason for hiding this comment

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

Bug: The redirect for /platforms/android/manual-configuration/ points to a non-existent page, /platforms/android/configuration/manual-init/, which will cause a 404 error.
Severity: MEDIUM

Suggested Fix

Update the redirect rule in src/proxy.ts. The to field for the path /platforms/android/manual-configuration/ should be changed from /platforms/android/configuration/manual-init/ to the correct, existing path /platforms/android/manual-setup/.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/proxy.ts#L951-L957

Potential issue: A redirect rule for the old documentation path
`/platforms/android/manual-configuration/` was updated to point to
`/platforms/android/configuration/manual-init/`. However, the target page at this new
path does not exist in the codebase. This change will cause users who navigate using the
old URL to encounter a 404 error instead of being redirected to the correct
documentation page, which is located at `/platforms/android/manual-setup/`.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

deviceType: ua.device.type || 'desktop',
isBot: false,
};
return patterns.some(pattern => pattern.test(userAgent));
Copy link

Choose a reason for hiding this comment

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

Proxy AI patterns diverge from shared constant

Medium Severity

The isAIOrDevTool function replaced the shared AI_AGENT_PATTERN import with hardcoded inline patterns that are missing gptbot, codex, perplexity, cohere, and gemini. These AI tools will now receive HTML instead of markdown. The shared AI_AGENT_PATTERN in trafficClassification.ts is still used by tracesSampler, creating an inconsistency where these tools get 100% trace sampling but no markdown content.

Fix in Cursor Fix in Web

/vscode/i, // VS Code extensions
/intellij/i, // IntelliJ plugins
/sublime/i, // Sublime Text plugins
/got/i, // Got HTTP library (sindresorhus/got)
Copy link

Choose a reason for hiding this comment

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

Overly broad /got/i user agent regex pattern

Low Severity

The /got/i regex matches any user agent containing the three-letter substring "got" (case-insensitive), which is overly broad. Additionally, the got HTTP library is a general-purpose HTTP client, not specifically an AI or dev tool — any server-side application using got to fetch documentation would incorrectly receive markdown instead of HTML. A more specific pattern like /^got\//i would target the actual library's user agent format.

Fix in Cursor Fix in Web


// This function can be marked `async` if using `await` inside
export function middleware(request: NextRequest) {
export function proxy(request: NextRequest) {
Copy link

Choose a reason for hiding this comment

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

Rename to proxy breaks redirect validation CI script

Medium Severity

The rename from src/middleware.ts to src/proxy.ts broke scripts/check-redirects-on-rename.ts, which still hardcodes src/middleware.ts in 7 places (file path, git diff check, git show). The parseMiddlewareTs function gracefully returns empty arrays when the file doesn't exist, so the CI redirect validation silently skips all redirects in the proxy file. The error message in scripts/no-vercel-json-redirects.mjs was updated to reference proxy.ts, but the functional check-redirects script was missed.

Additional Locations (1)

Fix in Cursor Fix in Web

@chargome
Copy link
Member Author

Leaving this here for posterity:

The [[...path]] route statically generates ~9,400 pages via generateStaticParams. In the Vercel build output, this produces 37,780 files (HTML fallbacks, RSC payloads, prerender configs) totaling 3.8GB. The deployment payload to Vercel's API exceeds its 75MB
   limit.

  This likely worked on Next.js 15 because the Vercel adapter produced a different (smaller) output format. Next.js 16's output structure creates more per-route artifacts.

  Size Breakdown

  - 9,439 HTML fallbacks: 2.4GB
  - 9,439 RSC fallbacks: 1.3GB
  - 18,896 JSON configs: 20MB
  - 4 .func bundles: ~3MB

  Solutions

  The main options are:

  Option 1: Switch to ISR (Incremental Static Regeneration)

  Change app/[[...path]]/page.tsx from full SSG to ISR - prerender a subset at build time, generate the rest on-demand:

  // Instead of:
  export const dynamicParams = false;
  export const dynamic = 'force-static';

  // Use:
  export const dynamicParams = true;
  export const revalidate = 300; // regenerate every 5 min

  And optionally limit generateStaticParams to only the most important pages (home, top-level sections).

  Option 2: Only prerender top-level pages

  Keep force-static but reduce what gets prerendered:

  export async function generateStaticParams() {
    const docs = await getDocsFrontMatter();
    // Only prerender top-level paths (depth ≤ 2), rest on-demand
    const paths = docs
      .filter(doc => doc.slug.split('/').length <= 2)
      .map(doc => ({ path: doc.slug.split('/') }));
    paths.push({ path: undefined });
    return paths;
  }
  export const dynamicParams = true; // allow unlisted paths



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.

1 participant

Comments