Commit graph

1552 commits

Author SHA1 Message Date
Gnadhi
c15d99dc3e
Update 08-parallel-routes.mdx (#52419)
I Belive this is the incorrect location for the default.js in this
example it should be in app/@authModal/default.js not
app/@authModal/login/default.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?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2023-07-10 11:03:10 +02:00
Darshan Jain
c68c4bdc9f
fixed error #52486 fetchUsers to fetchUser (#52487)
#52486 

Here I fixed the typo error of fetchUsers to fetchUser in
docs/api-reference/04-functions/not-found.mdx

async function fetchUser(id) { // Here instead of fetchUsers i changed
it to fetchUser
const res = await fetch('https://...')
if (!res.ok) return undefined
return res.json()
}

export default async function Profile({ params }) {
const user = await fetchUser(params.id)

if (!user) {
notFound()
}

// ...
}

https://nextjs.org/docs/app/api-reference/functions/not-found
2023-07-10 09:43:05 +02:00
Hank Lin
2ef8938ff0
docs: fix the incrementalCacheHandlerPath (#52124)
The `incrementalCacheHandlerPath` have to be under `experimental`.
And the path should use `path` library so that the custom cache handler can be used.
2023-07-10 04:08:15 +00:00
Thor 雷神 Schaeff
af1948bde1
docs: add Supabase loader for next/image (#52480)
### What?

- Adds Supabase Storage custom loader docs.

### Why?

- Help folks find supabase storage as an option for Image loaders.
2023-07-10 03:59:41 +00:00
Jordan Newland
922498e886
docs: Update TypeScript plugin section for VS Code prompt (#52111)
Hey Next.js Team, 👋🏻

I noticed Next.js apps scaffolded with create-next-app weren't prompting me for the TypeScript workspace version in VS Code. After digging through the repo, I stumbled on this https://github.com/vercel/next.js/pull/49133 PR from Tim. While this PR explains why it was removed, I'm not sure the docs were ever updated to reflect this change.

This PR aims to address that with a simple note in the TypeScript Plugin section of the TypeScript docs page.

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-09 23:12:36 +00:00
MONEY
ea000d1028
docs: clarify fetch request de-duplication (#52100)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:55:15 -07:00
nroland013
ef6cb4c954
docs: Add Kuma to CSS-in-JS supported list. (#52438)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:54:19 -07:00
Luc Gagan
399fa9cfa9
docs: Add Playwright/Cypress Discord links (#52084) 2023-07-09 15:53:54 -07:00
Delba de Oliveira
7ea788e472
docs: Improve error handling docs for server-side errors. (#52302)
This PR adds more info about `error.message`, `error.digest`, and
omission of sensitive error details from Server Components.

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:38:19 -07:00
Nick Mazuk
1ffada9a70
docs: Simplify message in React essentials section. (#52469)
`Infact` is not a word. It should be `In fact`.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-09 19:13:04 +00:00
Brennan Colberg
99490de928
fix metadata-related typo in MDX documentation (#52446) 2023-07-09 16:34:15 +02:00
Paul Ostrouskiy
b0e4d8e447
[Docs] remove unnecessary dot. (#52387)
There's unneeded dot in a sentance
2023-07-07 14:50:25 +02:00
Lee Robinson
deb1d19ee5
docs: Clarify create-next-app requires public GitHub URLs. (#52367)
x-ref: https://twitter.com/gwenshap/status/1677111697537130497
2023-07-07 08:30:26 +00:00
Gabriel França
2c12c6add9
chore(docs): fix link to useSearchParams (#52348)
### Overview
The purpose of this PR is to remove the wrong link to useParams in the useSearchParams documentation.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-07-06 23:33:55 +00:00
Hong Zheng You
a17f07aa5b
doc: update typo in instrumentation page (#52311)
There's a small typo: `[pagesExtension]` -> `[pageExtensions]`. 

Got confused why my instrumentation hook was not called. When I searched my source code for `pagesExtension` there was no occurrence so I thought I did not use it; soon after I realized the field in the docs has a typo .
2023-07-06 16:45:39 +00:00
Tyler Lutz
38e45f25b2
Add app router example (#52066)
- Add app router example to 03-environment-variables.mdx

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-07-06 15:53:54 +00:00
Muhammad Rio Ananta Firdaus
202dcb0e32
Update 10-router-handlers.mdx (#52098)
Fixes a link for the Dynamic Functions shortcut.
2023-07-06 15:27:59 +00:00
Delba de Oliveira
931b1b5d87
[Docs] Add manual installation instructions for pages (#51995)
Fixes: https://github.com/vercel/next.js/issues/51938
2023-07-06 15:06:31 +00:00
Delba de Oliveira
26c0730911
[Docs] Document redirect parameters (#51987)
Fixes: 

- https://github.com/vercel/next.js/issues/51975
- [Linear](https://linear.app/vercel/issue/DX-1713/docs-redirect-is-missing-an-explanation-not-redirecttype)
2023-07-06 13:10:10 +00:00
bottxiang
cee0599628
fix wrong Link import (#52298)
<!-- 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 component cause Error: Element type is invalid: expected a string
(for built-in components) or a class/function (for composite components)
but got:
undefined](https://stackoverflow.com/questions/69211200/next-js-error-element-type-is-invalid-expected-a-string-for-built-in-componen)
### Why?
Wrong Link import, default export should be import as `import Link from
"next/link"` instead of `import {Link} from "next/link"`;
`;
`
### How?
import Link from "next/link"

Closes NEXT-
Fixes #

-->
2023-07-05 22:08:22 -07:00
feikerwu
bd02b4db7c
docs: Add clearer instructions on the storage location of mdx-components files. (#52187)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-05 18:55:12 -07:00
nauvalazhar
8e1fa7ea19
docs: add a missing open brackets in a next/link custom component (#52178) 2023-07-05 17:01:20 -04:00
Steven
941757ffae
chore(docs): remove "Legacy" from Preview Mode (#52284)
[Some readers](https://twitter.com/madebymutual/status/1676515579362942976 ) are confused about the docs using the term [Legacy](https://en.wikipedia.org/wiki/Legacy_system) thinking it means [Deprecated](https://en.wikipedia.org/wiki/Deprecation).

Preview Mode only exists in Pages Router so technically both are legacy, but we don't need to call out Preview Mode specifically as legacy since we don't do that for any other Pages Router feature.

This PR removes the term "Legacy" to avoid confusion.
2023-07-05 20:23:27 +00:00
Delba de Oliveira
44d1a1cb15
docs: Migrate error messages to MDX and App Router. (#52038)
This PR is part of a larger effort to migrate error messages to MDX and
use App Router: https://github.com/vercel/front/pull/23459
2023-07-05 06:11:16 -07:00
Simon Vrachliotis
972d29b6d5
Update generate-image-metadata.mdx (#52230)
I read the PR checklist, but this is such a small PR that I feel it's
self-explanatory.

I believe the wrong function name (`generateMetadata`) is used on this
page, and it was meant to be `generateImageMetadata`.

If not... apologies 😅
2023-07-05 09:23:14 +02:00
Chris Yang
11bd7725b5
Add missing url hash (#52123)
<!-- 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>
2023-07-03 08:36:09 -07:00
Tyler Lutz
967b876f6b
docs: Fix broken link (#52092)
Fix a broken link in optimizing index.mdx.
2023-07-02 18:20:27 +00:00
MONEY
9db91ebfa0
Docs: Fix missing typings for typescript example (#52076) 2023-07-01 15:15:15 -05:00
Steven
97461f0bba
fix(create-next-app): consolidate messages to "Would you like to use" (#52011)
This PR ensure that `create-next-app` questions are all formatted the
same way:

```
Would you like to use <feature>?
```

fix NEXT-1333
2023-06-30 18:11:23 +02:00
Steven
efdc026ac7
chore(docs): explain NODE_ENV environment variable (#52003)
This PR documents the `NODE_ENV` environment variable behavior.

This feature was originally added in
152c2c2af3 which was released in `next@5`.

See the current source code here:


e3e76a45ee/packages/next/src/bin/next.ts (L82)

---------
2023-06-29 14:12:37 -07:00
Timothy Vernon
0759104287
Docs: Fix broken link (#51991)
Link leads to a 404 page
2023-06-29 20:39:49 +00:00
Tyler Lutz
a2df492957
Update next lint section (#51898)
App directory is stable so you no longer need appDir.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-06-29 19:56:45 +00:00
Delba de Oliveira
18406adf9c
Make sure DevEx can approve docs PRs / Remove Spaces (#51996) 2023-06-29 17:10:53 +00:00
Delba de Oliveira
7c5eb3191e
[Docs] Remove unnecessary mention of scroll false (#51964) 2023-06-29 12:21:49 +00:00
Balázs Orbán
3dcaf922de
docs: clarify reactStrictMode: true by default (#51931)
Closes #51841

[Slack thread](https://vercel.slack.com/archives/C03S9JCH2Q5/p1687815414309519?thread_ts=1687814821.415089&cid=C03S9JCH2Q5)

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-06-29 03:48:29 +00:00
JJ Kasper
15b84c1dd3
lint fix 2023-06-28 20:00:37 -07:00
Lee Robinson
e602207cb0
docs: make custom image loader a client component. (#51858) 2023-06-28 19:36:20 -07:00
Charles Dudley
f17614abd1
[Docs] Fix run-on sentence (#51956)
As stated in title :)
2023-06-29 02:28:28 +00:00
Mrxbox98
bd1fc78bd8
Add cpu-features to server external packages (#51946)
<!-- 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?
Adds [cpu-features](https://www.npmjs.com/package/cpu-features) to
external server packages.

### Why?
To prevent developers from having to add ``cpu-features`` to their next
config.
2023-06-28 17:52:04 -07:00
Tyler Lutz
1f19a5b810
Add separate links in shared documentation (#51733)
### What?
- Added separate links for the app and pages router in the shared documentation.
- Added comment at the top of all shared documentation.
- Fixed typos in pages documentation comment.

### Why?
- To limit the switching between the different routers in shared documentation when clicking the links.
2023-06-28 23:37:56 +00:00
VelociRaptor
64c297f194
[docs] fix curly brackets in mdx (#51916)
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-28 23:19:49 +00:00
Christian Ivicevic
73491308b4
[docs] Replace the term "hole" with "slot" (#51919)
It feels more natural to use the actual term "slot" when describing how
to interweave server and client components since it's used in other
frameworks as well.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 16:07:15 -07:00
VelociRaptor
d390d75e1f
[docs] fix angle bracket in mdx (#51920) 2023-06-28 23:01:24 +00:00
Jacob Fletcher
d206c68ad7
adds payload to server-external-packages.json (#51933)
### What?
Adds `payload` to the external package list

### Why?

To prevent developers using
[Payload](https://github.com/payloadcms/payload) modules within Next.js
from having to add this in their next config.
2023-06-28 13:03:08 -07:00
drblessing
0732f2f538
Update 10-router-handlers.mdx (#51850)
Fixes a key bug for RequestCookie type
2023-06-26 14:25:39 -07:00
Ty Hopp
65f94baa83
feat: Introduce eslint rule for async client components (#51547)
The [React Server Component RFC on promise support](https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises.md) indicates that [client components cannot be async functions](https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises.md#why-cant-client-components-be-async-functions).

This PR introduces an eslint rule to enforce this.

Fixes #50898
2023-06-26 21:10:24 +00:00
Charles Dudley
e140e90e05
[Docs] Fix usage of article "an" before a consonant sound (#51803)
Because `<Carousel />` starts with the consonant, "C", the preceding article should be "a" not "an".

Reference: [https://www.merriam-webster.com/words-at-play/is-it-a-or-an](https://www.merriam-webster.com/words-at-play/is-it-a-or-an)
2023-06-26 15:34:31 +00:00
Luca Steeb
6d0d5e313b
docs(deploy): fix GitHub Actions cache key (#51789)
The specified default cache key `**.[jt]s` does not consider any files
in
folders, while `**/*.[jt]s` recursively includes all files.
The same goes for jsx/tsx.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-25 13:28:02 -07:00
Lee Robinson
72fdb063ee
docs: Add updated next/image video. (#51790)
I made a video two years ago that was teaching old patterns of the
Next.js image component. Since then, we have simplified the API, made
improvements to the component that no longer require wrapping DOM
elements, and more. This updated video explains these concepts, as well
as walks through some of the practical examples in the `examples/` fold
here.
2023-06-25 13:11:37 -07:00
Italo A
5e36c34992
fix: typo into 03-css-in-js.mdx page (#51761)
### Improving Documentation
Just fixing a typo into "alphabetical" word

- 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

### What?
Misleading typo
2023-06-24 22:08:49 +00:00