Commit graph

2059 commits

Author SHA1 Message Date
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
rocketman
755c8d9041
docs: Make server actions maxDuration timeout more clear (#60005)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-01-27 17:19:34 -06:00
Lee Robinson
5d01e4e608
docs: add Lucia auth (#61255) 2024-01-27 09:25:40 -06:00
Delba de Oliveira
94b9afe219
Docs: Adjust message about RootLayout (#61199) 2024-01-26 14:25:52 -08:00
Aleksandr Kondrashov
a3243e6710
Refine revalidatePath warning message (#61220)
<!-- 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 #

-->
#61159 fixed the documentation by removing incorrect information stating
that the type parameter must be set to 'page' when the path contains a
dynamic segment. This PR reflects this change in the warning message,
while confirming that the condition for the warning is already correct.
Additionally, I changed the word "affect" to "effect," assuming it was a
typo. In the documentation, I corrected myself and changed the wording
from "argument is required" to "parameter is required".
2024-01-26 22:05:04 +00:00
Steven
7f4ca97ef8
chore(docs): fix docs for static assets (public) (#61225)
Closes NEXT-2260

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-01-26 15:19:54 -05:00
Delba de Oliveira
5fd0f38de9
Docs: Improve and add new parallel routes examples (#60981)
Continuing from: https://github.com/vercel/next.js/pull/60806

- [x] Update **conditional routes** example to render dashboard pages
based on user's role (rather than checking if the user is logged in)
- [x] Add **tab group** example to allow each slot to be navigated
independently.
  - [x] Expand the **modal** example to show full implementation
    - [x] Opening the modal
    - [x] Closing the modal
- [ ] Add **catch-all** slots example
    
Please merge after the diagrams PR:
https://github.com/vercel/front/pull/28770

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2024-01-26 12:29:30 -06:00
Delba de Oliveira
53b1924b4d
Docs: Add note about revalidatePath invalidating router cache (#61142) 2024-01-26 16:17:24 +00:00
Aleksandr Kondrashov
6bc07792a4
Refine revalidatePath type argument (#61159)
<!-- 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 #

-->

Fixes #61158

If both `page` and `layout` are valid values for the `type` argument of
`revalidatePath` function, and only an empty value is forbidden, this PR
updates the documentation to reflect that.
2024-01-26 13:30:18 +00:00
Yann Bolliger
7a516d469b
Add dot to regex chars in rewrites.mdx (#61095)
The rewrites doc was missing the `.` character when specifying which
characters were used for regex matching.

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

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-26 02:41:01 +00:00
Eisa faqiri
d36d61465a
Update generate-sitemaps.mdx (#61167)
<!-- 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-01-26 01:40:04 +00:00
Lee Robinson
c5d470a491
docs: fix Auth0 typo in authentication (#61171) 2024-01-25 23:20:00 +01:00
Dima Voytenko
e6763488b7
OpenTelemetry: update docs for new @vercel/otel (#61044)
Co-authored-by: Andrew Gadzik <andrew.gadzik@vercel.com>
2024-01-25 13:16:39 -08:00
Delba de Oliveira
2d4dbcdfcb
Docs: Add note about calling redirect after try/catch (#61138)
Closes: https://github.com/vercel/next.js/issues/60448
2024-01-25 13:39:39 -06:00
Lee Robinson
d7ff67de67
docs: Combine Pages/App authentication docs (#60848)
Co-authored-by: StephDietz <steph.dietz@vercel.com>
Co-authored-by: Stephanie Dietz <49788645+StephDietz@users.noreply.github.com>
2024-01-25 13:32:02 -06:00
Junior Yono
32212d60fa
Fixed typo in docs (#61118)
Co-authored-by: Steven <steven@ceriously.com>
2024-01-25 09:35:53 -05:00
Delba de Oliveira
9a808e602e
Docs: Update wording on opting out of the Router Cache (#61123) 2024-01-25 00:40:43 -06:00
sogoagain
0cdc927e0f
Docs: Correct JavaScript React Component File Extension to .jsx in '01-vitest.mdx' (#61087)
Hello,

This PR resolves a file extension inconsistency in the 'Setting up
Vitest with Next.js' section of the Next.js documentation
(`01-vitest.mdx`).

When using next.js with JavaScript, following the
documentation(`01-vitest.mdx`) leads to issues during testing because of
the jsx extension.

This PR corrects an example code that wrongly uses a '.js' extension for
a React component, which is against Vitest's requirement for '.jsx'
extensions.
  - https://github.com/vitest-dev/vitest/issues/1564

Thank you.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-24 16:10:54 -08:00
Ian Jones
52ba486253
Fix <AppOnly> typo in docs (#61103) 2024-01-24 13:34:57 -06:00
Delba de Oliveira
2eaaad2d16
Docs: Share Redirecting docs with /pages (#61083)
- Share new **Redirecting** docs with /pages
- Add equivalent example for API routes in /pages
2024-01-24 08:23:38 -06:00
Josh Story
b5772b859a
Dynamic APIs (#60645)
formalizes the concept of dynamic APIs inside Next to allow for varying
semantics beyond just staticGenerationBailout.

### Dynamic APIs

#### `markCurrentScopeAsDynamic`
useful to bail out of default caching semantics but does not imply a
Request specific data source was read. critically, this semantic is
ignored if you are inside a cache scope

#### `trackDynamicDataAccessed`
Must be called before reading any data source that is derived from
Request specific data. Currently this is `cookies()`, `headers()`, and
`searchParams`. This kind of data access inside a cache scope is
forbidden (it always should have been, but now it will error).

#### `trackDynamicFetch`
This one is unideal but the complexity of patch-fetch's current
implementation necessitates it for now. Essentially it will postpone if
we are prerendering. Long term this should be eliminated with a refactor
of patch fetch.


### Other Improvements
Also removes the `staticGenerationBailout` implementation as it has been
replaced with more specific logic in the places it was previously being
used.

One area that has also been enhanced is the proxy for app-route modules.
Previously we proxied the Request every time however when we are doing
non-static generation executions we generally don't want the overhead of
wrapping the request. In the refactor here I also improved the runtime
performance by using static proxy handlers and I believe I also fixed a
few bugs related to `clone` and `url`

In general there has been a bit of refactoring to clarify how we should
handle various render/execution states and a reduction in implicit side
effects for proper execution.

Another callout to notice is that app-route modules do not attempt a
static generation if they are force-dynamic regardless of the PPR
setting. Previously the PPR setting would opt them into this code path
which is not necessary because PPR itself does not work for routes, only
pages.

Closes NEXT-2099
2024-01-23 16:06:12 -08:00
Delba de Oliveira
142584cb59
docs: Address community feedback (#60960)
Closes: 

- https://github.com/vercel/next.js/issues/60953
- https://github.com/vercel/next.js/issues/60755

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-01-22 19:19:34 -06:00
Lee Robinson
524f4c8178
docs: clarify nginx buffering disable (#61010)
https://github.com/vercel/next.js/pull/60943#issuecomment-1904413114
2024-01-22 19:09:30 -06:00
Mike Timmerman
6b88dc55ae
Update code example on 01-pages-and-layouts.mdx (#60963)
Use nullish coalescing operator in all getLayout examples on
documentation page

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-22 20:00:46 +00:00
Delba de Oliveira
7181d46f7f
docs: Add link to bloom filter example (#60987) 2024-01-22 13:56:11 -06:00
Mike Dyer
c754d9fb6e
update edge and nodejs runtime doc (#60801)
<!-- 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?
Update the edge-and-nodejs-runtime doc with a Good to Know about a
common build error involving using packages that rely on the filesystem
in an edge runtime environment.

### Why?
The docs don't mention the issue. Most github issues, articles, and SO
answers revolve around updating the next.config with a webpack key to
ignore 'fs' imports in api routes and getServerSideProps functions. This
is incorrect when the issue is using packages that rely on 'fs',
'stream', or 'path' in an edge runtime environment. Silly mistake, but
it costs people time.

### How?
Update the docs. 

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-01-22 13:24:16 +00:00
Prachi Sharma
9cce76ac64
docs: updated the getStaticProps function name (#60949)
Fix: function name getStaticPaths is written in getStaticProps function,
issue exist in get-static-props.mdx under pages/api-reference/functions
folder. This issue was pushed as part of -
Pull Request: 55205
Commit Id: 80fba152f2add326a1520ffd2b530d00c75983f6


![image](https://github.com/vercel/next.js/assets/55828197/90923d4e-9d7b-4bc3-aaf9-7f5ce377410e)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-01-21 21:11:20 +00:00
Jason
6f39461f8a
docs: Update userScalable property in viewport object and user-scalable in meta tag (#60946) 2024-01-21 14:00:00 -06:00