Commit Graph

3804 Commits

Author SHA1 Message Date
Lee Robinson 12e64cf0ae docs: Update command to use npx for tracing files (#83903)
This was easier than needing to modify `package.json` or similar. Thank
you!

_(Hello from the otheeerr siiiiiiiddeeee 🎶)_
2025-09-17 18:25:33 +02:00
Joseph a4be33e9d1 docs: the as prop is still available in Pages Router (#83864)
We accidentally removed the documentation for `as` prop in Pages Router
`next/link`.

Closes:
https://linear.app/vercel/issue/DOC-3140/add-missing-props-as-to-nextlink-reference-page
2025-09-17 15:21:18 +02:00
Yousef Dawood a096e3ea73 Update generate-metadata.mdx (#81853)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-17 10:33:36 +02:00
Benjamin Woodruff bba9b2f366 docs: Fix self-referential link to Middleware in middleware.mdx (#83854)
This link was to the current page, which isn't very useful.

Link to the getting started page
(https://nextjs.org/docs/app/getting-started/route-handlers-and-middleware#middleware)
instead
2025-09-16 22:50:47 +02:00
Joseph aab50c395b docs: implications of mutating cookies in server actions (#83691)
Ref: https://github.com/vercel/next.js/discussions/83481 Closes:
https://linear.app/vercel/issue/DOC-5070/mutating-cookies-invalidates-router-cache

Making sure those using cookies in server actions, know that the server
tree is re-rendered and merged with the current client tree.
2025-09-16 15:18:32 +02:00
Joseph e2f7cb206d docs: Type narrowing using LayoutProps, PageProps (#83692)
Make a couple of clarifications:

- type resolved by the helpers
- ways to narrow down to a narrower union

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
2025-09-16 14:19:56 +02:00
Vladimir Bagdeev 8b17a636bc Removed link to maintain text consistency (#83644)
<!-- 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

### 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? Removed link 
### Why? To maintain text consistency. There are four includes of
'browser’s history stack' and two of them contain link with different
style.
### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-16 10:41:11 +02:00
Aymeric PINEAU 721def6b58 Update next-intlayer reference in i18n doc (#83761)
[`next-intlayer`](https://intlayer.org/doc/environment/nextjs) is an
i18n library that adopts a per-component approach to manage multilingual
content in a next.js application.

### Changes
- Fix doc related to page-router documentation,
- And add App Router realted doc.

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-15 16:09:42 +02:00
Luca Krebs deee6f3089 docs(data-security): add bun package manager example (#83735)
Adds the `bun add server-only` command to the data security guide.

This change adds the missing Bun package manager example to the
`docs/01-app/02-guides/data-security.mdx` file, ensuring consistency
with other documentation sections.

Fixes #83734

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-15 15:51:41 +02:00
David 716bc0e420 docs(metadata): align default function export name with file name (#83796) 2025-09-15 13:38:54 +02:00
Joseph a63cd29bae Docs/sep paper cuts (#83689)
Addressing `papercuts` found this month

- Fixes: #83622
2025-09-12 15:12:04 +02:00
Mohammad Nedaeifard 8348bd32ad Update content-security-policy.mdx, fix development environment error (#83665)
fix _nextjsDevtools csp error which happens in development environment
after enabling csp and following the current documents.

Full Error:
- Refused to apply inline style because it violates the following
Content Security Policy directive: "style-src 'self'
'nonce-YmYyMTZmYTQtMzgxNy00ZjYwLWIwMGQtYjBmYjJjNGYzZWQ1'
'unsafe-inline'". Note that 'unsafe-inline' is ignored if either a hash
or nonce value is present in the source list.

<!-- 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

### 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 #

-->

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-11 23:07:49 +02:00
Joseph 7a76e9fa68 docs: rewrite+usePathname+prerender hydration error mitigation (#83462)
Closes:
https://linear.app/vercel/issue/DOC-5040/usepathname-and-rewrites
2025-09-09 15:14:57 +02:00
pontasan 90c5a66bfa Docs: Add authentication note for external/internal image sources (#83469)
**Summary**  
This PR adds a note to the documentation clarifying the behavior when
using external or internal URLs (API Routes) as image sources with
Next.js Image Optimization.
This change addresses issue #82610.  

**Details**  
- Added a note explaining that, for security reasons, request headers
are not forwarded to API Routes or external URLs when Image Optimization
is used.
- Documented that if image data requires authentication, the
`unoptimized` property should be considered to disable Image
Optimization.

**Why**  
Users may be confused when trying to load images from endpoints that
require authentication. This clarification helps developers understand
the limitation and how to handle such cases.

**References**  
- [Vercel Changelog:
CVE-2025-57752](https://vercel.com/changelog/cve-2025-57752)
- [Next.js GitHub Issue
#82703](https://github.com/vercel/next.js/issues/82703)

---

resolves #82610

---------

Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: Steven <steven@ceriously.com>
2025-09-08 14:47:17 +00:00
Honda Yuto a225045924 Docs: Fix broken getImageProps sample code (#83436)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2025-09-04 17:18:12 +02:00
Steven 07e9324016 feat(next/image): introduce preload prop and deprecated priority prop (#83351)
The Image component's existing `priority` prop is confusing since its
not obvious what it does.

In order to improve clarity, we are introducing a `preload` prop and
deprecating the `priority` prop.

We also updated the dev warning to no longer suggest using this prop for
the LCP and instead use `loading="eager"`.
2025-09-04 13:50:17 +00:00
Joseph db1de21e25 docs: Middleware explicit runtime differences (#83348)
In previous docs versions, while not explicitly stated, it was rather
clearer that middleware has its own runtime.

Also, people who have used bundle-analyzer would for example be familiar
with the 3 bundles, or those who have worked with
`next.config.js`/instrumentation would understand that there's some
different runtimes at play going on there, but those who exclusively
work with middleware might still miss on this detail.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-09-04 09:04:06 +02:00
Bülent Güven fc6e3dbc5b Update next-response.mdx (#83302)
This PR aims to fix a typo in documentation

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-09-03 23:31:27 +00:00
geraldochristiano ce359e0065 Fixed broken link in backend-for-frontend.mdx (#83310)
Broken link to API Routes in Pages Router

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-09-03 23:25:35 +00:00
Joseph d373280a90 docs: relative links that were absolute (#83317)
Certain relative links were absolute, which renders them with the ->
external arrow - might have been a decision per case, but AFAIK, this is
only helpful for those links that are now redirecting to other content
2025-09-03 13:38:07 +02:00
Joseph 5cf762235a docs: Improve troubleshooting and awareness around useSearchParams (#83226)
Closes: https://linear.app/vercel/issue/DOC-5030/usesearchparams
2025-09-02 23:07:41 +02:00
Joseph f49402c7ff docs: use-link-status as a subtle hint (#83104)
Let's try to change how we present useLinkStatus - it could be misused
to overuse loading spinners next to links - which can cause layout
shifts.

Closes:
https://linear.app/vercel/issue/DOC-5028/uselinkstatus-reformulation

---------

Co-authored-by: Ian Jones <witspr@gmail.com>
2025-09-02 19:52:55 +02:00
Steven e33a128da4 BREAKING CHANGE!: next/image only allow quality 75 by default (#83175)
## Background
We have default allowlists for the `url` (localPatterns/remotePatterns
config) and `w` (imageSizes/deviceSizes config) but we don't have a
default allowlist for `q` (currently opt-in with via qualities config).

## What's changing?
BREAKING CHANGE: This PR is a breaking change that sets the default
allowlist to `qualities: [75]`, meaning that anything other than 75 is
invalid. Since most images don't set the quality prop and therefore
default to 75, most apps will be unaffected.

However, we can be even more gracious when users upgrade because we can
coerce the value automatically to 75 (or rather any value in `qualities`
allowlist). In dev, this will print a warning explaining why the prop
was not observed. This also works if you had `qualities` configured but
removed 75, since the closet matching value in the array will be used
instead.
2025-09-02 19:26:14 +02:00
Neko 9163d25a3c docs: use resourceFromAttributes to replace new Resource() to obtain Resource (#83321)
### What?

By following the default method to integrate OpenTelemetry in Next.js
applications... this error occurs:

```
'Resource' only refers to a type, but is being used as a value here.
```

### Why?

`Resource` presented here as a `interface` or type only definition, as
specified in OpenTelemetry's repo,
https://github.com/open-telemetry/opentelemetry-js/blob/2d544088ac9a4bcb07986be7d9cdc2d0688e7b44/packages/opentelemetry-resources/src/Resource.ts#L20-L30:

> This interface is NOT user-implementable. Valid ways to obtain a
{@link Resource} are by using either of these functions
> -
[`resourceFromAttributes`](https://github.com/open-telemetry/opentelemetry-js/blob/2d544088ac9a4bcb07986be7d9cdc2d0688e7b44/packages/opentelemetry-resources/src/ResourceImpl.ts#L149)
> -
[`emptyResource`](https://github.com/open-telemetry/opentelemetry-js/blob/2d544088ac9a4bcb07986be7d9cdc2d0688e7b44/packages/opentelemetry-resources/src/ResourceImpl.ts#L163)
> -
[`defaultResource`](https://github.com/open-telemetry/opentelemetry-js/blob/2d544088ac9a4bcb07986be7d9cdc2d0688e7b44/packages/opentelemetry-resources/src/ResourceImpl.ts#L167)
> -
[`detectResources`](https://github.com/open-telemetry/opentelemetry-js/blob/2d544088ac9a4bcb07986be7d9cdc2d0688e7b44/packages/opentelemetry-resources/src/detect-resources.ts#L27)

### How?

By default, we use `resourceFromAttributes` for OTEL resources with
attributes.


Fixes: https://github.com/vercel/next.js/issues/77451

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-02 18:57:41 +02:00
Remco Haszing 7aa5d16231 Use the automatic runtime for type checking (#83159)
Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
2025-09-02 12:35:42 +02:00
Kaung Min Khant 95ee107a85 Update caching.mdx (#83149)
In the docs it says => ( The default caching behavior of fetch (e.g.,
when the cache option is not specified) is equal to setting the cache
option to no-store )

But when I code, I found that fetch default behaviour and setting the
cache option to no-store are different.

After building process ....

When changing routes. default is stored as cache. I see that because
there is no new network request when I change route. In setting the
cache option to no-store, it is making a new network request as soon as
i get back to the page.

so docs and real working one are mismatch.

I also provided how tested with pictures belows.
Please build... and check
Change routes...

<img width="545" height="371" alt="image"
src="https://github.com/user-attachments/assets/4931302f-b5ef-4016-b43d-cbbd790c1e11"
/>

<img width="601" height="409" alt="image"
src="https://github.com/user-attachments/assets/3f2b4a79-fa24-466f-8330-0dc8323b6c16"
/>

Fixes https://github.com/vercel/next.js/issues/83146

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-01 10:38:14 +02:00
Joseph a26a753fa4 docs: fix snippets in getting started (#83228)
Fixing snippets in Getting Started
2025-08-30 00:38:05 +02:00
우혁 4a3ea6a20d docs: change API route example file extension to .ts and add JS example with switcher prop (#83044)
## For Maintainers

### What?
Changed the API route example in the documentation to use `.ts` file
extension for the TypeScript example since it uses TypeScript types.
Added a JavaScript example with `.js` extension using the `switcher`
prop to provide both TypeScript and JavaScript variants in the docs.

### Why?
The existing example used a `.js` extension but included
TypeScript-specific type annotations which is inconsistent and could
confuse users.
Providing both TypeScript and JavaScript examples improves clarity and
usability, catering to a broader audience.

### How?
- Updated the filename in the TypeScript example code block to
`pages/api/hello.ts`.
- Added a parallel JavaScript example code block with
`pages/api/hello.js` using the `switcher` property.
- Ensured both examples show equivalent handler logic with and without
type annotations.

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-29 16:59:30 +02:00
Joseph 3f122a4a51 Docs/typed routes snippets (#83132)
A few more improvements to typed routes and friends

- showing usage of router methods from `next/navigation` 
- using Route in other data structures
2025-08-28 14:55:15 +02:00
Lorenzo Palmes 90c0dcec0b Update middleware node version history with latest stable release (#83166)
<!-- 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 #

-->

Updates the middleware version history marking node as stable as
[announced in version
15.5](https://nextjs.org/blog/next-15-5#nodejs-middleware-stable)

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-28 13:52:12 +02:00
HosamSenosi 1a5ef158f0 Added 2 values to the props table at 02-components/image.mdx (#83160)
Added `unoptimized` and `decoding` props to the props table (the table
at the top of the doc page).

I was looking for the `unoptimized` prop and thought it wasn't in this
page because I could not find it at the props table. I think it's better
included there since it's not deprecated. The same goes for `decoding`.

Added them with the same syntax as the rest values in the table. 

Thanks.

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-28 13:52:06 +02:00
Jiwon Choi 5f768fe422 [Breaking] remove deprecated devIndicators options (#83124)
This PR removed deprecated `devIndicators` options since v15.2.0.
2025-08-28 00:28:33 +02:00
Joseph 70e5f22572 docs: Expanded type checks to Pages Router and tsconfigPath (#83096)
Closes:
https://linear.app/vercel/issue/DOC-5027/tsconfigpath-and-typed-routes-updates

Also addresses: https://github.com/vercel/next.js/issues/83109
2025-08-27 22:31:19 +02:00
ryu 43d4532a32 docs: clarify the location of middleware.ts (#83056)
<!-- 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 #

-->

I think the phrase "in the root of your project" is unclear and
contradictory if we use `src` directory.

https://nextjs.org/docs/app/api-reference/file-conventions/src-folder#:~:text=src/app%20or%20src/pages%20will%20be%20ignored%20if%20app%20or%20pages%20are%20present%20in%20the%20root%20directory.

So This PR removes that phrase.

---------

Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-27 10:13:06 +02:00
Joseph 71d1e9728d docs: next lint post 15.5 release adjustments (#82933)
Update installation guide, now we have Biome as an option to
create-next-app, and next lint is deprecated.

Also addresses: https://github.com/vercel/next.js/issues/82916

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Ben Gubler <nebrelbug@gmail.com>
2025-08-27 00:33:00 +02:00
Hendrik Liebau 4b66771895 Remove deprecated legacyBehavior and passHref prop from Link component (#83003)
The `legacyBehavior` prop of the `Link` component has been deprecated
since #77473. For Next.js 16, we're finally removing support for it.
Consequently, we're also removing support for the `passHref` prop, which
was only useful in conjunction with the `legacyBehavior` prop.

A [codemod is
available](https://nextjs.org/docs/app/guides/upgrading/codemods#new-link)
to help you automatically upgrade your codebase.

reverts #77473

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
2025-08-26 14:04:27 +02:00
Joseph b4319bc8a4 Docs/late aug feedback (#82953)
- I've seen `NextResponse.next({ headers });` where devs likely meant
`NextResponse.next({ request: { headers } });`
  - for example https://github.com/vercel/next.js/issues/82937
- Explaining further `outputFileTracingIncludes-*` options

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-08-26 12:57:22 +02:00
Joseph 6f1f49ebbe docs: typed routes manual tsconfig includes (#83031)
Docs fix to: https://github.com/vercel/next.js/issues/83010
2025-08-26 12:46:27 +02:00
Joseph 516b28270e Docs/getting started improv (#82741)
Part of:
https://linear.app/vercel/issue/DOC-4809/layout-pages-and-linking-and-navigating-improvements

Iterating a bunch of improvements to getting-started
2025-08-26 12:37:49 +02:00
Akinjide 1029d059a8 Update 07-fetching-data.mdx (#82862)
Promise.all or any of the other 3 static concurrency methods don't
actually run requests in parallel, rather they execute concurrently.

[Parallelism vs
Concurrency](https://wiki.haskell.org/Parallelism_vs._Concurrency)
[Promise
Concurrency](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency)

<!-- 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?
[Concurrency was confused as
parallelism](https://wiki.haskell.org/Parallelism_vs._Concurrency)
### Why?
Might confuse others, especially those still learning on how promises
work.
### How?
Promise.all or any of the other 3 static concurrency methods don't
actually run requests in parallel, rather they execute
[concurrently](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency).
Closes NEXT-
Fixes #

-->

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-25 13:12:22 +02:00
P41T 8e8dd0c8c2 Update prettier project dependency from 3.2.5 to 3.6.2 (#82896)
What?
This PR updates the dependency "prettier" from version 3.2.5 to version
3.6.2. It also modifies other scripts by using the pnpm run prettier-fix
after updating the dependency.

Why?
This is updated to benefit from the changes and fixes introduced in the
newer versions of prettier, from versions 3.3 to 3.6.

How?
The package has been updated using pnpm install prettier@latest, and the
files other than package.json and pnpm-lock.json have been modified
using the script pnpm run prettier-fix.

This PR does only have formatting changes introduced by the updated
dependency
This PR is the same as #82719 , with fixes implemented to prevent
prettier to modifiy symlink files
2025-08-21 21:05:20 +00:00
Nicolas Charpentier bed08dd1cc docs: fix typo in Image#priority (#82806)
`s/isused/is used`

<!-- 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 #

-->

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-08-20 01:11:34 +00:00
Will Binns-Smith 58d85ae99c docs: mention turbopack config codemod (#82183) 2025-08-19 17:53:21 -07:00
Ben Gubler 77bb702a01 docs: add explanation of disabling lint for next build (#82805)
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2025-08-19 23:27:19 +00:00
Joseph 533bcd1485 docs: Route props helpers, typegen and next lint deprecation (#82784)
As this lands and people learn about the new Route Props helpers, I
think we will have this period where the TypeScript snippets show the
manual typing, but in key places we introduce the helpers usage. We can
then follow up updating all TypeScript snippets showing a page, layout
or route, to use these.

---------

Co-authored-by: Ben Gubler <nebrelbug@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-08-19 14:32:52 -07:00
Madhur Mittal e6718d699d docs: fix TS error in Node.js runtime local assets example (#82672)
## What?  
Updated the documentation for `opengraph-image` / `twitter-image` to fix
the **Node.js runtime with local assets** example.

## Why?  
The existing snippet did not type-check cleanly with Next.js 15+ and
could confuse developers.
This update improves developer experience by ensuring the snippet is
immediately usable and accurate.

## How?  
- Reproduced the example in a fresh Next.js 15+ project.  
- Updated the docs example to:  
  - Use `readFile` + Base64 encoding instead of invalid file URLs.  
  - Clarify that assets should be placed relative to the project root.  
- Added an entry to **Version History** noting the update in v15.x.  

## Checklist  
- [x] Ran `pnpm prettier-fix`  
- [x] Verified formatting & linting (`pnpm build && pnpm lint`)  
- [x] Documentation guidelines followed  
- [x] Example verified in a real Next.js 15 project  

Fixes #75583 & #75625 (if considered same class of issue)

---------

Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-19 21:28:18 +00:00
Ben Gubler 91da00336c fix: remove a few old references to 'next lint' (#82800) 2025-08-19 20:56:46 +00:00
Ben Gubler c57fe2561c feat: add a codemod to migrate from the deprecated "next lint" command (#82685)
## Add codemod to migrate from `next lint` to ESLint CLI

This PR introduces a new codemod `next-lint-to-eslint-cli` that helps
users migrate away from the deprecated `next lint` command to using
ESLint directly, in preparation for Next.js 16 where `next lint` will be
removed.

### What it does

The codemod automates the migration process by:

1. **Updating package.json scripts** - Replaces all `next lint` commands
with `eslint` equivalents
- Maps Next.js-specific flags (`--strict` → `--max-warnings 0`,
`--dir`/`--file` → paths)
   - Preserves other ESLint-compatible flags
- Handles complex scripts with pipes, redirects, and multiple commands

2. **Managing ESLint configuration**
   - Creates a new flat config (`eslint.config.mjs`) if none exists
   - Updates existing flat configs to include Next.js rules
   - Provides guidance for legacy configs that need manual migration

3. **Installing dependencies automatically**
- Adds required packages: `eslint`, `eslint-config-next`,
`@eslint/eslintrc`
   - Detects and uses the project's package manager (npm/yarn/pnpm/bun)
   - Falls back to manual instructions if installation fails

### Usage

```bash
npx @next/codemod@latest next-lint-to-eslint-cli .
```

### Example transformations

```json
// Before
{
  "scripts": {
    "lint": "next lint",
    "lint:fix": "next lint --fix",
    "lint:strict": "next lint --strict --dir src"
  }
}

// After
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    "lint:strict": "eslint --max-warnings 0 src"
  }
}
```

### Why this change?

- `next lint` is being deprecated and will be removed in Next.js 16
- ESLint v9+ flat config is becoming the standard
- Direct ESLint usage provides more flexibility and better ecosystem
compatibility
- Reduces Next.js maintenance burden of wrapping ESLint functionality

The codemod ensures a smooth transition path for existing Next.js
projects while following ESLint best practices.
2025-08-19 13:27:17 -07:00
Ben Gubler c970d95136 feat: stabilize experimental.typedRoutes flag (#82762)
- Rename `experimental.typedRoutes` to `typedRoutes` 
- Remove old references to `typedRoutes` not working with Turbopack
- Remove unnecessary encoding of `typedRoutes` for bundlers
2025-08-19 11:02:26 -07:00
Ben Gubler 9c1a97bf56 feat: deprecate 'next lint', add Biome support (#82266)
# Transition from `next lint` to explicit ESLint configs and add Biome support

## What?
This PR makes two major changes to Next.js linting:

1. **Transitions away from `next lint`**: `create-next-app` now generates explicit ESLint configurations instead of relying on the `next lint` command
2. **Adds Biome as a linter option**: Users can now choose between ESLint, Biome, or no linter during project setup

## Why?

**ESLint Transition**: Provides transparency (users see exact rules), better IDE integration, easier customization, and follows industry standards for explicit configuration.

**Biome Support**: Offers a faster, unified linting/formatting tool and gives users more choice in their developer experience.

## How?

### ESLint Configuration Generation
- Generates `eslint.config.mjs` files that extend `eslint-config-next` packages
- Includes proper ignores for build artifacts (`next-env.d.ts`, `.next/`, etc.)
- Package.json scripts call `eslint .` directly instead of `next lint`
- Maintains complete feature parity with current `next lint` behavior

### Biome Integration
- Added `--biome` flag and interactive prompt selection
- Generated `biome.json` configurations with Next.js and React domain rules
- Includes both `lint` and `format` scripts for Biome projects

### Linter Selection
Interactive prompt offers: **ESLint** (comprehensive rules), **Biome** (fast with fewer rules), **None** (skip linter)

### Deprecation
Added deprecation warning to `next lint` command (removed in Next.js 16)

## Testing
Added comprehensive test suites for both ESLint and Biome configuration generation across all template variants.

This change modernizes Next.js linting while providing users with more choice and transparency.
2025-08-19 09:54:20 -07:00