Commit graph

1963 commits

Author SHA1 Message Date
Lee Robinson
9658cf7aad
Move link examples to only Pages Router docs. (#57758) 2023-11-01 14:39:28 +00:00
Gal Schlezinger
f832c56a03
[docs] fix next.config.mjs using commonjs in the example (#57874)
make sure `next.config.mjs` uses `export` instead of `module.exports`
2023-11-01 14:05:38 +00:00
Alexandre Spehler
a07e0de64f
Fix Google Tag Manager URL in Third Party Libraries documentation (#57731)
## Description

Updating the URL for the Google Tag Manager in the Next.js documentation for [Third Party Libraries](https://nextjs.org/docs/pages/building-your-application/optimizing/third-party-libraries).

We were using https://developers.google.com/maps/documentation/embed/embedding-map, which redirected to the documentation for embedding Google Maps.

## Implementation

- Replacing https://developers.google.com/maps/documentation/embed/embedding-map by https://developers.google.com/tag-platform/tag-manager
2023-10-30 16:11:48 +00:00
Tarik
d88d8aed36
Typo fix, version "13" to "14" (#57723)
Typo fix
2023-10-30 00:48:12 +00:00
Joel Hooks
6a8010dbb6
examples: Add inngest next.js example (#56049)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-28 11:57:27 -05:00
Kunal Agrawal
ee9a13aaa0
docs: fix incorrect heading structure in codemods (#57605)
Fixes #57593
2023-10-27 20:54:49 -05:00
Anthony Zheng
86d3043d22
docs: Add missing apostrophe (#57626) 2023-10-27 20:53:20 -05:00
Hugo Maestá
26b71fcf9f
docs: Fix typos in third parties section (#57592) 2023-10-27 20:52:44 -05:00
Fatih Kalifa
27106a481b
Fix incorrect link in GTM docs (#57547)
Previously options and link for tag manager refers to maps embed documentation
2023-10-27 01:11:31 +00:00
Hirotomo Yamada
0bb6b56c82
docs: fix 02-dynamic-routes.mdx (#57029)
params from `{}` to `{ slug: [] }`.

Fixes #57027
2023-10-27 01:09:05 +00:00
Gonzalo Pozzo
fa100e29b1
Update docs with a Good to know box about using redirect in client components (#56966)
This adds a new `Good to know` box to explain how to programmatically
redirect in Client Components to avoid people using `redirect` inside
handlers.


![image](https://github.com/vercel/next.js/assets/6494462/20858591-3d21-4a48-bbc9-8a1e0de29ca8)

Co-authored-by: Lee Robinson <me@leerob.io>
2023-10-26 19:57:22 -05:00
Jack Howard
423e945e15
doc: Clarify built-in support for sass after installation (#57279) 2023-10-26 19:52:57 -05:00
Zoe-Bot
f538232fda
docs(fix): example text unescaped entities (#57255)
Fix bug in example code. Loading with `'` can not be built with the default ESLint rules: 
```ssh
./src/app/reviews/loading.tsx
4:15  Error: `'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`.  react/no-unescaped-entities
4:26  Error: `'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`.  react/no-unescaped-entities
```
2023-10-27 00:20:13 +00:00
Igor Kowalczyk
ab831182bf
Add missing dot in codemod command (#57536)
Add missing dot in `next-og-import` codemod command

```
npx @next/codemod@latest next-og-import .
```
2023-10-26 22:37:47 +00:00
Lee Robinson
92b4d6737c
docs: Next.js 14 (#57342)
- Fetch logging configuration is no longer experimental
- Add `unstable_noStore` reference
- Add `unstable_cache` reference
- Add codemod docs for `next/og` import changes
- Update docs around stable Server Actions
- Add example of revalidating the entire data cache
- Update static export docs for `next export` command removal
- Update minimum required Node.js version
- Add `viewport` and `generateViewport` reference

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-10-26 15:30:43 +00:00
Michael Novotny
fd0a96ffe7
Another lint fix for front (#57511) 2023-10-26 09:57:06 -05:00
Michael Novotny
cbfa126e4b
Fixes lint error on front (#57509) 2023-10-26 14:33:53 +00:00
Jiachi Liu
07483d4b4c
Move serverActionsBodySizeLimit to serverActions.bodySizeLimit (#57433)
Scope all `serverActions` config in one group "serverActions" to make it
more semantics

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 08:51:32 +02:00
Houssein Djirdeh
7bee486f7c
Docs: Add documentation for next/third-parties (#57345)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-25 23:07:18 -07:00
Maia Teegarden
f412c8a991
Remove wasm target (#57437)
This PR removes the wasm target for the next-swc build for the next major version.  The main motivation is that Turbopack does not support targeting wasm yet, and it would be a significant amount of work to add. We plan to make Turbopack the default zero-config experience in a minor version, possibly before we are able to support a wasm target, so we need to make this breaking change now. We also plan to make more improvements to the webpack experience with shared Rust code, which we have so far been blocked from implementing because of the current wasm restrictions. We would like to support a wasm target again in the future, but cannot say at this time when that would be.


Closes WEB-1865
2023-10-26 02:29:07 +00:00
Jiachi Liu
164e43912d
codemods: migrate viewport related metadata export to viewport export (#57436)
This PR adds the codemods transforming certain fields from `metadata`
export to `viewport` export, will still preserve rest metadata export
properties. We don't cover `generateMetadata` to `generateViewport` as
there might be more complex logic inside the function which is hard to
apply the codemods rules.

TLDR: Codemods for #57302
2023-10-25 16:02:14 -07:00
Jiachi Liu
23f32465d7
types: mark ImageResponse from next/server deprecated (#57372)
* Should show `ImageResponse` is deprecated if you still import from `"next/server"`

<img width="708" alt="image" src="https://github.com/vercel/next.js/assets/4800338/38f9b9db-2cfb-48ec-99cc-08e7d1477155">


* If you build it will fail to compile, this might not be super ideal but at least it's not working. For pure js it will throw errors.

```ts
./app/icon.tsx:7:10
Type error: Only a void function can be called with the 'new' keyword.

   5 |
   6 | export default function icon() {
>  7 |   return new ImageResponse(
     |          ^
   8 |     (
   9 |       <div
  10 |         style={{
 ELIFECYCLE  Command failed with exit code 1.
 ```
2023-10-25 20:48:33 +00:00
Josh Story
5528cc6d4e
Remove the experimental serverActions flag (#57145)
Remove the experimental `serverActions` flag

Co-authored-by: Shu Ding <3676859+shuding@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-20 20:45:25 +00:00
Steven
a3aa6590ff
chore(next/image)!: mark domains as deprecated in favor remotePatterns (#57062)
We already had `domains` as "not recommended" but this PR marks it as "deprecated" and prints a warning if its detected.

I also updated all examples to switch from `domains` to `remotePatterns`.
2023-10-19 20:24:48 +00:00
Jiachi Liu
a3e56c9c1e
Move ImageResponse to next/og (#56662)
### Story

Since we introduced `ImageResponse` into `next/server` export, there're a few libraries relying on `next/server` that accidentally ended up with bundling og image into the bundle. As og package is quite large that could easily raise the size concern for middleware, edge runtime routes.

### Struggles
 We've done optimizations. The tree-shaking strategies are tricky, we tried modularize imports and also optimize cjs require/exports to make sure you're not including og package into bundle if it's not being used. However, it's still not 100% can handle all the bundle optimization cases, such as `import {..} from "next/server.js"` could also ended up with the cjs bundle that failed the tree-shaking.

### Move on
So we decide to move og `ImageResponse` into a separate export `next/og`

Closes NEXT-1660
2023-10-19 14:26:48 +00:00
Steven
27b89e4aaf
chore(docs): fix missing fallback on next/image sizes example (#56718)
This example use of `sizes` was missing the fallback.

Its best to review with [`?w=1`](https://github.com/vercel/next.js/pull/56718/files?w=1)
2023-10-18 17:55:46 +00:00
Steven
3a459ca986
chore(next/image)!: mark onLoadingComplete as deprecated in favor of onLoad (#56944)
## History

We used to pass `onLoad` through directly to the underlying img so `onLoadingComplete` was introduced in order to handle the case when `placeholder="blur"` was used and `onLoad` would trigger before the placeholder was removed.

We have since changed the behavior of `onLoad` so that it acts the same as `onLoadingComplete` and therefore `onLoadingComplete` is no longer needed.

## What is this PR doing?

This PR marks `onLoadingComplete` as deprecated in favor of `onLoad`. In the future, we may remove `onLoadingComplete`.
2023-10-17 21:12:22 +00:00
Juan Martín Seery
308a327923
feat(env): upgrade dotenv (#38481)
Upgraded dotenv to v16. Breaking changes are:

- Multiline parsing support
- Support inline comments
- Backtick support

[See their changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.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 helpful link attached, see `contributing.md`


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-10-17 00:57:51 +00:00
Josh Story
0a80017d03
Update React from d900fadbf to 09fbee89d. Removes server context and experimental prefix for server action APIs (#56809)
The latest React canary builds have a few changes that need to be
adopted for compatability.

1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the
`formData` opiont in `react-dom/server` are no longer prefixed with
`experimental_`
2. server content (an undocumented React feature) has been removed. Next
only had trivial intenral use of this API and did not expose a coherent
feature to Next users (no ability to seed context on refetches). It is
still possible that some users used the React server context APIs which
is why this should go into Next 14.

### React upstream changes

- https://github.com/facebook/react/pull/27513
- https://github.com/facebook/react/pull/27514
- https://github.com/facebook/react/pull/27511
- https://github.com/facebook/react/pull/27508
- https://github.com/facebook/react/pull/27502
- https://github.com/facebook/react/pull/27474
- https://github.com/facebook/react/pull/26789
- https://github.com/facebook/react/pull/27500
- https://github.com/facebook/react/pull/27488
- https://github.com/facebook/react/pull/27458
- https://github.com/facebook/react/pull/27471
- https://github.com/facebook/react/pull/27470
- https://github.com/facebook/react/pull/27464
- https://github.com/facebook/react/pull/27456
- https://github.com/facebook/react/pull/27462
- https://github.com/facebook/react/pull/27461
- https://github.com/facebook/react/pull/27460
- https://github.com/facebook/react/pull/27459
- https://github.com/facebook/react/pull/27454
- https://github.com/facebook/react/pull/27457
- https://github.com/facebook/react/pull/27453
- https://github.com/facebook/react/pull/27401
- https://github.com/facebook/react/pull/27443
- https://github.com/facebook/react/pull/27445
- https://github.com/facebook/react/pull/27364
- https://github.com/facebook/react/pull/27440
- https://github.com/facebook/react/pull/27436

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-16 15:46:10 -07:00
Dmitriy Glazkov
26d0bf27fb
Update 05-mdx.mdx . Fix key of the prop (#56883)
Fix key of the prop

Also the same key prop we can find in `next-mdx-remote` [example with getStaticProps](https://github.com/hashicorp/next-mdx-remote#typescript)
2023-10-16 22:21:44 +00:00
Balázs Orbán
1ff7f07875
feat: drop Node.js 16 (#56896)
### What?

BREAKING CHANGE: Bump the minimum required Node.js version.

### Why?

Node.js 16 has reached end-of-life in September.

Bumped to `18.18.2` since it contained some security-related patches: https://nodejs.org/en/blog/vulnerability/october-2023-security-releases

### How?

Bumped `engines` where needed, upgraded the workflows.

This will allow us to remove quite a few polyfills, I'll open separate PRs for those.
2023-10-16 21:41:38 +00:00
Joris Tirado
21fadd3358
Fix typo (#56863) 2023-10-15 17:18:00 +00:00
Diana Gouveia
db188e480f
docs: fix cypress script typo in 10-testing.mdx (#56765)
fix cypress script name typo to run `cypress:open` as declared on package.json script example
2023-10-14 22:43:32 +00:00
VAS
14aeb49662
Update supported-browsers.mdx (#56815)
Fixed a typo -
docs/04-architechture/supported-browsers.mdx

Changes(s) made -
Fixed a typo for improving clarity
[includes -> include]
'your dependencies includes' -> 'your dependencies include'

Please review and merge it.
2023-10-13 21:04:49 +00:00
Michael Novotny
fd2724ace0
Changes codeblock filename delimiter (#56712)
Based on feedback from #56603, the `/` can be interpreted as file paths instead of filename separators / delimiters. We'll change them to use pipes `|` instead.
2023-10-12 23:18:22 +00:00
Balázs Orbán
6fdba20b6d
docs: fix typo in Update 02-get-static-paths.mdx (#56757)
Fix typo in docs

Fixes #56741

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-10-12 12:18:20 -04:00
Delba de Oliveira
b6cce9ce5e
Docs: Add missing description field (#56749)
Fixing error in next-site due to empty description field.
2023-10-12 08:16:06 -05:00
Farsab
1c07848297
fix(docs): adjust api route documentation examples (#56660)
Fixed the example functions in the documentation to use `async` in order to use `await` within the function body. 

Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-10-10 15:23:00 +00:00
Krishnanand Yadav
f6d6acd9ec
Update 01-contribution-guide.mdx: Fix a typo (#56665)
Fix a small typo in the metadata section of the contributing guide.

Kindly add the label: `hacktoberfest-accepted`.
2023-10-10 15:15:13 +00:00
Chris Britten
c8064d69f6
docs(router): clarify dynamic route slug is about a file name, not "folder" (#56596)
### What?

Update documentation on dynamic routing to clarify the use of segment names within file names, rather than referring to them as "folder names".

### Why?

The original documentation used the example term `folderName` when it was referencing dynamic segment names within filenames.  The paths being described here are file names but not folders, and end in a file extension.  This could confuse readers and developers, especially those new to Next.js, leading to potential misunderstandings and misconfigurations.  Perhaps folderName was a relic of a different example wrapping a folder name to do a nested path or other configuration?  But here it seems out of place.

### How?

- Reviewed the provided documentation sections on dynamic routing.
- Replaced references to "folderName" with a different term "segmentName". 
- Ensured the examples provided in the documentation correctly showcase the use of segment names within filenames.
2023-10-10 00:03:49 +00:00
JoRyGu
3f25a2e747
clarify client components render on server on full page load (#55469)
IMO there is not enough of an indicator that client components render on the server on full page loads towards the top of the documentation page. I've seen plenty of experienced devs totally miss this critical info and get stuck on a problem due to a lack of understanding. Putting at least some kind of indicator above the fold would help with that.




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-09 14:39:24 +00:00
Zeeshan Ali
bfc2ab9cff
corrected sentence (#56595)
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-09 02:08:50 +00:00
Radu Petre Tarean
06ee9d7ca0
docs: update code snippet for correct file name (#56006)
params would be undefined on the /item route, i believe the route should be /item/[id]
2023-10-07 00:41:03 +00:00
jazsouf
82c095f8c2
docs: add missing word (#56547)
small typo




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-07 00:23:09 +00:00
Viktor
2c5a8b1abb
Update redirect.mdx (#56414)
Add link to streaming doc
2023-10-04 13:01:10 +00:00
Michael Novotny
f77f222d4f
Updates MDX docs (#56378)
When trying to update my own website to use App Router, I found the current Next.js Docs were missing specifics to get it working (most notably, no mention of `pageExtensions`). Coupled with community feedback, we decided to revisit and rework the entire page.

The page has been walked through and tested on brand new create-next-app projects for both App and Pages Routers to ensure completeness.

Closes [DX-2095](https://linear.app/vercel/issue/DX-2095/improve-nextjs-mdx-docs)

Rendered pages while running locally, in case they are more helpful in seeings the changes and different between routers.

### App Router 

![localhost_3332_docs_pages_building-your-application_configuring_mdx (1)](https://github.com/vercel/next.js/assets/446260/2a2b1a66-c794-4831-ab89-a6a61d02eb84)

### Pages Router

![localhost_3332_docs_pages_building-your-application_configuring_mdx](https://github.com/vercel/next.js/assets/446260/cc60a8a2-a931-4033-aaba-e989a719692d)
2023-10-03 19:32:58 +00:00
Syphini
ef440d40b6
add digest property to error prop (#56339)
Matching the conventions laid out in https://nextjs.org/docs/app/api-reference/file-conventions/error
2023-10-03 14:21:30 +00:00
Daigo Shitara
5254aaecf6
Update image.mdx (#56266)
fix link

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-10-02 14:29:18 +00:00
Daigo Shitara
0d4859b247
Update image.mdx (#56269)
add closing `'`.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-10-02 14:06:23 +00:00
Qing
c20e21bd38
fix: @libsql/client build error (#56192)
Here is the error when building @libsql/client:
<img width="794" alt="image" src="https://github.com/vercel/next.js/assets/7880675/7ec63918-04e1-4468-b552-0aba7225b745">

Here is the [codesandbox](https://codesandbox.io/p/sandbox/nice-feynman-hwjsyd?file=%2Fapp%2Fapi%2Froute.ts%3A8%2C7) to repro it.

Enable the `serverComponentsExternalPackages` the issue will be gone:
<img width="766" alt="image" src="https://github.com/vercel/next.js/assets/7880675/af014f2f-2ab2-4ab7-9e3e-4d4adbae36be">

This PR just adds it to the default package list, so Next.js developers don't have to add it manually.



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

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

### What?

Renamed a function.

### Why?

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

### How?

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

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

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

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

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

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

### How

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



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

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

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

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

But it's actually a property of its own:


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

I confirmed that the latter is correct because:

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

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




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

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

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

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

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

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

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



Reverts vercel/next.js#55776

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

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

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

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

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

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

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

If I want it to look nice in the bug report

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

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

### How?

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

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


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

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


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

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

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


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

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

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




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




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

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

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

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


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

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

Other simple changes include fixing docs.



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

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

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

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

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

---------

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

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

---

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

## Rules for nonce's

- The nonce must be unique for each HTTP response
- The nonce should be generated using a cryptographically secure random generator
- The nonce should have sufficient length, aim for at least 128 bits of entropy (32 hex characters, or about 24 base64 characters).
- Script tags that have a nonce attribute must not have any untrusted / unescaped variables within them.
- The characters that can be used in the nonce string are limited to the characters found in base64 encoding.
2023-09-06 22:52:51 +00:00
Lee Robinson
3f29268133
docs: Remove app reference on pages doc for runtimes. (#55058) 2023-09-06 15:19:32 +00:00
CSY54
b3ed162fe2
docs: add missing quotation mark (#54968)
There is a quotation mark missing in the docs. Adding it back in this PR.
2023-09-06 07:22:31 +00:00
迷悟
57bbc59028
docs: fix typo (#54973) 2023-09-06 07:16:19 +00:00
Hyewon Kim
85fb714f16
docs: Fix typo in getting-started/project-structure (#55035)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

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


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

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

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

There was also a little redundancy at the top. 

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

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

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

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

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

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

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

Clarify the "Forms and Mutations" docs. 

### Why?

This may be opinionated, but I believe this section of the docs starts out assuming that the user knows how the `<form>` HTML works. Coming from the client side React world, most developers are used to using state in forms. Clarifying that this data is accessible via the standard web API [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData) is essential for both transitioning developers and new developers.
2023-08-30 13:20:55 +00:00
vinay
8374e24a39
(Docs) Add missing JS-Code, cookies function names updated accordingly. (#54703)
Changed the name of the actions to `delete` and `read` to indicate the appropriate operation.
2023-08-30 12:03:17 +00:00
Ed Putans
75c641522d
Fixed typo in Building your application > 03. Rendering section (#54764)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

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


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-30 13:59:02 +02:00
Igor Gassmann
e8c71ed2ea
docs(upgrading): add "Migrating from Vite" guide (#53214)
### What?

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

### Why?

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

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

### How?

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

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

## Why?

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

### Problem

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

### Solution

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

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

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

---------

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




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

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

---------

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

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

---------

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

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

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

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

Hope it helps!

### Improving Documentation

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

Thank you!

### Improving Documentation

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

Docs change.

### Why?

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

### How?

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

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

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

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

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

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

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

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

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


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

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

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

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

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

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

### Improving Documentation

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

### What?

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

### Why

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

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

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

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

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

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

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

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

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

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

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

Replaced "stetch" with "stretch" in the fourth paragraph
2023-08-06 20:56:02 +00:00
Tomoya Kashifuku
5f9d2c55ca
docs: fix the link to another document (#53599)
The link used to be "https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises" but actually "https://github.com/acdlite/rfcs/blob/first-class-promises/text/0000-first-class-support-for-promises.md" is correct (needs ".md" at the end)
2023-08-05 17:06:21 +00:00
vinay
081151fed1
(Docs) Remove appDir from experimental flag in mdx configuration docs. (#53610)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

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


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2023-08-05 10:14:00 -04:00
Lee Robinson
b7aa7d4aa4
docs: fix typo on caching page (#53597)
- reduce: `MISS`
- reduces: `HIT`
2023-08-04 23:55:20 +00:00
Steven
acf5e84556
chore(docs): update static exports documentation with missing info (#53592)
- Related to https://github.com/vercel/next.js/issues/48022
2023-08-04 22:16:59 +00:00
William Li
aac4d9c3f7
use import type to import from 'next' in ts examples (#53568)
Updates typescript examples in https://nextjs.org/docs/app/building-your-application/optimizing/metadata#static-metadata to use `import type` instead of `import`.

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

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

Have a great day!

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

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

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

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

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

## For Contributors

### Improving Documentation

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

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

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

### Why?

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


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

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

First phase implementation for WEB-1313.

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

These are the list of status included in the output

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

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

<details>

```
### Host system information


  WSL: false
  Docker: false
  CI: false


### Next.js installation


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



### Node.js diagnostic report

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

### next-swc installation

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

### next-swc shared object dependencies

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

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


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

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

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