Commit graph

2110 commits

Author SHA1 Message Date
Ryan Halliday
78e7ddd0f2
Update 06-src-directory.mdx to mention Typescript paths (#62863)
Small update to mention TS paths when changing to src/ directory as it
is something most users will need to do.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-05 19:37:20 +00:00
Dev
5001da0ed0
Update sitemap.mdx (#62809)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-03-04 15:13:24 -08:00
Lee Robinson
1d00ed4bf1
docs: clarify client component intro (#62767)
"Render on the client" could sound like client-only rendering.
2024-03-02 16:39:04 -06:00
Sam Ko
ccbd69ff9a
docs: update Next.js CLI docs (#62304)
## Description

It made sense to improve our <picture data-single-emoji=":nextjs:"
title=":nextjs:"><img class="emoji" width="20" height="auto"
src="https://emoji.slack-edge.com/T0CAQ00TU/nextjs/2a85d633ae594556.png"
alt=":nextjs:" align="absmiddle"></picture> CLI docs after refactoring
the CLI!

## Important Changes
- Removes mention of `next export`, which was moved to `next.config.js`
- Adds mention of `--turbo`
- Adds all the expected help outputs

## Related
- https://github.com/vercel/next.js/pull/61877
- Fixes https://github.com/vercel/next.js/issues/59226

Closes NEXT-2545

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-01 15:13:08 -08:00
Wes Bos
b1089d3691
Update unstable_cache docs for revalidate option (#62689)
Clarifies what passing false or undefined to the revalidate property
option of unstable_cache does.

Context: I didn't want my DB query to be cached at all, but I did use
this API because I wanted to refresh a component's data after submitting
a server action. I thought I had to pass 0, or false to get it to not
cache at all.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 19:49:15 +00:00
Spencer Zeng
24b7175dcf
Correct format for autoplay attribute in NextJS video docs (#62695)
### What?
Updates the format of the `autoplay` attribute in the [videos
documentation](https://nextjs.org/docs/app/building-your-application/optimizing/videos#common-video-tag-attributes)
to camel case, which is the correct format for the attribute in JSX,
matching the format of `playsInline`.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 19:27:09 +00:00
Soheil Jafarnejad
c353b5f0e6
Update 05-error-handling.mdx (#62153)
The global error boundary is only displayed in the production (prod)
environment and is not shown in the development (dev) environment.

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

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-28 17:55:05 -08:00
Jimmy Chion
8c242ac095
[docs] update analytics doc to use useReportWebVitals (again) (#62654)
Closes #62653

Finishes the job started by https://github.com/vercel/next.js/pull/58196
and updates the last remaining code example that uses `reportWebVitals`
to use `useReportWebVitals`

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-28 15:19:01 -08:00
Avery Morin
eb0bd561a9
docs: Don't suggest using taintUniqueValue API with phone number (#62600)
Linked react docs explicitly advise not to use low-entropy values such
as phone numbers with the taintUniqueValue API.
https://react.dev/reference/react/experimental_taintUniqueValue#caveats

> Do not use taintUniqueValue to protect low-entropy values such as PIN
codes or phone numbers. If any value in a request is controlled by an
attacker, they could infer which value is tainted by enumerating all
possible values of the secret.

PS Sorry for the tiny change but this threw me off when I read it.
2024-02-27 16:28:05 -05:00
Balázs Orbán
f82a6e187a
docs: fix redirect loop in auth code example (#62589)
### What?

If the user is logged in and on the dashboard, no need to redirect.

### Why?

#62547

### How?

We still want to redirect to the dashboard from other routes, if the
user is logged in already.

Fixes #62547, also related #62548

Closes NEXT-2619
2024-02-27 15:35:59 -05:00
Ye Zhu
0d1b11fba3
docs: Remove superfluous <PagesOnly> tags in api-reference/components/link.mdx (#62501)
Within the document
[docs/02-app/02-api-reference/01-components/link.mdx](https://github.com/zhuyedev/next.js/blob/canary/docs/02-app/02-api-reference/01-components/link.mdx#L327),
there is an unnecessary set of `<PagesOnly>` tags, which prevents a few
sections from being displayed correctly.This issue particularly affects
the section starting with "### If the child is a custom component that
wraps an <a> tag" (in line 327) and ending just before "### Middleware"
(in line 458).

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-26 17:20:41 +00:00
JINSOUL KIM
7727c5c411
docs: fix typo (#62543)
### What?
I found a small typo in the docs.(analytics.mdx)
Missing ")" in the end of function.

### How?
Add ")" in the end.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-26 16:15:40 +00:00
bestlyg
0f4e3eeece
docs: update app router link (#62533) 2024-02-26 09:03:47 -06:00
bestlyg
e98978033f
feat(docs): update 14-internationalization.mdx (#62484)
### Improving Documentation

follow the
[example](https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/middleware.ts#L53),
it is better to use NextResponse instead of Response.
2024-02-24 15:11:19 +00:00
Delba de Oliveira
01c1bfa325
Docs: Add CORS examples (#62439) 2024-02-23 09:11:57 -06:00
Masato Nakamura
946c15fb2c
chore: Bump actions/cache (#62422)
<!-- 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 #

-->

GitHub is [planning to upgrade to Node
20](https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/).
Versions prior to actions/cache v3 use an outdated version of node, so
we will upgrade to actions/cache v4, where [Node 20 is the
default](https://github.com/actions/cache/releases/tag/v4.0.0).

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-23 08:05:17 +00:00
Sam Ko
ad48047beb
docs(link): update docs around link prefetch: false (#62414)
## Changes

Better clarify the differences between App and Pages Router around
`prefetch: false`.

Closes NEXT-2575
2024-02-23 01:34:25 +01:00
Jiwon Choi
5a4b56fb0f
chore(docs): mention that next.config.js must have default export (#62341)
### What?

When the next config has no default export, it does not inform the user
correctly, but as:

```ts
// next.config.mjs

/** @type {import('next').NextConfig} */
export const config = {
  // ...
}
```

```sh
⚠ Invalid next.config.mjs options detected: 
⚠     Unrecognized key(s) in object: 'config'
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
```

### Why?

The options within the named exported config may be inactivated without
notice.

### How?

Since we use dynamic import for the config, check if `userConfigModule`
has a `default` export, and if not, throw an error.
Also, added to the docs to address by text that the config needs a
default export.
2024-02-22 15:37:13 -05:00
Mehran Farahani
0b346c28bc
docs: add current state argument to authenticate function (#62399)
### What?
Added a `_currentState` argument to the `authenticate` function in the
'Building Your Application' authentication documentation.

### Why?
The `useFormState` hook's first argument is a function that requires two
arguments. This adjustment ensures the `authenticate` function aligns
with the expected structure used by `useFormState`. For more details,
refer to the React documentation: [useFormState
Hook](https://react.dev/reference/react-dom/hooks/useFormState).
2024-02-22 19:24:41 +00:00
Colby Fayock
f2c2b0d0fe
Updating Cloudinary Video Resources (#61959)
### What?

Updates the Cloudinary bullets and links under the Video Optimization.


https://nextjs.org/docs/app/building-your-application/optimizing/videos#cloudinary-integration

### Why?

More relevant direct link to the Cloudinary-supported Next.js SDK along
with an additional link to the Video solution itself.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-22 19:01:01 +00:00
John Slemmer
e42fadacbf
better reference for what is serializable by React (#62405)
The current link just takes you to the definition of serialization on
MDN. I'm proposing this should link to the React docs and what they are
able to serialize because it is way more than JSON.
2024-02-22 19:00:36 +00:00
Svetoslav99
e722778768
docs: fix web-vitals.tsx file path for second example (#62387)
Changing from "components" to "_components" folder name here
"app/components/web-vitals.tsx", to be the same as previous example on
the page "app/_components/web-vitals.tsx".

Co-authored-by: Steven <steven@ceriously.com>
2024-02-22 16:54:11 +00:00
suu3
9feaffaf68
docs: add an explanation about prefetch on hover to the link.mdx (#62182)
<!-- 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 #

-->

Hello, I noticed the following code in `link.tsx`.
```
//client/link.tsx
...
onMouseEnter(e) {
    ...
    if (
        (!prefetchEnabled || process.env.NODE_ENV === 'development') &&
        isAppRouter
    ) {
        return
    }

    prefetch(
          ...
    )
},
```
It seems that when prefetch={false} is set, prefetch still occurs on
hover for page routers.
However, there is no explanation in the <Link> documentation, which
caused misleading.
I added the explanation inside PageOnly component, could you please
review it?
2024-02-21 05:56:07 +00:00
Nick Muller
1783e55c28
Fix typo in unstable_cache.mdx (#62301) 2024-02-20 22:25:20 +00:00
Cody Lundquist
fb99d2eaf5
docs: Update unstable_cache.mdx with important info about dynamic data (#62202)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

This caused me a ton of issues in production due to inconsistent cache.
It does not manifest itself in local development. The only reason I
figured it out was because I upgraded to the canary release and someone
added a helpful exception explaining that I shouldn't be doing what I
was doing. To hopefully help people in the future, I'm adding a blurb to
the `unstable_cache` docs.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-20 17:52:53 +00:00
Balázs Orbán
0d64d592f4
docs(cli): tweak next info docs (#62274)
### What?

Follow-up on #62249

### Why?

I noticed the example `next info` output was outdated/missing a few
parts in the docs.
2024-02-20 09:55:49 -05:00
Tobias Koppers
8250a8419a
add turbo.resolveExtensions to allow to customize extensions (#62004)
### What?

* add `turbo.resolveExtensions` to allow to customize extensions in
Turbopack

fixes PACK-2335
Fixes https://github.com/vercel/turbo/issues/4934
2024-02-19 09:07:09 +00:00
ArianHamdi
ab487cba92
docs: fix page.js file name in 02-pages-and-layouts.mdx (#62221)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-19 03:22:24 +00:00
Theo
d18335ba43
Fix 02-pages-and-layouts.mdx to show Good to know and contents in the same box (#62203)
**Good to know:** and list should be inside the same box.


![image](https://github.com/vercel/next.js/assets/36564257/072eb7ca-1c95-473b-9d08-c4cea649b7ea)


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

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-02-17 22:39:18 +00:00
Ismail Ghallou
ef1fb15260
docs: fix srclang prop (#62164)
### What?
- `srclang` -> `srcLang`

### Why?
React.js!
2024-02-16 19:47:16 +00:00
kevinmitch14
d397832e01
Docs: update link.mdx (#61508)
Updated paths in relation to `<Link />` and middleware rewrites. Feel
free to leave suggestions if needed, this has always confused me a
little bit.

**Old Version**:
For example, if you have a Dynamic Route like `/dashboard/[user]` that
you want to present differently via middleware, you would write: `<Link
href={{ pathname: '/dashboard/authed/[user]', query: { user: username }
}} as="/dashboard/[user]">Profile</Link>`.

The `as` prop should be the URL we want to display while href/pathname
is the actual path. So if we want to present something differently via
middleware, we would do so via `as`. In the example above we want to
display `/dashboard/[user]` differently but we use
`as='/dashboard/[user]'`.
2024-02-16 19:43:11 +00:00
Bernardo Belchior
f23f57f692
Fix extra const in video docs (#62155)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:26:06 +00:00
Phil Z
5f98a8def0
Add puppeteer-core to serverComponentsExternalPackages.mdx (#62156)
<!-- 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 #

-->

This is a docs change that I should have included with
https://github.com/vercel/next.js/pull/62063

Adds `puppeteer-core` to the documented list of external server
dependencies to be ignored by the bundler.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:25:16 +00:00
Lee Robinson
c48a0f8e6d
docs: add link to Blob (#62056) 2024-02-14 11:06:47 -05:00
Alex Puertas
898f74e729
docs: update Auth.js name to NextAuth.js (#61974)
On the Examples section the name was already updated but not updated on
the Selecting Session Management in Next.js

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-02-13 12:32:36 +01:00
Balázs Orbán
65517ac621
chore: fix lint (#61950)
Fixes linting issue from #61934

Closes NEXT-2442
2024-02-12 16:32:20 +00:00
Rajdeep singh
1c64850360
docs: add missing closing curly brace to code snippet (#61934)
Closed the missing `}` in the [Theme Detection
Picture](https://nextjs.org/docs/app/api-reference/components/image#theme-detection-picture)
example code.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-02-12 17:26:23 +01:00
Hong
eb03ae742f
docs: fix typo (#61943)
### Why?
`compatability` is not a correct word.

### How?
Use `compatibility` instead.
2024-02-12 17:24:26 +01:00
Sam Ko
ca18f4ff9d
docs(cli): fix next info section title and re-order (#61895)
## Changes

- Update section title from `Next Info` to `Info`
- Adds consistency with other section titles and fixes broken link →
09a764d0fc/packages/next/src/cli/next-info.ts (L100)

Closes NEXT-2425
2024-02-10 17:24:32 -08:00
Lee Robinson
09a764d0fc
docs: follow up from CRA docs (#61893) 2024-02-10 11:59:17 -06:00
Delba de Oliveira
971a1a6421
Docs: Address community feedback (#61857)
Closes: 

- https://github.com/vercel/feedback/issues/54964
- https://github.com/vercel/feedback/issues/54580
- https://github.com/vercel/feedback/issues/54555
- https://github.com/vercel/feedback/issues/54341
- https://github.com/vercel/feedback/issues/54309
- https://github.com/vercel/feedback/issues/53751
- https://github.com/vercel/feedback/issues/55173

Add diagram: https://github.com/vercel/front/pull/29561
2024-02-10 09:59:29 -06:00
Lee Robinson
479faa7117
docs: migrating from CRA (#61866)
Co-authored-by: Michael Novotny <manovotny@gmail.com>
2024-02-09 19:32:53 -06:00
Sam Ko
19adc81e62
docs: update API reference for <Script> (switch to _document.js) (#61875)
## Changes

- Fixes https://github.com/vercel/next.js/issues/61594

Closes NEXT-2421
2024-02-09 21:03:49 +00:00
Sam Ko
8f6f137977
docs: add Page Router only section for beforeInteractive (#61839)
## Changes

Updates `beforeInteractive` section in API Reference docs for Pages
Router

-
https://nextjs.org/docs/pages/api-reference/components/script#beforeinteractive
- Closes https://github.com/vercel/next.js/issues/61594
2024-02-09 20:38:25 +00:00
SaiGanesh21
09c8eae4e0
docs: Example mismatch when changing language JS/TS (#61833)
### What? 
Resolves issue #61695 

### Why?
The `Building Your Application -> Data Fetching -> Server Actions and
Mutations` section in the Next.js documentation has a few mismatches
with respect to JS and TS codes.

---------

Co-authored-by: battuAshita <battua@iitbhilai.ac.in>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-08 20:11:42 +00:00
Zack Tanner
13d8b14040
Fix closing a modal example in parallel routes docs (#61819)
The docs mention using a `Link` to close the modal, but navigating away
from a slot that was active won't automatically unmount unless it
matches with a new page for that slot. This is because client-side
navigations don't switch slots from active -> default. Default is only
used on a hard navigation.

I believe this example used to be in here but got removed, so I re-added
with some extra clarity.


Closes NEXT-2405
2024-02-08 11:03:08 -08:00
Jimmy Lai
feb27ad621
Revert "feat(next/image)!: remove squoosh in favor of sharp as optional dep" (#61810)
Reverts vercel/next.js#61696

Closes NEXT-2401
2024-02-08 11:00:34 +00:00
Gen Tamura
72826823d6
Update 02-server-actions-and-mutations.mdx (#61756)
Hi, there.

I have fixed the missing leading slash in the anchor link in Route
Segment Config.

Thanks
2024-02-07 11:36:46 +01:00
Shahzar Mazhar
2145300fe1
fix: showing incorrect filename in example (#61736)
### What?

change filename to `app/dashboard/@analytics/layout.js` in example

### Why?

It  was written incorrect i.e. `app/layout.js`

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

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

change filename to app/dashboard/@analytics/layout.js

### Why?

It  was written incorrect i.e. app/layout.js

### How?

Closes NEXT-
Fixes #

-->
2024-02-06 20:38:56 +00:00
Steven
07c4ec052e
feat(next/image)!: remove squoosh in favor of sharp as optional dep (#61696)
## History

Previously, we added support for `squoosh` because it was a wasm
implementation that "just worked" on all platforms when running `next
dev` for the first time. However, it was slow so we always recommended
manually installing `sharp` for production use cases running `next
build` and `next start`.

Now that [`sharp` supports
webassembly](https://sharp.pixelplumbing.com/install#webassembly), we no
longer need to maintain `squoosh`, so it can be removed. We also don't
need to make the user install sharp manually because it can be installed
under `optionalDependencies`. I left it optional in case there was some
platform that still needed to manually install the wasm variant with
`npm install --cpu=wasm32 sharp` such as codesandbox/stackblitz (I don't
believe sharp has any fallback built in yet).

Since we can guarantee `sharp`, we can also remove `get-orientation` dep
and upgrade `image-size` dep.

I also moved an [existing `sharp`
test](https://github.com/vercel/next.js/pull/56674) into its own fixture
since it was unrelated to image optimization.

## Related Issues
- Fixes https://github.com/vercel/next.js/issues/41417
- Closes https://github.com/vercel/next.js/pull/54670
- Related https://github.com/vercel/next.js/issues/54708
- Related https://github.com/vercel/next.js/issues/44804
- Related https://github.com/vercel/next.js/issues/48820
2024-02-06 14:17:07 -05:00