Commit graph

21106 commits

Author SHA1 Message Date
Tobias Koppers
7ea0337ad1
avoid filtering the error message (#65311)
### What?

If the error message contains a reference to `node_modules` it would
omit the error message, but actually we only want to omit the stack
frames

### Why?

### How?
2024-06-03 15:14:35 +00:00
Alexander Lyon
4849ae76c4
expose experimental option to set a memory limit for turbo (#66101)
### What?

We have a GC with rough edges, but it is worth exposing a flag to be able to try it out.

### Why?

I think it would be useful to set up a benchmark that tests the GC perf on new canary builds to make sure we are going in the right direction.

### How?

Add a new flag in the experimental settings and wire it up to the existing native bindings.

Closes PACK-3093
2024-06-03 15:03:58 +01:00
Jiachi Liu
18a7a4d204
Polish copy button state and styles (#66370)
### What
Address the feedbacks in #65921 

* Improve the a11y, using native button
* add more state, such as pending.

### Videos

#### Successful state


https://github.com/vercel/next.js/assets/4800338/2943d6dc-148d-4122-92dd-ba8578abdcf4

#### Error state


https://github.com/vercel/next.js/assets/4800338/3fa36c41-845b-4152-8b82-f15b2ebd72b2

---------

Co-authored-by: Sebastian Silbermann <sebastian.silbermann@vercel.com>
2024-06-03 15:11:32 +02:00
Hendrik Liebau
41c1af30d5
Fix flaky redbox expectation in unstable_after e2e test (#66490) 2024-06-03 13:11:11 +00:00
Hendrik Liebau
994d8ee2c3
Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
Tim Afanasiev
48e9cd9b60
Renamed two files: right order of supported styling (#66443)
### What?
I've renamed two files:
`04-sass.mdx` -> `03-sass.mdx`
`03-css-in-js.mdx` -> `04-css-in-js.mdx`

### Why?
In the documentation of App Router/Building Your Application/Styling,
the last two items on the list (Sass, CSS-in-JS) are ordered differently
compared to the links provided below.


[Documentation](https://nextjs.org/docs/app/building-your-application/styling)

Here is the screenshot:

![image](https://github.com/vercel/next.js/assets/84281349/e072f489-bbdf-46b7-a8a1-ea1df543f1b2)

Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-02 23:42:55 +00:00
Boris
fd25a6af57
refactor: rename API endpoint to '/api/protected-api' for comment (#66456)
Requests to the protected endpoint without the '-api' suffix will return
a 404. Ensure to use '/api/protected-api' to see the expected behavior.

<!-- 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-06-02 23:38:42 +00:00
Anay Paraswani
128e80ca59
Update cookies.mdx to show that maxAge accepts a value in seconds (#66476)
In the discord server, people were confused whether maxAge accepts in
second or millisecond. It would be worth specifying it

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-02 23:34:00 +00:00
vercel-release-bot
12dbc8ad7e v15.0.0-canary.7 2024-06-02 23:23:04 +00:00
Niklas Arens
6278046116
docs: fix link for server components (#66470) 2024-06-02 09:13:05 -05:00
vercel-release-bot
5ae286ffd6 v15.0.0-canary.6 2024-06-01 23:23:16 +00:00
Zack Tanner
734fa1df62
fix: ensure route handlers properly track dynamic access (#66446)
In #60645, dynamic access tracking was refactored but we erroneously
stopped tracking dynamic access in route handlers. Request proxying, as
well as tracking segment level configs (such as `export const dynamic =
'force-dynamic'`), were only enabled during static generation. This was
an unintended breaking change that consequently caused dynamic access to
not properly bail from data cache in various circumstances.

This adds some more rigorous testing for route handlers, as this seems
to be a fairly large gap in our fetch cache testing currently.

This PR is easiest to review with [whitespace
disabled](https://github.com/vercel/next.js/pull/66446/files?w=1).
2024-06-01 15:32:50 -07:00
Jiachi Liu
34c2a05da2
Warn metadataBase missing in standalone mode or non vercel deployment (#66296)
### What

Change the metadataBase missing warning for all cases to only warn in
standalone mode or the non-vercel deployment.

### Why

In vercel deployments, previous concern was that you might not discover
you missed that metadataBase when you deploy. But now we have sth
fallback on production deployments. So we only need to warn in
non-vercel deployment.

Standalone is usually for self-hoist, we always warn users to set the
`metadataBase` to make sure the domain can be properly resolved.


[x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1716926825853389?thread_ts=1716923373.484329&cid=C03S8ED1DKM)
2024-06-01 20:15:01 +02:00
Sebastian Silbermann
355a4acc9e
Improve JSDoc link for Metadata API (#66455) 2024-06-01 17:00:36 +00:00
Zack Tanner
d9b2d8b9cc
fix erroneous RSC calls on hash changes (#66434)
When the router encounters a `stale` cache entry, it clears the `rsc`
data so that it can be fetched in render. All navigations (even just for
hash fragments) flow through the navigation reducer, which has logic to
discard any existing cache entries when the cache is stale.

This bug has become more obvious after removing the default 30s cache,
which would previously have masked it.

This updates the existing handling that clears flight data to not do so
if only the hash changes as there would be no server changes in this
case.

<!-- 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-06-01 06:26:04 -07:00
Will Binns-Smith
b39ae62a3b
Update rust toolchain to nightly-2024-05-31 (#66428)
Depends on https://github.com/vercel/turbo/pull/8256
2024-06-01 03:37:04 +00:00
vercel-release-bot
1e63f5b336 v15.0.0-canary.5 2024-05-31 23:22:44 +00:00
Will Binns-Smith
2de828e139
Use rust-lld for Windows on arm64 (#66360)
Test Plan: Built with Windows on arm64
2024-05-31 16:00:01 -07:00
Will Binns-Smith
fe6ca5e216
Revert "next-swc: Update from tokio 1.32.0 to 1.37.0 (#66087)" (#66391)
This reverts commit 99fff19d97.

See https://github.com/vercel/turbo/pull/8246 for context.
2024-05-31 15:26:25 -07:00
vercel-release-bot
86a0c8f7b1 v15.0.0-canary.4 2024-05-31 21:57:18 +00:00
Zack Tanner
f55a064ce5
add experimental flag for retrying static generation (#66393)
Transient/recoverable errors can cause page(s) to fail. When building an
app with a lot of static pages, a single page failing to build can be
frustrating, especially if it it'll pass on a retry. This adds an
experimental `staticPageGenerationTimeout` property that can be used to
configure how many times Next.js attempts to build a particular page
before giving up.

I recommend reviewing this PR [without
whitespace](https://github.com/vercel/next.js/pull/66393/files?w=1)

<!-- 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-05-31 14:53:46 -07:00
Zack Tanner
a0155c79c5
refactor page export error tracking (#66392)
This adds a map to track failed pages (and the number of attempts, which
will be used in #66393). I removed some other variables that were being
used to track the same information.

<!-- 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-05-31 20:23:27 +00:00
Zack Tanner
c467c0a992
remove duplicate export workers (#66388)
We already have workers available when determining if a page is static,
and we expose those workers to the page export handler. We should re-use
those workers instead of creating new ones.

In practice this seems like dead code, since `setupWorkers` returns the
existing workers if a pages worker exists, and we always create a pages
worker.

<!-- 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-05-31 12:41:17 -07:00
Kevin Mårtensson
2e4884035d
chore: bump supported msw version to v2.3.0 (#66351)
### What?

This bumps the supported `msw` version when using the `playwright` test
mode. There's no need for mocking requests and responses anymore since
[they adopted](https://github.com/mswjs/msw/pull/1436) the global fetch
API in `msw`.

### Why?

Users can extend `test` from `playwright` manually and create the `msw`
fixtures, but it's better if it works out of the box with newer versions
of `msw`.

Fixes #63338.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-31 12:18:41 -07:00
vercel-release-bot
9622d89eb9 v15.0.0-canary.3 2024-05-31 18:17:31 +00:00
Jiachi Liu
86723a6f52
Revert "Middleware RSC bundling changes" (#66422)
Revert #66052 
Revert #66294
2024-05-31 18:10:08 +00:00
Benjamin Woodruff
c0562529db
next-swc-napi: Remove "plugin" from default feature list (#66380)
Effectively a revert of https://github.com/vercel/next.js/pull/66006,
but:

- Keeps the cleanup changes from that PR.
- With https://github.com/vercel/nextpack/pull/106 removing the explicit
`--features plugin` flag, we will match behavior between cargo's
defaults and the nextpack development scripts (which we want to do for
maximizing cache reuse).

The tradeoff here is faster cold builds, at the cost of waiting longer
when you want to test with plugins.

Feedback from @kdy1 was:

> I think it's a good idea to disable plugin by default for nextpack. We
don't use it for most of daily development, but it's very large and slow
to compile

Tested by running both:

```
pnpm build-native
pnpm build-native-no-plugin
```
2024-05-30 17:03:15 -07:00
vercel-release-bot
f9bbb0c82d v15.0.0-canary.2 2024-05-30 23:22:53 +00:00
Vercel Release Bot
50ca7f874c
Update font data (#66359)
This auto-generated PR updates font data with latest available

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-30 12:25:46 -07:00
Jiwon Choi
3506398d37
fix: revert removed flags from lint-staged config (#66381)
cc @ijjk @samcx 

Revert removed flags from lint-staged.

x-ref:
https://github.com/vercel/next.js/pull/65861#issuecomment-2140007873
2024-05-30 11:39:06 -07:00
DHRUV KAUSHIK
a2a94ab181
fix(docs): typescript error in useOptimistic() (#66247)
<!-- 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 Typescript assignment error

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-30 18:01:59 +00:00
yasmin p
139d577c95
Use classnames to set font family in Tailwind create-next-app templates (#66374)
Replaces inline styles in the Tailwind `create-next-app` templates with
classnames to set the font family.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-30 10:43:36 -07:00
Arno
d82c5fddf7
Update compress.mdx (#66376)
Updated the nginx link; they changed domains from https://www.nginx.com/
to https://nginx.org

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-30 17:33:38 +00:00
Wyatt Johnson
dc6d612529
fix: ensure dynamic fetches are tracked correctly (#66349)
This modifies the patched fetch implementation to better handle when
called within an `unstable_cache` callback. In these callbacks, it
should not throw an error related to dynamic access.

This replaces the verbose `trackDynamicFetch` instead with
`markCurrentScopeAsDynamic` which already has support for checking if
inside an unstable cache context. It also has been adjusted to be a
no-op when `export const dynamic = "force-static"`, further simplifying
the code within the patch fetch implementation.
2024-05-30 16:54:03 +00:00
Sebastian Silbermann
deb60c65f4
Restore optimization to ignore legacy APIs in react-dom/server (#66371) 2024-05-30 16:34:48 +02:00
notomo
278b0ba481
feat(react-dev-overlay): Open nvim with line number (#66358)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-05-30 15:59:48 +02:00
Tim Neutkens
95d1bb2cac
Split webpack specific test into separate test suite (#66328)
## What?

Ensures `next build` does not fail with Turbopack on
`test/e2e/app-dir/rsc-basic/rsc-basic.test.ts`. Gets 36 extra tests
passing for Turbopack build.

<!-- 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-05-30 12:29:18 +02:00
Jiachi Liu
92443b6f75
Transform client reference in middleware layer (#66294)
### What

Use `next-flight-loader` to transform the client components into client
reference in middleware and instrumentation.
Add related required webpack aliases, such as alias for
`react-server-dom-webpack`

### Why

issue reported in
https://github.com/vercel/next.js/pull/65424#issuecomment-2128902585
2024-05-30 11:38:55 +02:00
Jiachi Liu
a95356a59d
feat: add copy button for runtime error (#65921)
### What

Add copy stack trace button to copy the original stacktrace in error
overlay.
It will be a dimmed red button with disallowed cursor when it's found
not able to copy.

#### Video



https://github.com/vercel/next.js/assets/4800338/c44e0bf8-f340-41ba-8ee8-4b94fdc298e1


### Why

Makes error reporting easier, users can do one-click to copy the
original text
2024-05-30 09:58:01 +02:00
Jiwon Choi
0558f61c41
refactor: remove unnecessary lint-staged operations (#65861)
### Why?

The current `lint-staged` hook uses [function
signature](https://github.com/lint-staged/lint-staged?tab=readme-ov-file#function-signature)
to target the **staged files** and has extra steps for handling those
files that seem to have been passed on from a [5-year-old legacy
code](https://github.com/vercel/next.js/pull/9245).

The entire process is unnecessary today since `lint-staged` only runs on
the staged files.

### How?

This PR removed unnecessary logic, removed some no-effect flags, and
[removed `git
add`](https://github.com/lint-staged/lint-staged?tab=readme-ov-file#v10).

> If your task previously contained a git add step, please remove this.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-30 00:56:30 +00:00
vercel-release-bot
b4f32831ef v15.0.0-canary.1 2024-05-29 23:22:54 +00:00
Jiachi Liu
5747afd21f
docs: remove invalid og image cases (#66355)
### What

Removing the `/[...catchall]/<metadata image convention>.js` case from
docs

### Why

Since og image and icon routes are using catch-all routes to handle the
both single or multiple routes. For instance:

`app/opengraph-image.js` can possibly generate two cases: 

- single route: `/opengraph-image`
- multi routes with `generateImageMetadata()`:  `/opengraph-image/[id]`

We're not able to detect if there's `generateImageMetadata` defined in
the file before mapping the routes, and decided to create the different
routes to either `/opengraph-image` or `/opengraph-image/[id]`. That's
why we're using a catch-all routes to handle them rn.

Related #48106 
Related #57349
2024-05-29 16:16:31 -07:00
조계진
e2d0082784
Refactor app dir metadata test (#66331)
### What?
Because `createMultiHtmlMatcher` does not use `await` keyword internally
and is not an async function, all `await` in front of the match function
returned from `createMultiHtmlMatcher` was removed in
`test/e2e/app-dir/metadata/metadata.test.ts`.

The JSDoc for `createMultiHtmlMatcher` was also modified.

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-05-29 22:18:15 +00:00
Wyatt Johnson
b5ab9abd62
refactor: remove isRSCRequestCheck (#65587)
In preparation for the following request adapter work, this removes a
helper function for checking if a request is an RSC one, instead
preferring to use the metadata directly.

This helps readability because we know where it's coming from, and it
keeps the implementation simple.
2024-05-29 14:23:59 -07:00
Rishabh Poddar
4fbf3d374c
Update to with-supertokens example (#66320)
Updates to using latest supertokens' SDK versions.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-29 18:16:03 +00:00
alpedia
3d2494a390
docs(next.config.js Options): Remove experimental mdxRs feature from pageExtensions (#66310)
### What?
Removed experimental
[mdxRs](https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs)
from
[pageExtensions](https://nextjs.org/docs/app/api-reference/next-config-js/pageExtensions)

### Why?
The pageExtensions setting demonstrates how to allow other extensions
like .md and .mdx. The inclusion of the experimental Rust MDX compiler
is unnecessary and can lead to confusion.

<!-- 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-05-29 18:12:41 +00:00
Sebastian Silbermann
9085ea4b83
Update labeler config for CI approved (#66335) 2024-05-29 17:37:36 +02:00
vercel-release-bot
64ed7ec951 v15.0.0-canary.0 2024-05-29 15:30:18 +00:00
JJ Kasper
913bf03af0
Handle premajor version for canary (#66336)
Ensures we can cut premajors for canary the same as release-candidate
tags.
2024-05-29 08:26:51 -07:00
Tim Neutkens
f521cc8fc4
Revert "Reapply "Turbopack: Register react refresh exports in module factory (#8191)"" (#66322)
Reverts vercel/next.js#66298
2024-05-29 13:10:13 +02:00