Skip to content

Backport/docs fixes 16.1.5#88916

Merged
icyJoseph merged 11 commits intonext-16-1from
backport/docs-fixes-16.1.5
Jan 23, 2026
Merged

Backport/docs fixes 16.1.5#88916
icyJoseph merged 11 commits intonext-16-1from
backport/docs-fixes-16.1.5

Conversation

@icyJoseph
Copy link
Member

Back porting docs updates into 16-1 (canary now contains changes that shouldn't show in 16.1)

icyJoseph and others added 8 commits January 22, 2026 22:59
In the **When to use Server and Client Components?** section of [Server
and Client
Components](https://nextjs.org/docs/app/getting-started/server-and-client-components)
page, the code block should highlight line 17 `<LikeButton
likes={post.likes} />` to demonstrate that it is passing a prop to the
component.


![](https://github.com/user-attachments/assets/c32ba20b-7a52-4855-807a-ea3930c7032b)

---------

Co-authored-by: Joseph <[email protected]>
Co-authored-by: Joseph <[email protected]>
)

## What

Fixes the CSP documentation "Without Nonces" example to only include
`'unsafe-eval'` in development mode.

## Why

The example was showing `'unsafe-eval'` without a development check,
which would cause it to be shipped to production. This is inconsistent
with the guidance in the "Development vs Production Considerations"
section which correctly shows how to conditionally add `'unsafe-eval'`
only in development.

## How

Added a `isDev` check using `process.env.NODE_ENV === 'development'` and
conditionally includes `'unsafe-eval'` in the `script-src` directive
only when in development mode.
#88429)

## Description

This PR adds dedicated documentation pages for `useSearchParams` and
`useParams` hooks in the Pages Router documentation.

### Changes

- Added
`docs/02-pages/04-api-reference/03-functions/use-search-params.mdx`
- Added `docs/02-pages/04-api-reference/03-functions/use-params.mdx`

### Why

Both `useSearchParams` and `useParams` from `next/navigation` work in
the Pages Router, but this was not well documented. The only mention was
a brief note in the App Router docs and a migration section in the Pages
Router `useRouter` docs.

### What's Documented

For both hooks:
- Basic usage with the fallback UI pattern for handling `null` during
pre-rendering
- Return values and behavior differences from App Router
- Usage with `getServerSideProps` (where params are immediately
available)
- Examples for sharing components between App Router and Pages Router

For `useParams` specifically:
- Comparison with `router.query` (which includes both dynamic params and
query string params)

### Related Test

The existing test at `test/e2e/app-dir/params-hooks-compat` validates
that these hooks work in both routers.
#88326)

## Summary

Fixes #88291

The Pages Router fonts documentation was incorrectly showing App Router
examples (`app/layout.tsx`) which don't exist in Pages Router. This
confused users trying to use fonts with the Pages Router.

## Changes

Updated `docs/01-app/01-getting-started/13-fonts.mdx` to include proper
`<AppOnly>` and `<PagesOnly>` sections:

**For Pages Router users:**
- Added examples using `pages/_app.tsx` (Custom App) to wrap components
with font className
- Added examples using `pages/_document.tsx` (Custom Document) to apply
fonts to the `<html>` element

**For App Router users:**
- Wrapped existing `app/layout.tsx` examples in `<AppOnly>` sections

This follows the same pattern used in other shared documentation like
`docs/01-app/01-getting-started/11-css.mdx` which properly separates App
Router and Pages Router content.
@nextjs-bot nextjs-bot added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. Font (next/font) Related to Next.js Font Optimization. labels Jan 22, 2026
icyJoseph and others added 3 commits January 22, 2026 23:35
Adding CLI docs for next experimental-analyze

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
…lyzer (#87246)

This PR adds instructions on how to run and navigate the new turbopack
bundle analyzer to the existing [Optimizing package bundling guide
](https://nextjs.org/docs/app/guides/package-bundling).
Todo: 
- [x] Embed video
- [x] Add image for import chain

---------

Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <[email protected]>
Co-authored-by: Rich Haines <[email protected]>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
add link to the mcp client configuration details section before the code
block of example

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: timneutkens <[email protected]>
@icyJoseph icyJoseph merged commit 5333625 into next-16-1 Jan 23, 2026
73 checks passed
@icyJoseph icyJoseph deleted the backport/docs-fixes-16.1.5 branch January 23, 2026 08:40
@github-actions github-actions bot added the locked label Feb 6, 2026
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. Font (next/font) Related to Next.js Font Optimization. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants