Commit Graph

1072 Commits

Author SHA1 Message Date
Lee Robinson af2405678b docs: update CRA guide (#75939) 2025-02-11 21:01:27 -06:00
Sam Ko 58e1adf4ca docs(css-in-js): update warning about using css-in-js with server components (#75931)
## Why?

The warning suggests its not supported in Server Components, but since React 19 was released, there is better support! Need to just re-word the warning a bit.

- Fixes https://github.com/vercel/next.js/issues/75895

- https://nextjs.org/docs/app/building-your-application/styling/css-in-js
- https://react.dev/blog/2024/12/05/react-19#support-for-stylesheets
2025-02-11 14:55:33 -08:00
Jude Gao 06613427c0 docs: add Chrome debugging port configuration steps (#75845)
This configure step is potentially required for the ports to show up in
the remote targets.
2025-02-10 12:16:27 -06:00
Delba de Oliveira 4b443ec82a Delete expirePath and expireTag pages (again) (#75691)
Context: https://vercel.slack.com/archives/C02F56A54LU/p1738675938419809
2025-02-10 16:33:46 +00:00
Lee Robinson ab6aeab515 docs: improve JSDocs for metadata and <Link> (#75576)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2025-02-09 20:36:26 +00:00
Maia Teegarden fcd2658bbd unsupported should be supported in docs (#75772)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2025-02-07 08:29:10 -07:00
Sam Ko ecc16d32c8 docs(route-segment-config): remove line in force-dynamic mentioning it's like getServerSideProps (#75773)
## Why?

`force-dynamic` is not like `getServerSideProps` in Pages Router, so this bullet point needs to be removed.

- Fixes https://github.com/vercel/next.js/issues/75697
2025-02-06 15:51:24 -08:00
Lee Robinson 13bcbf0d7a docs: follow up fix (#75760)
This was wrong https://github.com/vercel/next.js/pull/75693
2025-02-06 13:53:56 -06:00
JJ Kasper c5b823e7b5 Fix lint for cacheTag doc (#75703)
Seems this was failing in https://github.com/vercel/next.js/pull/75693
2025-02-05 09:29:11 -08:00
Tawsif Haque 674d32bed3 docs: fix example for multiple tags in cacheTag usage (#75693) 2025-02-05 10:45:32 -06:00
Lee Robinson b3907454d4 docs: remove unused imports (#75653) 2025-02-04 07:16:23 -06:00
Lee Robinson cdb275c7b8 docs: clarify env vars (#75488) 2025-01-30 20:56:38 -06:00
Lee Robinson c0d23aee2f docs: specify encryption for custom actions key (#75425)
If you are overriding the server actions encryption key, you need to
also ensure it uses AES-GCM encrpytion.
2025-01-29 12:25:11 -06:00
Lee Robinson 38efbed5b1 docs: add optimizations for navigating between App/Pages router (#75427) 2025-01-29 08:53:25 -06:00
Sebastian "Sebbie" Silbermann 274ce806b6 docs: Convert remaining sync (search)params access (#75389)
Looked through all `params.` and `searchParams.` accesses. Remaining
ones are either from Pages Router, not actual `params`, OG images (still
sync params) or migration docs.

`headers()` and `cookies()` were all working.
2025-01-28 08:06:37 -06:00
k8o 03f6660d4f docs: let searchParams be Promise in <Form> example. (#75386) 2025-01-28 10:10:53 +01:00
Lee Robinson 921fdfa7e0 docs: remove infinite looping redirect (#75376) 2025-01-27 17:02:25 -06:00
Smit Mistry 57dc9f6865 docs: fixed typo to auth.ts (#75345)
renamed auth.tsx to auth.ts in signup function.
2025-01-27 14:05:13 -08:00
Delba de Oliveira a016ea3e9c Getting Started docs: Consistent casing and naming (#74637) 2025-01-27 06:40:11 -06:00
Lee Robinson 3e7a510fa4 docs: opengraph-image files work with the node.js runtime (#75274)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2025-01-24 15:08:13 +00:00
Hendrik Liebau bf726d3c21 Introduce standalone experimental.useCache flag (#75240) 2025-01-24 00:28:05 +01:00
Lee Robinson 9cc6e96ed5 docs: Update robots for generateMetadata spec (#75229)
Typically you would want things to be indexed, so flipping the defaults
shown.
2025-01-23 09:06:59 -06:00
Kushagra S 36056bf307 Update 06-data-fetching-and-streaming.mdx (Removed duplicate word) (#74810)
Removed the duplicate `to` in the document page introduction. The top of
the page had a duplicate `to` making the statement as
```
This page will walk you through how you can fetch data in [Server Components](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#server-components) and [Client Components](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#client-components). As well as how to to [stream](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#streaming) content that depends on data
```

Corrected statement
```
This page will walk you through how you can fetch data in [Server Components](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#server-components) and [Client Components](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#client-components). As well as how to [stream](https://nextjs.org/docs/app/getting-started/data-fetching-and-streaming#streaming) content that depends on data
```

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Closes: https://github.com/vercel/next.js/pull/74870
Closes: https://github.com/vercel/next.js/pull/75154
2025-01-22 00:00:06 +00:00
Mohsen Azimi 1d4a024b2f Allow disabling HTTP request logs in dev server (#74349)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2025-01-21 23:28:07 +01:00
Jude Gao 17fc0c73c8 fix: remove unnecessary parentheses in draft mode API (#75153)
## What?
Updates the draft mode documentation to fix incorrect method calls in
the code examples.

## Why?
The code examples were showing incorrect syntax for enabling and
disabling draft mode, using `draft()` instead of accessing the methods
directly on the `draft` object.

## How?
Removes the unnecessary parentheses when calling `enable()` and
`disable()` methods on the draft mode object in the documentation
examples.

Fixes https://github.com/vercel/feedback/issues/82345
2025-01-21 11:32:21 -06:00
Jiachi Liu 303585a94e Display global-error along dev overlay during development (#75101)
### What

Display `global-error.js` along with error overlay in development. When
a runtime error occurred, you should be able to view the
`global-error.js` content by just hiding the error overlay.


### Why

Current behavior of `global-error.js` confused a lot of users that it
only renders in production build, howerver in dev it's always shows the
error overlay. This was considered "expected" before as you should focus
on fixing error in dev. But this brings a lot of inconvenience for
users, since they can't view the `global-error.js` easily in development
but production build.


#### After
The global-error content is displayed in the html with error overlay
covered

![image](https://github.com/user-attachments/assets/58fd73f8-7634-4a52-b6f8-c912cbb36fc3)

#### Before
Notice nothing displayed

![image](https://github.com/user-attachments/assets/319f3eb0-5d30-4c51-8e29-872aaec42261)


Fixes #55462
Fixes #52993
Closes NDX-694
2025-01-20 16:39:08 +01:00
Zack Tanner 808d2ba3e0 error when output: export is used with intercepting routes (#75058)
Intercepting routes are built on top of
[rewrites](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites)
which is one of the listed [unsupported
features](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features)
of `output: "export"`.

However, because the Next.js server injects the interception routes,
it's not caught by existing validation logic in the export flow.

This properly documents that intercepting routes are not currently
supported by `output: "export"` and hard errors in next dev/build if
detected. Previously route interception would just not have worked,
instead serving the non-intercepted page when built, leading to a
confusing experience.

We eventually want to support this with improved SPA/export features,
however that's out of scope for this PR: the goal here is to ensure
we're providing more immediate feedback about the fact that this is
unsupported.
2025-01-18 11:24:58 -08:00
Lee Robinson 2eb590bc1e docs: update Next.js 15 versions in upgrade guide (#74960) 2025-01-17 21:15:00 -06:00
Jam Balaya 23dee53f61 docs: fix typos in 08-mutating-data.mdx (#74856) 2025-01-14 11:14:37 +01:00
Jiachi Liu 2b13d26894 docs: mention special case for trailing slash (#74839)
### What

Clarify trailing slash special cases
[slack-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1718055917076779)
2025-01-13 14:08:52 -08:00
Jiachi Liu 5c4294feb1 docs: disclaimer for only canary version available for ppr (#74813) 2025-01-13 14:56:48 +01:00
Jiachi Liu 9010e45448 docs: mark app router dynamic example as client component (#74806) 2025-01-13 13:58:31 +01:00
Loco 61b4a74044 fix: unauthorized.mdx (#74799)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2025-01-13 00:31:20 +01:00
Lee Robinson 106043a573 docs: unstable_cache clarify usage (#74802) 2025-01-12 09:51:47 -06:00
Paweł Ciosek 8d0896a221 docs update: Remove public access modifier from resetRequestCache method in CacheHandler class, it's not available in js file (only in typescript) (#74788)
### What?

During development I noticed that example of custom CacheHandler
contains expression that works only in TypeScript but the file is
declared as JS.

### Why?

To improve documentation DX, so other developers won't be surprised that
code they copied from official docs is not correct semantically.

### How?

Added small fix removing public accessor
2025-01-11 20:21:21 +00:00
Konstantin Pschera f813dd4a81 Fix small bug in getting started docs (#74744)
This will fix a small bug in one of the examples in the Getting Started
docs. The examples declares a variable that's already declared in the
props which would result in an error when running this.
2025-01-11 20:19:59 +00:00
mikeboensel ff2e3541d4 Update 09-error-handling.mdx (#74656) 2025-01-10 19:42:18 +01:00
Lee Robinson afdaf1abfa docs: fix typo (#74657)
Oops.
2025-01-08 13:06:00 -06:00
Lee Robinson 5fd16c762a docs: SPAs (#74605)
This documents how to build Single-Page Applications with Next.js.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
2025-01-08 12:38:50 -06:00
Sam Ko 66059a4a14 docs(images): update distinction between priority and fetchPriority (#74650)
## Why?

This [PR](https://github.com/vercel/next.js/pull/67351) de-coupled functionality between the Next.js-provided `priority` property and the native `<img>`-provided `fetchPriority` property.

We need to update the documentation to reflect this.
2025-01-08 10:09:57 -08:00
Abhijeet Singh 7581beffe2 docs: pin react version to 18 in Next.js 14 upgrade guide (#74222)
### Improving Documentation

I was just upgrading from Next.js v13 to v14 following this guide:

https://nextjs.org/docs/app/building-your-application/upgrading/version-14

npm installation throws the below error:

```sh
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: blog@0.0.8
npm error Found: react@19.0.0
npm error node_modules/react
npm error   react@"19.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^18.2.0" from next@14.2.21
npm error node_modules/next
npm error   next@"14.2.21" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
```

The react version for Next.js v14 should be pinned to react@18.
2025-01-06 13:06:54 -08:00
T 4fab32fadb fix react being incorrectly mentioned as extending fetch API (#74278) 2025-01-06 21:56:33 +01:00
Delba de Oliveira c527168d7e Getting Started docs: Add Error Handling page (#74069)
Closes: https://linear.app/vercel/issue/DOC-4077/page-handling-errors
2025-01-06 08:41:17 -06:00
Delba de Oliveira 67ac8bfdb2 Getting Started Docs: Add Mutating Data page (#74018)
Closes: https://linear.app/vercel/issue/DOC-3906/page-mutating-data

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2025-01-06 08:40:11 -06:00
JJ Kasper 2e114e44c5 Fix linting between lint-check and lint-staged (#74503) 2025-01-03 23:17:14 +00:00
Steven 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
YeonHee 22970b829d docs(use-cache): add missing switcher code blocks and types in examples (#74083)
Hi Team.
This PR updates the use cache directive documentation with the following
changes:

- Added switcher code blocks for `next.config.ts` and `next.config.js`
examples.
- Updated missing `switcher` for `Bookings` component examples to
include switcher support.
- Added missing types for `ClientComponent` of tsx block.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-01-02 21:39:43 +00:00
YeonHee bf02ac33b1 docs(fetching-data-and-streaming): add missing types to example (#74081)
This PR updates the `use` hook example in the Fetching Data and
Streaming section by adding missing TypeScript types for the `posts`
prop.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-01-02 21:37:30 +00:00
YeonHee edc6e18ad1 docs(generate-static-params): add typescript example and missing jsx switcher (#73962)
Hi Team.

This PR enhances the Generate Static Pararms documentation by adding
TypeScript examples, and adding missing jsx switcher code blocks, which
previously caused some content to disappear when switching to JavaScript
due to the absence of corresponding jsx examples.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-01-02 21:33:19 +00:00
Lee Robinson b2c20c9f90 docs: remove catch-all for opengraph-image (#74338)
x-ref: https://github.com/vercel/next.js/issues/49630
2024-12-27 19:30:10 -06:00