Commit Graph
618 Commits
Author SHA1 Message Date
Delba de OliveiraGitHubJosephgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2e2ee08b60 Docs IA 2.0: Delete routing section, add BFF guide, polish getting started (#80365)
Closes:
https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section
Redirects: https://github.com/vercel/front/pull/47151

---------

Co-authored-by: Joseph <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-16 13:42:20 +01:00
Delba de OliveiraandGitHub bbaa164737 Docs IA 2.0: Move examples to middleware.js API reference (#80363)
Part of:
https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section
2025-06-10 08:00:17 -05:00
Delba de OliveiraGitHubgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>Joseph
24434f18db Docs: Add Data Security Guide (#80249)
Closes: https://linear.app/vercel/issue/DOC-4678/guide-data-security

Please merge this PR first: https://github.com/vercel/next.js/pull/80242

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <[email protected]>
2025-06-10 06:52:38 -05:00
Josh StoryandGitHub 035a12ea8e [dynamicIO] Document client component remediations for sync IO (#79787)
When you use sync IO in the client in a way that needs to be fixed we
currently still just provide you with the explanation for server
components. The fixes when sync IO happens in the client are not the
same as when they happen in a server component so this update adds
client specific documentation for these situations.

Namely, the key difference is that on the server you can add caching
through "use cache" and this is not available to you in the client. sync
IO in general is (going to be) allowed in client components broadly as
long as Next.js has a fallback UI to prerender. This means that "fixing"
sync IO access in the client will usually be solved by wrapping in a
Suspense boundary. The alternative is to move the sync IO out of render
or move it to the server where it can be cached.
2025-06-03 16:44:51 -07:00
Delba de OliveiraandGitHub fffb2eb6fb Docs IA 2.0: Delete Error Handling page (#79495)
The content has already been migrated to
https://nextjs.org/docs/app/getting-started/error-handling.

Closes:
https://linear.app/vercel/issue/DOC-4700/bya-delete-error-handling-page
Redirects: https://github.com/vercel/front/pull/46127
2025-05-27 14:58:40 +00:00
Delba de OliveiraandGitHub 8b7f937e36 Docs IA 2.0: Add Caching and Revalidating page (#79493)
Closes:
https://linear.app/vercel/issue/DOC-3700/getting-started-caching-and-revalidating-page
Redirects: https://github.com/vercel/front/pull/46120
2025-05-27 13:35:36 +01:00
Delba de OliveiraandGitHub f87fee7b28 Docs IA 2.0: Update template.js API reference (#79490)
Merge template.js information from BYA and update API reference to
follow the convention.

Please merge this PR first: https://github.com/vercel/next.js/pull/79453
Closes:
https://linear.app/vercel/issue/DOC-4696/routing-section-layouts-and-templates
2025-05-27 10:30:17 +01:00
f18b756cde Docs IA 2.0: Add examples to layout.js (#79453)
In the **layout.js** API reference, we talk about the limitations of
layouts but don't provide alternative examples. This simplifies the
wording, and adds examples using the recommended APIs.

Also adds more general `layout.js` examples.

Part of:
https://linear.app/vercel/issue/DOC-4696/routing-section-layouts-and-templates

Follow up: Look into template.js

---------

Co-authored-by: Joseph <[email protected]>
2025-05-27 10:02:17 +01:00
Delba de OliveiraandGitHub 72f5429fe0 Docs IA 2.0: Add i18n guides (#79391)
Closes:
https://linear.app/vercel/issue/DOC-4682/guide-internationalization-i18n
Redirects: https://github.com/vercel/front/pull/45963
2025-05-21 15:43:02 +01:00
Jiwon ChoiandGitHub 6258af666b docs: add missing links and imports to cacheLife and cacheTag for prerender-missing-suspense error (#79247)
One of the important resources for this message is `cacheLife` and
`cacheTag`, but the links were missing, and the snippet omitted imports,
which newcomers won't know how to import unless looking up.
2025-05-15 21:28:50 +02:00
Delba de OliveiraandGitHub 9c757f6d5c Docs IA 2.0: Server and Client Components (#79143)
Closes: 
- https://linear.app/vercel/issue/DOC-4655/client-components
- https://linear.app/vercel/issue/DOC-4656/server-components
- https://linear.app/vercel/issue/DOC-4657/composition-patterns

Redirects: https://github.com/vercel/front/pull/45564

This PR:

- Adds new **Server and Client Components** page to **Getting Started**
   - Explains how Server and Client components are rendered 
   - Clarifies when to use them
   - Reviews and simplifies composition patterns (examples)
- Improves the **How does PPR work** section in light of static,
dynamic, and streaming.
2025-05-15 14:26:19 +01:00
04a19c1260 docs: Move Edge Runtime information to API reference (#79152)
Closes: https://linear.app/vercel/issue/DOC-4658/edge-runtime
Redirects: https://github.com/vercel/front/pull/45645

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-05-14 12:35:09 +00:00
f3ad435ff3 docs: Merge CSS pages (#78996)
Closes: https://linear.app/vercel/issue/DOC-4648/css
Redirects: https://github.com/vercel/front/pull/45417

- Improves the CSS content for clarity and brevity. 
- Adds Pages Router examples.

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-05-12 08:32:57 -05:00
3bf570d84d Docs IA 2.0: Images (#78769)
Closes:
- https://linear.app/vercel/issue/DOC-4626/images
- https://linear.app/vercel/issue/DOC-4610/split-image-and-font-pages

Redirects: https://github.com/vercel/next.js/pull/78769

**Housekeeping:** 
- Deletes BYA images page
- Creates relevant getting started docs in `/pages`
- Splits "Images and Fonts" into "Images" and "Fonts" pages to allow us
to add more context to each page in the future

**API reference**: 
- Improves image API reference to follow more of a consistent format and
language
- Adds examples

**Follow-up:** https://github.com/vercel/next.js/pull/78857
- Create a Deep Dive Guide on how image optimization works

---------

Co-authored-by: Rich Haines <[email protected]>
2025-05-08 13:11:38 +01:00
Delba de OliveiraandGitHub 6e3af1b0fe Docs IA 2.0: Fonts (#78899)
Closes: https://linear.app/vercel/issue/DOC-4641/fonts
Redirects: https://github.com/vercel/front/pull/45242
2025-05-07 10:09:12 +01:00
Josh StoryandGitHub f0f0e4bf5a [dynamicIO] Disallow only dynamic metadata (#78576)
stacked on #78575 

When I changed the dynamic validation rules to be based on the existence
of a static shell I removed an important protection for apps that have
static metadata. Now that metadata is implicitly rendered within a
Suspense boundary it is always opted into allowing dynamic. For dynamic
and partially static pages this is fine because we are going to be
generating a response per request anyways. But if you have a fully
static page and then later accidentally make your metadata dynamic your
page will deopt to partially static without any warning.

This change reintroduces the heuristic where if the only dynamic thing
on the page is metadata the build errors. If there is at least one other
dynamic thing on the page then dynamic metadata is allowed.

A similar change is not necessary for viewport because that is never
rendered in a Suspense boundary and the only way to have dynamic
viewports is to opt the entire app into dynamic with a Suspense boundary
around your root layout
2025-04-27 14:34:36 -07:00
Delba de OliveiraandGitHub 354b255d91 docs: Move Sass and CSS-in-JS pages to guides (#78536) 2025-04-25 08:16:35 -05:00
Delba de OliveiraandGitHub 93a9e97c71 Docs IA 2.0: Create public folder API reference (#78531)
Closes: https://linear.app/vercel/issue/DOC-4604/public-folder

- Renames "Static Assets" page to "Public Folder" and moves it to the
file-system conventions section.

Redirects: https://github.com/vercel/front/pull/44623
2025-04-25 08:08:57 +01:00
Delba de OliveiraandGitHub 76ade73def docs: Move optimizing pages to guides (#78500) 2025-04-24 13:40:54 -05:00
Delba de OliveiraandGitHub 7a64ada1ab docs: Move pages from Config section into guides (#78496) 2025-04-24 07:28:50 -05:00
fd438787f3 misc: use correct capitals for React terms (#78445)
- `Client/Server Component`
- `React Hooks`

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
2025-04-23 21:50:55 +09:00
Delba de OliveiraandGitHub 74d999e06d docs: Move CI build caching page under guides, and create equivalent /app guide (#78416)
Closes: https://linear.app/vercel/issue/DOC-4577/ci-build-caching
Redirects: https://github.com/vercel/next.js/pull/78416
2025-04-22 10:18:39 -05:00
d5359765dd docs: Move Static Exports to guides, create Self-hosting guide (#78244)
Closes: 

- https://linear.app/vercel/issue/DOC-4550/static-exports
- https://linear.app/vercel/issue/DOC-4551/self-hosting

Redirects: https://github.com/vercel/front/pull/44237

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-04-22 08:44:58 -05:00
Delba de OliveiraandGitHub bd0da32a68 Docs IA 2.0: Move migration docs under Guides (#78193)
Closes: https://linear.app/vercel/issue/DOC-4540/migration-guides

Redirects: https://github.com/vercel/front/pull/44177

Please merge this one first:
https://github.com/vercel/next.js/pull/78189
2025-04-15 15:39:01 +00:00
Delba de OliveiraandGitHub ae1cad07dd Docs IA 2.0: Move version upgrade docs under Guides (#78189)
Closes: https://linear.app/vercel/issue/DOC-4539/version-upgrade-guides

Redirects: https://github.com/vercel/front/pull/44175

Move version upgrade guides under `Guides`. Also creates a guides
section under the Pages docs.
2025-04-15 16:00:54 +01:00
Josh StoryandGitHub c24c4ac3f5 [dynamicIO] Model invalid dynamic on empty shells (#77270)
Dynamic is disallowed unless a Suspense boundary is above it. This now
applies to metadaata (though this shouldn't matter because it now
streams) and viewport. To allow for fully dynamic routes including
viewport you must put a Suspense boundary around your root layout.
2025-04-14 13:45:14 +02:00
StevenandGitHub c010ecb237 Revert "docs: revert image 15.3 change until live" (#77977)
Reverts vercel/next.js#77941
2025-04-09 08:32:36 -07:00
Jiwon ChoiandGitHub b9620e6b1f docs: improve file tree (#77889)
The file tree can be improved and share the same convention:

- Use the `txt` file extension.
- One tab indented.
- Use file tree with root `.` and trailing slash for folders.

x-ref: https://tree.nathanfriend.io
2025-04-09 12:53:44 +02:00
Lee RobinsonandGitHub 27bb7066dc docs: revert image 15.3 change until live (#77941) 2025-04-08 12:54:25 -05:00
StevenandGitHub c9e238edf9 feat(next/image): support new URL() for images.remotePatterns (#77692)
Configuring `remotePatterns` can be a hassle because you have to define
each of the parts. And if you forget a part, its a wildcard meaning it
will match anything. This is usually not desirable since most remote
images don't allow query strings.

This PR adds support for using an array of `URL` objects when defining
`images.remotePatterns`.

```js
module.exports = {
  images: {
    remotePatterns: [
      new URL('https://res.cloudinary.com/my-account/**'),
      new URL('https://s3.my-account.*.amazonaws.com/**'),
    ],
  },
}
```

Note that wildcards must be explicit and anything missing is assumed to
no longer match.
2025-04-02 19:13:57 -04:00
Sam KoandGitHub 8dd0b56fb6 docs(errors): update suppressHydrationWarning section (#76521)
## Why?

We should clarify that React will **not** attempt to patch mismatched text content when using `suppressHydrationWarning`.

- Related: https://github.com/reactjs/react.dev/pull/7651
- x-ref: https://github.com/vercel/next.js/discussions/75890
2025-02-26 12:11:59 -08:00
Sam KoandGitHub d55c00d842 docs(errors): minor update to failed-to-find-server-action error page (#76296)
## Why?

Follow up to https://github.com/vercel/next.js/pull/75678#discussion_r1964355401.
2025-02-20 13:57:36 -08:00
Sam KoandGitHub beb1f72e6d docs(errors): add failed-to-find-server-action error page (#75678)
## Why?

We should also have an error page when somebody gets this error → https://github.com/vercel/next.js/blob/d70cac3eb4dee1d1361629d1b4c765365f184e26/packages/next/src/server/app-render/action-handler.ts#L1086.
2025-02-20 12:31:59 -08:00
Maxim EvtushandGitHub 173a461ef7 fix: typos in documentation files (#75816) 2025-02-11 21:04:37 -06:00
JJ KasperandGitHub 2e114e44c5 Fix linting between lint-check and lint-staged (#74503) 2025-01-03 23:17:14 +00:00
StevenandGitHub d70595e5b6 feat(next/image): add support for images.qualities in next.config (#74257)
This PR adds support for `images.qualities` configuration which is an
allowlist of qualities that can be used with the quality prop on the
Image component.

- Depends on https://github.com/vercel/vercel/pull/12792
2025-01-03 20:43:29 +00:00
StevenandGitHub 2a25cbdd99 chore(docs): add missing search: '' on remotePatterns (#73925)
We typically add `search: ''` on `remotePatterns` to disallow the query
string, which is the most common case.

There were a few missing places in the docs so this PR fills in those
gaps.
2024-12-13 17:05:47 -05:00
26e8b765ae Docs clean up: Merge and delete content from routing/index.mdx (#73859)
Please merge this PR first: https://github.com/vercel/next.js/pull/73858

Closes: https://linear.app/vercel/issue/DOC-4049/delete-routingindexmdx

The content for this page has already been moved to the `Getting
Started` section or `API Reference`.

---------

Co-authored-by: Rich Haines <[email protected]>
2024-12-13 13:16:26 +00:00
Hendrik LiebauandGitHub 7db3bf73cb Fix unstable_allowDynamic when used with pnpm (#73732)
When using dependencies in Middleware that make use of dynamic code evaluation, Next.js emits a build error because this is not supported in the Edge runtime.

In rare cases, when the code can not be reached at runtime and can't be removed by tree-shaking, users might opt in to using the `unstable_allowDynamic` config.

When combined with pnpm, the provided glob patterns as documented at https://nextjs.org/docs/messages/edge-dynamic-code-evaluation#possible-ways-to-fix-it did not match correctly because of pnpm's use of the `.pnpm` directory.

To fix the pattern matching, we need to provide the `dot` option to [picomatch](https://github.com/micromatch/picomatch), which enables dotfile matching.

_Side note: Ideally we would detect dynamic code evaluation after tree shaking, to reduce the number of cases where users need to revert to using `unstable_allowDynamic`._

fixes #51401
2024-12-10 22:14:40 +01:00
13880d37d2 docs(typo): fix typos in file conventions, functions, and errors (#73376)
`occured` -> `occurred`
`compatability` -> `compatibility`

Co-authored-by: Delba de Oliveira <[email protected]>
2024-12-03 14:01:38 +00:00
LioRaelandGitHub f8fddfa1dd docs: add await before headers() and cookies() calls (#73315) 2024-11-28 15:19:47 +01:00
2a4bdbd4ab docs: fix code block language (#72839)
## Summary
Change `jsx` to `diff` in
[next-dynamic-api-wrong-context](https://github.com/vercel/next.js/blob/canary/errors/next-dynamic-api-wrong-context.mdx)
error page.

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 09:58:44 +00:00
6f4352993d docs: add and unify notes to error pages (#72838)
## Description
Unify the note format according to the [contribution
guide](https://nextjs.org/docs/community/contribution-guide#notes).
In addition, add missing bullet points to useful links.

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

---------

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 09:44:42 +00:00
f5ead56cb4 docs: add the section titles to error page (#72942)
## Summary
Add the paragraph name to
[next-prerender-crypto](https://github.com/vercel/next.js/blob/canary/errors/next-prerender-crypto.mdx)
error page like [other next-prerender
pages](https://github.com/vercel/next.js/blob/canary/errors/next-prerender-current-time.mdx).

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 09:00:36 +00:00
e5ce54de0b docs: use relative urls (#72941)
## Description
Follow up #52038.
Remove `https://nextjs.org` from URL in [error
pages](https://github.com/vercel/next.js/tree/canary/errors).

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

---------

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 08:58:29 +00:00
016b033aaa Fix broken link to the rootDir doc (#72893)
### What?

Fix broken link to the `rootDir` doc at
https://nextjs.org/docs/messages/no-html-link-for-pages#options

### Why?
This is because there is an extra space between a path and an anchor. 

### How?

This PR removes it to fix the format.

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 08:50:01 +00:00
20dc57391e docs: fix code block language in error pages (#72943)
## Summary
Update code block language in [error
pages](https://github.com/vercel/next.js/tree/canary/errors).

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-19 07:56:55 +00:00
Jiwon ChoiandGitHub c469404824 improve no-img-element lint error message (#72410)
### Why?

To customize Image Optimation, the user can use a custom loader, but
that information was out from the related lint error message.

Closes NDX-181
2024-11-12 21:48:12 +09:00
691eeae8fb docs: unify the header deps by removing # (#72451)
## Description
Follow up #72391.
I missed some error pages.

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <[email protected]>
2024-11-08 11:20:34 -08:00
Delba de OliveiraandGitHub 0b35ddd825 Docs: Move next.config.js API pages under a config folder, fix headings in TS and ESLint config pages (#72465)
This PR:

- Moves `next.config.js` options under a "config" folder which includes
references for other configuration such as the ESLint plugin. I figure
it would be tidier than having "Next.config.js Options" and "Config" in
the API reference.
- Fixes the issue with the "config" folder not showing up in canary:
https://linear.app/vercel/issue/DOC-3749/bug-figure-out-why-new-config-folder-isnt-showing-up-in-the-canary
- Fixes the indentation issues and missing example header (caused by an
invisible character).

Redirects: https://github.com/vercel/front/pull/38704
2024-11-08 14:48:55 +00:00