Commit graph

2086 commits

Author SHA1 Message Date
Cody Lundquist
fb99d2eaf5
docs: Update unstable_cache.mdx with important info about dynamic data (#62202)
<!-- 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?

This caused me a ton of issues in production due to inconsistent cache.
It does not manifest itself in local development. The only reason I
figured it out was because I upgraded to the canary release and someone
added a helpful exception explaining that I shouldn't be doing what I
was doing. To hopefully help people in the future, I'm adding a blurb to
the `unstable_cache` docs.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-20 17:52:53 +00:00
Balázs Orbán
0d64d592f4
docs(cli): tweak next info docs (#62274)
### What?

Follow-up on #62249

### Why?

I noticed the example `next info` output was outdated/missing a few
parts in the docs.
2024-02-20 09:55:49 -05:00
Tobias Koppers
8250a8419a
add turbo.resolveExtensions to allow to customize extensions (#62004)
### What?

* add `turbo.resolveExtensions` to allow to customize extensions in
Turbopack

fixes PACK-2335
Fixes https://github.com/vercel/turbo/issues/4934
2024-02-19 09:07:09 +00:00
ArianHamdi
ab487cba92
docs: fix page.js file name in 02-pages-and-layouts.mdx (#62221)
<!-- 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: Sam Ko <sam@vercel.com>
2024-02-19 03:22:24 +00:00
Theo
d18335ba43
Fix 02-pages-and-layouts.mdx to show Good to know and contents in the same box (#62203)
**Good to know:** and list should be inside the same box.


![image](https://github.com/vercel/next.js/assets/36564257/072eb7ca-1c95-473b-9d08-c4cea649b7ea)


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

-->
2024-02-17 22:39:18 +00:00
Ismail Ghallou
ef1fb15260
docs: fix srclang prop (#62164)
### What?
- `srclang` -> `srcLang`

### Why?
React.js!
2024-02-16 19:47:16 +00:00
kevinmitch14
d397832e01
Docs: update link.mdx (#61508)
Updated paths in relation to `<Link />` and middleware rewrites. Feel
free to leave suggestions if needed, this has always confused me a
little bit.

**Old Version**:
For example, if you have a Dynamic Route like `/dashboard/[user]` that
you want to present differently via middleware, you would write: `<Link
href={{ pathname: '/dashboard/authed/[user]', query: { user: username }
}} as="/dashboard/[user]">Profile</Link>`.

The `as` prop should be the URL we want to display while href/pathname
is the actual path. So if we want to present something differently via
middleware, we would do so via `as`. In the example above we want to
display `/dashboard/[user]` differently but we use
`as='/dashboard/[user]'`.
2024-02-16 19:43:11 +00:00
Bernardo Belchior
f23f57f692
Fix extra const in video docs (#62155)
<!-- 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>
2024-02-16 18:26:06 +00:00
Phil Z
5f98a8def0
Add puppeteer-core to serverComponentsExternalPackages.mdx (#62156)
<!-- 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 #

-->

This is a docs change that I should have included with
https://github.com/vercel/next.js/pull/62063

Adds `puppeteer-core` to the documented list of external server
dependencies to be ignored by the bundler.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:25:16 +00:00
Lee Robinson
c48a0f8e6d
docs: add link to Blob (#62056) 2024-02-14 11:06:47 -05:00
Alex Puertas
898f74e729
docs: update Auth.js name to NextAuth.js (#61974)
On the Examples section the name was already updated but not updated on
the Selecting Session Management in Next.js

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-02-13 12:32:36 +01:00
Balázs Orbán
65517ac621
chore: fix lint (#61950)
Fixes linting issue from #61934

Closes NEXT-2442
2024-02-12 16:32:20 +00:00
Rajdeep singh
1c64850360
docs: add missing closing curly brace to code snippet (#61934)
Closed the missing `}` in the [Theme Detection
Picture](https://nextjs.org/docs/app/api-reference/components/image#theme-detection-picture)
example code.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-02-12 17:26:23 +01:00
Hong
eb03ae742f
docs: fix typo (#61943)
### Why?
`compatability` is not a correct word.

### How?
Use `compatibility` instead.
2024-02-12 17:24:26 +01:00
Sam Ko
ca18f4ff9d
docs(cli): fix next info section title and re-order (#61895)
## Changes

- Update section title from `Next Info` to `Info`
- Adds consistency with other section titles and fixes broken link →
09a764d0fc/packages/next/src/cli/next-info.ts (L100)

Closes NEXT-2425
2024-02-10 17:24:32 -08:00
Lee Robinson
09a764d0fc
docs: follow up from CRA docs (#61893) 2024-02-10 11:59:17 -06:00
Delba de Oliveira
971a1a6421
Docs: Address community feedback (#61857)
Closes: 

- https://github.com/vercel/feedback/issues/54964
- https://github.com/vercel/feedback/issues/54580
- https://github.com/vercel/feedback/issues/54555
- https://github.com/vercel/feedback/issues/54341
- https://github.com/vercel/feedback/issues/54309
- https://github.com/vercel/feedback/issues/53751
- https://github.com/vercel/feedback/issues/55173

Add diagram: https://github.com/vercel/front/pull/29561
2024-02-10 09:59:29 -06:00
Lee Robinson
479faa7117
docs: migrating from CRA (#61866)
Co-authored-by: Michael Novotny <manovotny@gmail.com>
2024-02-09 19:32:53 -06:00
Sam Ko
19adc81e62
docs: update API reference for <Script> (switch to _document.js) (#61875)
## Changes

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

Closes NEXT-2421
2024-02-09 21:03:49 +00:00
Sam Ko
8f6f137977
docs: add Page Router only section for beforeInteractive (#61839)
## Changes

Updates `beforeInteractive` section in API Reference docs for Pages
Router

-
https://nextjs.org/docs/pages/api-reference/components/script#beforeinteractive
- Closes https://github.com/vercel/next.js/issues/61594
2024-02-09 20:38:25 +00:00
SaiGanesh21
09c8eae4e0
docs: Example mismatch when changing language JS/TS (#61833)
### What? 
Resolves issue #61695 

### Why?
The `Building Your Application -> Data Fetching -> Server Actions and
Mutations` section in the Next.js documentation has a few mismatches
with respect to JS and TS codes.

---------

Co-authored-by: battuAshita <battua@iitbhilai.ac.in>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-08 20:11:42 +00:00
Zack Tanner
13d8b14040
Fix closing a modal example in parallel routes docs (#61819)
The docs mention using a `Link` to close the modal, but navigating away
from a slot that was active won't automatically unmount unless it
matches with a new page for that slot. This is because client-side
navigations don't switch slots from active -> default. Default is only
used on a hard navigation.

I believe this example used to be in here but got removed, so I re-added
with some extra clarity.


Closes NEXT-2405
2024-02-08 11:03:08 -08:00
Jimmy Lai
feb27ad621
Revert "feat(next/image)!: remove squoosh in favor of sharp as optional dep" (#61810)
Reverts vercel/next.js#61696

Closes NEXT-2401
2024-02-08 11:00:34 +00:00
Gen Tamura
72826823d6
Update 02-server-actions-and-mutations.mdx (#61756)
Hi, there.

I have fixed the missing leading slash in the anchor link in Route
Segment Config.

Thanks
2024-02-07 11:36:46 +01:00
Shahzar Mazhar
2145300fe1
fix: showing incorrect filename in example (#61736)
### What?

change filename to `app/dashboard/@analytics/layout.js` in example

### Why?

It  was written incorrect i.e. `app/layout.js`

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

change filename to app/dashboard/@analytics/layout.js

### Why?

It  was written incorrect i.e. app/layout.js

### How?

Closes NEXT-
Fixes #

-->
2024-02-06 20:38:56 +00:00
Steven
07c4ec052e
feat(next/image)!: remove squoosh in favor of sharp as optional dep (#61696)
## History

Previously, we added support for `squoosh` because it was a wasm
implementation that "just worked" on all platforms when running `next
dev` for the first time. However, it was slow so we always recommended
manually installing `sharp` for production use cases running `next
build` and `next start`.

Now that [`sharp` supports
webassembly](https://sharp.pixelplumbing.com/install#webassembly), we no
longer need to maintain `squoosh`, so it can be removed. We also don't
need to make the user install sharp manually because it can be installed
under `optionalDependencies`. I left it optional in case there was some
platform that still needed to manually install the wasm variant with
`npm install --cpu=wasm32 sharp` such as codesandbox/stackblitz (I don't
believe sharp has any fallback built in yet).

Since we can guarantee `sharp`, we can also remove `get-orientation` dep
and upgrade `image-size` dep.

I also moved an [existing `sharp`
test](https://github.com/vercel/next.js/pull/56674) into its own fixture
since it was unrelated to image optimization.

## Related Issues
- Fixes https://github.com/vercel/next.js/issues/41417
- Closes https://github.com/vercel/next.js/pull/54670
- Related https://github.com/vercel/next.js/issues/54708
- Related https://github.com/vercel/next.js/issues/44804
- Related https://github.com/vercel/next.js/issues/48820
2024-02-06 14:17:07 -05:00
JJ Kasper
daf8912627
Add case-sensitive note for revalidateTag/revalidatePath (#61729)
Our tag values are case-sensitive so this ensures we properly document
this so users are aware of this caveat.

x-ref:
https://github.com/vercel/next.js/pull/61392#issuecomment-1926004777

Closes NEXT-2379
2024-02-06 10:30:42 -08:00
Sandeep Mani Kumar Kushwaha
2d488564e6
Fixed #61434 : Docs: Duplicated code snippets (#61446)
<!-- 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 #

-->
### What?

Issue - Docs: Duplicated code snippets

The code snippet is repeated, second snippet had to be with Link
component.

### How?
Replaced button with Link component.

Fixes #61434 - Docs: Duplicated code snippets

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-05 12:13:29 -08:00
Ishaan
d245079177
Update README.md (#48717)
## Improving Documentation

### The following changes have been made to the official repository's
**Readme.md**:

- Shortened link text across the readme.
- Added additional descriptions for more details.
- Added bold text to highlight emphasis on important topics
- Changed heading sizes to indicate first headings (h1) for each section
instead of second headings (h2) which was previously being used
- Merged _'Who is using Next.js?'_ section with _'Getting Started'_
section for a more professional, cleaner look.

### The following changes have been made to the repository's
**Contribution docs**:

- Fixed two typos in the docs

---------

Co-authored-by: Sam Ko <sam@vercel.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-02-04 18:47:51 -08:00
Olivier Tassinari
6587a37b00
Mobile Friendly Test was retired (#61647)
https://twitter.com/googlesearchc/status/1731702833060237642
2024-02-05 01:23:58 +00:00
Sam Ko
5284451ed9
docs: update style9 to stylex (#61646)
## Description

The `style9` [repo](https://github.com/johanholmerin/style9) now
recommends `stylex` since `stylex` has been open sourced.
2024-02-04 16:02:15 -08:00
Andrew Paramoshkin
5ed493e548
docs: update useParams examples and pages usage (#61595)
<!-- 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 #

-->

Updated https://nextjs.org/docs/app/api-reference/functions/use-params
with:
* returns block, examples table: route with no dynamic parameters should
return an empty object
* returns block, `pages` usage: if `useParams` is used in `pages` it
will return `null` only for the initial render and will update its value
with dynamic parameters following the same rules as stated in the doc
above this point.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-04 23:44:43 +00:00
Daniel Rivers
5602e6bc14
docs: Add Kinde to authentication docs (#61460)
Added Kinde to the authentication documentation, Its already mentioned
elsewhere in the docs just not here.

Co-authored-by: Lee Robinson <me@leerob.io>
2024-02-04 10:47:37 -06:00
byhow
3fee9e6295
docs: add auto closing tag to <source> (#61546) 2024-02-04 10:47:13 -06:00
hmmChase
d4b1c6c097
Update 03-linking-and-navigating.mdx (#61622)
Fix code example syntax

<!-- 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>
2024-02-04 00:23:44 +00:00
Steven
804cb937fe
chore(docs): add // @ts-check to next.config.js docs (#61543)
This PR updates the docs to add `// @ts-check` at the top of each
`next.config.js` or `next.config.mjs`.

Even though you can't use `next.config.ts`, you can still get some type
checking to catch typos such as wrong type or even duplicate keys.


<img width="322" alt="image"
src="https://github.com/vercel/next.js/assets/229881/fcaba393-3560-4d16-95bf-a0504e66fa26">

<img width="325" alt="image"
src="https://github.com/vercel/next.js/assets/229881/e7156dd4-7b79-4f08-b843-4431b56b1c50">



Closes NEXT-2335
2024-02-02 00:36:00 +01:00
Stephanie Dietz
9945e8706d
remove note about updating next.config with hostname as this is not n… (#61458)
Since we do not optimize videos, we do not need to add the hostname to
the `next.config.js` file. This PR removes the note telling the reader
to do this.
2024-01-31 11:12:13 -05:00
Delba de Oliveira
70900cebfd
Docs: Add note on default.js receiving params (#61454) 2024-01-31 06:59:36 -08:00
Delba de Oliveira
5d21c6cba1
Docs: Document prefetch null for App Router (#61203)
As per: https://github.com/vercel/next.js/pull/48383
2024-01-31 08:00:30 -06:00
Delba de Oliveira
91cbe61e75
Docs: Add instrumentation.ts API reference, improve instrumentation docs (#61403)
- Add instrumentation.ts API reference
- Polish and restructure instrumentation docs
2024-01-31 07:54:32 -06:00
Delba de Oliveira
68c5edf7ed
Docs: Update migration wording for /pages (#61453) 2024-01-31 07:52:39 -06:00
Stephanie Dietz
0964c12983
Remove the regions option from the config section of the middleware file conventions doc (#61425) 2024-01-30 21:23:12 -06:00
Stephanie Dietz
bc22b21788
add the middleware.ts API reference file convention (#61037)
This PR adds a new docs page under the File Conventions section for
the`middleware.ts` file. It includes:

- Explanation of `middleware.ts` usage in Next.js.
- Code examples in TypeScript and JavaScript.
- Information on `matcher` function, `NextResponse`, and middleware
runtime environment.
- Version history of middleware feature updates.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
2024-01-30 13:14:13 -06:00
Sam Ko
e6e95f42bb
chore: update docs around redirect() (#61334)
## Description
- Add a sentence for clarifying redirecting in a Server Component
- Fixes https://github.com/vercel/next.js/issues/61315

Closes NEXT-2284

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2024-01-29 13:37:06 -08:00
Dima Voytenko
1862b8a0bf
OpenTelemetry: clarify Edge runtime support (#61338) 2024-01-29 12:24:04 -06:00
Dima Voytenko
6eb2c2461f
Telemetry: add time-to-first-byte signal (#61238) 2024-01-29 09:36:12 -08:00
Delba de Oliveira
fa935e5a3c
Docs: Fix headings in Parallel Routes page (#61328) 2024-01-29 08:48:29 -06:00
Aflah vp
5d80989d55
Removed an extra braces and comma from doc (},) (#61250)
<!-- 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 #

-->
2024-01-29 02:10:47 +00:00
Michael Peters
4701836d2f
docs: typo in page title (#61267)
Simple docs update, title on app router Static Assets page reads as
Statics Assets

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-29 01:52:27 +00:00
Kenji
093675fa74
docs(02-jest): fixes failing test in the tutorial (#61272)
### What?

This PR fixes the example test provided on [Setting up Jest with
Next.js: Creating your first
test:](https://nextjs.org/docs/app/building-your-application/testing/jest#creating-your-first-test)
not passing due to Jest not being compatible with async Server
Components.

### Why?

Although it's noted at the start of the tutorial that async Server
Components aren't currently supported by Jest, the example test failing
might confuse the reader.

### How?

This PR makes the example test pass by removing async from the `<Home>`
component

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-29 01:49:45 +00:00