Commit graph

20283 commits

Author SHA1 Message Date
Tim Neutkens
5a1409179c
Ensure automated-update-workflow fails on errors (#63807)
## What?

Ensure that test runs like this one fail:
https://github.com/vercel/next.js/actions/runs/8463659474/job/23186935591

<!-- 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-2953
2024-03-28 12:29:45 +01:00
vercel-release-bot
0c21ff7df6 v14.2.0-canary.46 2024-03-27 23:21:35 +00:00
Vercel Release Bot
1f443776fa
Update Turbopack development test manifest (#63776)
This auto-generated PR updates the development integration test manifest
used when testing Turbopack.
2024-03-27 20:43:22 +01:00
vercel-release-bot
1d9833bc63 v14.2.0-canary.45 2024-03-27 19:12:36 +00:00
Tobias Koppers
ab5d0a2002
update turbopack (#63778)
* https://github.com/vercel/turbo/pull/7797 <!-- Tobias Koppers - fix
externals in side-effect optimized modules -->
* https://github.com/vercel/turbo/pull/7830 <!-- Tobias Koppers - Avoid
showing import map description in resolving issue when there is no
import map mapping -->
* https://github.com/vercel/turbo/pull/7833 <!-- Tobias Koppers - add
next.js trace format -->
* https://github.com/vercel/turbo/pull/7835 <!-- Tobias Koppers -
correct global start by first start time -->
* https://github.com/vercel/turbo/pull/7812 <!-- Will Binns-Smith -
Turbopack docs: Fix broken webpack loaders link -->
* https://github.com/vercel/turbo/pull/7847 <!-- Will Binns-Smith -
Turbo tasks: Reuse aggregation context and apply queued updates -->
* https://github.com/vercel/turbo/pull/7840 <!-- Tobias Koppers - add
concurrency corrected duration -->
* https://github.com/vercel/turbo/pull/7854 <!-- Tobias Koppers - fix
size_hint on count hash set -->
2024-03-27 20:09:08 +01:00
Tim Neutkens
0c0573fd65
Improve handling of failed nextBuild() calls in test suite (#63717)
## What?

Currently `next build` with Turbopack fails to run in certain tests (as
expected), the problem with that is that the `afterAll()` calls assume
the server was started, which doesn't happen when the build fails, and
then causes a timeout that can't be reported if an error happens. This
change ensures the error around `server['__app']` doesn't happen.

<!-- 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-2933
2024-03-27 19:29:16 +01:00
Tobias Koppers
916174b7ff
remove left-over debugging (#63774)
Closes PACK-2856
2024-03-27 19:28:59 +01:00
Tobias Koppers
f56a674f58
add tracing to server actions transform (#63773)
### What?

The transform seem to be quite inefficient regarding memory usage. Just
leaving a trace here to allow inspecting performance and memory of it
separately from the normal `parse` function.


Closes PACK-2855
2024-03-27 19:24:21 +01:00
OJ Kwon
e820e92dc3
fext(next-core): inherit root layout segment config for the routes (#63683)
### What

Supports root segment config inherit from layout. Currently route
segment config only runs agasint own source, so individual route segment
config works but if the config is set in layout level it is being
ignored. PR introduces root segment and pass into each route if tree
level have a corresponding layout.

Closes PACK-2839
2024-03-27 16:38:23 +00:00
Tobias Koppers
00e9cf9dd9
fixes to next.js tracing (#63673)
### What?

* fix the span name generated for webpack build-module
* fix the time base for spans reported by manualTraceChild


Closes PACK-2835
2024-03-27 16:23:56 +00:00
Tobias Koppers
7d82b68233
Turbopack: parallelize app structure (#63707)
### What?

Allow to scan app structure in parallel


Closes PACK-2845
2024-03-27 17:01:06 +01:00
Jiachi Liu
93aac0e39b
Respect non 200 status to page static generation response (#63731)
### What

In static generation phase of app page, if there's any case that we're
receiving 3xx/4xx status code from the response, we 're setting it into
the static generation meta now to make sure they're still returning the
same status after build.

### Why

During static generation if there's any 3xx/4xx status code that is set
in the response, we should respect to it, such as the ones caused by
using `notFound()` to mark as 404 response or `redirect` to mark as
`307` response.

Closes NEXT-2895
Fixes #51021
Fixes #62228
2024-03-27 16:20:02 +01:00
Tim Neutkens
98e6fc5820
Update Turbopack docs (#63759)
## What?

Same as #63729. That branch was restacked strangely by the Graphite CLI.

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

---------

Co-authored-by: Anthony Shew <anthonyshew@gmail.com>
2024-03-27 12:15:28 +01:00
Vercel Release Bot
5bc2ceab0b
Update Turbopack development test manifest (#63751)
This auto-generated PR updates the development integration test manifest
used when testing Turbopack.
2024-03-27 12:00:45 +01:00
Tobias Koppers
4296a0d9f5
improve tilde test case (#63470)
### What?

Test more cases


Closes PACK-2785
2024-03-27 06:16:49 +00:00
Josh Story
7425d51172
Fix ServerAction rejection reason (#63744)
Recently the serverActionReducer was updated to no longer use React's
thenable type to carry resolution/rejection information. However the
rejection reason was not updated so now when a server action fails we
were rejecting with `undefined` rather than the rejected reason. This
change updates the reject to use the rejection value.


Closes NEXT-2943
2024-03-26 17:46:50 -07:00
vercel-release-bot
2fc408d66d v14.2.0-canary.44 2024-03-26 23:23:31 +00:00
Tobias Koppers
1b76aa9ec1
Turbopack: fix allocation inefficiency (#63738)
### What?

- remove unnecessary clones

### Why?

### How?


Closes PACK-2847
2024-03-26 23:39:49 +01:00
Ivo Biaus
d1d29cc263
Update default.mdx (#63678)
Corrected the indicated URL, since based on the image it's referring to,
there is no "dashboard" parent folder around settings.
Image of reference:

![image](https://github.com/vercel/next.js/assets/43274372/337bf077-4cb6-4900-8f29-6af506097078)
2024-03-26 22:33:44 +00:00
Zack Tanner
8d979b6233
de-flake prerender-prefetch test (#63739)
This test frequently fails, likely because it's possible to navigate
before the revalidation finishes


[x-ref](https://github.com/vercel/next.js/actions/runs/8441089149/job/23119594182#step:27:299)

[x-ref](https://github.com/vercel/next.js/actions/runs/8441133466/job/23119898500?pr=63606#step:27:297)

<!-- 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-2942
2024-03-26 14:47:22 -07:00
Zack Tanner
9b4a055033
prevent router markers from leaking (#63606)
While looking into bugfixes related to router refreshing (the other PRs
in this stack), I noticed there were situations where the `Next-URL`
header would include `/children`, or where `page$` would be present in
LoaderTree for a segment.

This updates a few spots to prevent these markers from leaking into
places they shouldn't, and shouldn't have any behavioral changes.

<!-- 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-2902
2024-03-26 21:41:55 +00:00
Sukka
a70e55eac9
perf: download and save mkcert in stream (#63527)
Previously, Next.js would buffer the `mkcert` binary in memory and write
it to disk all at once. The pull request changes this to pipe the
download stream to the disk. This improves memory consumption by
avoiding having to load the entire `mkcert` binary into memory.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-26 20:54:03 +00:00
Sam Ko
8d8ffa81dd
chore(github-workflow): remove TODO comment (#63737)
## Why?

This PR → https://github.com/vercel/next.js/pull/63679 was finishing the
`TODO` comment, so we should be good to remove it.

Closes NEXT-2941
2024-03-26 20:50:40 +00:00
JJ Kasper
f762af6e66
Ensure test-firefox-safari is required for tests passing (#63733)
This can currently fail and still pass our final tests pass check which
it shouldn't

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

Closes NEXT-2939
2024-03-26 19:44:31 +00:00
Zack Tanner
3fc65bac75
ensure null loading boundaries still render a Suspense boundary (#63726)
This ensures that even if a `loading.js` returns `null`, that we still
render a `Suspense` boundary, as it's perfectly valid to have an empty
fallback.

This was accidentally lost in #62346 -- this brings back the
`hasLoading` prop which will check the loading module itself (rather
than the `ReactNode`) for truthiness, and I've added a test to avoid
another regression.

<!-- 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-2936
2024-03-26 18:45:22 +00:00
Shu Ding
f840cb4882
Rename encryption key generation code (#63730)
This PR renames the API to be not specifically related to Server
Actions, as in the future it might be used by other things. It also adds
the `__next_encryption_key_generation_promise` variable to avoid
double-generating of the key when it's called concurrently (e.g. by the
node server and edge server compilers).

Closes NEXT-2938
2024-03-26 18:25:23 +00:00
Wyatt Johnson
4ee00d4f88
[PPR] Dynamic API Debugging (#61798)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

This adds dynamic usage logging when the `__nextppronly` query parameter
is set and partial prerendering has been enabled. This will print the
stack trace for the accesses for all Dynamic API's that were called.
This includes those API's that were called during the flight render if
they were called before the static shell was ready.

### Why?

To take the most advantage of partial prerendering, it's important to
track where Dynamic API's are called so developers can determine what
has caused part of the component tree not to be included in the static
shell. This also helps debug situations where the error thrown by
Dynamic API's (used internally for tracking and interruption) are caught
but not re-thrown, but due to the implementation of the flight renderer
provided by React, we are unable to distinguish between errors that are
swallowed by user code or by the flight renderer.

### How?

Instead of using a boolean to track **if** a dynamic API was used, this
actually captures the stack at the callsite, allowing developers to find
the location in the codebase that invoked it.

Closes NEXT-2399
2024-03-26 18:19:07 +00:00
Jiachi Liu
d01a621961
Polish dev-overlay text styling (#63721)
Follow up for #63522 

Adding more polish details for the dev overlay header
- The quoted text uses lighter color of text and use default font weight
- Use the same color for the link and give it a bold font weight
- Use the wilder support sans font for apple devices


### After vs Before
<img width="335" alt="image"
src="https://github.com/vercel/next.js/assets/4800338/a401f958-a5a1-443d-b2e9-f011de44f882">

<img width="335" alt="image"
src="https://github.com/vercel/next.js/assets/4800338/4b1340b7-6664-47ef-8935-cf715d6a3f63">




Closes NEXT-2935
2024-03-26 16:29:06 +00:00
Vercel Release Bot
8bb1a79d1b
Update font data (#63691)
This auto-generated PR updates font data with latest available

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-26 16:02:26 +00:00
Balázs Orbán
7569c8087a
feat(log): improve dev/build logs (#62946)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-03-26 15:33:09 +01:00
Vercel Release Bot
740d103282
Update Turbopack development test manifest (#63716)
This auto-generated PR updates the development integration test manifest
used when testing Turbopack.
2024-03-26 15:26:23 +01:00
Tim Neutkens
172e3d4375
Fix name of production tests for collection (#63714)
## What?

Ensures the test can be discovered for uploading.

<!-- 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-2931
2024-03-26 13:45:24 +01:00
Tobias Koppers
459e8fe96e
generate the same next/font modules for the same options (#63513)
### What?

Improves caching of next/font generated modules (make them independent
on importer context)


Closes PACK-2796
2024-03-26 10:13:03 +00:00
Tim Neutkens
f4fc68765a
Ensure production integration test results are uploaded (#63706)
## What?

Ensures `test/integration` tests are uploaded 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 #

-->


Closes NEXT-2930
2024-03-26 10:41:16 +01:00
Tim Neutkens
40fbede8db
Revert "Revert "Update Turbopack production test manifest"" (#63700)
Relanding this PR after investigating why the test/integration tests
were running.

Reverts vercel/next.js#63688

Closes NEXT-2927
2024-03-26 10:22:02 +01:00
Tim Neutkens
91144461ed
Revert "chore(examples): migrate mdx from pages router (JS) to app router (TS)" (#63704)
Reverts vercel/next.js#63646

The example changes are missing a bunch of stuff:
- Types are not added, you can see the changes required here:
https://github.com/vercel/next.js/pull/63703
- Dependencies are missing, i.e. `@types/react` `@types/node`,
`typescript` are all missing.

Reverting as CI is broken.
2024-03-26 10:18:42 +01:00
Tim Neutkens
f502ebbe44
Revert "Update Turbopack production test manifest" (#63699)
This had a failing suite. Reverting.

Reverts vercel/next.js#63688

Closes NEXT-2926
2024-03-26 08:46:04 +01:00
Vercel Release Bot
08a92e0aa5
Update Turbopack production test manifest (#63688)
This auto-generated PR updates the production integration test manifest
used when testing Turbopack.
2024-03-25 16:49:28 -07:00
vercel-release-bot
c7dbbd9a54 v14.2.0-canary.43 2024-03-25 23:22:56 +00:00
Arian
b749570d24
chore(examples): migrate mdx from pages router (JS) to app router (TS) (#63646)
Please if it needs further updates, Let me know!
 Happy to contribute

---------

Co-authored-by: Steven <steven@ceriously.com>
2024-03-25 22:42:26 +00:00
michaltarasiuk
89a5251d73
refactor: unnecessary ternary operator (#63374)
Remove unnecessary ternary operator.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-25 22:04:00 +00:00
JJ Kasper
866b418123
Add Next.js version to process title (#63686)
Makes debugging a little easier by showing the Next.js version in the
process title as well.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1711401562557429?thread_ts=1711400819.248569&cid=C03KAR5DCKC)

Closes NEXT-2924
2024-03-25 21:44:39 +00:00
Tim Neutkens
cd46c221d2
Add defaults for integration test run schedule (#63684) 2024-03-25 22:36:49 +01:00
Tim Neutkens
3a50598b02
Enable test/integration for TURBOPACK_BUILD (#63679)
## What?

Enables Turbopack build tests for `test/integration`. Follow-up to
#63671

<!-- 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-2918
2024-03-25 21:19:18 +01:00
Stephanie Dietz
b0843fea26
Update middleware docs to include common use cases (#63534) 2024-03-25 14:56:48 -05:00
JJ Kasper
cf9e647f41
Auto map optimizePackageImports to transpilePackages for pages (#63537)
This ensures `optimizePackageImports` doesn't unexpectedly fail to apply
for `pages` as they aren't transpiled/bundled by default without either
`transpilePackages` being used or `experimental.bundlePagesExternals`.
This also ensures our docs correctly show this config in the pages docs
as currently in only shows in `app`.

x-ref: [slack
thread](https://vercel.slack.com/archives/C0676QZBWKS/p1710967294942029)

Closes NEXT-2884
2024-03-25 12:17:02 -07:00
Balázs Orbán
752d6e49d5
feat(error-overlay): style tweaks (#63522) 2024-03-25 12:37:12 -06:00
grajen3
043bbaa731
perf: conditionally import Telemetry (#63574)
<!-- 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?

Make Telemetry import in `packages/next/src/server/lib/router-server.ts`
lazy and conditional

### Why?

`Telemetry` in that module is only used when `opts.dev` is truthy, so in
production mode the module is imported and used.

Cost of importing that module is quite significant chunk of starting
`standalone` server. Those are example logs I got from
https://www.npmjs.com/package/require-times (with updates to make it
work as that is pretty old package that wasn't updated and doesn't work
as is) on the server:

Before the change:
```
total: 658ms
646ms node_modules/next/dist/server/lib/start-server.js
  479ms node_modules/next/dist/server/lib/router-server.js
    149ms node_modules/next/dist/telemetry/storage.js
      87ms node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js
        86ms node_modules/next/dist/compiled/@edge-runtime/primitives/index.js
          1ms node_modules/next/dist/compiled/@edge-runtime/primitives/load.js
            23ms node_modules/next/dist/compiled/@edge-runtime/primitives/fetch.js.text.js
            12ms node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js
            1ms node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js
            1ms node_modules/next/dist/compiled/@edge-runtime/primitives/structured-clone.js.text.js
      41ms node_modules/next/dist/compiled/conf/index.js
        12ms node_modules/next/dist/compiled/semver/index.js
      12ms node_modules/next/dist/telemetry/project-id.js
      3ms node_modules/next/dist/telemetry/post-payload.js
      1ms node_modules/next/dist/compiled/is-docker/index.js
      1ms node_modules/next/dist/telemetry/anonymous-meta.js
        1ms node_modules/next/dist/compiled/is-wsl/index.js
    100ms node_modules/next/dist/server/base-server.js
      17ms node_modules/next/dist/server/future/route-matcher-providers/app-page-route-matcher-provider.js
        7ms node_modules/next/dist/lib/is-app-page-route.js
        7ms node_modules/next/dist/server/future/normalizers/built/app/index.js
          3ms node_modules/next/dist/server/future/normalizers/built/app/app-page-normalizer.js
            2ms node_modules/next/dist/server/future/normalizers/absolute-filename-normalizer.js
              1ms node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js
            1ms node_modules/next/dist/lib/page-types.js
          2ms node_modules/next/dist/server/future/normalizers/built/app/app-bundle-path-normalizer.js
            1ms node_modules/next/dist/shared/lib/page-path/normalize-page-path.js
          1ms node_modules/next/dist/server/future/normalizers/built/app/app-filename-normalizer.js
          1ms node_modules/next/dist/server/future/normalizers/built/app/app-pathname-normalizer.js
        1ms node_modules/next/dist/server/future/route-matcher-providers/manifest-route-matcher-provider.js
      15ms node_modules/next/dist/server/app-render/strip-flight-headers.js
      13ms node_modules/next/dist/server/future/route-modules/helpers/response-handlers.js
        13ms node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js
      8ms node_modules/next/dist/server/future/normalizers/locale-route-normalizer.js
      4ms node_modules/next/dist/server/api-utils/index.js
        2ms node_modules/next/dist/server/web/spec-extension/adapters/headers.js
          1ms node_modules/next/dist/server/web/spec-extension/adapters/reflect.js
      4ms node_modules/next/dist/server/render-result.js
        3ms node_modules/next/dist/server/stream-utils/node-web-streams-helper.js
          1ms node_modules/next/dist/lib/scheduler.js
      4ms node_modules/next/dist/server/future/route-matcher-providers/pages-api-route-matcher-provider.js
        3ms node_modules/next/dist/server/future/normalizers/built/pages/index.js
          1ms node_modules/next/dist/server/future/normalizers/built/pages/pages-filename-normalizer.js
          1ms node_modules/next/dist/server/future/normalizers/built/pages/pages-pathname-normalizer.js
        1ms node_modules/next/dist/lib/is-api-route.js
      2ms node_modules/next/dist/server/future/route-matcher-managers/default-route-matcher-manager.js
        1ms node_modules/next/dist/server/future/route-matchers/locale-route-matcher.js
      2ms node_modules/next/dist/server/future/route-matcher-providers/app-route-route-matcher-provider.js
      2ms node_modules/next/dist/server/lib/match-next-data-pathname.js
      2ms node_modules/next/dist/server/future/route-modules/checks.js
      1ms node_modules/next/dist/lib/is-edge-runtime.js
      1ms node_modules/next/dist/shared/lib/runtime-config.external.js
      1ms node_modules/next/dist/server/lib/revalidate.js
      1ms node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js
      1ms node_modules/next/dist/server/future/route-matcher-providers/pages-route-matcher-provider.js
        1ms node_modules/next/dist/server/future/route-matchers/pages-route-matcher.js
      1ms node_modules/next/dist/server/send-response.js
      1ms node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js
      1ms node_modules/next/dist/server/lib/server-action-request-meta.js
    83ms node_modules/next/dist/server/lib/router-utils/filesystem.js
      22ms node_modules/next/dist/lib/load-custom-routes.js
        4ms node_modules/next/dist/lib/try-to-parse-path.js
          2ms node_modules/next/dist/lib/is-error.js
            1ms node_modules/next/dist/shared/lib/is-plain-object.js
          1ms node_modules/next/dist/compiled/path-to-regexp/index.js
        2ms node_modules/next/dist/lib/redirect-status.js
          1ms node_modules/next/dist/client/components/redirect-status-code.js
        1ms node_modules/next/dist/shared/lib/escape-regexp.js
      16ms node_modules/next/dist/server/future/normalizers/request/rsc.js
      13ms node_modules/next/dist/shared/lib/router/utils/index.js
        10ms node_modules/next/dist/shared/lib/router/utils/is-dynamic.js
          3ms node_modules/next/dist/server/future/helpers/interception-routes.js
            1ms node_modules/next/dist/shared/lib/router/utils/app-paths.js
              1ms node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js
        1ms node_modules/next/dist/shared/lib/router/utils/sorted-routes.js
      9ms node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js
      4ms node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js
        4ms node_modules/next/dist/shared/lib/router/utils/prepare-destination.js
          1ms node_modules/next/dist/client/components/app-router-headers.js
          1ms node_modules/next/dist/server/api-utils/get-cookie-parser.js
      4ms node_modules/next/dist/lib/metadata/get-metadata-route.js
        2ms node_modules/next/dist/server/server-utils.js
        1ms node_modules/next/dist/lib/metadata/is-metadata-route.js
      1ms node_modules/next/dist/compiled/lru-cache/index.js
      1ms node_modules/next/dist/lib/file-exists.js
      1ms node_modules/next/dist/lib/recursive-readdir.js
      1ms node_modules/next/dist/shared/lib/router/utils/path-match.js
      1ms node_modules/next/dist/shared/lib/router/utils/route-regex.js
      1ms node_modules/next/dist/shared/lib/router/utils/route-matcher.js
      1ms node_modules/next/dist/server/future/normalizers/request/postponed.js
        1ms node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js
      1ms node_modules/next/dist/server/future/normalizers/request/prefetch-rsc.js
    35ms node_modules/next/dist/server/lib/router-utils/resolve-routes.js
      11ms node_modules/next/dist/server/body-streams.js
      1ms node_modules/next/dist/server/lib/server-ipc/utils.js
      1ms node_modules/next/dist/shared/lib/router/utils/relativize-url.js
      1ms node_modules/next/dist/server/future/normalizers/request/next-data.js
      1ms node_modules/next/dist/server/lib/mock-request.js
    22ms node_modules/next/dist/server/serve-static.js
      20ms node_modules/next/dist/compiled/send/index.js
        1ms node_modules/next/dist/compiled/fresh/index.js
    22ms node_modules/next/dist/server/pipe-readable.js
      20ms node_modules/next/dist/server/web/spec-extension/adapters/next-request.js
        18ms node_modules/next/dist/server/web/spec-extension/request.js
          15ms node_modules/next/dist/server/web/next-url.js
            12ms node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
              1ms node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
            1ms node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
          2ms node_modules/next/dist/server/web/spec-extension/cookies.js
            1ms node_modules/next/dist/compiled/@edge-runtime/cookies/index.js
      1ms node_modules/next/dist/lib/detached-promise.js
    19ms node_modules/next/dist/compiled/compression/index.js
    16ms node_modules/next/dist/server/lib/dev-bundler-service.js
    4ms node_modules/next/dist/trace/index.js
      3ms node_modules/next/dist/trace/trace.js
        2ms node_modules/next/dist/trace/report/index.js
          1ms node_modules/next/dist/trace/report/to-telemetry.js
          1ms node_modules/next/dist/trace/report/to-json.js
    2ms node_modules/next/dist/server/lib/router-utils/proxy-request.js
      1ms node_modules/next/dist/server/server-route-utils.js
    1ms node_modules/next/dist/server/node-environment.js
    1ms node_modules/next/dist/shared/lib/utils.js
    1ms node_modules/next/dist/lib/find-pages-dir.js
    1ms node_modules/next/dist/server/lib/router-utils/is-postpone.js
  140ms node_modules/next/dist/server/next.js
    84ms node_modules/next/dist/server/config.js
      20ms node_modules/next/dist/shared/lib/match-remote-pattern.js
        18ms node_modules/next/dist/compiled/micromatch/index.js
      17ms node_modules/next/dist/compiled/zod/index.js
      14ms node_modules/next/dist/shared/lib/constants.js
        8ms node_modules/@swc/helpers/cjs/_interop_require_default.cjs
      3ms node_modules/next/dist/compiled/find-up/index.js
        1ms node_modules/next/dist/compiled/p-limit/index.js
      3ms node_modules/next/dist/telemetry/ci-info.js
        1ms node_modules/next/dist/compiled/ci-info/index.js
      2ms node_modules/next/dist/server/config-shared.js
        1ms node_modules/next/dist/shared/lib/image-config.js
      2ms node_modules/@next/env/dist/index.js
      2ms node_modules/next/dist/telemetry/flush-and-exit.js
      2ms node_modules/next/dist/lib/find-root.js
      1ms node_modules/next/dist/server/setup-http-agent-env.js
      1ms node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
    21ms node_modules/next/dist/server/lib/trace/tracer.js
      5ms node_modules/next/dist/compiled/@opentelemetry/api/index.js
      1ms node_modules/next/dist/server/lib/trace/constants.js
    13ms node_modules/next/dist/shared/lib/router/utils/format-url.js
    12ms node_modules/next/dist/build/output/log.js
      9ms node_modules/next/dist/lib/picocolors.js
    3ms node_modules/next/dist/server/require-hook.js
    1ms node_modules/next/dist/server/node-polyfill-crypto.js
    1ms node_modules/next/dist/lib/constants.js
    1ms node_modules/next/dist/server/lib/utils.js
  14ms node_modules/next/dist/compiled/watchpack/watchpack.js
  3ms node_modules/next/dist/compiled/debug/index.js
  1ms node_modules/next/dist/server/lib/format-hostname.js
  1ms node_modules/next/dist/server/lib/app-info-log.js
  1ms node_modules/next/dist/lib/turbopack-warning.js
```

And after the change:
```
total: 516ms
499ms node_modules/next/dist/server/lib/start-server.js
  303ms node_modules/next/dist/server/lib/router-server.js
    103ms node_modules/next/dist/server/base-server.js
      42ms node_modules/next/dist/server/future/route-matcher-providers/app-page-route-matcher-provider.js
        38ms node_modules/next/dist/server/future/normalizers/built/app/index.js
          20ms node_modules/next/dist/server/future/normalizers/built/app/app-page-normalizer.js
            18ms node_modules/next/dist/server/future/normalizers/absolute-filename-normalizer.js
              17ms node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js
            1ms node_modules/next/dist/lib/page-types.js
          17ms node_modules/next/dist/server/future/normalizers/built/app/app-bundle-path-normalizer.js
            16ms node_modules/next/dist/shared/lib/page-path/normalize-page-path.js
          1ms node_modules/next/dist/server/future/normalizers/built/app/app-pathname-normalizer.js
        1ms node_modules/next/dist/lib/is-app-page-route.js
        1ms node_modules/next/dist/server/future/route-kind.js
        1ms node_modules/next/dist/server/future/route-matcher-providers/manifest-route-matcher-provider.js
      10ms node_modules/next/dist/server/send-response.js
      8ms node_modules/next/dist/server/future/normalizers/locale-route-normalizer.js
      4ms node_modules/next/dist/server/api-utils/index.js
        2ms node_modules/next/dist/server/web/spec-extension/adapters/headers.js
          1ms node_modules/next/dist/server/web/spec-extension/adapters/reflect.js
      3ms node_modules/next/dist/server/render-result.js
        2ms node_modules/next/dist/server/stream-utils/node-web-streams-helper.js
      3ms node_modules/next/dist/server/future/route-matcher-providers/pages-api-route-matcher-provider.js
        2ms node_modules/next/dist/server/future/normalizers/built/pages/index.js
          1ms node_modules/next/dist/server/future/normalizers/built/pages/pages-bundle-path-normalizer.js
        1ms node_modules/next/dist/server/future/route-matchers/pages-api-route-matcher.js
      2ms node_modules/next/dist/server/future/route-matcher-providers/app-route-route-matcher-provider.js
        1ms node_modules/next/dist/lib/is-app-route-route.js
        1ms node_modules/next/dist/server/future/route-matchers/app-route-route-matcher.js
      2ms node_modules/next/dist/server/future/route-modules/helpers/response-handlers.js
        1ms node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js
      2ms node_modules/next/dist/server/lib/match-next-data-pathname.js
      1ms node_modules/next/dist/lib/is-edge-runtime.js
      1ms node_modules/next/dist/shared/lib/runtime-config.external.js
      1ms node_modules/next/dist/server/lib/revalidate.js
      1ms node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js
      1ms node_modules/next/dist/server/future/route-matcher-managers/default-route-matcher-manager.js
      1ms node_modules/next/dist/server/future/route-matcher-providers/pages-route-matcher-provider.js
      1ms node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js
      1ms node_modules/next/dist/server/app-render/strip-flight-headers.js
      1ms node_modules/next/dist/server/future/route-modules/checks.js
      1ms node_modules/next/dist/server/lib/server-action-request-meta.js
    91ms node_modules/next/dist/server/lib/router-utils/filesystem.js
      21ms node_modules/next/dist/lib/load-custom-routes.js
        16ms node_modules/next/dist/lib/try-to-parse-path.js
          13ms node_modules/next/dist/lib/is-error.js
            1ms node_modules/next/dist/shared/lib/is-plain-object.js
          2ms node_modules/next/dist/compiled/path-to-regexp/index.js
        3ms node_modules/next/dist/lib/redirect-status.js
          1ms node_modules/next/dist/client/components/redirect-status-code.js
      16ms node_modules/next/dist/server/future/normalizers/request/prefetch-rsc.js
      12ms node_modules/next/dist/lib/metadata/get-metadata-route.js
        10ms node_modules/next/dist/server/server-utils.js
        1ms node_modules/next/dist/shared/lib/isomorphic/path.js
      9ms node_modules/next/dist/shared/lib/router/utils/route-regex.js
        1ms node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
      6ms node_modules/next/dist/shared/lib/router/utils/index.js
        3ms node_modules/next/dist/shared/lib/router/utils/is-dynamic.js
          2ms node_modules/next/dist/server/future/helpers/interception-routes.js
            1ms node_modules/next/dist/shared/lib/router/utils/app-paths.js
              1ms node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js
        1ms node_modules/next/dist/shared/lib/router/utils/sorted-routes.js
      5ms node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js
        5ms node_modules/next/dist/shared/lib/router/utils/prepare-destination.js
          1ms node_modules/next/dist/shared/lib/router/utils/parse-url.js
          1ms node_modules/next/dist/client/components/app-router-headers.js
          1ms node_modules/next/dist/server/api-utils/get-cookie-parser.js
      2ms node_modules/next/dist/compiled/lru-cache/index.js
      2ms node_modules/next/dist/server/future/normalizers/request/postponed.js
        1ms node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js
      1ms node_modules/next/dist/lib/file-exists.js
      1ms node_modules/next/dist/lib/recursive-readdir.js
      1ms node_modules/next/dist/shared/lib/router/utils/path-match.js
      1ms node_modules/next/dist/server/future/normalizers/request/rsc.js
    24ms node_modules/next/dist/server/pipe-readable.js
      22ms node_modules/next/dist/server/web/spec-extension/adapters/next-request.js
        20ms node_modules/next/dist/server/web/spec-extension/request.js
          17ms node_modules/next/dist/server/web/next-url.js
            13ms node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
            2ms node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
              1ms node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
            1ms node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
          3ms node_modules/next/dist/server/web/spec-extension/cookies.js
            1ms node_modules/next/dist/compiled/@edge-runtime/cookies/index.js
        1ms node_modules/next/dist/server/web/utils.js
      1ms node_modules/next/dist/lib/detached-promise.js
    22ms node_modules/next/dist/server/serve-static.js
      21ms node_modules/next/dist/compiled/send/index.js
    18ms node_modules/next/dist/server/lib/router-utils/resolve-routes.js
      11ms node_modules/next/dist/server/body-streams.js
      1ms node_modules/next/dist/server/lib/server-ipc/utils.js
      1ms node_modules/next/dist/shared/lib/router/utils/relativize-url.js
      1ms node_modules/next/dist/server/future/normalizers/request/next-data.js
      1ms node_modules/next/dist/server/lib/mock-request.js
    18ms node_modules/next/dist/compiled/compression/index.js
      1ms node_modules/next/dist/compiled/bytes/index.js
    10ms node_modules/next/dist/server/lib/dev-bundler-service.js
    4ms node_modules/next/dist/trace/index.js
      2ms node_modules/next/dist/trace/trace.js
        2ms node_modules/next/dist/trace/report/index.js
          1ms node_modules/next/dist/trace/report/to-json.js
    3ms node_modules/next/dist/server/lib/router-utils/proxy-request.js
      2ms node_modules/next/dist/server/server-route-utils.js
        1ms node_modules/next/dist/server/request-meta.js
    2ms node_modules/next/dist/shared/lib/utils.js
    1ms node_modules/next/dist/server/node-environment.js
    1ms node_modules/next/dist/lib/find-pages-dir.js
    1ms node_modules/next/dist/server/lib/router-utils/is-postpone.js
  157ms node_modules/next/dist/server/next.js
    99ms node_modules/next/dist/server/config.js
      24ms node_modules/next/dist/shared/lib/match-remote-pattern.js
        5ms node_modules/next/dist/compiled/micromatch/index.js
      17ms node_modules/next/dist/compiled/zod/index.js
      15ms node_modules/next/dist/shared/lib/constants.js
        1ms node_modules/@swc/helpers/cjs/_interop_require_default.cjs
        1ms node_modules/next/dist/shared/lib/modern-browserslist-target.js
      4ms node_modules/next/dist/compiled/find-up/index.js
        1ms node_modules/next/dist/compiled/p-limit/index.js
      4ms node_modules/next/dist/telemetry/ci-info.js
        2ms node_modules/next/dist/compiled/ci-info/index.js
      3ms node_modules/next/dist/server/config-shared.js
        1ms node_modules/next/dist/shared/lib/image-config.js
      2ms node_modules/next/dist/telemetry/flush-and-exit.js
      2ms node_modules/next/dist/lib/find-root.js
      2ms node_modules/next/dist/server/setup-http-agent-env.js
      2ms node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
        1ms node_modules/next/dist/shared/lib/router/utils/parse-path.js
      1ms node_modules/@next/env/dist/index.js
    17ms node_modules/next/dist/server/lib/trace/tracer.js
      14ms node_modules/next/dist/compiled/@opentelemetry/api/index.js
      1ms node_modules/next/dist/server/lib/trace/constants.js
    13ms node_modules/next/dist/lib/constants.js
    5ms node_modules/next/dist/shared/lib/router/utils/format-url.js
      1ms node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs
      1ms node_modules/next/dist/shared/lib/router/utils/querystring.js
    4ms node_modules/next/dist/build/output/log.js
      1ms node_modules/next/dist/lib/picocolors.js
    3ms node_modules/next/dist/server/require-hook.js
    1ms node_modules/next/dist/server/lib/utils.js
  7ms node_modules/next/dist/compiled/watchpack/watchpack.js
  3ms node_modules/next/dist/compiled/debug/index.js
  2ms node_modules/next/dist/server/lib/format-hostname.js
    1ms node_modules/next/dist/server/lib/is-ipv6.js
  1ms node_modules/next/dist/server/lib/app-info-log.js
  1ms node_modules/next/dist/lib/turbopack-warning.js
```

I would not pay much attention to absolute numbers as there will be
variance and those are single runs - but from first "require time dump"
you can estimate importing Telemetry (that might be unused) is costing
149ms / 658ms ~= 22.5% of entire time spent on importing modules -
that's pretty significant

### How?

By moving static import/require from top level to conditional code path
that actually uses it. This code path already have some modules
lazy/conditionally loaded. `packages/next/src/telemetry/storage.ts`
doesn't seem to have import side effects so at least on my first glance
it doesn't seem like moving import should cause problems?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-25 17:50:40 +00:00
Tim Neutkens
69f5fb260a
Skip test/integration development tests during Turbopack build test run (#63671)
## What?

Follow-up to #63665.

Ensures development tests are skipped during the production build run
for Turbopack (i.e. used to create the turbopack-build-tests-manifest).

Adds `pnpm test-dev-turbo` and `pnpm test-start-turbo` (and their
`testonly` equivalent) for running tests.

<!-- 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-2915
2024-03-25 18:37:34 +01:00
Shu Ding
9677c87e8a
Improve TypeScript plugin for server boundary (#63667)
For problems like #62821, #62860 and other, the only way to improve the
DX would be relying on the type checker to ensure that Server Actions
are async functions. Inlined definitions will always be checked by SWC
(as they're always syntactically defined as functions already), but
export values are sometimes determined at the runtime.

Also added `react-dom` related methods to the disallow list for the
server layer.

Examples:


https://github.com/vercel/next.js/assets/3676859/ac0b12fa-829b-42a4-a4c6-e1c321b68a8e


https://github.com/vercel/next.js/assets/3676859/2e2e3ab8-6743-4281-9783-30bd2a82fb5c


https://github.com/vercel/next.js/assets/3676859/b61a4c0a-1ad4-4ad6-9d50-311ef3450e13



Closes NEXT-2913
2024-03-25 18:37:10 +01:00