Commit graph

1963 commits

Author SHA1 Message Date
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
Tyler Lutz
1f19a5b810
Add separate links in shared documentation (#51733)
### What?
- Added separate links for the app and pages router in the shared documentation.
- Added comment at the top of all shared documentation.
- Fixed typos in pages documentation comment.

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

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

### Why?

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

This PR introduces an eslint rule to enforce this.

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

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

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

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

### What?
Misleading typo
2023-06-24 22:08:49 +00:00
kevinmitch14
881512baf1
docs: improve minor grammar mistake (#51758) 2023-06-24 20:43:23 +00:00
Shu Ding
70692d80b4
Rename serverActionsSizeLimit as serverActionsBodySizeLimit and add docs (#51755)
Close the circle after #51104. The name "size limit" can be confusing as it could also mean the size of the Server Action function itself, so this PR changes it to `serverActionsBodySizeLimit` and makes sure it's well documented.
2023-06-24 16:16:09 +00:00
Angel Lopez Pol
385e6fdbcf
Fix Typo in Optimizing - Open Telemetry docs (#51729)
### What this PR does

This PR fixes a minor typo on the Vercel Open Telemetry Docs.
`It's not extensible and you should configure OpenTelemetry manually
(if) you need to customize your setup.`

That is all :)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-23 16:33:34 -07:00
Tyler Lutz
91636405fc
Add app to tailwind.config.js in fonts documentation. (#51671)
The tailwind.config.js in the fonts documentation was missing the app
directory.
2023-06-23 13:43:59 -07:00
Morgan Feeney
fb79c116c6
Update 01-images.mdx (#51532)
Due to the size of grid tracks specified in the CSS I amended the usage of the HTML `sizes` attribute.

The media can be ascertained from `gridTemplateColumns` and `gridGap` values, this change results in smaller images also being available in the srcset for use with sizes, which should be more performant.
2023-06-23 19:28:35 +00:00
SMG
b448a50475
fix(docs): added missing dot (#51718)
Added missing dot in
```docs/02-app/01-building-your-application/06-configuring/03-environment-variables.mdx```
2023-06-23 11:48:47 -07:00
Tyler Lutz
b7d49e0e0f
Fix typo in 01-typescript.mdx (#51669)
Change 'Previous' to 'Previously'
2023-06-23 14:13:19 +00:00
Bigyan
df08b22e7f
docs: fix generated app icons file extensions (#51562)
The file extensions of the generated file extensions section are not what it's supposed to be or not what documentation has specified.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-06-23 10:34:16 +00:00
Lee Robinson
f1624b65b4
docs: link to tutorial for incremental adoption. (#51682)
https://www.youtube.com/watch?v=YQMSietiFm0
2023-06-23 01:25:45 +00:00
Tyler Lutz
df0612adf5
docs: Add 'DO NOT EDIT' comment (#51600)
### What?

Adds missing "DO NOT EDIT" comment to some of the shared documentation pages"

### Why?

A few of the shared documentation files didn't have the comment to not edit them.
2023-06-22 16:54:52 +00:00
Tyler Lutz
5127c33fc9
Add page router documentation (#51626)
Adds tailwindcss documentation for the pages router.
2023-06-22 14:12:50 +00:00
Keerthi Ramanarayan Meda
e3ad371c97
Add docs for src directory to include tailwindcss (#51619)
Tailwind CSS configuration is missing in the docs when configuring the `src` folder




Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-22 13:33:40 +00:00
Lee Robinson
e73baa5a65
docs: Add Panda CSS to CSS-in-JS docs. (#51484)
https://panda-css.com is a new solution that works with the Next.js App
Router.
2023-06-21 16:12:28 -07:00
SHOURYA SHIKHAR
87bfab4448
added good to know in /app based pages and layout in nested layouts (#51558)
<!-- 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?

-->
Added a good to know section mentioning that one should not add `html`
or `body` tags in nested layouts under `/app` based routing.

It was not mentioned anywhere before and often one forgets this while
migrating from the `/pages` based routing

Fixes #51556

---------
2023-06-21 15:42:43 -07:00
hustLer2k
a101ffe213
Broken link at 01-static-and-dynamic-rendering.mdx (#51582)
useSearchParams() links to /docs/app/api-reference/functions/use-params instead of /docs/app/api-reference/functions/use-search-params
2023-06-20 19:13:06 +00:00
Tyler Lutz
70c1024737
Remove duplicate word in 11-draft-mode.mdx (#51580)
Removes duplicate "to" in documentation.
2023-06-20 11:49:52 -07:00
Tyler Lutz
21af14dc11
docs: Fix typo (#51517)
Change tranforming to transforming in 05-mdx.mdx
2023-06-19 22:49:02 +00:00
Wyatt Johnson
85002ba01e
Linted MDX (#51530)
Fixes a linting issue with a MDX file that was updated.
2023-06-19 14:19:03 -06:00
Wisnu Wicaksono
3ca833da3b
docs: add missing comma for code snippet. (#51437) 2023-06-19 07:50:05 -07:00
Leo Driesch
53df94f8d5
docs: Remove duplicate bullet point in app router migration. (#51440) 2023-06-19 07:49:33 -07:00
vicsantizo
03e975be9e
docs: add missing comma. (#51489) 2023-06-19 07:48:39 -07:00
vicsantizo
4977bb7006
docs: add missing word. (#51490) 2023-06-19 07:48:15 -07:00
Sonam Serchan
5936213e74
docs: link to caching heading for production docs. (#51501) 2023-06-19 07:47:48 -07:00
Lee Robinson
b0a704d801
docs: add better examples to next/image docs. (#51457) 2023-06-19 07:44:58 -07:00
Tyler Lutz
ac74b58bd1
docs: Fix typo in image alt. (#51487) 2023-06-18 21:40:45 -07:00
Kevin Wang
6a189bc442
docs: Update to prepending in contribution guide. (#51474) 2023-06-18 20:08:29 -07:00
Rexford Essilfie
8dfaa48668
docs: fix MDX formaction link ID. (#51481) 2023-06-18 20:06:44 -07:00
Tyler Lutz
67853aa8cd
docs: Fix typo in Route Handlers docs. (#51429) 2023-06-16 15:01:33 -07:00
Michael Novotny
cd683523a1
docs: Adds missing export from Server Actions docs (#51418) 2023-06-16 08:41:03 -07:00
Delba de Oliveira
13c205ffdf
[Docs] Add note about adding the instrumentation file inside 'src' (#51415)
The instrumentation.js should be placed in the root, or inside the 'src' folder if one exists
2023-06-16 14:15:39 +00:00
Jon Meyers
3cac09790b
examples: update with-supabase example to App Router (#51335)
### What?

Update Next.js with Supabase example

### Why?

Existing example for Next.js with Supabase is out of date

### How?

- Rename `with-supabase-auth-db-realtime` to `with-supabase`
- Update example to use App Router
- Use Supabase Auth Helpers for Next.js to configure auth cookies

---------
2023-06-16 06:16:42 -07:00
Bruno Eduardo de Souza Medeiros
94c9418091
docs: remove copy mentioning appDir as an experimental feature (#51403)
The documentation for `(App or Pages) / Building your Application /
Configuring / Eslint`
[here](https://nextjs.org/docs/app/building-your-application/configuring/eslint#linting-custom-directories-and-files)
is mentioning the appDir as an experimental feature that needs to be
enabled.

This PR update it's content removing this mention

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-16 05:54:38 -07:00
Lee Robinson
f7533e0dc1
docs: Add streaming AI example. (#51382)
Addresses https://github.com/vercel/feedback/issues/32707.
2023-06-16 03:11:38 +00:00
Hank Lin
e43f134c1f
docs: fix the url of router event (#51339)
Refer to [here](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString#examples)

The `searchParams.toString()` doesn't include the question mark.


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-15 15:56:35 +00:00
Michael Novotny
f7c105d371
Adds env suggestions (#51312)
Adds suggestions from #51063, which didn't get applied before merge.
2023-06-14 21:33:34 +00:00
Shu Ding
5e9b5e5d3c
Update example of Server Actions HoC (#51299)
Currently the Server Action function with `"use server"` must be an
async function as it's required by the compiler, even if it returns a
promise already.
2023-06-14 12:17:45 -07:00
Tyler Lutz
9539440965
Docs: Remove extra word in 03-scripts.mdx (#51304)
Removes extra 'the' in the documentation

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-14 12:06:25 -07:00
Gideon
86112a357c
Update images.mdx (#51275)
fix Fastly and Gumlet heading level
2023-06-14 18:59:04 +00:00
Delba de Oliveira
d27cda21d6
[Docs] Fix broken links (#51285)
Bring back #related-links and fix broken link in fonts page
2023-06-14 14:30:35 +00:00
Delba de Oliveira
419194bb4b
[Docs] Fix broken link (#51281) 2023-06-14 13:52:03 +00:00
John Albin Wilkins
1e796726ee
Document CSS concatenation order matches the import order (#39889)
Given the amount of CSS ordering problems mentioned in the issue queue
(see #16630), it's clear, for most people, that it is NOT obvious that
the order of CSS concatenation matches the order of importing CSS and
modules inside `_app.js`.

We should try to make this fact explicit in the docs. Right now, it's
only implied.


## Documentation checklist

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 23:31:49 -07:00
wiredacorn
cc46d97232
Update module-path-aliases.md (#43592)
<!--
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 that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [X ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 19:53:17 -07:00
J
18b133e6a3
docs: fixed a typo in parallel routes (#51267)
`allow` => `allows`
2023-06-14 02:45:48 +00:00
Guilleo
691598ecee
Fix middleware documentation (#48876)
In the actual documentation, `value` does not exist. I removed `value`
and work correctly

<!-- 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 or adding/fixing 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-06-13 19:18:11 -07:00
William Wilder
99142b5897
Update 02-fonts.mdx (#51249)
Add link to font api instead of internal reference to same page.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 19:06:32 -07:00
Joe Marty
ac32452d1c
Clarify the limitations of NEXT_PUBLIC_ (#49105)
It's not totally clear from the docs that using `NEXT_PUBLIC_` env vars
will be a problem for pipelines that deploy the same image to multiple
environments (this bit us in a production incident). This PR is an
attempt to make it clear. Open to feedback/suggestions!

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 19:01:44 -07:00
Jan Cizmar
0a9148901b
docs: Add Tolgee to internationalization section (#49754)
It would be nice to have Tolgee listed in internationalization libs
supporting Next.JS

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 18:50:11 -07:00
Delba de Oliveira
85ea7cde33
Remove related-links (#51258) 2023-06-13 22:12:48 +00:00
Steven
0f03ef14f0
chore(docs): codemod docs should mention . for cwd (#51264)
These docs were wrong because `./pages` is not sufficient to run a
codemod.

Imagine a project that has `./components` and `./pages` and many
directories for example.

Also its important to run at the root of the Next.js project so that the
path has a `next.config.js` because some codemods modify that config.
2023-06-13 14:44:53 -07:00
Delba de Oliveira
d27a4969f6
Fix code example filename for related-links (#51256) 2023-06-13 13:36:41 -05:00
Delba de Oliveira
6431b19906
Fix broken link (#51253)
Fix broken link in client-side rendering page
2023-06-13 13:08:19 -05:00
Delba de Oliveira
8a0686e28d
[Docs] Add version history to app api pages (#51218) 2023-06-13 18:03:27 +00:00
Delba de Oliveira
3d41ccb916
Update codeowners (#51250)
Tweak code owners after some testing and feedback. 

- Move the Next.js team up to be optional global code owners (so that everyone can review but are not tagged for review). Global individuals should still be tagged if there are no specific `.vercel.approvers` files in subdirectories.
- Adds @vercel/devex to image files so there's coverage on those files for the docs
- Target specific folder and files for Styfle to get notified
- Deletes some rules in the old GitHub codeowners
2023-06-13 17:47:12 +00:00
Delba de Oliveira
a3344ad6fc
[Docs] Add mininum client-side rendering page (#51220) 2023-06-13 12:16:29 -05:00
Delba de Oliveira
e048f4ef03
[Docs] Recommend prettier-fix in PR template and contribution guide (#51237)
Recommend running `prettier-fix` before opening docs PRs to fix formatting issues. I've found that `lint-fix` is currently not fixing formatting issues. Related: https://vercel.slack.com/archives/C03S9JCH2Q5/p1686647582580629
2023-06-13 14:54:06 +00:00
VelociRaptor
b89da42985
[docs] Fix typo in parallel routes (#51238) 2023-06-13 13:54:37 +00:00
Delba de Oliveira
a611641cec
[Docs] Remove extra line in summary dropdowns (#51226)
They were causing markdown to render a <p> tag which has margins and broke the summary dropdowns
2023-06-13 13:50:20 +00:00
Chad Luo
2a93345f14
[Docs] fix example function param and signature (#51235)
Apparently the object deconstruction in the example doesn't work. This PR proposes a working version:

```diff
- export default function Page({ params: { slug: string } }) {
-   return <div>My Post: {slug}</div>
- }
+ export default function Page({ params }: { params: { slug: string } }) {
+   return <div>My Post: {params.slug}</div>
+ }
```

According to the [page reference](https://nextjs.org/docs/app/api-reference/file-conventions/page), the page function parameter slugs needs to be retrieved by calling `params.slug`.

The TypeScript section below shows the correct function type signature, although not referencing to the parameter.
2023-06-13 13:33:31 +00:00
Kiko Beats
4633b2254b
[docs] Add missing Edge Runtime APIs (#51224)
Added missing APIs, also sorted all of them alphabetically to make it
easier to read.

---------

Co-authored-by: Delba de Oliveira <delbabrown@gmail.com>
2023-06-13 11:01:40 +01:00
Jiachi Liu
d544c2806e
docs: fix prettier lint (#51222)
Fix prettier lint errors in #51080
2023-06-13 09:19:10 +00:00
Michael Novotny
cefdb27662
docs: Adds Note to Good to know consistency (#51080)
* Changes all `Note` → `Good to know`
* Consistently puts the colon on the outside of bold text
* Documents singe and multi-line styles in contribution guide

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-12 19:00:07 -07:00
Tyler Lutz
9fc904f489
docs: fix typos in Server Actions docs. (#51185) 2023-06-12 15:07:27 -07:00
Max Leiter
cdfdaab67d
docs: correct valid route segments for icon/favicon/apple-icon (#51188)
Improves the documentation to correctly mention that only favicon is
restricted to the root app/ segment.

x-ref:
[slack](https://vercel.slack.com/archives/C03KAR5DCKC/p1686425241975119)
2023-06-12 15:06:57 -07:00
Jeremy Douglas Hoover
3b2ee1e085
docs: Fix typo on strategy for next/script. (#51189) 2023-06-12 15:06:12 -07:00
Jack Sutton
4ae8bc7da0
docs: Update Vanilla Extract example link. (#51192) 2023-06-12 15:05:48 -07:00
Tyler Lutz
1987f44474
docs: Add separate lines to eslint prompt. (#51143) 2023-06-12 15:05:23 -07:00
S. Mahdi Mir-Ismaili
0c9041e5b9
Fix a mistake URL in "docs/generate-metadata.mdx/metadataBase" (#51199)
The sample output of `metadataBase` configuration (`<head <link rel="alternate" ...>`) had an incorrect `href`:

https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
2023-06-12 21:34:15 +00:00
Michael Novotny
a973ad64d4
Makes codeblock language and filename extensions consistent (#51056)
There was mismatched usage of `js`, `jsx`, `ts`, and `tsx`. Just tried to get them all in sync.
2023-06-12 18:55:08 +00:00
Delba de Oliveira
98351e9398
[Docs] Update static assets page to filter out <PagesOnly> information (#51180)
Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-06-12 18:25:06 +00:00
Jiachi Liu
272ffffd59
docs: fix prettier error (#51182) 2023-06-12 11:31:53 -05:00
Mehran Mirshekaran
0f5b1917df
docs: remove accidental character before use client directive. (#51176) 2023-06-12 08:46:37 -07:00
Lee Robinson
e5a45c8a49
docs: clarify usePathname usage as client hook. (#51146)
Using client components for `usePathname` is not a de-optimization. This
update tries to make this more clear by sharing more information about
the design and tradeoffs of this approach.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-12 07:58:06 -07:00
Lee Robinson
f9813ad671
docs: Improve Actions docs. (#51145)
Adds more clarity on which pieces are Next.js only, how actions
integrate with Next.js, and details on the progressive enhancement
story.
2023-06-12 07:57:17 -07:00
Tristan
b870bf22e5
docs: Fix useSearchParams link in adoption guide. (#51151) 2023-06-12 07:36:52 -07:00
James Pearson
d2e014a011
docs: fix link to next/font API reference. (#51169) 2023-06-12 07:34:02 -07:00
Sayyed Shozib Abbas
109e6cb34b
docs: fix grammar issue in next/image intro. (#51133) 2023-06-11 12:59:21 -07:00
Pau Fernández
bd97c01fca
docs: remove added verb and fix good to know section. (#51054) 2023-06-10 11:55:27 -07:00
Arun S V
6a9fb9e77f
Update 03-linking-and-navigating.mdx (#51084)
Fixed a typo in 'Scrolling to an id' section.

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

- 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-06-10 11:53:42 -07:00
Michael Novotny
8366f1af31
docs: Clarify manual graceful shutdown in dev server (#51078)
Replaces #50481

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-10 07:24:25 -07:00
Michael Novotny
e797546ee3
Adds missing and in How to Use These Docs section (#51058)
Fixes #50227
2023-06-10 13:15:02 +00:00
Michael Novotny
83860091a6
Removes PORT from .env concatenation example (#51063)
This is to [avoid confusion](https://github.com/vercel/next.js/issues/32603#issuecomment-996751692) about being able to set Next.js's port via `.env`, which is currently not allowed.
2023-06-10 10:47:49 +00:00
Delba de Oliveira
ccc64d96b6
[Docs] Remove html <b> from summaries (#51008)
This PR removes manual HTML `<b>` tags in `<details><summary>...` titles. They are unnecessary because we add bold styling in CSS.

Also did a tiny fix to some other unnecessary inline HTML.
2023-06-09 22:12:58 +00:00
Michael Novotny
9fad474018
Adds the "why" for next/image optimization (#51066)
Give a touch more context as to why one would want to use image optimization.

Fixes #30220
2023-06-09 22:02:35 +00:00
Delba de Oliveira
9c44c1dca1
[Docs] Add section on how to preview docs changes on VSCode (#51019) 2023-06-09 15:16:19 +00:00
Delba de Oliveira
9800eaf467
[Docs] Clarify a few things about the instrumentation.ts file (#51034)
There was some confusion about where to place it.
2023-06-09 13:40:53 +00:00
Alain Kaiser
8370e52a32
Fix Typo in Metadata API Description (#51024)
### Fix Typo in Metadata API Description

#### Description:

This PR fixes a minor typo in the description of the Metadata API.

#### Changes:

- Fixed typo in the Metadata API description. 

**File:** `docs/02-app/01-building-your-application/05-optimizing/04-metadata.mdx`

**Old Sentence:**

> Next.js has a Metadata API that can used to define your application metadata (e.g. `meta` and `link` tags inside your HTML `head` element) for improved SEO and web shareability.

**New Sentence:**

> Next.js has a Metadata API that can be used to define your application metadata (e.g. `meta` and `link` tags inside your HTML `head` element) for improved SEO and web shareability.

This change helps improve the readability and understanding of the documentation for readers and users.

#### Checks:

- [x] Followed the Docs Contribution Guide
- [x] Linting passes (`pnpm build && pnpm lint`)
2023-06-09 12:20:41 +00:00
Kevin Ang
e5b88caed7
fix revalidateTag import (#51005)
This PR fixes the erroneous `revalidateTag` import on certain examples.
It was imported from `next/server`, but should be imported from
`next/cache` instead.

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-09 09:23:58 +01:00
Taylor Bryant
8484a6b9c2
Fix typos in 01-contribution-guide.mdx (#51006)
This PR fixes some small typos in the Contribution Guide.
2023-06-09 08:16:12 +00:00
Tyler Lutz
aef03cf3a5
docs: update ESLint prompt output. (#50986)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-08 19:07:58 -07:00
PatrickCodes_
3817770bc0
docs: update Route Handlers to have JS/TS code snippet. (#51003)
Added a TS and JS switcher. Previously the code snippet did not have a
switcher. The file extension was .js when the code was TypeScript which
made it confusing to try to read.

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-08 19:06:08 -07:00
Michael Novotny
9c4b0ec9e9
Adds missing JavaScript codeblock in Opengraph Image API reference (#50996)
Also changes JavaScript examples to use `.jsx` extensions so IDEs better recognize the JSX allowed as the first argument to `ImageResponse`. 

Fixes #50141
2023-06-08 21:29:47 +00:00
didemkkaslan
f2cbfe3147
docs: Fix typo in colocation documentation. (#50975) 2023-06-08 12:16:48 -07:00
Tyler Lutz
3ccbe82280
Update create-next-app docs (#50981)
### What?

Update the create-next-app prompts and create-next-app --help
documentation
2023-06-08 12:16:05 -07:00
Ethan Mick
9a08206242
docs: Correct useFormStatus to be a client component (#50991)
### What?

The `useFormStatus` needs to be used in a client component. That
component should be used within a `form` for the `pending` property to
reflect the form status.

### Why?

The docs are currently not accurate.

### Notes

I could also update the name of the file to not be `form.js`, which
implies this is the entire form instead of just the submit button being
used as a component within the form.
2023-06-08 12:13:13 -07:00
Michael Novotny
61a553963d
Adds missing async to Opengraph Image code example. (#50990) 2023-06-08 12:08:04 -07:00
Jiwoo JEONG
b8e08abf9e
fix: add missed / at useSelectedLayoutSegment at App routing/Pages and Layout (#50956)
## Why?
- When i click `red box` in following image, page returns 404 page.
<img width="1728" alt="스크린샷 2023-06-08 오후 7 31 37" src="https://github.com/vercel/next.js/assets/63336958/903b11e3-17af-426e-8787-b6e033c14a24">

## How?
- I found that `/` is missed at `docs/02-app/01-building-your-application/01-routing/02-pages-and-layouts.mdx`.
- So I added `/`.
2023-06-08 15:33:25 +00:00
Delba de Oliveira
f4f34e4226
[Next Docs] Migrate new docs from next-site to Next.js repo (#50701) 2023-06-08 12:03:14 +02:00
Delba de Oliveira
8c2e5bd072
Update codeowners to use Vercel Spaces (#50841)
Move as much of codeowners as possible to use Vercel Spaces. 

1. Makes `@timneutkens @ijjk @shuding @huozhi @feedthejim` global owners
2. Make the `@vercel/next-js` team _optional_ owners of **/docs**,
**/errors**, and **/contributing**, makes team owners of a few packages
as per old config.
3. Make `@vercel/devex` (docs and devrel) owners of **/docs**,
**/errors**, and **/contributing**
4. Make `@vercel/devrel` (devrel only) owners of **/examples**
5. Make `@vercel/web-tooling` owners of specific files and folders (as
per old config)

Leaves @styfle as owner of **image** files on the old config since this
pattern `/**/*image*/** ` can't be used with Vercel Spaces.

Note: We cannot add * or / at the end of files.
[Docs](https://spaces-docs.vercel.sh/docs/code-owners#:~:text=Code%20Owners%20files%20are%20meant%20to%20encourage%20distributed%20ownership%20definitions%20across%20a%20codebase.)
2023-06-08 12:02:18 +02:00
Javi Velasco
aa91de56ce
Remove static analysis of process.env (#50260)
Since there is no longer a limitation that requires us to static analyze
`process.env`, this PR removes it from the build process and updates the
corresponding documentation.
2023-05-24 08:19:02 -07:00
Anders Kjær Damgaard
428342dbdf
Add --use-yarn flag to create-next-app (#49407)
# Add `--use-yarn` flag to `create-next-app`

fixes #49405

- [x] Implement `--use-yarn` flag
- [x] Update docs
- [x] Add tests

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-10 14:51:12 +02:00
Gabriel Schneider
c9d87eec7c
Add note about custom distDir to standalone build docs (#48592)
### What?
Add a note that if a custom `distDir` has been set, the standalone build
can be found at the specified location and the static files folder has
to be copied to the custom location as well.

### Why?
This may be obvious, but such a note would've saved me some minutes, not
gonna lie.

### How?
\-

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-05-10 12:33:24 +02:00
Maia Teegarden
fdd6e979f4
Turbopack alpha -> beta (#49103)
Closes WEB-918
Closes WEB-913
2023-05-04 16:53:40 +02:00
Shu Ding
83b774eeb6
Fix standalone mode with appDir running in a single process (#49116)
Fixes #49055, fixes #48918. 

App dir will always require the server to run in the workers mode, so it
can keep a separate Node.js process for pages. This PR updates the
standalone server to initialize a "standalone server" (which works
similar to `start-server`), and changes the tracked files to include
Jest worker.
2023-05-04 05:55:05 +02:00
Tim Neutkens
3cb15a064b
Update create-next-app App Router question (#49111)
<!-- 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 or adding/fixing 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-05-02 17:28:31 -07:00
JJ Kasper
26f69d5ef3
Simplify CNA prompts a bit (#49063)
This updates the default CNA prompts a bit to be more straightforward.

x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681919151818769)
x-ref: [slack thread](https://vercel.slack.com/archives/C04K237UHCP/p1682959312307409)
2023-05-02 17:01:36 +00:00
Alberto Vilches
2343610fdf
fix: wrong link in docs (#49001)
A link to a third-party package in the docs directs you to the wrong page.
2023-05-01 15:28:50 +00:00
Steven
e7c9d3c051
fix: bump minimum Node.js version to 16.8.0 (#48957)
We bumped `undici` fetch which has a minimum version of 16.8.0 so we need to make sure `next` and `create-next-app` also have the same minimum version.

Since 14.x reaches End-of-Life on [2023-04-30](https://github.com/nodejs/Release), we can drop support for 14 in the next release.

See also:

- Related to #48870
- Related #48941
2023-04-28 15:07:54 +00:00
Jan Kaifer
cc2bcece63
Start recommending gRPC with otel (#48915) 2023-04-28 11:43:28 +00:00
JTaylor0196
f7baa56792
update example Deploy button URLs (#48842)
### What?
Updates Deploy button URLs for all listed examples here:
https://github.com/vercel/next.js/tree/canary/examples

### Why?
The Deploy URLs are currently broken and result in a failed clone
attempt on Vercel.

### How?
The URLs have been changed from https://vercel.com/new/git/external?… to
-> https://vercel.com/new/clone?…
(Last updated
[here](8eaabe2fb0)
in 2021)
2023-04-26 13:31:44 -04:00
Martin Wahlberg
c390c1662b
Add missing word to getStaticProps documentation (#48854)
### What?
Added missing `that` to documentation for getStaticProps

### Why?
This change fixes grammar.

### How?
Updated the text.
2023-04-26 14:02:53 +00:00
Jan Kaifer
db764c35e6
Add support for async instrumentation register (#48575) 2023-04-24 11:43:50 +00:00
Chris
2679ab672d
Update naming for Next.js Analytics (#48618)
Updates the name of Next.js Analytics to Next.js Speed Insights

closes ALY-579

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-04-24 12:14:45 +02:00
Afonso Jorge Ramos
2e99645b6c
docs: update Image props (#48726)
Hey! Hope this can help anyone dealing with this in the future.

I'm also using the `TinaMarkdown` provider to generate my MDX and one of the things that I've found helpful so that the image was better handled in the browser was to set position to `undefined`, as it was the only way to unset it from `absolute`, which was affecting the visual aspect of the page.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-04-23 20:28:03 +00:00
Jan Kaifer
82a01c11a7
Fix TYPO in otel docs (#48623)
<!-- 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 or adding/fixing 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-04-20 11:30:40 +00:00
Ryo
9c0a8ce730
Docs: Unify note formatting (#48417)
<!-- 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 or adding/fixing 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 #

-->

closes #48416 

### What?

Standardize the "Note" format in the Next.js documentation for improved
consistency and readability.

### Why?

There are currently four different variations of "Note" formatting in
the documentation.
Standardizing to a single format will improve the overall experience for
users.

### How?

Update all instances of "Note" in the documentation to follow the most
common format, `**Note**:` (used in 27 files).
This will involve updating the following variations:

- `Note` (12 files)
- `Note:` (20 files)
- `**Note:**` (21 files)

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-04-19 20:21:28 +00:00
Toru Kobayashi
7b6e336bc5
docs: fix minimum Node.js version to 14.18.0 (#48545)
fixes #42729

According to #42729, the minimum Node.js version of Next is `14.18.0`,
but some docs say `14.6.0`, and it's error-prone.
https://github.com/vercel/next.js/issues/42729#issuecomment-1309947579
pointed out it's a bug rather than wrong documentation.

But Node v14 is going to be EOF this month, so Next will update the
minimum version in the next major release.
https://github.com/nodejs/release#release-schedule

So I feel it's enough to only fix the documentation rather than fixing
the implementation to work with 14.6.0 as a temporary fix.


<!-- 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 or adding/fixing 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: Steven <steven@ceriously.com>
2023-04-19 15:16:37 +00:00
Chris McGrath
a9e4b795d7
typo (#48495)
<!-- 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 or adding/fixing 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-04-18 02:39:15 +00:00
Rodrigo Feijao
3aca97b410
Update instrumentation.md (#48394)
There is a typo on `export const` where it should be `export function`
2023-04-14 19:06:21 +02:00
Jan Kaifer
79f4e11034
Fix grammar and typos in OTEL docs (#48235)
I ran a grammar check on OTEL docs to get any remaining issues that
spell check didn't fix.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-04-13 21:21:06 -07:00
Mohit Yadav
c1991c6bae
docs: fix grammar for dynamic routes catch-all explanation and give better examples (#48181)
### Why?

Making the explanation more obvious because it took quite a while for me
to figure out the difference between catch-all and optional catch-all,
and I think others may feel the same way too.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-13 21:12:46 -07:00
Jan Kaifer
89366ff44c
Add information about deploy to open telemetry docs (#48241)
Added information on how to deploy with OTEL.

- mentioned that `@vercel/otel` works on Vercel and when self-hosted
- added links to Vercel docs
- added links into OTEL docs for self-hosted
- Added information about custom exporter

Questions:

- should we mention Datadog, NewRelic and others as an examples of
custom exporters?
  - https://docs.datadoghq.com/opentelemetry/
-
https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-legacy-new-relic-exporters/
2023-04-12 14:45:46 +00:00
apeltop
8bacad921b
Fix typo in script.md (#48225)
occuring -> occurring

I hope it helps.

<!-- 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 or adding/fixing 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-04-11 13:26:23 +00:00
Jan Kaifer
af12a94a28
Docs: Describe how to manually configure open telemetry (#48071)
It's currently not clear that `@vercel/otel` is just a simple wrapper
when you are trying things out. So I added an excellent example of how
to instrument create an OpenTelemetry setup.

The only FUD I have here is that people won't skip that `Manual
OpenTelemetry setup` and try to understand it. But I try to describe
this at the beginning of that section.

I'll also try to update `@vercel/otel` readme to be more transparent on
what it does.
2023-04-11 10:59:00 +00:00
Chandrajeet Maurya
536b4dca8c
Update deployment.md (#48062)
Since the code above is referring to `package.json` it should be `npm
run build` and `npm run start` instead of running `next build` and `next
start` directly

<!-- 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 or adding/fixing 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-04-07 08:38:59 -07:00
Steven
690208b11f
fix: show error when "next start" is used with "output" config (#47989)
fix #47334
fix NEXT-861
2023-04-06 17:28:27 -07:00
Jan Kaifer
e35710f71f
Recommend @opentelemetry/api instead of @vercel/otel reexport (#48013)
- remove vscode folder from example
- recommend `@poentelemetry/api` over `@vercel/otel`

<!-- 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 or adding/fixing 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 NEXT-959
2023-04-06 14:17:47 +02:00
Jan Kaifer
dd959251e6
Docs: Improve Open Telemetry documentation (#47955)
- Removed duplicate information
- Add links into official docs to explain `http.*` attributes
- Properly explain what `next.page` means.
fix NEXT-945

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-04-06 11:41:19 +00:00
Gustavo Steinmetz
9df4e0614e
Update Local Images Example to Use Assets Folder (#47878)
This pull request updates the Local Images example in the Next.js
documentation to use an ``assets`` folder inside the ``src`` directory
instead of the ``public`` folder. The changes are made to emphasize the
recommended practice of organizing and importing static assets when
using the Next.js ``Image`` component.

The previous example could cause confusion as it suggested importing
images from the ``public`` folder, which is generally used for static
files that can be accessed directly via a URL. However, when using the
Next.js ``Image`` component, it is recommended to import images as
modules and store them in a folder like ``assets`` inside the ``src``
directory. This approach allows the Image component to optimize images
and prevent Cumulative Layout Shift while loading.

This PR changes the image import statements as the example below:

```jsx
import profilePic from '@/assets/me.png';
```

These changes aim to provide clearer guidance on how to handle local
images. To avoid misunderstandings while the developer follows the
documentation.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-05 04:10:31 +00:00
Swarnava Sengupta
a79d1efdd0
[Docs] Update react docs link (#47891)
- This PR fixed the  Documentation link of new react.dev website.
2023-04-04 11:56:03 -07:00
Jan Kaifer
a3acbf4f55
Add documentation on OTEL support (#47194)
Added docs that mention:
- important code-snippets from example
- links to official OTEL docs
- document NEXT_VERBOSE_OTEL
- explain what we provide out of the box
- what we don’t
- explain how you can add tracing yourself
- explain how instrumentation.js works
- it can be used for different types of instrumentation that don't use
OTEL. It's just a hook called when starting up a new node environment.

- list of all spans we instrument by default
 
fix NEXT-799 ([link](https://linear.app/vercel/issue/NEXT-799))

---------

Co-authored-by: S3Prototype <liuqahs15@gmail.com>
2023-04-04 14:24:46 +00:00
HarshaVardhanReddyDuvvuru
217fbbfd39
[docs] Update getting-started.md with New react docs link (#47841)
Replaced the old React Docs Link with new one




Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-04-03 07:43:34 +00:00
Vishal Jagtap
c8a5bd5eba
Update react-strict-mode.md (#47780)
Updated the old react doc link
2023-04-01 21:34:13 +00:00
Vishal Jagtap
75c76ea772
Update error-handling.md (#47779)
Updated the react error boundary doc link. old one is depricated

<!-- 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 or adding/fixing 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-04-01 14:15:02 -07:00
Javi Velasco
2adc1f6c54
Document node.js APIs for Edge Runtime (#47760) 2023-03-31 19:54:22 +00:00
Steven
4c60b7b6ae
feat: bump minimum ts version to 4.5.2 (#47712)
Fixes an issue with newer app directory usage:

```
Failed to compile.
../../node_modules/next/dist/server/future/route-handlers/app-route-route-handler.d.ts:11:15
Type error: ',' expected.
```

---------
2023-03-31 11:37:09 -07:00
Hofer Ivan
9ab6ca5d5f
chore(docs): add typesafe-i18n as a new i18n option (#47315)
<!-- 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 or adding/fixing 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-03-31 11:28:28 -07:00
Jay
247ea65edb
Linking to SST Next.js tutorial. (#47752)
Updating the SST link to a Next.js tutorial: https://docs.sst.dev/start/nextjs
2023-03-31 17:13:31 +00:00
Insik-Han
47152638d4
Replace AWS Serverless to SST in Serverless (#47725)
AWS Serverless(a.k.a Serverless Next.js) is not suitable for versions of
Next.js 12 or higher. As an alternative, I recommend SST.

<!-- 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 or adding/fixing 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-03-30 21:45:05 -05:00
Steven
af49d5098b
chore(docs): update next export to output: 'export' (#47717)
fix NEXT-927 ([link](https://linear.app/vercel/issue/NEXT-927))
2023-03-31 02:04:23 +00:00
Balázs Orbán
cbb8486afa
docs: clarify returning response in Middleware (#47696)
I noticed that the wording was still suggesting that you needed to
"enable" this, but since
[`13.1`](https://nextjs.org/blog/next-13-1#nextjs-advanced-middleware),
`experimental.allowMiddlewareResponseBody` is not needed anymore.

Ref: #44224
2023-03-30 09:13:14 -07:00
isaackatayev
e9085efe47
Grammar fix (#47600)
<!-- 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 or adding/fixing 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 #

-->
Change are -> is in docs (check commits).

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-29 16:43:26 -07:00
Max Gudkov
9d9bd8be15
Fix typo (#47634) 2023-03-28 23:08:40 +00:00
Karl Horky
45e2c1e064
Switch to ESM Jest config in docs (#42144)
Thanks again for Next.js 13! Finding a bunch of new ways to improve things 🙌 

Just a quick PR to switch the Jest configuration file with `next/jest` to ESM to eliminate another instance of CommonJS.

ESM requires a `.js` extension on the import.

An alternative would be to switch to a TypeScript config file (`jest.config.ts`) which would (I am guessing) not require this file extension (but still allow switching to an ESM-style `import` syntax).

New version in the diff:

```js
// jest.config.mjs
import nextJest from 'next/jest.js'

const createJestConfig = nextJest({
  // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
  dir: './',
})

// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const config = {
  // Add more setup options before each test is run
  // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
  // if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
  moduleDirectories: ['node_modules', '<rootDir>/'],
  testEnvironment: 'jest-environment-jsdom',
}

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config)
```

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-28 00:10:58 +00:00
Lachlan Campbell
461617bc70
docs(image): Update browser bugs section for Safari 16.4 release (#47577)
### What?

Safari 16.4, released today, fixed a known browser bug [around lazy-loading images](https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#:~:text=Now%20in%20Safari%2016.4%2C%20a%20gray%20line%20no%20longer%20appears%20to%20mark%20the%20space%20where%20a%20lazy%2Dloaded%20image%20will%20appear%20once%20it%E2%80%99s%20been%20loaded.).

### Why?

This bug is mentioned in the docs & the fix has been long-awaited by @styfle & users.

### How?

I've updated the next/image doc with this link.
2023-03-28 00:02:27 +00:00
Donny/강동윤
688d8253da
refactor(relay): Use transform from swc/plugins repository (#47441)
Previously `next-swc` had relay transform inline, but it makes
maintenance harder. So this PR patches next-swc to use relay plugin from
`swc-project/plugins` repository.

Closes WEB-782
Fixes #47239

fix NEXT-883 ([link](https://linear.app/vercel/issue/NEXT-883))
2023-03-27 09:34:09 +02:00
Ken Murphy
836539d083
Docs typo (#47528)
fix: typo
2023-03-25 16:46:17 +00:00
Rodrigo Esteves
c7cbb4aaf8
Update Error Boundaries link to new ReactJS documentation (#47474) 2023-03-24 04:12:33 +00:00
Sean Massa
3d9396020b
clarify warning about edge + ISR support (#47452)
Made two tweaks:

- ~renamed `experimental-edge` to `edge`: do we still need to reference
`experimental-edge`?~
- added "you" for clarity of word flow
2023-03-23 11:55:08 -07:00
Steven
9791d1e608
feat: change next build to emit output with output: export (#47376)
This PR ensures the correct output is emitted during `next build` and
deprecates `next export`.

The `output: export` configuration tells it to emit exported html and
the `distDir: out` configures the output directory.

```js
module.exports = {
  output: 'export',
  distDir: 'out',
}
```

fix NEXT-868 ([link](https://linear.app/vercel/issue/NEXT-868))

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-23 15:40:18 +01:00
Nikhil Swaminathan
db2037134b
Updating the default URL of Amplify Hosting (#47420)
Updating the URL to a place customers can learn about the capabilities available within Amplify (vs the docs).

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-03-23 04:26:25 +00:00
Steven
5eaaa3fbf7
fix: add pretty error for exportPathMap with app dir (#47371)
The `exportPathMap` feature has been unofficially deprecated for a long time since introducing `getStaticPaths()`.

For the `app` dir, the same can be accomplished with `generateStaticParams()`.

This PR adds a pretty error when using `exportPathMap` with `app` and updates documentation to reflect the current status.


fix NEXT-836 ([link](https://linear.app/vercel/issue/NEXT-836))
2023-03-21 22:22:34 +00:00
Alexander Grattan
4942394bd9
fix: update capitalization of ISR doc heading (#47370)
Makes the capitalization for `On-demand Revalidation` correct and consistent with the rest of the page by changing it to `On-Demand Revalidation`. Thanks for this awesome framework!
![nextjs-isr-doc-change](https://user-images.githubusercontent.com/51346343/226716622-c2b77d39-780a-448e-96a7-ed417cdf2353.png)
2023-03-21 19:31:22 +00:00
Lee Robinson
269780cfbf
Add note about Windows Defender (#47298)
https://twitter.com/timneutkens/status/1637504870541320193
2023-03-19 18:01:33 +00:00
Lee Robinson
990f62acde
Improve static export documentation (#47251)
There has been some helpful [discussion on Twitter](https://twitter.com/dan_abramov/status/1636778278882099216) around this page of documentation. I refactored the introduction to make it more clear that you also get to use SPA features when doing a static export, and underscoring the value of being able to deploy/host virtually anywhere with this approach.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-03-17 18:54:54 +00:00
Felipe Saldanha
e49bfeaf47
Update router.md (#47210) 2023-03-17 09:39:31 +00:00
Balázs Orbán
8c98a207f2
feat(cli): introduce --tailwind flag (#46927)
### What?

This PR introduces a new `--tailwind` flag to the `create-next-app` CLI,
to make it easier to bootstrap a Next.js app with Tailwind CSS
pre-configured. This is going to be the **default**. To opt-out of
Tailwind CSS, you can use the `--no-tailwind` flag.

### Why?

Tailwind CSS is one of the most popular styling solutions right now, and
we would like to make it easier to get started.

Currently, the closest you can come to this is by running `pnpm create
next-app -e with-tailwindcss` which will clone the
https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss
example. But that example is not configured for the App Router. This PR
will let you add Tailwind CSS to both `app/`, `pages/`, and start out
with TypeScript or JavaScript via the CLI prompts.

(Some community feedback
https://twitter.com/dev_jonaskaas/status/1632367991827443713,
https://twitter.com/samselikoff/status/1634662473331617794)

### How?

We are adding 4 new templates to the CLI bundle.

> Note: The styling is not pixel-perfect compared to the current
templates (using CSS modules) to require fewer overrides, but I tried to
match it as close as possible. Here are a few screenshots:

<details>
<summary><b>Current, light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733372-9dba86fe-9191-471d-ad9f-ab904c47f544.png"/>
</details>

<details>
<summary><b>Tailwind (new), light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733610-038d9d0f-634d-4b69-b5c2-a5056b56760c.png"/>
</details>

<details>
<summary><b>Current, dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733790-9b4d730c-0336-4dbe-bc10-1cae1d7fd145.png"/>
</details>

<details>
<summary><b>Tailwind (new), dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224734375-28384bbc-2c3a-4125-8f29-c102f3b7aa1d.png"/>
</details>

#### For reviewers

This introduces 4 new templates, with a very similar code base to the
original ones. To keep the PR focused, I decided to copy over duplicate
code, but we could potentially create a shared folder for files that are
the same across templates to somewhat reduce the CLI size. Not sure if
it's worth it, let me know. Probably fine for now, but something to
consider if we are adding more permutations in the future.

---

~Work remaining:~

- [x] app+ts
	- [x] layout
	- [x] dark mode
	- [x] media queries
	- [x] animations
- [x] app+js
- [x] pages+ts
- [x] pages+js
- [x] prompt/config
- [x] deprecate Tailwind CSS example in favor of CLI
- [x] update docs
- [x] add test
- [x] add [Prettier
plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)
 
Closes NEXT-772
Related #45814, #44286
2023-03-16 16:06:27 +01:00
Hannes Bornö
cb729c1087
Remove experimental fontLoaders option from next.config.js (#46886)
Currently there's an experimental option in `next.config.js` that lets you define default subset(s) to preload for all your fonts. [docs](https://nextjs.org/docs/basic-features/font-optimization#specifying-a-subset)

Over time we haven't seen much use of this option, and we are defining the subsets in the font function call in all our examples/docs. Imo it would be fine to drop this option.

This PR removes that experimental option. If you happen to use it you'll get a build error with [a link](f67af163cd/errors/google-fonts-missing-subsets.md).

Next step (breaking change for next major) would probably be to remove the preload and subsets properties from `next/font/google` calls, and just have something like [`preloadSubsets´](https://vercel.slack.com/archives/C8EAN8A94/p1674868993169559?thread_ts=1674707555.461809&cid=C8EAN8A94) that is required.
2023-03-13 21:34:43 +00:00
konomae
5cf4219686
Fix URL anchor position in going-to-production.md (#47056)
Fix an anchor currently not working properly.
2023-03-13 06:01:37 +00:00
Irek Róg
a0c4354be8
update dynamic-import.md example (#46787)
Because there is a TS error when is set just a string:
`TS2322: Type '() => string' is not assignable to type '(loadingProps: DynamicOptionsLoadingProps) => Element | null'.   Type 'string' is not assignable to type 'Element'.`
2023-03-06 14:28:02 +00:00
Steven
25efdfad36
Add support for output: export config (#46744)
## Background

In the early days, `next export` was created when Next.js was SSR-only in order to statically export your pages for self hosting where no server was available. However, around the time `getStaticProps()` and `getStaticPaths()` were introduced, Next.js began [automatically generating static pages](https://nextjs.org/docs/advanced-features/automatic-static-optimization) (SSG first and SSR opt-in) during `next build`. This meant there were very few reasons to use `next export` and it started to become a stale feature.

## Problem We Need To Solve

Users targeting `next export` currently have a really bad experience. They start a new project and use all the features Next.js has to offer because they all features work with `next dev`. Then when development is finished and it comes time to deploy, running `next build && next export` will fail with errors for [unsupported features](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features).

## Solution

This PR introduces a new configuration option, `output: 'export'`, to indicate that the user intends to run `next export`.

With this change, Next.js can fail fast during `next dev` if any [unsupported features](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features) are used, thereby improving developer experience with instant feedback.


```js
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  output: 'export',
}

module.exports = nextConfig
```
2023-03-04 00:46:20 +00:00
Hamburger
9c32adc18a
Update script.md (#46680)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-02 16:26:03 +00:00
Aite Eboigbe
7323d5cdef
docs: clarified the wording (#46691)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-03-02 15:54:09 +00:00
Jan Potoms
6499b7b656
Fix custom server error handling in the docs (#46671) 2023-03-02 09:53:36 +00:00
Sora Morimoto
d2cbf8c4e0
Fix the doc on how to use the turbo loader in option-less format (#46665)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-02 06:40:50 +00:00
Steven
9720ba55bb
chore(docs): add snippets for common image loaders (#46647)
## Related

- #18606
- #29370
- #19117 
- #18314
- #18391
- #18495
- #18561
- #18450

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-01 17:19:28 -05:00
John Daly
725fbc29ce
[next/jest] Support path aliases from tsconfig/jsconfig (#45815)
<!--
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:
-->

# Description

fixes #31159
fixes #44553

Path aliases defined in `tsconfig.json` or `jsconfig.json` are not
automatically configured to work with Jest. This means that these
aliases have to be defined in multiple places.

This PR configures the SWC Jest transform to handle the `baseUrl` and
`paths`, so that users don't need to configure a `moduleNameMapper` for
Jest.

~This PR intends to make the experience more seamless by automatically
configuring Jest's `moduleNameMapper` and `moduleDirectories` based on
the settings in a project's `tsconfig`/`jsconfig`.~

~Users will be able to supply their own configuration for these fields,
if they have use-cases that require manual configuration.~

~The implementation is taken from the [`paths-to-module-name-mapper`
function in
`ts-jest`](5a0880add0/src/config/paths-to-module-name-mapper.ts).~

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [x] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-01 10:52:32 +01:00
Rowin
ee7c0c5ca4
Docs: Fix Railway link (#46381)
The current link leads to a 404 page. The new link leads to a page that describes how to deploy a Next.js application.
2023-02-24 20:01:14 +00:00
Jan Kaifer
3997b50279
Add note explaining how to import fonts with spaces in name (#46348)
Fixes: https://github.com/vercel/next.js/issues/45916



## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-02-24 19:25:34 +00:00
Delba de Oliveira
e91de8e0dd
Docs: next/font updates (#46159)
Update `next/font` docs pages for version 13.2, rename `@next/font` to `next/font` and remove installation instructions. 

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-02-24 05:20:26 +00:00
Hannes Bornö
0305d0cbd7
Docs: built-in-next-font codemod (#46301)
Add `built-in-next-font` to the codemods page.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
2023-02-23 15:40:15 +01:00
Rich Haines
16e2fd6dc3
Update Edge Runtime docs page (#46239)
<!--
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:
-->

This PR updates the Edge Runtime docs on the next.js docs site with
simplified tables for each API section

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-22 20:40:21 -08:00
Steven
57d2963507
feat: add contentDispositionType config to Image Optimization API (#46254)
Add `contentDispositionType` config to Image Optimization API so the user can configure `inline` vs `attachment`.

This is recommended when `dangerouslyAllowSVG` is enabled but can also be used when its disabled.
2023-02-22 19:56:51 +00:00
Nicolas Bouvrette
80c4766d2c
Adding next-multilingual as a new i18n option (#37452)Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order 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 that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-20 13:56:48 +01:00
Broda Noel
8c1f210019
Fix small error in documentation (#46105)
Just fixing a small comment in the doc
2023-02-18 21:44:47 +00:00
Donny/강동윤
b1f45ce896
Remove swcMinifyDebugOptions from the config (#45976)
x-ref: https://vercel.slack.com/archives/C02HY34AKME/p1676511557291209
2023-02-17 00:18:35 +00:00
Andrii Bodnar
c55345267e
chore(examples): update with-lingui example (#46007)
This PR updates the `with-lingui` example's dependencies and the actual Lingui site URL

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-16 22:15:53 +00:00
Valentín Costa
c0431d0e11
docs(next/router): capitalize React (#45950)
## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-15 16:18:01 +00:00
Michael Law
4697b1591d
Update font.md (#45932)
Change it '/docs/api-reference/components/font.md#preload' to 'https://nextjs.org/docs/api-reference/next/font#preload', if not, 404 caused.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-02-15 06:16:18 +00:00
Eng Zer Jun
cc428e925d
Update NextResponse section in Middleware docs (#45913)
Starting from Next.js 13.1.0, we can now return a response directly from Middleware. However, the NextResponse section in the middleware docs is still outdated.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-14 21:48:10 +00:00
JJ Kasper
a485dc9af1
Add top-level trace include/exclude config (#44605)
This adds a top-level experimental config for including/excluding files
from the file traces. This replaces the page level
`unstable_includeFiles`/`unstable_excludeFiles` as those had some
drawbacks such as not being supported for API routes as these files
aren't required during build to gather the configs, having to duplicate
includes/excludes for multiple pages, and causing more confusion for
where the globs were meant to be relative to.

The new top-level configs allow mapping page globs to includes/excludes
so they can be shared across multiple pages or a single page. These can
also affect the `next-server` trace by specifying that as the key if
necessary. The previous `outputFileTraceIgnores` config is automatically
mapped to the new config with a deprecation warning.

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-02-14 12:09:47 -08:00
LongYinan
ac7f2b6fe7
Make turbotrace run after the webpack build (#45621)
- [x] Depends on https://github.com/vercel/next.js/pull/45776

Turbotrace occupies too many memories while running; this PR makes it
run after the webpack build is finished, it can reduce the memory
hogging by webpack and turbotrace, thus avoiding OOM

The `maxFiles` option in turbotrace is removed because there is
`memoryLimit` option takes over its role.

Close WEB-556
2023-02-10 20:58:55 +01:00
Will Binns-Smith
d726fe30b7
Turbopack experimental fields docs and schema (#45560)
This adds:
- Documentation for Turbopack experimental fields `turbopackLoaders` and `resolveAlias` to the API reference site.
- Typings and schema for the above Turbopack experimental options

Test Plan: 
- `pnpm build`, updated an example to use TypeScript for its Next.js config, and verified the config passed with matching shapes and failed with mismatching shapes.
2023-02-08 23:10:26 +00:00
Steven
53c2ae8720
chore: update next/image docs with unoptimized example (#45720) 2023-02-08 14:43:27 -08:00
Michael Law
d9cf49fcc1
A repeated description should be updated (#45691) 2023-02-08 15:00:03 +00:00
Mike Plummer
2246db680e
Add Cypress component testing to docs & example (#44869)
[Cypress](https://www.cypress.io/) recently went GA with a Component Testing offering which supports Next.js. This PR adds a brief section on what and how to use Cypress for component-level testing and updates the example project with a component test.

Any feedback on content or the example is welcome, thanks for considering!

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 23:42:35 +00:00
Wojtek Olek
6444006f23
[ESLint] Add app dir to default linting directories (#44426)
Fixes #44424 by adding the `app` folder to an `ESLINT_DEFAULT_DIRS`
constant which defines all folders where the linter should go through.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-07 13:53:46 -08:00
琚致远 / Zhiyuan Ju
59ea4e6a32
docs: added missing strategy (#45584)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-06 12:42:40 -08:00
Logan Houp
1b0dde4c74
Add example for clearPreviewData with path to documentation (#45465)
Added an example based on #40238

## Documentation / Examples

- [ x ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ x ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-02-04 02:13:19 +00:00
Steven
a6fbe20535
Remove "standalone" from next export docs (#45539)
`next export` and `output: standalone` are two different feature so this PR removes "standalone" to avoid confusion.

If you are using `next export`, you are not using `standalone` mode (and vice versa).

https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-files
2023-02-03 00:41:20 +00:00