Commit graph

2224 commits

Author SHA1 Message Date
Vladimir Kryachko
2d341c7b89
Add --skip-install flag to create-next-app (#64691)
This change allows disabling automatic `npm install`(or other supported
package managers).

Installing NextJS dependencies takes a long time and results in 0.5GB on
disk inside `node_modules`, it's not always what you want as sometimes
it's useful to delay dependency installation to a later time.

<!-- 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-04-23 22:04:54 +00:00
かがみ
769a19e7b6
docs: update og generation code with local assets (#64888)
### What?
This PR fixes OpenGraph generation code with local assets in Node.js
runtime. Also adds some notes on file location.

The updated code is validated with my project on vercel.

### Why?
I tried loading a file in `public` folder(say `./public/og.png`). The
Node.js local assets example code did work locally with `next start` but
failed with error message `Error: ENOENT: no such file or directory`
when deployed to vercel.

Then I found out the trick here is the relative path. On my local
machine the CWD is the root folder so the relative path works, And it
seems the CWD is somewhat different on vercel runtime. Then I tried
using `process.cwd()` to get the CWD and construct a absolute path, this
has been validated with my project on vercel.

Also it's worthy to note where the local assets should be placed, so
that devs could be less confused.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-23 11:07:16 -07:00
Delba de Oliveira
13a3e94ca3
Docs: Add section for @next/env package (#64908)
Related to: https://github.com/vercel/front/pull/31685

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-04-23 16:31:05 +01:00
adiguno
6370155240
Update 04-loading-ui-and-streaming.mdx (#64857)
add a missing word in the suspense documentation to improve readability

<!-- 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-04-22 23:47:34 +00:00
OJ Kwon
372f00eb07
fext(next): extend next.config for mdxRs support options (#64801)
### What

Closes PACK-2978, requires https://github.com/vercel/turbo/pull/8005.

PR extends existing mdxRs config from accepting object as well in
addition to current boolean flag, mainly to allow to specify what kind
of markdown types will be used between gfm and commonmark.
2024-04-22 21:51:47 +00:00
Paul Asjes
ad6386601d
docs: Add WorkOS to list of auth libraries (#64860) 2024-04-22 16:09:38 -05:00
Nils Jacobsen
ed15893814
docs: added inlang to the list of i18n community libraries (#61323)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-04-22 16:07:16 -05:00
Mikhail Danshin
b5f241de67
docs: remove types in js example (#64878) 2024-04-22 10:21:21 -05:00
Sean O'Neil
ea0f5163b0
Update 06-bundle-analyzer.mdx (#64740)
The[ existing code
example](https://nextjs.org/docs/app/building-your-application/optimizing/bundle-analyzer)
generates the following warning when using `--turbo` in the current
latest version of NextJS (14.2.2):

⚠ Webpack is configured while Turbopack is not, which may cause
problems.
 ⚠ See instructions if you need to configure Turbopack:
  https://nextjs.org/docs/app/api-reference/next-config-js/turbo

This modification ensures that the bundle analyzer is only applied when
the user intends to generate a report.

Fixes # https://github.com/vercel/next.js/issues/64739

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Maxim Svetlakov <maxim@ebookapplications.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-19 20:43:26 +00:00
Steven Primeaux
cf038a335b
docs: "generateMetadata" to "generateViewport" in doc "generateViewport" (#64795)
Changed "generateMetadata" to "generateViewport" in
generate-viewport.mdx

Co-authored-by: Sam Ko <sam@vercel.com>
2024-04-19 18:36:25 +00:00
Kushagra Sharma
a0f334ccda
Update index.mdx (#64794)
Removed a type annotation from a code block

<!-- 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-04-19 18:34:21 +00:00
Delba de Oliveira
b7eb7d3554
Docs: Clarify template.js behavior (#64781) 2024-04-19 09:27:01 -05:00
Mikhail Danshin
f1c4558dca
docs: remove types in js example (#64761) 2024-04-19 12:32:49 +02:00
Ehren Nwokocha
00d11899be
Update 07-route-groups.mdx, remove extra bracket (#64754)
<!-- 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-04-18 15:01:31 -07:00
Zack Tanner
89b88ee0ea
docs: fix default.js params example (#64748)
The `params` example in the docs for `default.js` have the slot/params
in the wrong order, giving the impression that you can deeply nest
`default` slots.

This clarifies that the params received by a slot are based on the
dynamic params leading up to the segment containing the slot.

Fixes #64708


Closes NEXT-3160
2024-04-18 13:59:29 -07:00
kiner-tang
adf7529604
docs: Add ant-design to CSS-in-JS section (#63965) 2024-04-18 15:54:07 -05:00
Noemi
13ebfe402c
Add @appsignal/nodejs to the external packages list (#64503)
The `@appsignal/nodejs` instrumentation package fails to load in Next.js
14 due to Webpack failing to bundle its Node.js native extension. Adding
it to the server components external packages list fixes this issue.

Part of https://github.com/appsignal/appsignal-nodejs/issues/1014.
2024-04-18 09:12:26 -07:00
Travis Arnold
843332f0bd
add node example to open graph image docs (#64305)
### What?

Adds a Node.js example for using assets with `ImageResponse` to create
og images.

### Why?

The only examples available use `new URL` and `fetch` which does not
work when the runtime is using Node.js.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-04-18 14:23:45 +01:00
Delba de Oliveira
6dc6226fe0
Docs: Review auth guide (#64605)
Following up from: https://github.com/vercel/next.js/pull/63140
2024-04-17 22:00:58 -05:00
Lee Robinson
b1db5f81fd
docs: fix MDX codeblock (#64673) 2024-04-17 18:18:16 +00:00
Lee Robinson
07a0700dcb
docs: clarify runtime (#64593) 2024-04-16 22:52:53 -05:00
Delba de Oliveira
66f8ffaa7a
Docs: Fix broken link (#64581) 2024-04-16 19:30:08 +00:00
Delba de Oliveira
3cf4183d9b
Improve auth docs (#63140)
Clarify best practices for implementing authentication in Next.js,
including what Next.js and React features to use and when. With the
minimum number of tools, we'll try to teach authentication from first
principles (simple password + email), then recommend Next.js-compatible
libraries, and further resources.

**Authentication:**
- [x] Forms and Server Actions
- [x] Server-side form validation and early returns
- [x] Form errors with `useFormStatus()`
- [x] Pending states with `useFormState()`

**Session Management:** 
- [x] Stateless Sessions
- [x] Database Sessions
- [x] Setting cookies on the server
  - [x] `cookies()`
- [x] `sever-only`

**Authorization:** 
- [x] Optimistic vs. secure checks
- [x] Middleware for optimistic checks
  - [x] Performance caveats - what not to do
- [x] DAL - centralizing data requests, verifying auth state close to
the data source
   - [x] `redirect()`
- [x] DTO - returning the minimum data, preventing exposure on the
client
- [x] Recommendations for: 
  - [x] Server Components
      - [x] Partial rendering and `layout` caveats
  - [x] Server Actions
  - [x] Route Handlers 
  
DX Content: ["What is the right way to do
authentication?"](https://www.notion.so/vercel/00b2a5121a264939a5d4d10f76b36954?v=cac009672f9d411f900f41a0c3971702&p=2a80e8d450f54ea58da5cf8b42c15ac1&pm=s).
Test Example: https://github.com/vercel-labs/app-router-auth/pull/1

This is how I currently visualize it, this diagram is not meant for
users, but to help clarify our current understanding. What am I missing?

![CleanShot 2024-03-22 at 14 27
24@2x](https://github.com/vercel/next.js/assets/32464864/4bdfc0f5-a82d-4faa-bbf3-c15146d534c8)

---------

Co-authored-by: Michael Novotny <manovotny@gmail.com>
Co-authored-by: Anthony Shew <anthonyshew@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2024-04-16 17:55:21 +01:00
Kenji
bde895191d
docs(09-authentication): fixes link to NextAuth.js (#64457)
There's a TODO above the links, I didn't understand if it was related to
this PR as the domain was already authjs.dev

### What?

- Fixes the link to NextAuth in the `Examples` section

### How?

- Changes https://authjs.dev/guides/upgrade-to-v5 to
https://authjs.dev/getting-started/migrating-to-v5

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-15 12:49:53 -07:00
Damien Simonin Feugas
e7a8645cb8
BREAKING CHANGE: remove deprecated analyticsId from config, and the corresponding performance-relayer files and tests (#64199)
### 🤔 What's in there?

We've deprecated config's `analyticsId` in 14.1.1 [almost 3 months
ago](https://github.com/vercel/next.js/releases/tag/v14.1.1-canary.2).
Users can opt in fot `@vercel/speed-insights`, or use
`useReportWebVitals` to report to any provider they'd like.

This PR:
- removes `analyticsId` key from configuration
- stops setting `__NEXT_PUBLIC_ANALYTICS_ID` env variable when the key
was present
- stops injecting `performance-relayer` file, when the variable is set
- cleans up related test code.
2024-04-15 15:23:30 +00:00
Abhay
d6476dae84
chore(docs): Add example usage of PixelBin custom image loader (#64074)
### Improving Documentation
Integrate PixelBin Custom Image Loader for optimized image handling

PixelBin is Real-time image transformations with automatic optimization,
image URL and storage for efficient image organization

### References

- [Resize
Doc](https://www.pixelbin.io/docs/transformations/basic/resize/#width-w)
- [Optimize Doc](
https://www.pixelbin.io/docs/optimizations/quality/#image-quality-when-delivering)

### Contributors

- @pnutmath
- @umesh162


Co-authored-by: Steven <steven@ceriously.com>
2024-04-15 15:10:07 +00:00
JJ Kasper
9c83a3458c
Fix missing PagesOnly in 05-mdx (#64505)
Looks like we have a syntax error in
https://github.com/vercel/next.js/pull/63568 from missing closing
`</PagessOnly>` tag.

```sh
b383-75ab3d452c93.mdx:0:0: ERROR: [plugin: @mdx-js/esbuild] Expected a closing tag for `</PagesOnly>` (503:1-503:12)
```

x-ref: https://github.com/vercel/next.js/pull/63568

Closes NEXT-3111
2024-04-15 07:56:53 -07:00
Lee Robinson
50ed4542df
docs: fix config variable usage in memory docs (#64469)
Closes https://github.com/vercel/feedback/issues/61864
2024-04-14 11:00:36 -05:00
Michael Novotny
fbc0a0eb8c
docs: Adds MDX Components file convention page and updates MDX page (#63568)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
2024-04-13 13:07:18 -05:00
Zack Tanner
f602b2979c
default fetchCache to no-store when force-dynamic is set (#64145)
`fetchCache` is a more fine-grained segment level cache-control
configuration that most people shouldn't have to use. Current semantics
of `dynamic = "force-dynamic"` will still treat the fetch as cacheable
unless explicitly overriding it in the fetch, or setting a segment level
`fetchCache`.

The `dynamic` cache configuration should be seen as a "top-level"
configuration, while more fine-grained controls should inherit logical
defaults from the top-level. Otherwise this forces people to opt-into
the `fetchCache` configuration, or manually override each `fetch` call,
which isn't what you'd expect when forcing a segment to be dynamic.

This will default to not attempting to cache the fetch when
`force-dynamic` is used. As a result, I had to update one of the
`app-static` tests to use `revalidate: 0` rather than `force-dynamic`,
as the revalidate behavior is slightly different in that it won't modify
the revalidation time on a fetch if it's non-zero.

Closes NEXT-2067
2024-04-13 17:05:47 +00:00
kxlow
9b77edee06
Fix optimizePackageImports docs for Pages Router (#64439)
The current documentation displays the docs for the `compress` option
instead of the `optimizePackageImports` option.


https://nextjs.org/docs/pages/api-reference/next-config-js/optimizePackageImports
2024-04-13 16:46:06 +00:00
Hung Doan
904908cf33
docs(pages): update slug value for optional catch all routes (#64381)
## Why?

When you do, →

```
  const router = useRouter()
  console.log('[test] router =', router.query.slug)
 ```
 
 the value of `router.query.slug` should be undefined in this instance.
 
 (screenshot from current docs)
![CleanShot 2024-04-13 at 00 18 14@2x](https://github.com/vercel/next.js/assets/28912696/6cd79b3e-9258-4fcb-8685-dc6fe4d336e8)

it should be `slug: undefined`.
2024-04-13 04:23:45 +00:00
Colton Ehrman
9994e74a6c
fix(next-lint): update option --report-unused-disable-directives to --report-unused-disable-directives-severity (#64405)
## Why?

The Option name and type has been incorrect for
`--report-unused-disable-directives` (it's likely that
https://github.com/vercel/next.js/pull/61877 exposed this.

For correctness, we have updated the name to
`--report-unsed-disable-directives-severity` →
https://eslint.org/docs/v8.x/use/command-line-interface#--report-unused-disable-directives-severity.

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

---------

Co-authored-by: samcx <sam@vercel.com>
2024-04-12 22:09:05 +00:00
Anatolii Kurochkin
fdeff57c7d
docs: clarify Internationalization (i18n) Routing (#63853)
## Description

Updated [Internationalization (i18n)
Routing](https://nextjs.org/docs/pages/building-your-application/routing/internationalization#leveraging-the-next_locale-cookie)
to clarify that `NEXT_LOCALE` does not override the `accept-language`
header value; rather, it prioritizes the `NEXT_LOCALE` cookie value over
`accept-language`.

## How has this been tested?

Ran `pnpm prettier-fix`
2024-04-12 18:56:08 +00:00
Vivek Kaushik
bf45353af1
Update 13-debugging.mdx (#64344)
This doc is outdated as mentioned as this issue has been going on for
years now where people are unable to debug/set breakpoints in VSCode due
to some mismatch of port/process configuration b/w VSC, Next/Node or
Browser(Chrome Dev tools).

Regardless, I found the fix on
https://github.com/vercel/next.js/issues/47561#issuecomment-1549241442
and it works like a charm.

Kindly update your docs accordingly. Thanks.

<!-- 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: samcx <sam@vercel.com>
2024-04-12 15:55:02 +00:00
Sir Tangale
41b18b3959
Update 04-cypress.mdx (#64375)
Cypress supports TypeScript 5 with moduleResolution: "bundler" starting
from version 13.6.3 and later.

<!-- 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-04-12 15:43:16 +00:00
Gediminas
322ecdf287
Update 02-server-actions-and-mutations.mdx (#64248)
### Improving Documentation

mistake in the docs.

action should not be apply on the button.
only formAction or onClick is allow.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-04-12 08:28:53 -07:00
MC Naveen
3b838e297d
docs: update tree to include mdx-components.tsx file (#64376) 2024-04-12 08:31:04 -05:00
Paul Asjes
a66676a64e
docs: Add WorkOS to list of auth solutions (#64395) 2024-04-12 08:14:22 -05:00
mknichel
ab262348a6
Add documentation for --experimental-debug-memory-usage (#64322)
<!-- 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: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-11 21:14:11 +02:00
Delba de Oliveira
d94466c780
Docs: Add recommendations for CSS import order (#64321) 2024-04-11 20:59:38 +02:00
Delba de Oliveira
38850bf1ee
Docs: Instructions on how to generate turbopack trace file (#64325)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-04-11 11:55:18 +02:00
Tim Neutkens
c976ca6ec5
Update documentation on webpack loaders in Turbopack (#64296)
## What?

Updates the loader documentation to the format.

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

-->


Closes NEXT-3061
2024-04-10 17:02:55 +02:00
Martin Goutry
e1e3332b17
chore(docs): update wrong route in staleTimes.mdx (#64278)
This fixes a wrong route in the
[staleTimes](https://nextjs.org/docs/app/api-reference/next-config-js/staleTimes)
doc

Co-authored-by: Sam Ko <sam@vercel.com>
2024-04-10 04:07:37 +00:00
Ahsan Moin
90b3ddd671
chore: fix some typos (#64276)
`functionaility` -> `functionality`
`programatically` -> `programmatically`
`recored` -> `record`
`specfy` -> `specify`

<!-- 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-04-10 04:04:52 +00:00
Sam Ko
5ee8c4bd3f
docs(cli): re-order profile to match help output (#64267)
## Why?

Forgot to add this change in here →
https://github.com/vercel/next.js/pull/64264.

Closes NEXT-3055
2024-04-09 18:18:58 +00:00
Zack Tanner
85b9ed5eb8
provide revalidateReason to getStaticProps (#64258)
Provides a `revalidateReason` argument to `getStaticProps` ("stale" |
"on-demand" | "build").

- Build indicates it was run at build time
- On-demand indicates it was run as a side effect of [on-demand
revalidation](https://nextjs.org/docs/pages/building-your-application/data-fetching/incremental-static-regeneration#on-demand-revalidation)
- Stale indicates the resource was considered stale (either due to being
in dev mode, or an expired revalidate period)

This will allow changing behavior based on the context in which it's
called.

Closes NEXT-1900
2024-04-09 09:53:08 -07:00
Steven
8c9c1d2b6d
feat(next/image): add overrideSrc prop (#64221)
- Fixes https://github.com/vercel/next.js/discussions/60888
- Related
https://merj.com/blog/optimising-nextjs-image-component-for-image-search
2024-04-09 10:48:01 -04:00
Jiachi Liu
5e2ac0986f
chore: externalize undici for bundling (#64209)
Currently acornjs has an issue with compiling undici, add undici
externalize, once it's resolved we can remove the externalization for it

```
You may need an additional loader to handle the result of these loaders.
|       // 5. If object is not a default iterator object for interface,
|       //    then throw a TypeError.
>       if (typeof this !== 'object' || this === null || !(#target in this)) {
|         throw new TypeError(
|           `'next' called on an object that does not implement interface ${name} Iterator.`

Import trace for requested module:
../../../../node_modules/.pnpm/undici@6.12.0/node_modules/undici/lib/web/fetch/util.js
../../../../node_modules/.pnpm/undici@6.12.0/node_modules/undici/lib/web/fetch/headers.js
../../../../node_modules/.pnpm/undici@6.12.0/node_modules/undici/index.js
./app/undici/page.js
```

Closes NEXT-3030
2024-04-09 07:26:53 +00:00
HyunJick Lee
baaca4b69e
fix(docs): update width height value on example to sync with demo (#64147)
I'm looking at the example code and demo for the Image component, 
[Responsive image using a static
import](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-using-a-static-import)
and [Responsive image with aspect
ratio](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-with-aspect-ratio)
sections are immersive because the code in the example and the demo
match, The [Responsive image with
fill](https://nextjs.org/docs/app/api-reference/components/image#responsive-image-with-fill)
section breaks the immersion because the code in the example and the
demo are slightly different.

I think it's just a typo. It seems the width and height values are
reversed.

Attach the code from the demo.

<img width="504" alt="Responsive image with fill demo code"
src="https://github.com/vercel/next.js/assets/56260102/72ab314d-a9b3-4a88-8d9c-48f0dde8c19f">

Co-authored-by: Steven <steven@ceriously.com>
2024-04-08 22:15:03 +00:00