Commit graph

1963 commits

Author SHA1 Message Date
boylett
769d27aacc
correcting link to useSearchParams ref (#56169)
The link to the useSearchParams ref within the File Conventions > layout.js page currently links to the useParams ref, which is wrong and may lead to confusion as the useParams and useSearchParams APIs operate differently.
2023-09-28 23:11:33 +00:00
Vũ Văn Dũng
7f6a494e9e
docs: Use Response.json over NextResponse.json (#56173)
TypeScript 5.2 now supports `Response.json` (https://github.com/microsoft/TypeScript/issues/52841). That means, if we just need to return a JSON `Response`, we no longer need to import `NextResponse`. This PR updates all such instances in the documentation to use `Response.json`.
2023-09-28 19:36:21 +00:00
Shu Ding
fe90b04f95
(docs) Document Server Actions .bind method (#56164)
This will be the recommended way of passing extra arguments to a Server Action. A couple of reasons behind:

- This is better than putting a hidden `<input hidden value={userId}/>` because that will appear in the SSR'd HTML as full text and cannot be encoded. With `.bind`, we can handle that in the future.
- This is better than event callbacks `onSubmit={(e) => { await updateUser(userId, e.target.formData) }}` as this supports progressive enhancement.
- This is better than re-creating a new action `action={async (formData) => { "use server"; return updateUser(userId, formData) }}` as inlined `"use server"` only works in Server Components.
2023-09-28 16:20:53 +00:00
Bozhen
9cd46e335c
docs: Renamed function that is used by other name (#56170)
In "app/actions.ts" the function is named like create(), but in "app/add-form.tsx" file "createTodo" function is imported and used. This is related to TypeScript examples, .js files are ok.

### What?

Renamed a function.

### Why?

There are two example files in docs ([Error Handling](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#error-handling) section) and the `app/add-form.tsx` is importing function `create` from `app/actions.ts` by another name (`createTodo`).

### How?

Fixed by renaming function to `createTodo`, to match .js file with the same example.
2023-09-28 15:05:24 +00:00
walker flynn
8f3eb01193
Update revalidatePath.mdx to fix confusing wording of arguments section. (#56099)
This part of the documentation was confusing and did not match the below examples.
2023-09-28 01:11:00 +00:00
Vũ Văn Dũng
cf3d73a46b
Add the default import alias to create-next-app prompt for clarity (#55896)
### Why?

Whenever I run `create-next-app` and reach this question

```
Would you like to customize the default import alias? No / Yes
```

I always have to select "No", because I don't remember what this default import alias here is. [It _is_ documented to be `@/*`](https://nextjs.org/docs/app/api-reference/create-next-app#non-interactive), but the documentation is relatively hidden and not many people know about it – it's also easy to forget.

Even more confusingly, the next question ("What import alias would you like configured?") doesn't have this `@/*` as the default answer, but the user's last choice as the default answer instead (which could be different from `@/*` – making people wonder if Next.js changed their defaults overnight).

I suppose it would be better to just make it clear in the prompt itself, so people with skill issues who happen to forget that default value (like me) can still confidently select "Yes" if they want `@/*`, without having to do "No" and manually type `@/*` again.

### How

```diff
- Would you like to customize the default import alias?
+ Would you like to customize the default import alias (@/*)?
```
2023-09-26 22:58:46 +00:00
MUTESA Cedric
730b43d0ce
docs: link from install docs to create-next-app-docs (#55909)
as many developers are moving to bun, its a good idea that it also be included as an installation method.



Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-26 15:28:56 +00:00
Martyanov Andrey
9e9e366865
docs: pass base headers while setting nonce (#55708)
Example for setting "nonce", when created, clears the passed headers
2023-09-26 15:12:13 +00:00
water
ed6e8010e4
Update 02-project-structure.mdx (#55940)
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-26 10:08:55 +00:00
Lee Robinson
0e61aa99a2
docs: Add Stytch auth provider (#55777) 2023-09-25 21:41:38 -05:00
Lee Robinson
c7ff12b753
docs: update next-forms example (#55927)
A few bits of follow up from my previous PR updating the forms example.
2023-09-25 21:41:14 -05:00
Abdulghane Jesry
1d86a092ad
Update 03-linking-and-navigating.mdx (#55969)
I've removed a duplicated example.
2023-09-25 18:03:24 +00:00
Matthew Martinez
3dc2c1c7f8
docs-55629 update router cache column in cache interactions api table (#55630)
Fixes https://github.com/vercel/next.js/issues/55629.

Updates the `Router cache` column in the [Cache Interactions API Table](https://nextjs.org/docs/app/building-your-application/caching#apis) to reflect `Revalidate (Server Action)` in the `revalidateTag`, `revalidatePath` and `cookies` rows when used in a Server Action.
2023-09-25 17:48:30 +00:00
3λiȯ+
9d86c1224c
docs: Correct place for passing extension option to createMDX() (#55967)
### What?

Fixing a little mistake in the documentation, where the placement of the `extension` option for `createMDX()` was described as being inside the `options` property:

```ts
const withMDX = createMDX({
  options: {
    extension: /\.mdx?$/,
```

But it's actually a property of its own:


```ts
const withMDX = createMDX({
  extension: /\.mdx?$/,
```

I confirmed that the latter is correct because:

- It solves an issue I was having: Unable to import `.md` files
- On the same docs page, there's another place where it mentions this `extension` option and the code example is correct there
- The option is described in a similar issue, such as https://github.com/vercel/next.js/issues/45431#issuecomment-1410363864
2023-09-25 17:38:01 +00:00
Radu Petre Tarean
fb551c90e7
Update 03-linking-and-navigating.mdx (#55907)
I hope this is right, the description said for a link to be active the pathname should match the href, sorry if its wrong
2023-09-25 17:11:47 +00:00
Deepa Subramanian
9e3c1829b0
docs: add not-found to file conventions page (#55944)
Issue: https://github.com/vercel/next.js/issues/53888

Added "not-found.js" information to error.mdx after the `global-error.js`. Please approve.




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-25 15:06:01 +00:00
Vũ Văn Dũng
0b74f51882
docs: Add example on query parameters in route handlers (#55789)
### Why?

There is already an example of handling query parameters (`searchParams`) in route handler, but it's quite hidden (in [Opting out of caching](https://nextjs.org/docs/app/building-your-application/routing/route-handlers#opting-out-of-caching)). It made it hard for many developers to figure out how to do that: [there](https://discord.com/channels/752553802359505017/1127781032242974790) [are](https://discord.com/channels/752553802359505017/752647196419031042/1143181251856044042) [several](https://discord.com/channels/752553802359505017/752647196419031042/1146007247630106704) [people](https://discord.com/channels/752553802359505017/752647196419031042/1154623267164917861) who couldn't find that section in the documentation. (Linked are messages in the Next.js Discord server.)

Therefore this PR adds an example to the route handler documentation on how to do that, so developers can take reference more easily.
2023-09-24 15:23:40 +00:00
Mostafa Gouda
8f7d83f1fd
docs: Add note that Server Actions work with static routes (#55626)
In the new next.js v13.5 blog post, the [other improvements section](https://nextjs.org/blog/next-13-5#other-improvements) mentions:

> [Improvement] Server Actions now work with fully static routes (including revalidating data with ISR)

In the forms and mutation docs page, the [good to know section](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#how-server-actions-work) mentions:

> Currently, if a route uses a Server Action, it is required to [render dynamically](https://nextjs.org/docs/app/building-your-application/rendering/server-components#server-rendering-strategies).

I have changed the good to know section to convey the new improvement mentioned in the v13.5 blog post
2023-09-24 15:03:16 +00:00
João de Vasconcelos
3b8bbe197f
Fix missing async keyword in function declaration (#55887)
Just a one word change to fix the example in https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#generate-images-using-code-js-ts-tsx
2023-09-24 01:54:38 +00:00
Dom Sip
814db26c9c
Revert "fix typo in API Reference - Image Component" (#55889)
Currently the image props section is broken:
https://nextjs.org/docs/pages/api-reference/components/image



Reverts vercel/next.js#55776

fixes: [#55869](https://github.com/vercel/next.js/issues/55869)
2023-09-23 22:30:26 +00:00
Deepa Subramanian
d5db4d366c
Update 10-testing.mdx (#55801)
Made changes as suggested by the reporter. 

```json filename="tsconfig.json or jsconfig.json"
{
  "compilerOptions": {
    "module": "esnext",
    "moduleResolution": "node",
    "baseUrl": "./",
    "paths": {
      "@/components/*": ["components/*"]
    }
  }
}
```

```json filename="package.json"
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "cypress:open": "cypress open"
  }
}
```
2023-09-23 01:11:46 +00:00
Lee Robinson
5f4238d9fa
docs: useFormState (#55564)
This PR shows how to use a new React hook `useFormState` in the context
of the [Forms and
Mutations](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations)
docs. It also updates the forms example (`next-forms`) to show the
recommended patterns for loading / error states.

Related: https://github.com/vercel/next.js/pull/55399
---
Co-authored-by: John Pham <johnphammail@gmail.com>
2023-09-22 16:10:25 -05:00
Daigo Shitara
380986c535
fix typo in API Reference - Image Component (#55776)
removed unnecessary parentheses

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-22 19:31:20 +00:00
Deepa Subramanian
965fcfa04c
Update 01-pages-and-layouts.mdx (#55795)
``` 
Pages and Layouts
The Pages Router has a file-system based router built on the [concept of pages](https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts).
```
Change requested:
Here `concept of pages` hyperlinks routes to the current page. This bit confusing for someone trying to learn next.js. removing the hyperlink to the text would make clear.
2023-09-22 19:16:47 +00:00
Vũ Văn Dũng
a680571d04
Remove the left padding in next info output (#55704)
## Why?

Although the left padding makes the output looks good in the terminal, it causes this weird alignment in almost all bug reports:

```yaml
Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Pro
    Binaries:
      Node: 18.12.0
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.5.2-canary.2
      eslint-config-next: 13.5.2
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A
```

If I want it to look nice in the bug report

```yaml
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Thu Aug 17 21:23:02 PDT 2023; root:xnu-10002.1.11~3/RELEASE_ARM64_T8112
Binaries:
  Node: 20.3.1
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 8.6.12
Relevant Packages:
  next: 13.5.2
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A
```

I have to paste this to a text editor and manually remove the first four spaces on every lines.

### How?

This PR removes that four-space padding to make future bug reports look a bit nicer.
2023-09-21 18:26:43 +00:00
S3Prototype
69a8878631
Feedback: Remove line saying server actions is dynamic-only (#55746)
- Removes a line from next docs that is no longer accurate:
> Currently, if a route uses a Server Action, it is required to render
dynamically.
According

With the release of Next.js 13.5, Server Actions now work with fully
static routes (including revalidating data with ISR).


<!-- 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-09-21 10:43:42 -05:00
Ryan Gillie
90b0352a3e
Docs - Fix VSCode Full Stack Debugging Regex Pattern (#55670)
The most recent Next.js update [redesigned the logging output](https://github.com/vercel/next.js/pull/54713) (which looks great btw) but it broke the uri regex for the VSCode debugger. This PR updates it to use the new pattern.

Output Pattern Before: 
![Alt Text](https://user-images.githubusercontent.com/4800338/265493587-ee181263-3dd4-40d0-9ffc-819a56b45900.png)
Regex Before: `started server on .+, url: (https?://.+)`


Output Pattern After:
![Alt Text](https://user-images.githubusercontent.com/4800338/265130260-9649b340-8241-4756-a2b3-a989f0b74003.png)
Regex After: `- Local:.+(https?:\/\/.+)`

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-09-20 23:24:12 +00:00
Travis Anderson
f0ffa1c79e
add tip for case sensitivity of imports (#55662)
While an import may work on initial load, fast refresh fails, and also this can also cause issues when trying to deploy your project to Vercel, resulting in your component not being found.

This could save people time when they run into this issue, and I wish this small nuance, would've been in the docs.




Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-20 21:12:40 +00:00
GabenGar
fcca4ce955
fix(docs): internationalization middleware example (#55645)
- remove the slash before `pathname` (already included in the value).
- add `search` and `hash` values in redirected url:
   - retains these values on redirect
   - they already have `?` and `#` respectively




Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-20 11:37:15 +00:00
Jiachi Liu
7e17de9880
docs: move optimizePackageImports to experimental (#55614)
Closes #55611
2023-09-19 21:49:29 +00:00
Jake Boone
3cd4b975c3
create-next-app templates: Change bun run dev commands to bun dev (#55603)
[As of Bun v1.0.0](https://bun.sh/blog/bun-v1.0#changelog-since-v0-8), `bun dev` runs the "dev" script from package.json. Therefore, as with Yarn and pnpm, the "run" command is not necessary.

This PR changes the `create-next-app` README templates to show `bun dev` instead of `bun run dev`.
2023-09-19 19:04:33 +00:00
romeobravo
caa908326f
chore: Fix heading hierarchy in revalidateTag documentation (#55470)
### What?
Fix heading hierarchy in revalidateTag documentation (https://nextjs.org/docs/app/api-reference/functions/revalidateTag)

### Why?
Makes it consistent with https://nextjs.org/docs/app/api-reference/functions/revalidatePath
2023-09-19 01:41:18 +00:00
JJ Kasper
1b8ce8f634
Add route groups example to revalidatePath doc (#55543)
Adds explicit examples for route groups as those may not be obvious from
existing examples.

x-ref:
https://github.com/vercel/next.js/issues/49387#issuecomment-1722575969
2023-09-18 14:40:30 -05:00
Lee Robinson
676e3aeb6d
docs: Update streaming section. (#55408)
Adds a bit more clarity.
2023-09-16 14:58:35 +00:00
Lee Robinson
1ba414034d
docs: optimizePackageImports (#55185)
Follow up from https://github.com/vercel/next.js/pull/54695.
2023-09-16 14:46:49 +00:00
Alexandre Ferreira
cd1a50f133
Update 03-forms-and-mutations.mdx (#55386)
A unique key is required for each item on a list.
2023-09-14 17:17:13 +00:00
Will Binns-Smith
17ba84b7a7
WEB-1135: Update examples and schema for Turbopack loaders config change (#54584)
This addresses inconsistencies with existing examples and config schema
from changes in #49535.


Closes WEB-1451
2023-09-14 14:50:02 +02:00
Umoh Andem
055b5df50d
Update generate-metadata.mdx (#55347)
fixed a grammatical blunder
2023-09-14 02:08:23 +00:00
Ngô Đức Anh
f2f582c17f
Fix network URL logging in start-server (#55260)
### What?
Follow-up of #54926.
While that PR's main fix is no longer necessary due to the removal of render workers, I figure that some changes are nice-to-have and have isolated them into this PR. This includes fixing `appUrl` and `networkUrl` in `start-server`, fixing docs and removing some unnecessary template literals in `turbopack-warning`.

### How?
`appUrl` now tries to use `hostname` instead of `actualHostname` (an address like `example.com` seems to be more useful here than an IP like `xxx.xxx.xxx.xxx`), and `networkUrl` is now prefixed with `http://`.

Other simple changes include fixing docs.



Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2023-09-14 02:01:26 +00:00
Arseny Kruglikov
3561baa5d4
docs: add explicit units to isrMemoryCacheSize option (#55108)
This PR clarifies `isrMemoryCacheSize` value units. Units is not obvious
due to `Defaults to 50MB` comment and lack of TSDoc comments

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-09-13 15:52:04 -05:00
Michael Novotny
fe797c1074
Updates Mozilla links to not include language preference (#55326)
Internal suggestion to remove `en-US` from Mozilla urls since MDN is
available in multiple languages nowadays it will automatically redirect
to the viewer’s language preference.

Closes
[DX-2076](https://linear.app/vercel/issue/DX-2076/make-external-mozilla-links-language-agnostic-in-nextjs-docs)
2023-09-13 11:06:29 -05:00
Lee Robinson
6e3c4e24ed
docs: Add some App Router FAQs (#55186)
Based on questions I've seen in issues and discussions.
2023-09-12 19:45:55 +00:00
Daigo Shitara
49a876d456
Update route-segment-config.mdx for fix broken link (#55212)
Fixed link to `Node.js Runtime` in the revalidate section, as the link
was broken by the leading `/`.

Co-authored-by: Steven <steven@ceriously.com>
2023-09-12 15:43:19 -04:00
JJ Kasper
c2f587640a
Update docs for revalidatePath fix (#55083)
This updates docs for the fixes landed in
https://github.com/vercel/next.js/pull/53321 related to
`revalidatePath`.

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

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-09-12 11:28:16 -07:00
Pekka Enberg
45ee4ed260
Add libsql to external package list (#55266)
The `libsql` package is a fork of `better-sqlite3` that powers the Turso database client. Let's add `libsql` to the list of external packages, like `better-sqlite3`, so that people don't have to add extra configuration for their Next.js applications.
2023-09-12 16:48:48 +00:00
Lee Robinson
591d4e11ef
docs: clarify setting cookies docs (#55149) 2023-09-11 15:19:57 -05:00
Daniel Salvadori
e486d74464
Fix typo (#55245)
This PR fixes a single character typo.
2023-09-11 12:09:06 -07:00
Lee Robinson
9d529e525f
docs: satisfies follow up (#55234)
Follow up from https://github.com/vercel/next.js/pull/55205/files#r1321306801.
2023-09-11 13:59:27 +00:00
Lee Robinson
9de2fd53e8
docs: use satisfies for TypeScript code blocks (#55205)
Yay, TS 4.9!

https://twitter.com/leeerob/status/1563540593003106306
2023-09-11 10:04:54 +00:00
Lee Robinson
9b98e1ccc6
docs: fix nested list (#55178)
Seems to be rendering fine here (https://nextjs.org/docs/messages/react-hydration-error) with actual numbering
2023-09-10 13:08:29 +00:00
Dalton McPhaden
a8f300dd0f
Update 01-server-components.mdx (#55085) 2023-09-07 03:27:57 +00:00
Callum Silcock
cc34ea52ff
docs: example of generated nonce to use base64 encoding as per spec (#55039)
nonce's are limited to characters found in base64 encoding, uuids contain '-' which breaks the spec,
converting to a base64 string after generating simplifies this

---

This was a bit gotcha in our project, there are a few tools that only expect there to be a single `-` and do a split based off it (so when there are >1 they fail)

## Rules for nonce's

- The nonce must be unique for each HTTP response
- The nonce should be generated using a cryptographically secure random generator
- The nonce should have sufficient length, aim for at least 128 bits of entropy (32 hex characters, or about 24 base64 characters).
- Script tags that have a nonce attribute must not have any untrusted / unescaped variables within them.
- The characters that can be used in the nonce string are limited to the characters found in base64 encoding.
2023-09-06 22:52:51 +00:00
Lee Robinson
3f29268133
docs: Remove app reference on pages doc for runtimes. (#55058) 2023-09-06 15:19:32 +00:00
CSY54
b3ed162fe2
docs: add missing quotation mark (#54968)
There is a quotation mark missing in the docs. Adding it back in this PR.
2023-09-06 07:22:31 +00:00
迷悟
57bbc59028
docs: fix typo (#54973) 2023-09-06 07:16:19 +00:00
Hyewon Kim
85fb714f16
docs: Fix typo in getting-started/project-structure (#55035)
<!-- 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 #

-->

- Fix typo in [Next.js Project Structure: Top-level
files](https://nextjs.org/docs/getting-started/project-structure#top-level-files)
- It's common to create it as `next-env.d.ts` without dots.
2023-09-06 00:12:17 -07:00
JJ Kasper
2f31fa9476
Update eslint dependencies note in docs (#55023)
Closes: https://github.com/vercel/next.js/issues/54105
2023-09-05 19:01:27 +00:00
Lee Robinson
930db5c1af
docs: Add template API reference (#54938)
Ports content from the Pages and Layouts section about templates and formats to match other API reference pages.

Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-09-04 16:54:56 +00:00
Chanhee Lee
85f9e1b751
docs: Fix typo in app/building-your-application/caching (#54841)
- fix typo in [Building Your Application: Caching](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttag-and-revalidatetag)
- `options.next.tags` is correct (current: `options.next.tag`)
2023-09-03 17:25:35 +00:00
Robert Bradford
17da2ca1fe
docs: Move general info about next.config.* to its index page (#53542)
I was reading through the current https://nextjs.org/docs/app/api-reference/next-config-js/pageExtensions and noticed it started explaining different file formats for the `next.config.*` file. Is that information better suited for the https://nextjs.org/docs/app/api-reference/next-config-js index page?

There was also a little redundancy at the top. 

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-03 00:12:47 +00:00
Rousan Ali
d58603fb63
docs: Update Vercel YouTube channel url (#54912) 2023-09-03 00:10:00 +00:00
Fuma
f74f676f73
docs: Clarify the ability to access current route segments in layouts (#53349)
> Layouts do not have access to the current route segment(s). To access route segments, you can use useSelectedLayoutSegment or useSelectedLayoutSegments in a Client Component.

The term "current" is confusing. 
It should be only the route segments under the layout. For example: `app/layout.tsx` can not access `app/[slug]`.
2023-09-02 23:55:18 +00:00
Curtis L
96e13c3bf1
docs: add missing word in client components (#54830)
Missing word in client component page in docs when discussing the effect of "use client" on a client component's children and imported components. Not sure if 'children' is the appropriate word or whether there should be a reference to imported components too.
2023-09-02 23:47:56 +00:00
Florentin / 珞辰
a0beb340ca
docs: add maxDuration in API Routes config (#54844)
Update the code snippet for configuring API Routes to include `maxDuration` as an option.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-02 23:43:11 +00:00
imageck
6c098a74e3
docs: Minor formatting fix in Pages Router SSG (#54915) 2023-09-02 23:34:21 +00:00
Rob Johansen
166f556f69
Fix typo in description of error.js (#54933) 2023-09-02 22:57:49 +00:00
Lee Robinson
5eea161d8b
docs: Add docs on CSP and nonce generation (#54601)
There's been some confusion on the correct way to add a `nonce`, so took the opportunity here to:

- Add a new docs page for Content Security Policy
- Explained how to generate a `nonce` with Middleware
- Showed how to consume the `nonce` in a route with `headers`
- Updated the `with-strict-csp` example
- Update the `nonce` error message page
- Backlinked to the new page in a few places in the docs
2023-09-01 22:13:49 +00:00
Bora Öksüzoğlu
f621defc11
Docs: Add changeFrequency and priority attributes to sitemaps (#54863)
https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-09-01 14:36:41 +00:00
Michael Novotny
e2584c6fb3
Updates minimum node version in documentation (#54839)
Updates minimum node version in documentation as we've changed what we require since written.

DX-2046
2023-09-01 04:02:24 +00:00
Sadaf
ac56bcafa7
docs: define router instance in code block (#54707)
…g scroll
2023-08-31 03:21:46 +00:00
Aryan Malik
4f0b7156a4
docs: Add JS/TS code switchers to Middleware (#54726)
In case a user needs a `js` code
2023-08-31 03:19:21 +00:00
Xvezda
44509f690a
docs: fix syntax error in i18n example code block (#54749)
Added missing comma to fix syntax error in i18n configuration example.
2023-08-31 03:16:55 +00:00
Mateusz Aliyev
a759711cab
docs: remove typo in use-selected-layout-segments.mdx (#54767)
This pull request removes a typo in `use-selected-layout-segments.mdx`.

![image](https://github.com/vercel/next.js/assets/82393815/3c2717cf-212b-4d99-b403-3f90193adf42)
2023-08-30 13:27:47 +00:00
Lee Robinson
dc55050894
docs: Change Vite guide title (#54774) 2023-08-30 13:23:15 +00:00
Michael Angelo Rivera
d02124aae6
docs: clarify data type in Forms and Mutations section (#54630)
### What?

Clarify the "Forms and Mutations" docs. 

### Why?

This may be opinionated, but I believe this section of the docs starts out assuming that the user knows how the `<form>` HTML works. Coming from the client side React world, most developers are used to using state in forms. Clarifying that this data is accessible via the standard web API [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData) is essential for both transitioning developers and new developers.
2023-08-30 13:20:55 +00:00
vinay
8374e24a39
(Docs) Add missing JS-Code, cookies function names updated accordingly. (#54703)
Changed the name of the actions to `delete` and `read` to indicate the appropriate operation.
2023-08-30 12:03:17 +00:00
Ed Putans
75c641522d
Fixed typo in Building your application > 03. Rendering section (#54764)
<!-- 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: Balázs Orbán <info@balazsorban.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-30 13:59:02 +02:00
Igor Gassmann
e8c71ed2ea
docs(upgrading): add "Migrating from Vite" guide (#53214)
### What?

This adds to the docs a guide for migrating a Vite application to
Next.js. It also contains a section that lists the reasons why one would
want to switch from Vite to Next.js.

### Why?

This guide is helpful for developers that want to switch to Next.js but
don't know how difficult that would be and how to do it. The "Why?" list
is also helpful to developers who haven't yet been convinced to switch
or need help formulating the reasons to switch to decision-makers.

This guide was [first published on the Inngest
blog](https://www.inngest.com/blog/migrating-from-vite-to-nextjs). To
our own surprise, we were able to [migrate from Vite to
Next.js](https://github.com/inngest/inngest/pull/479) our [Dev Server
app](https://github.com/inngest/inngest/tree/main#the-inngest-dev-server)
in less than a day, which motivated us to share our learnings with the
community.

### How?

The guide aims to have the minimum number of steps to get a working
Next.js application so that
the reader can then adopt Next.js features incrementally. This means the
migration of the router isn't part of this guide. However, this would be
something valuable to document at a later time so that the reader can
also learn how to migrate to the App Router and get all the Next.js
benefits.
2023-08-29 14:17:05 -05:00
Ryo Matsukawa
d2e4d2c170
docs: Standardize heading levels (#54590)
## What?

- Updated the heading structure in the documentation to maintain a consistent hierarchy.
- All primary points now use `###` for better readability and understanding of content structure.

## Why?

While reviewing the documentation, I noticed that the heading levels were inconsistent between sections 1, 2, and 3-5.
2023-08-29 18:34:13 +00:00
Shohei Maeda
efd8d22654
Add new permanentRedirect function in App Router (#54047)
for internal:
https://vercel.slack.com/archives/C03S8ED1DKM/p1691700057242999

### Problem

- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
can't control the status code.
- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
returns a 307 HTTP redirect response while it returns a 308-equivalent
meta tag `<meta http-equiv="refresh" content="0;url=/foo"/>` in
streaming response (e.g., suspense boundary), making the behavior
inconsistent.

### Solution

Adding a new `permanentRedirect()` function and changing the meta tag
default accordingly.

| func   |      HTTP status      |  meta tag |
|---|:---:|---|
| `redirect()` | 307 | `<meta http-equiv="refresh"
content="1;url=/foo"/>` |
| `permanentRedirect()` | 308 | `<meta http-equiv="refresh"
content="0;url=/foo"/>` |

ref.
https://developers.google.com/search/docs/crawling-indexing/301-redirects

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-28 14:22:43 -07:00
Krychaxp
bdfbde5db8
Update revalidatePath.mdx (#54631)
add if statement, because typescript throws error: revalidatePath require `string`, but `searchParams.get('path')` returns `string|null` type




Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-28 20:33:49 +00:00
Donovan Dikaio
41368670a3
docs: fix small typo (#54656) 2023-08-28 07:25:51 +00:00
Emilio Schaedler Heinzmann
a699c980aa
docs: updates generateMetadata function signature (#54638)
Change optional arg to non-optional arg of `parent` in the `generateMetadata` API function example in oder to avoid the error shown below.
 
![Screenshot 2023-08-27 at 15 23 02](https://github.com/vercel/next.js/assets/103655828/a39dc0c0-ab1b-4a26-9ac0-1e9ddcfd11da)
2023-08-27 23:21:48 +00:00
Lee Robinson
68331892cc
docs: Add JS code snippets for forms (#54577)
https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations

Some of the code blocks where I only specified TS code snippets aren't
working with JS as well (when there are no types). I think I might have
incorrectly assumed you could leave those out. So added the JS snippets
in here (same code, just different file names).
2023-08-27 11:37:10 -05:00
Chan Nyein Thaw
a221121002
Update revalidatePath to revalidateTag (#54633)
Fix typo in `revalidateTag.mdx`. Updated `revalidatePath` -> `revalidateTag`
2023-08-27 15:58:25 +00:00
Delba de Oliveira
05dbd9a8a2
Docs: Update Edge runtime and data revalidation information (#54499)
Fixes: https://vercel.slack.com/archives/C042LHPJ1NX/p1692666204185669

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-08-26 18:33:15 -07:00
Vector73
f2766b979b
docs: Fixes typo in route handlers (#54605) 2023-08-26 15:24:16 -05:00
Lee Robinson
b048d7eee2
docs: Forms and mutations (#54314)
This PR is a larger change to documentation to make the following
updates:

- Deconstructs [Server
Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions)
into "Forms and Mutations" and an API reference
- Removes content in place of future React API documentation pages
- Removes outdated [Building
Forms](https://nextjs.org/docs/pages/building-your-application/data-fetching/building-forms)
docs from the Pages Router and adds conditional content for both routes
in "Forms and Mutations"
- Adds TypeScript code blocks to API Routes page, recommends Route
Handlers for isomorphic signatures.
- Updates `revalidatePath` and `revalidateTag` docs to have a Server
Actions example.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-08-25 14:31:11 -05:00
Clément Dreptin
41be932238
docs: fix source files hash calculation (#54509)
Hello!

I recently tried to cache the `.next/cache` directory in a GitHub action following what was said in the documentation and realized that hashing the source files didn't work properly.

This problem also occured in [next-cache](https://github.com/jongwooo/next-cache) and was fixed by [this PR](https://github.com/jongwooo/next-cache/pull/17).

This PR simply changes the example from the documentation to apply the same fix (stop using brackets in the patterns passed to `hashFiles`).

Hope it helps!

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide
2023-08-25 16:04:21 +00:00
Steven
6a70ebf2aa
chore(docs): add example of sanity image to loaderFile config (#54529)
https://www.sanity.io/docs/image-urls
2023-08-25 14:10:26 +00:00
Ahmed Abdelbaset
7ac6bb1a88
docs: Add missing parameters to both useSelectedLayoutSegment & useSelectedLayoutSegments (#53602)
This PR adds missing parameters to the `useSelectedLayoutSegment` & `useSelectedLayoutSegments` hooks since they take *optional* `parallelRoutesKey`.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-08-24 23:14:47 +00:00
Lee Robinson
4e052deff2
docs: fix broken link missing leading slash (#54520) 2023-08-24 17:19:23 +00:00
Delba de Oliveira
94b7743cbe
Docs: Fix formatting issues in the rendering docs (#54517) 2023-08-24 16:49:46 +00:00
Delba de Oliveira
1dc5c066cb
docs: Rewrite Rendering Section and React Essentials Page (#51579)
We initially wrote the [React
page](https://nextjs.org/docs/getting-started/react-essentials) to
introduce Server Components in the App Router, but over time, some
implementation details have changed, and the information has become
stale. The React team is working on adding new docs, so I'd like to
change the narrative on the Next.js docs from "client vs. server
components" to "writing code for the server and for the client" - and
link back to the React documentation when it becomes available.

As React developers, we're very familiar with writing code for the
client, it's nice and simple. But doing so comes at the expense of not
being familiar with the server. The aim of these docs is to help
developers become proficient in both the client and server environments.

I'd like to take it back to the foundations, and not use abstractions
like SSG and CSR, MPAs or SPAs, as those terms come with their own set
of assumptions that make it harder to understand how RSC works. Instead,
we'll focus on the request lifecycle, show how application code flows
from the server to the client, and discuss the trade-offs of doing
operations in each environment.

- [x] Page: Rendering Fundamentals
   - [x] Environments: Client and Server
   - [x] Request-response lifecycle
   - [x] Network Boundary
- [x] Page: Server Components
    - [x] Benefits and use cases of server rendering
    - [x] How to use Server Components in Next.js
    - [x] How Server Components are rendered
    - [x] Static Rendering
    - [x] Dynamic Rendering
    - [x] Streaming
- [x] Page: Client Components
    - [x] Benefits and use cases of client rendering
    - [x] How to use Client Components in Next.js
    - [x] How Client Components are rendered
        - [x] Initial vs. Subsquent navigation
- [x] Page: Composition Patterns
    - [x] When to use client and server components
    - [x] Server Component Patterns
    - [x] Client Component Patterns
    - [x] Interleaving Client and Server Components
- [ ] ~Diagrams~ will follow up with new PR.
- [x] Set up redirects: https://github.com/vercel/front/pull/24917

---------

Co-authored-by: Térence Hollander <hollanderterence@gmail.com>
Co-authored-by: shawnthwei <32075290+shawnthwei@users.noreply.github.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
2023-08-24 08:48:44 -05:00
Uzair Ali
32f11c34e8
Update 10-testing.mdx (#54107)
Fixed `next/jest.js` import in documentation. without `.js` it show this error
```
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'F:\React\my-project\node_modules\next\jest' imported from F:\React\my-project\jest.config.mjs
Did you mean to import next/jest.js?
    at new NodeError (node:internal/errors:399:5)
    at finalizeResolution (node:internal/modules/esm/resolve:326:11)
    at moduleResolve (node:internal/modules/esm/resolve:945:10)
    at defaultResolve (node:internal/modules/esm/resolve:1153:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36)
 ```
2023-08-24 12:02:00 +00:00
David Porter
be5f9baf74
docs: Add next-i18n-router as a resource for internationalized routing (#52344)
### Why?
Many developers are asking how to add internationalized routing in the App Router as it works in the Pages Router. [next-i18n-router](https://www.npmjs.com/package/next-i18n-router) is a very helpful package that fully solves this challenge.

### How?
Unlike the example provided in these Next.js i18n docs, [next-i18n-router](https://www.npmjs.com/package/next-i18n-router) does not require nesting all pages in a `[lang]` dynamic segment. It also allows for the default language to be accessible without a locale prefix in the path (just like in the Pages Router).

It includes locale detection based on the `accept-language` header as recommended in the Next.js docs, as well as support for the `NEXT_LOCALE` cookie to set a user's preferred language (just like in the Pages Router).
2023-08-24 01:07:43 +00:00
Lee Robinson
ed3aea924d
docs: Remove unneeded word in caching docs (#54451) 2023-08-23 16:24:31 +00:00
Delba de Oliveira
06be3c6cf5
Docs: Remove runtime configuration from /app docs (#54336)
Remove runtime configuration from app docs as it's not available. 

Fixes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692029581031809
2023-08-23 12:42:50 +00:00
Delba de Oliveira
705b2ef2d4
Docs: Refer users to IDE or MDN for manifest object options (#54385)
Based on feedback here:
https://vercel.slack.com/archives/C03S9JCH2Q5/p1692712555316389?thread_ts=1692710113.742499&cid=C03S9JCH2Q5
2023-08-22 09:50:53 -05:00
Delba de Oliveira
83394b900b
Docs: Document manifest metadata file (#54380)
Add missing docs for `manifest` metadata file. 

Fixes: https://github.com/vercel/next.js/issues/54296
2023-08-22 14:35:41 +00:00
Delba de Oliveira
9ca82f68ed
Docs: Clarify status codes w/ streaming (#54374)
Clarify what status code is returned when streaming, and in relation to `redirect` and `not-found`. 

Relates to: https://github.com/vercel/next.js/pull/54361

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-08-22 14:03:56 +00:00
Delba de Oliveira
f0ff3c468c
Docs: Update template.js section (#54370)
Fixes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692619927373449

- Updates wording on nesting, to say it's not the actual output, but rather how `template.js` nests between `layout.js` and its children.
- Remove mention of animations, needs further clarification.
2023-08-22 09:05:38 +00:00
Steven
f6d2aa09de
fix: minimum node version 16.14.0 (#54331)
- Fixes https://github.com/vercel/next.js/issues/54269
- Related to https://github.com/vercel/next.js/pull/54285
2023-08-22 08:58:53 +00:00
Delba de Oliveira
0c85f8aad3
Docs: Add notes that revalidation is not available in the Edge runtime / only Node.js (#54338)
Fixes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692261964220369
2023-08-21 22:00:40 +00:00
Delba de Oliveira
3bce82e807
Docs: Fix broken links (#54340)
Fix broken links picked up by crawl-analysis: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692621216597749
2023-08-21 16:33:38 +00:00
Tooooooooon
5d758c7ec0
update readme in nextjs testing (#54322)
Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-08-21 15:32:13 +00:00
Laurent Thiebault
71d424e804
docs: update a small typo in 02-app/01-building-your-application/06-optimizing/01-images.mdx (#54311)
Hello,

I just make this PR because the `/me.png` example is not in "remote images" section but in "local images", that's why I propose to edit this :)

Thank you!

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide
2023-08-20 18:33:16 +00:00
Joseph
76997cc053
docs: Bump minimum Node.js version to 16.14 (#54285)
### What?

Docs change.

### Why?

- https://github.com/vercel/next.js/issues/54269

### How?

Bump the Node.js version shown at: https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#nodejs-version 

Fixes #54269
2023-08-20 03:03:02 +00:00
Willi-m
baef523fb0
[Docs] fix missing ' in data-fetching/fetching-caching-and-revalidating (#54058)
In https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#opting-out-of-data-caching a single quote (`'`) is missing.

![CleanShot 2023-08-15 at 17 08 58](https://github.com/vercel/next.js/assets/179761/eccd5fc9-a2fd-4c11-968f-76fd33fc5317)
2023-08-15 14:12:56 +00:00
Matt Cowley
c1fa78bf6c
fix(next/image): empty blur image when animated (#54028)
Partial fix for #54012: do not generate a blur image in the image loader when the image is detected to be animated, rather than returning the *entire* animated image as the blur image.
2023-08-15 02:17:40 +00:00
Tibor Sándor
b4d5ddb834
Update opengraph-image.mdx: Fix typo (#54020)
This commit fixes a typo in the `<head> output` (twitter-image.alt.txt) code block
2023-08-14 21:05:22 +00:00
Kyle McDonald
3d569bd92a
Open Graph Image font declaration moved to correct place (#53998)
When implementing `opengraph-image` in my [personal-site-project](https://github.com/kylemcd/personal-site). I was consistently running into issues where custom fonts would either only work locally or only work on vercel. To me it seemed like differences in pathing in `edge` vs `nodejs` runtimes. After digging around I found issue #48081, more specifically [this comment](https://github.com/vercel/next.js/issues/48081#issuecomment-1565842740) where moving the `fetch` for the font into the `Image` function solved the issue.

I'm not sure if this is 100% the correct fix, or if this is an issue that needs to be solved in another way. If that's not the case this PR updates the documentation around `opengraph-image` to have the fetch for custom fonts inside of the `Image` function.
2023-08-14 19:36:13 +00:00
Lacy Morrow
3958fc0732
Update 05-client-side-rendering.mdx with latest tanstack query version (#54009)
### What?
Update Tanstack query URL

### Why?
The latest Tanstack query version is v4, the docs currently list v3
2023-08-14 18:28:12 +00:00
Aryan Malik
5ec7933f6b
Update 11-middleware.mdx: Added Switcher (#53977)
Added a switcher on a code snippet under heading -> `Using Cookies`, just like the other code snippets on this page got one..

(For those who don't know what a switcher is -> It's just a simple functionality for changing `typescript` code to `javascript` and vice-versa, kind of a UI feature for better experience`

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-08-14 12:32:23 +00:00
Tim Neutkens
983feeb3da
Fix typo in partial navigation section (#53981)
Noticed a small typo, this fixed it.

<!-- 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-08-14 10:36:04 +02:00
Hüsrev
5cda9af70f
The extra word 'the' has been deleted (#53951) 2023-08-12 21:37:51 +00:00
Kevin Pham
ea0bb97729
Docs: fix pnpm command for saving dev deps (#53937) (#53938)
Previous of after (before in linked issue)
```
❯ pnpm add --save-dev @next/eslint-plugin-next
Already up to date
Progress: resolved 525, reused 517, downloaded 0, added 0, done
Done in 6.4s
```

Resolves #53937
2023-08-12 07:52:46 +00:00
Artur Bień
e0ca2ba544
feat(image): DataURL placeholder support for <Image /> (#53442)
Adds support for base64-encoded `placeholder`. Enables using placeholders without the "blur" effect.

Fixes #47639
- [x] Add support for DataURL placeholder
- [x] Add tests
- [x] Update docs

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-11 23:45:20 +00:00
Banbarashik
424b205344
fix typo (#53908)
remove misused pronoun "it"

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-11 21:59:31 +00:00
Shu Ding
10cb74062b
(docs) Fixes Server Actions example (#53920)
Closes #53910.
2023-08-11 18:25:31 +00:00
Delba de Oliveira
1cafeb4102
Docs: Update confusing wording in intercepting routes (#53854)
Fixes: https://github.com/vercel/next.js/issues/53787
2023-08-11 08:59:03 +00:00
Colin McDonnell
7e16538485
Include instructions for bun package manager (#53590)
## For Contributors

### Improving Documentation

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

### What?

Add instructions for using `bun/bunx` where relevant. I only added mentions where npm/yarn/pnpm were all already listed. 

### Why

Bun can be used as a runtime-agnostic [package manager](https://bun.sh/package-manager) and script runner in any project with a `package.json`.

(Sorry, I probably should have consolidated this with https://github.com/vercel/next.js/pull/53467)

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-10 23:44:20 +00:00
Steven
2cf5d3a8aa
chore(docs): note cache-control header for preview/draft mode (#53825)
You can technically get similar ISR behavior setting the `Cache-Control` in `getServerSideProps()`, but this won't be automatically bypassed when enabling Preview Mode or Draft Mode so this PR adds that to the documentation.

x-ref: [slack discussion](https://vercel.slack.com/archives/C03S8ED1DKM/p1691514209722429)
2023-08-10 14:05:54 +00:00
Lee Robinson
1286e145b0
docs: Opting out of scrolling with next/link and useRouter. (#53804)
Addressing comments from https://github.com/vercel/next.js/issues/49087.
Introduced with https://github.com/vercel/next.js/pull/51869.
Related https://github.com/vercel/next.js/issues/50105.

This PR adds documentation for `next/link` and useRouter` about how to disable scroll restoration.
2023-08-10 09:41:56 +00:00
Steven
89be8c4b35
chore(docs): add missing "try it out" (#53815)
Follow up to https://github.com/vercel/next.js/pull/53760

This follows the same pattern as other demo links on this page.
2023-08-10 00:30:56 +00:00
Lucas Constantino Silva
0350e00d0d
docs: document cache tagging mechanism (#53806)
This PR document the cache tagging semantics in Next.js, and how to benefit from it during cache revalidation.
2023-08-09 23:18:02 +00:00
Lee Robinson
3077a0e9ff
docs: Add more information about Server Actions (#53805)
A few helpful additions based on conversations I've had recently.
2023-08-09 15:48:24 +00:00
Steven
87301834b3
chore: add light/dark mode theme detection to image component example (#53760)
This PR adds documentation for light/dark mode detection with `next/image`.

In the future, we could also document the picture solution once https://github.com/vercel/next.js/pull/51205 goes stable (although some of the preloading would not be possible).

* x-ref: https://twitter.com/victorbayas/status/1688596439704780822
2023-08-09 14:55:42 +00:00
Delba de Oliveira
8e0d108836
Docs: Add option for fetching data using route handlers - from the client (#53793)
In the data fetching page, we discuss the different ways you can fetch data in Next.js. This PR adds a fourth option which is to call route handlers from client components. I've also added a note that you shouldn't call a route handler from a server component. 

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-08-09 13:55:44 +00:00
Emilien Kenler
64d9475f37
Fix typo in data fetching documentation (#53772)
Fix a typo in data fetching documentation.
2023-08-09 04:45:49 +00:00
MrAdib
2566d0781d
Fix a link in incrementalCacheHandlerPath.mdx (#53718)
fix the default cache handler link
2023-08-09 00:55:13 +00:00
Jude Gao
de0ff6fd59
Fix doc grammatical errors (#53672)
### Improving Documentation

- Ran `pnpm prettier-fix`
2023-08-07 16:24:42 +00:00
Shen Lu
0363cef4c0
Fix: missing equal sign (#53650)
Missing an equal sign in Image docs

1e02a92a94/docs/02-app/02-api-reference/01-components/image.mdx (L690)
2023-08-07 01:52:37 +00:00
Martín Stanicio
3e637cab8c
fix typo in image.mdx (#53638)
Fixed a typo in the api reference about the [\<Image\> component](https://nextjs.org/docs/pages/api-reference/components/image#fill).

Replaced "stetch" with "stretch" in the fourth paragraph
2023-08-06 20:56:02 +00:00
Tomoya Kashifuku
5f9d2c55ca
docs: fix the link to another document (#53599)
The link used to be "https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises" but actually "https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises.md" is correct (needs ".md" at the end)
2023-08-05 17:06:21 +00:00
vinay
081151fed1
(Docs) Remove appDir from experimental flag in mdx configuration docs. (#53610)
<!-- 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-08-05 10:14:00 -04:00
Lee Robinson
b7aa7d4aa4
docs: fix typo on caching page (#53597)
- reduce: `MISS`
- reduces: `HIT`
2023-08-04 23:55:20 +00:00
Steven
acf5e84556
chore(docs): update static exports documentation with missing info (#53592)
- Related to https://github.com/vercel/next.js/issues/48022
2023-08-04 22:16:59 +00:00
William Li
aac4d9c3f7
use import type to import from 'next' in ts examples (#53568)
Updates typescript examples in https://nextjs.org/docs/app/building-your-application/optimizing/metadata#static-metadata to use `import type` instead of `import`.

![CleanShot 2023-08-04 at 17 28 12](https://github.com/vercel/next.js/assets/179761/d14503a4-1453-4f8f-95de-9d40ad1917ef)
2023-08-04 20:30:09 +00:00
José Olórtegui
49d4f8af3b
docs: update webhook snippet for cache revalidation (#53585)
This PR updates cache revalidation snippets in the docs. It seems that `res` should not be there since you can't find it anywhere in the snippet so I suppose that the intent was to use `NextResponse` instead. Another thing is that now we're checking the existence of the params so typescript doesn't get mad at us. And last I changed the methods to `POST` since AFAIK webhooks normally use the `POST` method.

Please let me know if there's anything left to do on my side.

Have a great day!

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-04 20:22:02 +00:00
Michal Landsman
4b13d80744
doc: styled-components has stable version (#53539)
replace rc.1 by stable version

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-04 19:08:08 +00:00
Colin McDonnell
57ce466502
Add --use-bun to create-next-app (#53467)
This adds support for `--use-bun` to `create-next-app` to use `bun
install` when bootstrapping a new project.

```
npx create-next-app --use-bun
```

As with Yarn and pnpm, it reads from `npm_config_user_agent` to
determine if the user ran `bunx create-next-app`. If so, it defaults to
using Bun.

```sh
bunx create-next-app
```

## For Contributors

### Improving Documentation

- [x] Run `pnpm prettier-fix`
- [x] `pnpm build && pnpm lint` 
- [x] Added test to
`test/integration/create-next-app/package-manager.test.ts`

---------
2023-08-03 18:00:38 -07:00
Balázs Orbán
9477b61b51
fix(next): clarify fetch polyfill, drop node-fetch (#53548)
### What?

Fix documentation about `fetch` polyfilling, and drop `node-fetch` references.

### Why?

Since we stopped using `node-fetch` in `next` in favor of `undici` there were some inconsistencies in the docs, and unused references to the `node-fetch` package inside `packages/next`-


Noted this while answering this [Slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1691089801007129)
2023-08-03 23:12:26 +00:00
Noam Honig
bf9c65f8d9
docs: fix force-dynamic example (#53521)
fixed force dynamic example

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-08-03 18:57:43 -04:00
Robert Bradford
f08d42d533
docs: Fix typo and link in 02-app-router-migration.mdx (#53537)
Fixes a typo and a missing closing parenthesis on a link.
2023-08-03 22:50:01 +00:00
Jakub Naskręski
754a2a6ad8
docs: Remove duplicate backtick in next/font (#53520)
Fixed duplicate backtick in
[adjustFontFallback](https://nextjs.org/docs/pages/api-reference/components/font#adjustfontfallback:~:text=false%3A%20for-,%60%60next/font/google%60,-adjustFontFallback%3A%20%27Times%20New)
API docs.
2023-08-03 16:56:54 -04:00
Jacob Pargin
e30f6f4530
Fix markdown for caching doc link (#53536)
☝️  Just that!
2023-08-03 17:11:37 +00:00
OJ Kwon
630c41cd92
feat(next): next info --verbose for additional details (#53181)
### What?

First phase implementation for WEB-1313.

This PR expands existing `next info` features by adding new flag `--run-diags`. When this flag is supplied, next.js will try to collect more information. Primarily informations are related to next-swc installation to see if it's possible to diagnose why next-swc cannot be loaded on certain systems. It is not a definitive list - depends on the findings we may increase more items to collect.

These are the list of status included in the output

- Host info: CI / WSL / Docker
- Next.js installation: node, pkg mger version, next.js pkg
- Partial Node.js diagnostics report: `header, javascriptHeap, sharedObjects`
- next-swc installation: check if installed next-swc can be loaded
- (Mac os only) next-swc shared object dependencies: using `otool` or `dyld_info` to collect binary dependencies. Linux / Windows support will follow later.

Below's an example generated report, expect user to attach into issue if there are failures. 

<details>

```
### Host system information


  WSL: false
  Docker: false
  CI: false


### Next.js installation


  Binaries:
    Node: 18.11.0
    npm: 8.19.2
    Yarn: N/A
    pnpm: 7.24.3
  Relevant Packages:
    next: 13.4.13-canary.1
    eslint-config-next: 13.4.13-canary.1
    react: 18.2.0
    react-dom: 18.2.0
    typescript: 5.1.3
  Next.js Config:
    output: N/A



### Node.js diagnostic report

{
  "header": {
    "reportVersion": 2,
    "event": "JavaScript API",
    "trigger": "GetReport",
    "filename": null,
    "dumpEventTime": "2023-07-25T14:13:32Z",
    "dumpEventTimeStamp": "1690319612854",
    "processId": 33203,
    "threadId": 0,
    "nodejsVersion": "v18.11.0",
    "wordSize": 64,
    "arch": "arm64",
    "platform": "darwin",
    "componentVersions": {
      "node": "18.11.0",
      "v8": "10.2.154.15-node.12",
      "uv": "1.43.0",
      "zlib": "1.2.11",
      "brotli": "1.0.9",
      "ares": "1.18.1",
      "modules": "108",
      "nghttp2": "1.47.0",
      "napi": "8",
      "llhttp": "6.0.10",
      "openssl": "3.0.5+quic",
      "cldr": "41.0",
      "icu": "71.1",
      "tz": "2022b",
      "unicode": "14.0",
      "ngtcp2": "0.8.1",
      "nghttp3": "0.7.0"
    },
    "release": {
      "name": "node",
      "headersUrl": "https://nodejs.org/download/release/v18.11.0/node-v18.11.0-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v18.11.0/node-v18.11.0.tar.gz"
    },
    "osName": "Darwin",
    "osRelease": "22.5.0",
    "osVersion": "Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000",
    "osMachine": "arm64"
  },
  "javascriptHeap": {
    "totalMemory": 25624576,
    "executableMemory": 1048576,
    "totalCommittedMemory": 23543808,
    "availableMemory": 4324923368,
    "totalGlobalHandlesMemory": 16384,
    "usedGlobalHandlesMemory": 8384,
    "usedMemory": 20296720,
    "memoryLimit": 4345298944,
    "mallocedMemory": 1431256,
    "externalMemory": 1450294,
    "peakMallocedMemory": 6525792,
    "nativeContextCount": 1,
    "detachedContextCount": 0,
    "doesZapGarbage": 0,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 0,
        "used": 0,
        "available": 0
      },
      "old_space": {
        "memorySize": 8994816,
        "committedMemory": 9175040,
        "capacity": 8830992,
        "used": 8829704,
        "available": 1288
      },
      "code_space": {
        "memorySize": 966656,
        "committedMemory": 917504,
        "capacity": 765440,
        "used": 762496,
        "available": 2944
      },
      "map_space": {
        "memorySize": 802816,
        "committedMemory": 1048576,
        "capacity": 773376,
        "used": 773264,
        "available": 112
      },
      "large_object_space": {
        "memorySize": 6094848,
        "committedMemory": 6094848,
        "capacity": 6056016,
        "used": 6056016,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 0,
        "used": 0,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 376832,
        "committedMemory": 376832,
        "capacity": 4995992,
        "used": 351088,
        "available": 4644904
      },
      "new_space": {
        "memorySize": 8388608,
        "committedMemory": 5931008,
        "capacity": 4123904,
        "used": 3524152,
        "available": 599752
      }
    }
  },
  "sharedObjects": [
    "/Users/ojkwon/Library/Application Support/fnm/node-versions/v18.11.0/installation/bin/node",
    "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
    "/usr/lib/libobjc.A.dylib",
    "/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal",
    "/usr/lib/liboah.dylib",
    "/usr/lib/libfakelink.dylib",
    "/usr/lib/libicucore.A.dylib",
    "/usr/lib/libSystem.B.dylib",
    "/System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking",
    "/usr/lib/libc++abi.dylib",
    "/usr/lib/libc++.1.dylib",
    "/usr/lib/system/libcache.dylib",
    "/usr/lib/system/libcommonCrypto.dylib",
    "/usr/lib/system/libcompiler_rt.dylib",
    "/usr/lib/system/libcopyfile.dylib",
    "/usr/lib/system/libcorecrypto.dylib",
    "/usr/lib/system/libdispatch.dylib",
    "/usr/lib/system/libdyld.dylib",
    "/usr/lib/system/libkeymgr.dylib",
    "/usr/lib/system/libmacho.dylib",
    "/usr/lib/system/libquarantine.dylib",
    "/usr/lib/system/libremovefile.dylib",
    "/usr/lib/system/libsystem_asl.dylib",
    "/usr/lib/system/libsystem_blocks.dylib",
    "/usr/lib/system/libsystem_c.dylib",
    "/usr/lib/system/libsystem_collections.dylib",
    "/usr/lib/system/libsystem_configuration.dylib",
    "/usr/lib/system/libsystem_containermanager.dylib",
    "/usr/lib/system/libsystem_coreservices.dylib",
    "/usr/lib/system/libsystem_darwin.dylib",
    "/usr/lib/system/libsystem_dnssd.dylib",
    "/usr/lib/system/libsystem_featureflags.dylib",
    "/usr/lib/system/libsystem_info.dylib",
    "/usr/lib/system/libsystem_m.dylib",
    "/usr/lib/system/libsystem_malloc.dylib",
    "/usr/lib/system/libsystem_networkextension.dylib",
    "/usr/lib/system/libsystem_notify.dylib",
    "/usr/lib/system/libsystem_sandbox.dylib",
    "/usr/lib/system/libsystem_secinit.dylib",
    "/usr/lib/system/libsystem_kernel.dylib",
    "/usr/lib/system/libsystem_platform.dylib",
    "/usr/lib/system/libsystem_pthread.dylib",
    "/usr/lib/system/libsystem_symptoms.dylib",
    "/usr/lib/system/libsystem_trace.dylib",
    "/usr/lib/system/libunwind.dylib",
    "/usr/lib/system/libxpc.dylib",
    "/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices",
    "/usr/lib/libDiagnosticMessagesClient.dylib",
    "/usr/lib/libenergytrace.dylib",
    "/usr/lib/libbsm.0.dylib",
    "/usr/lib/libz.1.dylib",
    "/usr/lib/system/libkxld.dylib",
    "/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices",
    "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList",
    "/System/Library/Frameworks/Security.framework/Versions/A/Security",
    "/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration",
    "/usr/lib/libapple_nghttp2.dylib",
    "/usr/lib/libcompression.dylib",
    "/usr/lib/libnetwork.dylib",
    "/usr/lib/libsqlite3.dylib",
    "/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation",
    "/System/Library/Frameworks/Network.framework/Versions/A/Network",
    "/usr/lib/libCoreEntitlements.dylib",
    "/System/Library/PrivateFrameworks/MessageSecurity.framework/Versions/A/MessageSecurity",
    "/System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer",
    "/usr/lib/libMobileGestalt.dylib",
    "/System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression",
    "/usr/lib/libcoretls.dylib",
    "/usr/lib/libcoretls_cfhelpers.dylib",
    "/usr/lib/libpam.2.dylib",
    "/usr/lib/libxar.1.dylib",
    "/System/Library/PrivateFrameworks/CoreAutoLayout.framework/Versions/A/CoreAutoLayout",
    "/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration",
    "/usr/lib/libarchive.2.dylib",
    "/usr/lib/libxml2.2.dylib",
    "/usr/lib/liblangid.dylib",
    "/System/Library/Frameworks/Combine.framework/Versions/A/Combine",
    "/usr/lib/swift/libswiftCore.dylib",
    "/usr/lib/swift/libswiftCoreFoundation.dylib",
    "/usr/lib/swift/libswiftDarwin.dylib",
    "/usr/lib/swift/libswiftDispatch.dylib",
    "/usr/lib/swift/libswiftIOKit.dylib",
    "/usr/lib/swift/libswiftObjectiveC.dylib",
    "/usr/lib/swift/libswiftXPC.dylib",
    "/usr/lib/swift/libswift_Concurrency.dylib",
    "/usr/lib/swift/libswift_StringProcessing.dylib",
    "/usr/lib/swift/libswiftos.dylib",
    "/System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo",
    "/System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/Versions/A/IOMobileFramebuffer",
    "/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface",
    "/usr/lib/libpcap.A.dylib",
    "/usr/lib/libdns_services.dylib",
    "/usr/lib/liblzma.5.dylib",
    "/usr/lib/libbz2.1.0.dylib",
    "/usr/lib/libiconv.2.dylib",
    "/usr/lib/libcharset.1.dylib",
    "/usr/lib/swift/libswift_RegexParser.dylib",
    "/usr/lib/libheimdal-asn1.dylib",
    "/usr/lib/libCheckFix.dylib",
    "/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC",
    "/System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP",
    "/System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate",
    "/usr/lib/libmecab.dylib",
    "/usr/lib/libCRFSuite.dylib",
    "/usr/lib/libgermantok.dylib",
    "/usr/lib/libThaiTokenizer.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib",
    "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib",
    "/System/Library/PrivateFrameworks/MIL.framework/Versions/A/MIL",
    "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory",
    "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory",
    "/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS",
    "/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation",
    "/usr/lib/libutil.dylib",
    "/System/Library/PrivateFrameworks/InstalledContentLibrary.framework/Versions/A/InstalledContentLibrary",
    "/System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore",
    "/usr/lib/libapp_launch_measurement.dylib",
    "/System/Library/PrivateFrameworks/AppleMobileFileIntegrity.framework/Versions/A/AppleMobileFileIntegrity",
    "/usr/lib/libmis.dylib",
    "/System/Library/PrivateFrameworks/MobileSystemServices.framework/Versions/A/MobileSystemServices",
    "/System/Library/PrivateFrameworks/ConfigProfileHelper.framework/Versions/A/ConfigProfileHelper",
    "/System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics",
    "/System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce",
    "/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling",
    "/usr/lib/libxslt.1.dylib",
    "/usr/lib/libcmph.dylib",
    "/System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji",
    "/System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData",
    "/System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon",
    "/System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement",
    "/usr/lib/libTLE.dylib"
  ]
}

### next-swc installation

next-swc is installed correctly for aarch64-apple-darwin

### next-swc shared object dependencies

/Users/ojkwon/github/next.js-upstream/node_modules/@next/swc-darwin-arm64/next-swc.darwin-arm64.node:
	/Users/runner/work/next.js/next.js/target/aarch64-apple-darwin/release/deps/libnext_swc_napi.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1228.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60420.60.24)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.255.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

/Users/ojkwon/github/next.js-upstream/node_modules/@next/swc-darwin-arm64/next-swc.darwin-arm64.node [arm64]:
    -platform:
        platform     minOS      sdk
           macOS     12.0      13.1   
    -segments:
        load-offset   segment section        sect-size  seg-size perm
        0x00000000    __TEXT                             94304KB r.x
        0x00001680             __text           66042588
        0x03EFD15C             __stubs            3336
        0x03EFDE64             __init_offsets      112
        0x03EFDED4             __gcc_except_tab 5771520
        0x0447F000             __const          8830192
        0x04CEACF0             __cstring           128
        0x04CEAD70             __unwind_info    2417156
        0x04F38F78             __eh_frame       13496364
        0x05C18000    __DATA_CONST                        3040KB rw.
        0x05C18000             __got              2288
        0x05C188F0             __const          3101360
        0x05F10000    __DATA                               512KB rw.
        0x05F10000             __data           422352
        0x05F771D0             __thread_vars      1656
        0x05F77848             __thread_data       104
        0x05F778B0             __thread_bss       2776
        0x05F78388             __common          62704
        0x05F87880             __bss             18424
    -dependents:
        attributes     load path
                       /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
                       /System/Library/Frameworks/Security.framework/Versions/A/Security
                       /usr/lib/libSystem.B.dylib
                       /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
                       /usr/lib/libiconv.2.dylib
```


</details>
2023-08-03 17:03:41 +00:00
John Ide
57788b56f8
Adding docs about static exports not supporting dynamic segments (#52959)
Adding docs about how Dynamic Segments aren't supported with Static Exports.

- Related to https://github.com/vercel/next.js/issues/48022

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-02 18:27:31 +00:00
Shu Ding
a58a869f48
(docs) Add example of redirection in Server Actions (#53485)
Based on the feedback from #53435, this PR adds an example of redirection inside Server Actions to the docs. Currently, we have examples of getting/setting cookies but there's nothing for `redirect()`.
2023-08-02 17:58:07 +00:00
Jarrett Meyer
c7fa524ebd
docs: add clarity for deleting cookies (#52338)
Added additional methods for deleting a cookie




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-02 17:02:51 +00:00
SubsequentlySneeds
c3f4e5d866
Minor grammar fix in "src Directory" page (#53481)
This change removes the sentence fragment starting with "Which" and merges it into the previous sentence.
2023-08-02 16:33:31 +00:00
Delba de Oliveira
eecd8dc146
Docs: update caching docs (#53478)
This PR:
- Makes minor content and formatting improvements
- Updates caching diagrams:
  - Adds missing static/dynamic diagram (fixes #53460) 
  - Tweaks designs to explain things better
  - Increases font sizes

Relies on: https://github.com/vercel/front/pull/24321
2023-08-02 12:11:22 +00:00
Steven
1b2e361e0d
chore(docs): add section about responsive images (#53463)
We got some feedback from that there is missing information when working with responsive images.

This PR adds a new section for Responsive Images along with some recipes how to achieve that.
2023-08-02 09:29:08 +00:00
leotrt
f51978beae
fix(doc): Broken link formatting in draft-mode doc (app router) (#53446)
### What?
Link to dynamic rendering is not appearing as such in the App router's draft-mode docs.

### Why?
The formatting is wrong, it misses a parenthesis

### How?
Added the missing parenthesis
2023-08-01 15:22:49 +00:00
Delba de Oliveira
dc3936b11a
Docs: Review Getting Started Section (#53377)
I've started reviewing the docs to identify areas we need to cover / improve. This PR contains minor improvements for the **getting started**, **installation**, and **project structure** pages.


New tasks added to linear: 
- Create [middleware.ts](https://linear.app/vercel/issue/DX-1834/create-middlewarets-api-reference-in-file-conventions) page
- Create [instrumentation.ts](https://linear.app/vercel/issue/DX-1833/create-instrumentationts-api-reference-in-file-conventions) page
2023-08-01 15:12:18 +00:00
Delba de Oliveira
b4d40f454e
Docs: Fix formatting issues in the caching docs (#53436) 2023-08-01 13:34:25 +00:00
Lee Robinson
19c4eec064
docs: fix broken diagram in caching docs (#53414)
Follow up from https://github.com/vercel/next.js/pull/52514.

We're still missing the static and dynamic diagram, it was missed in the PR to `front` to add the original diagrams. We'll need to get that in as well, could be here, or in a follow up.
2023-08-01 03:21:00 +00:00
Delba de Oliveira
98c3076eb4
Docs: Document caching mechanisms (#52514)
This PR document the caching semantics in Next.js, how they interact, and what APIs affect them. We're also taking the opportunity to consolidate terminology, remove duplicate content, and update sections of the docs that relate to caching. 

### Documentation

- [x] Create a new section for caching
- [x] Explain how the different caching mechanisms work
   - [x] Request Memoization (React Cache)
   - [x] Persistent Data Cache 
   - [x] Persistent Full Route Cache 
   - [x] In-memory, client-side Router Cache 
- [x] Document how different APIs affect caching
- [x] Document cache interactions 
- [x] Clean up stale information in the other docs sections
   - [x] Routing Section
      - [x] Move advanced navigation topics from fundamentals to **How Navigation Works** section
      - [x] Rewrite the **How Navigation Works** section
   - [x] Rendering Section
      - [x] Simplify fundamentals page
      - [x] Rewrite the **Static and Dynamic Rendering** pages
      - [ ] ~Create a page to explain how **Client and Server Components** are rendered~. Moved to this PR: https://github.com/vercel/next.js/pull/51579
   - [x] Data fetching section 
      - [x] Consolidate data fetching story for fetching, caching, and revalidating
      - [x] Clarify data fetching story with 3rd party libraries and React `cache`
      - [x] Create **Data Fetching Patterns** page
- [x] Document other related behaviors: 
   - [x] Update information on scroll position for back/forward navigation 
   - [x] Remove the concepts of **soft and hard navigation**
   - [x] Remove the concepts of **static and dynamic data fetching**
   - [x] Use consistent terminology **runtime** 👉🏼  **request time**. Runtime for Edge and Node.js, request time to describe when dynamic stuff happens
   - [x] `generateStaticParams` being able to seed the Full Route Cache
- [x] Polish 💅🏼 

---
### Related PRs:

- Diagrams: https://github.com/vercel/front/pull/24142
- Redirects: https://github.com/vercel/front/pull/24179
2023-07-31 17:03:26 +00:00
Ozan Sevkin
97a0a3373f
docs: update active link code snippet for better equality check (#53327)
Update pathname and href matching check from startsWith() method to strict equality. startsWith() method causes all paths to match with root link "/"
2023-07-30 23:21:59 +00:00
JJ
d3b0c7bb42
[Docs] remove x-xss-protection-header (#53362)
The x-xss-protection header is a non-standardized http header with low browser-capability.
If it is likely to be supported in the future, it can be treated as experimental, but since it is not, it is preferable to remove it.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
https://caniuse.com/mdn-http_headers_x-xss-protection
2023-07-30 20:12:41 +00:00
Steven Tey
ed35e2a6ea
Added docs on async not-found.js server components (#51999)
While `not-found.js` components do not accept any props, you can still turn the `not-found.js` component into an async server component to fetch dynamic data:


```tsx filename="app/blog/not-found.tsx" switcher
import Link from 'next/link'
import { headers } from "next/headers";

export default async function NotFound() {
  const headersList = headers();
  const domain = headersList.get("host")
  const data = await getSiteData(domain)
  return (
    <div>
      <h2>Not Found: {data.name}</h2>
      <p>Could not find requested resource</p>
      <p>
        View <Link href="/blog">all posts</Link>
      </p>
    </div>
  )
}
```

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-07-29 07:33:28 +00:00
Dom Sip
b149fb7009
docs: Update Route Handlers AI example code snippet (#52127)
changing AI example model from `text-davinci-003` to `gpt-3.5-turbo`
which is in a `chat/route.ts` format.

The alternative but with "completition" style would be a bit longer code
like:

```
// app/api/completion/route.ts

import { Configuration, OpenAIApi } from 'openai-edge'
import { OpenAIStream, StreamingTextResponse } from 'ai'

export const runtime = 'edge'

const apiConfig = new Configuration({
  apiKey: process.env.OPENAI_API_KEY!,
})

const openai = new OpenAIApi(apiConfig)

function buildPrompt(prompt: string) {
  return prompt.split('\n').map((message) => ({
    role: 'user',
    content: message,
  }));
}

export async function POST(req: Request) {
  
  // Extract the `prompt` from the body of the request
  const { prompt } = await req.json();

  // Request the OpenAI API for the response based on the prompt
  const response = await openai.createChatCompletion({
    model: 'gpt-3.5-turbo',
    stream: true,
    messages: buildPrompt(prompt),
    max_tokens: 500,
    temperature: 0.7,
    top_p: 1,
    frequency_penalty: 1,
    presence_penalty: 1,
  })

  // Convert the response into a friendly text-stream
  const stream = OpenAIStream(response)

  // Respond with the stream
  return new StreamingTextResponse(stream)
}

```

<!-- 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: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-07-29 00:25:48 -07:00
Julien Bouquillon
71f08ef873
docs: fix typo (#53100)
just a typo in next/jest docs
2023-07-29 07:12:33 +00:00
Shunya Hayashi
dffafdecd3
Update nginx.conf example in documentation for improved flexibility and clarity (#53135)
## Description

This PR updates the provided example of nginx.conf in the documentation. The changes introduce more flexibility and clarity, making the example easier to understand and more suited for general use.

## What?

Changes include ↓

- Modifying the root directory to `/var/www/out`. This aligns more closely with typical server configurations and separates the public web content from other parts of the server.

- Updating the try_files directive for the `/` location block. The directive now attempts to serve `$uri`, `$uri.html`, and `$uri/` in that order. This setup caters to the common pattern in static websites of serving files derived directly from the URL and correctly handles URLs that omit the .html extension.

- The `/blog/` location block is retained as is, with the rewrite directive still relevant and not requiring changes.

## Why?

These modifications aim to improve the applicability of the example to a wider range of use cases and make it more comprehensible for new users.

## How?

The changes were made directly to the `nginx.conf` example provided in the docs, following the standard syntax and conventions of Nginx configuration files.


Please let me know if there are any questions, or if further modifications are needed !!

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-07-29 07:03:14 +00:00
Andrew Garvin
ce29de25e4
Fixed simple typo in documentation (#53317)
I think this is a typo, at the very least I found the sentence a little clunky.
2023-07-28 21:22:37 +00:00
Steven Tey
7f77f427d2
docs: Add next-international to examples list (#53303) 2023-07-28 21:04:22 +00:00
Zack Tanner
604681912b
ensure colocated unit tests run in CI & fix various failing tests (#53270)
Colocated unit tests (such as ones in `packages/next` and `packages/font`) weren't running in CI since `run-tests` marks the glob cwd as `<root>/tests`. This modifies the working directory to be the root so the new expanded test pattern will pick up files outside of `test/`.

Several of these tests were failing so there are updates in here to fix them. Specifically:

- Source Sans Pro font was renamed to Source Sans 3
- `fillCacheWithDataProperty` test was hitting the `bailOptimistic` code path
- `resolve-metadata` had an invalid assertion (`rel: icon` gets added as part of `IconsMetadata`)
- `resolve-opengraph` wasn't handling undefined images
- `server-patch-reducer` now use inline snapshots as one was failing since it now has a prefetchCache
2023-07-28 13:54:15 +00:00
Oyebadejo Michael
37bb09d36a
chore(docs): remove repeated closing bracket (#53268)
### Adding or Updating Examples

- The repeated closing bracket that comes just after "Server Actions" has been removed

### Fixing a bug

- fixes #53267
2023-07-27 19:35:34 +00:00
Balázs Orbán
7721b9ba64
docs: match image example with code (#53254)
Closes NEXT-1761
Fixes #52037
2023-07-27 12:27:50 +00:00
Florentin / 珞辰
f1bd1eda8e
[docs] add documentation for maxDuration segment option (#52326)
This PR documents the new `maxDuration` segment options that allows to opt into higher Vercel function timeouts.
2023-07-26 16:35:28 +00:00
Aryan Malik
ccc269a5ae
Update 01-installation.mdx (#53192)
Added switcher on `page/_document.tsx` example just for a consistency
2023-07-26 15:34:27 +00:00
Aryan Malik
4cb14b5110
Fix grammatical error in docs (#53197)
Changed 'created' to 'create' for improved grammar and clarity in the documentation.

Find it under `Custom App`
[https://nextjs.org/docs/pages/building-your-application/routing/custom-app](url)
2023-07-26 13:25:25 +00:00
Daniel
84197ece65
chore(docs): client-side data fetching loading state (#53164)
setLoading must be "true" at first and then set to "false". The documentation, as is, always has the value of setLoading set to "false".

The purpose of this code is to show "...loading" on the screen while the data is being fetched. In order for this to happen, setLoading must be initially set to "true" and then (after the data is successfully loaded) set to "false", since the line `if (isLoading) return <p>Loading...</p>` is asking if the content is still loading, and if it is, it'll return a message indicating it.

Because of this

### What?
setLoading should be set to "true" at first.

### Why?
Because the code then asks if the content is being loaded. The code (as is) always has setLoading set as "false" and it doesn't show the loading message when it's supposed to.

### How?
I changed the line to `const [isLoading, setLoading] = useState(true)`.




Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-07-25 16:49:40 +00:00
Steven
a0856eb596
chore: update warning message from yarn add sharp to npm i sharp (#53130)
Previously, this warning message assumed the user knew what `yarn` was and had it installed.

This PR changes the warning message to assume the user knows what `npm` is and has it installed, since `npm` ships with the official `node` installation.
2023-07-24 22:33:12 +00:00
Lee Robinson
436408272e
docs: fix codeblock for redirect (#53120)
Just needs a language 👍
2023-07-24 16:48:15 +00:00
vinay
c355fb1a38
(Docs) Remove FormData type on formData defined in .js file (#53014) 2023-07-24 15:47:35 +00:00
vinay
a18e2ec94b
(Docs) Add missing import for useRef() (#53015) 2023-07-23 21:41:10 +00:00
Paul Barry
85676da42c
chore(docs): Extend the options for custom server init (#52851)
## For Contributors

### Improving Documentation

While working with a custom server, I noticed that [the list of available options within the codebase](https://github.com/vercel/next.js/blob/canary/packages/next/src/server/base-server.ts#L138-L180) was much larger than [the options listed within the docs](https://nextjs.org/docs/pages/building-your-application/configuring/custom-server). This PR extends the `next` import function options to include all of ~the allowed~ documented options from the codebase. 

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




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-23 17:25:07 +00:00
Sungyun Hur
caeaa74dda
docs: fix typo in 08-parallel-routes.mdx (#53069)
### What?

Fix a typo in `08-parallel-routes.mdx` by adding a whitespace.

### Why?

<img width="783" alt="스크린샷 2023-07-23 오후 4 11 22" src="https://github.com/vercel/next.js/assets/8033896/0bb92fc5-5a6f-4461-895a-a956abf52a9d">


### How?
2023-07-23 17:01:38 +00:00
trigaten
e4871f6927
docs: remove unneeded good to know section during installation (#53078)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-23 09:49:51 -07:00
Vu Van Dung
a0ea5f2d79
Fix formData code snippet in route handler docs (#52532)
### Why?

The code snippet in the Route handler `formData` documentation

```ts
import { NextResponse } from 'next/server'
 
export async function POST(request: Request) {
  const formData = await request.formData()
  return NextResponse.json({ formData })
}
```

is slightly wrong, because `formData` is not a plain object and hence `return NextResponse.json({ formData })` doesn't actually work.

Since we are already in the topic of parsing `formData`, I also added a mention on `zod-form-data` which can be used to validate the form and parse it to non-string formats such as `number`.
2023-07-22 21:15:12 +00:00
vinay
94878fe719
(Docs) add missing import. (#52992)
`import { cookies } from 'next/headers'`
2023-07-22 05:05:38 +00:00
Steven
26a57af389
chore(docs): fix broken link (#53021)
This link is failing CI as seen here:

https://github.com/vercel/next.js/actions/runs/5623454975/job/15238167610


```
Error: The action could not create a Github comment because it is initiated from a forked repo. View the action logs for a list of broken links.
This PR introduces broken links to the docs:
┌─────────┬───────────────────────────────────────────────────────────────────────────────┬──────┬─────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │                                     link                                      │ type │                                       docPath                                       │
├─────────┼───────────────────────────────────────────────────────────────────────────────┼──────┼─────────────────────────────────────────────────────────────────────────────────────┤
│    0    │ 'app/building-your-application/configuring/typescript#statically-typed-links' │      │ 'docs/02-app/01-building-your-application/01-routing/03-linking-and-navigating.mdx' │
└─────────┴───────────────────────────────────────────────────────────────────────────────┴──────┴─────────────────────────────────────────────────────────────────────────────────────┘
Error: This PR introduces broken links to the docs. The action could not create a Github check because it is initiated from a forked repo.
Error: Process completed with exit code 1.
```
2023-07-21 18:28:24 +00:00
Heidar-An
732219e9df
Update 02-dynamic-routes.mdx (#52975)
grammatical mistake

### What?
Small grammatical mistake on https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes
2023-07-21 17:08:52 +00:00
Shaun Ferris
3e34b9f2d2
"Clarify the 'Existing Projects' section of the TypeScript docs: (#52944)
> Add a sentence to the instructions for using typescript in an existing project instructing the user to copy the `paths` compiler option from the existing jsconfig file to the new tsconfig file.
> Not doing so causes absolute imports from project directories to break, and gives "Module Not Found" messages that the docs do not have a case for solving"
2023-07-21 15:09:28 +00:00
Cassidy Williams
7a0297c2d4
Change "publically" to "publicly" in the routing docs (#52966)
### What and why?

The word "publicly" should be spelled consistently across the documentation. It is spelled currently as "publically" in a few places.

### How?

Fixed the spelling!
2023-07-20 20:47:42 +00:00
Daryll J. Reillo
66f0983cb8
Update 06-lazy-loading.mdx: Incorrect filename in Example on "Importing Named Imports" (#52932)
The correct filename is seen on PagesOnly. But on AppOnly, the filename is not correct. It should be "hello" instead of "ClientComponent".

line to change:
from:
import('../components/ClientComponent').then((mod) => mod.Hello)

to:
import('../components/hello').then((mod) => mod.Hello)


line to change:
from:
import('../components/ClientComponent').then((mod) => mod.Hello)

to:
import('../components/hello').then((mod) => mod.Hello)
2023-07-20 12:57:18 +00:00
Soheil Nazari
20b115e827
wrong content for next.config.mjs for MDX Plugins (#52738) 2023-07-19 21:55:40 +00:00
Adam Hunter
2c1c8fa089
docs: fix example component in MDX documentation (#52753) 2023-07-19 14:25:31 -07:00
Steven
b12e6fef0c
chore(docs): fix typo in generate metadata docs (#52904)
- See current bug:
https://nextjs.org/docs/app/api-reference/functions/generate-metadata#generatemetadata-function
- Closes #52903
2023-07-19 14:21:18 -07:00
Antoine Bourin
08e87fb405
docs: add Typescript statically typed links mention in link doc (#52847) 2023-07-19 14:15:04 -07:00
Steven Tey
55fdfe4280
Update 02-edge-and-nodejs-runtimes.mdx (#52888)
Added clarification that runtime edge can be defined on Layout level too.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-07-19 14:41:01 +00:00
Joseph Garrone
f5272acbe5
docs: Add tss-react for CSS-in-JS docs (#52764) 2023-07-18 19:48:01 -07:00
Rinald
d18334ae92
docs: Improve OpenTelemetry manual config (#52784) 2023-07-18 19:46:30 -07:00
hiro
daac0484fa
Fix typo in docs (#52815)
The following files have been modified.

- `docs/02-app/01-building-your-application/05-optimizing/04-metadata.mdx`
  programatically -> programmatically
- `docs/02-app/02-api-reference/04-functions/image-response.mdx`
   ImageReponse -> ImageResponse




Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-07-18 04:36:31 +00:00
Eldar Amantay
0084166caa
chore(docs): Add mentioning of HOSTNAME env variable for standalone output (#52804)
### What?

Update documentation to mention a `HOSTNAME` env variable for `standalone` output

Related to Feature: https://github.com/vercel/next.js/pull/44627 

### Why?

Current documentation mentions only `PORT` env, but does not mention `HOSTNAME` added in January

Affected documentation pages:

- https://nextjs.org/docs/app/api-reference/next-config-js/output

Affected examples:

- https://github.com/vercel/next.js/tree/canary/examples/with-docker
- https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env

### How?

- Run examples
- Check documentation
2023-07-17 19:59:53 +00:00
Cheol-Won
82efdfe877
docs : fix typo in React cache example (#52787)
### Description
This PR fix typo in the description of Caching Data

### Changes
- Added types to React `cache()` exercise

File: `docs/02-app/01-building-your-application/03-data-fetching/02-caching.mdx`
2023-07-17 15:46:30 +00:00
vinay
503677c099
(Docs) add missing js version for generateMetadata. (#52763)
There was no JS version for `generateMetadata` function.

fixes #52759 

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-07-17 15:23:54 +00:00
Tim Neutkens
f5f79e7a8c
Update mention of route handlers for forms (#52781)
Route handlers are not specifically different from API Routes in terms of forms or other usage, the only difference is how you write them (Request) => Response. Initially this mention was supposed to be removed when server actions are marked stable, but it's leading to some confusion so I've updated the mention to clarify that there will be a more integrated solution for React.
2023-07-17 14:11:42 +00:00
Balázs Orbán
82cf9a670e
docs: move MUI to supported list (#52584)
fixes #52575

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-12 12:50:20 -07:00
ilyamed
f321864c5e
docs: Fix typo in generate-static-params.mdx (#52595) 2023-07-12 17:11:16 +00:00
Cheol-Won
967c501c7b
docs: fix typo in CSS Modules Description (#52599)
## Description
Remove unnecessary type in the JSX file. Additionally, this change helps maintain consistency with the examples below

## References
[CSS Modules Description page link](https://nextjs.org/docs/app/building-your-application/styling/css-modules)
2023-07-12 16:59:49 +00:00
Fernand
1989f4943d
Fixed grammar in 03-react-essentials.mdx (#52597)
"will eventually be should be placed" was changed to "will eventually be placed".
2023-07-12 15:51:33 +00:00
Daryll J. Reillo
3338df187c
docs: fix grammar on Server Actions (#52556) 2023-07-11 11:11:58 -07:00
Steven
673107551c
chore(docs): fix a few typos in image loader docs (#52508)
The `quality` is not always defined. so it must have a default value before calling `.toString()`

Closes NEXT-1421
2023-07-11 01:31:12 +00:00
Mate Papp
b450895387
docs: correct TypeScript spelling on the home page (#52500)
### What?
Changing the word TypeScript with an uppercase S.

### Why?
- Because that's the official recommendation from TypeScript. (Reference: [typescriptlang.org](https://www.typescriptlang.org))
- The docs already uses this format (e.g. [TypeScript page](https://nextjs.org/docs/app/building-your-application/configuring/typescript)) so it's just a matter of consistency.
2023-07-10 16:15:19 +00:00
Balázs Orbán
a06775cdf3
fix: add aws packages to default serverComponentsExternalPackages (#52388)
Related #51969

[Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1688734253149379?thread_ts=1688734176.782469&cid=C04DUD7EB1B)
2023-07-10 10:24:03 +00:00
Lee Robinson
c6b163f3c5
docs: Update _app and _document (#52479)
- Remove specific TypeScript sections and add JS/TS code block toggles
- Consolidate "Good to know" information into sections
- Add links back to incrementally adopting the App Router when trying to
use escape hatches
- Add better TS example for `getInitialProps` (even tho it's not
recommended, still helpful)
2023-07-10 11:29:17 +02:00
Carlos Menezes
9ea188a06f
chore(docs): Typesafe metadata object (#52252)
Adds missing `Metadata` type to a few declarations.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-07-10 11:19:59 +02:00
Yago Veloso
dfebdb75d9
docs: Add formData example for Route Handlers (#52358)
Add formData function

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-07-10 11:14:12 +02:00
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