Commit graph

21200 commits

Author SHA1 Message Date
Will Binns-Smith
f7d3733652
Update turbopack to turbopack-240528.2 (#66293)
This includes an update to lightningcss to 1.0.0-alpha.57

vercel/turbo#7986
vercel/turbo#8218
vercel/turbo#8222
2024-05-28 22:06:20 +00:00
Jiachi Liu
25db485a00
Trigger error for stream on client when it is not finished as expected (#65798)
### What

* Error on case that readable stream controller tries to close but
stream is either errored or unfinished
* Delay the DOMContentLoaded event to avoid "Connection Closed" error


### Why

Regarding to the new error about readbale stream controller, the new
error we added here is for identifying the connection is closing before
the last bit has been received that's an error case not intentional
close. It's not a proper state for close more for erroring.


As for adding the queuing for the task of dom content loaded callback,
after investigation, I found that if the DOMLoaded execute earlier the
readable stream controller cuold close earlier on client, which lead to
the "Connection Closed." error. Hence we added a `queueMicroTask` here
to delay it after hydrate call.

x-ref: [slack
thread](https://vercel.slack.com/archives/C01A2M9R8RZ/p1715188343813489)
2024-05-28 23:42:04 +02:00
Sebastian Silbermann
d739df15d2
Fail early in release if auth fails with configured gh token (#66171)
`gh auth status` works:
https://github.com/vercel/next.js/actions/runs/9216143946/job/25355841804#step:4:16

We should fail early to hopefully get a better error message if
authentication with the configured token fails.
2024-05-28 14:29:19 -07:00
Donny/강동윤
97c92a24f2
feat: Upgrade lightningcss (#66280)
### What?

Update `lightningcss` **crate**.

### Why?

x-ref: https://vercel.slack.com/archives/C04KC8A53T7/p1716896534206159

### How?
2024-05-28 13:49:01 -07:00
Jiachi Liu
9c993ec787
enhance: ignore nextjs version fetch error in dev overlay (#66271)
### What 

It's not helpful to see the network issue of fetching error on reading
nextjs version in dev overlay

### Why

Error case:

<img width="400"
src="https://github.com/vercel/next.js/assets/4800338/a7852d9b-1f98-4098-8498-a3b832efdbb0">

This should just be ignored, it's fine that the fetching is failed.
There're so many fetch errors code, it's easy to try-catch on fetch
instead of enumerate all the codes
2024-05-28 22:19:35 +02:00
Hendrik Liebau
0ec02b0ce4
Add support for IPv6 in tests (#66285)
Using the hostname `::` enables dual-stack support. This prevents
`ECONNREFUSED` errors when running tests locally, and `localhost` being
resolved to `::1` (IPv6) instead of `127.0.0.1` (IPv4).
2024-05-28 13:14:27 -07:00
Shubh Porwal
0c7c49588b
Update with-react-hook-form example (#66253)
Updates `with-react-hook-form` example by bumping react-hook-form and
other dependencies to their latest versions, along with a minor cleanup
of the UI.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-28 18:52:34 +00:00
vercel-release-bot
7dfb652ef1 v14.3.0-canary.86 2024-05-28 16:24:47 +00:00
Kwon SeungMin
489beb94ee
📝 docs: Add missing example code file name (#66251) 2024-05-28 15:02:28 +00:00
Wyatt Johnson
9d1ae19af3
[lint] Disable linting using project config for tests (#66145)
During integration testing, previously, calls to `next build` could rely
on the project (the Next.js project) level ESLint configuration. In
order to correct this, a new `lint` option was added to `nextBuild` that
can be passed to enabled linting. If this is `false` or `undefined`, a
`--no-lint` argument will be passed to `next build` to prevent it from
running.
2024-05-28 07:53:26 -07:00
Wyatt Johnson
b5d911c92c
[ppr] Don't mark RSC requests as /_next/data requests (#66249)
Old logic from the pages router was previously being hit during
development. This was more apparent when PPR was enabled as it was
mixing dynamic + static rendering in development which propagated to
errors. This change ensures that requests that are made with `RSC: 1`
are not marked as `/_next/data` URL's, and don't use the same logic
paths.

Previously it was a bit confusing because we used the variable
`isDataReq` in a few places that made it hard to tell what it was
referring to. In this case, the `isDataReq` is actually only used by the
pages router. This renames the `isDataReq` to `isNextDataRequest` to
make it clearer, as well as refactors to ensure that it's not used in
the paths for app routes.

Also to better represent the rendering modes the `supportsDynamicHTML`
variable was renamed to `supportsDynamicResponse`.

Fixes #66241
2024-05-28 07:53:04 -07:00
Jiachi Liu
1b36d76155
fix dev overlay version indicator style (#66278)
Fix the Build Error indicator location, it should be located on the
top-right corner. Align the padding with

### Build Error


![image](https://github.com/vercel/next.js/assets/4800338/835506a5-bf29-4f3e-ae0e-091dc9a7b386)

### Runtime Error


![image](https://github.com/vercel/next.js/assets/4800338/2a61a933-58f2-471e-9d3f-84b3954b1460)
2024-05-28 16:26:40 +02:00
Jiachi Liu
1415609870
Reland bunling webpack middleware changes (#66049) (#66052)
Revert the revert in #66049 

It was erroring in pages api with importing `react-dom/server` as this
is disallowed in app but shouldn't be in pages. It's caused by we're
validating middleware layer as server components but edge pages api is
still bundled in the same layer, where we shouldn't apply the check.

* Separate the api in api layers, and while handling middleware
warnings, checking api layer as well
* No need to check layers while handling externals in edge compiler
* Found a bug that we shouldn't check if `config.transpilePackages` is
defined then we enable `externalDir`, removed that condition. It fails
the telemetry tests case build with code change from this PR.


Add more tests for pages dir and middleware

|  | `react` condition | `react-dom/server` condition |
| ---- | ---- | ---- |
| middleware (edge) | react-server | not allowed, failed with dev/build
checks |
| pages/api edge | default condition | default condition |
| pages/api node | default condition | default condition |
2024-05-28 13:55:12 +02:00
vercel-release-bot
1c83394dd3 v14.3.0-canary.85 2024-05-27 23:23:34 +00:00
Sebastian Silbermann
d36917cd34
Bump React types to 19 rc (#66186) 2024-05-27 16:19:41 +00:00
Hendrik Liebau
6ea265f402
Fix source map loading failure for path-to-regexp (#66242) 2024-05-27 16:16:08 +00:00
Sebastian Silbermann
202243932f
Bump styled-jsx to 5.1.6 (#66185) 2024-05-27 18:05:32 +02:00
Sebastian Silbermann
2ae0572742
Bump React types to latest 18.3.x (#66181) 2024-05-27 17:16:59 +02:00
yasmin p
0f55f2ab1d
Update create-next-app template CSS (#66233)
Updates `create-next-app` template CSS:

- Declares variable font weights in `localFont` options and removes
instances of `font-synthesis: none`
- Removes Geist font variables from Tailwind config files
- Adds fallback sans typefaces to the `body` CSS

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-26 17:42:36 -07:00
akazwz
10dd336747
chore: update empty template tailwindcss config (#66173)
### What?

update update empty template tailwindcss config

### Why?

empty template tailwindcss with src dir has problem
[https://github.com/vercel/next.js/blob/canary/packages/create-next-app/templates/index.ts#L162](https://github.com/vercel/next.js/blob/canary/packages/create-next-app/templates/index.ts#L162)

### How?

Closes NEXT-
Fixes #66172

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-27 00:18:46 +00:00
Lenz Weber-Tronic
73a05e1e3c
adopt modern & supported Apollo Client patterns in the with-apollo example (#65316)
#64186 removed the pages router implementation from the `with-apollo`
example and replaced it with an app router implementation.

Unfortunately, it did so in an unsupported way.  
At this point, we can not support any streaming SSR scenario without
additional helper packages - in the case of the app router, it is vital
to use the `@apollo/experimental-nextjs-app-support` package.

This PR switches the example to our officially supported patterns.


<!-- 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-26 17:08:52 -07:00
Adam Bosco
b3d9098383
fix(create-next-app): Update CNA templates' .gitignore files for parity with Yarn recommendations (#65823)
### What?

Updates create-next-app's templates' `.gitignore` files for parity with
[Yarn's official
recommendations](https://v3.yarnpkg.com/getting-started/qa#which-files-should-be-gitignored),
accounting for Yarn's modern Plug-n-Play functionality.

Fixes #65586 

### Why?

New projects initialized with create-next-app presently add various
extraneous files from the Yarn cache to the initial commit. This is most
notable in the case of the Next SWC binary, which may exceed 100M in
some environments and prevent users from pushing their new projects to
free GitHub repositories without rewriting the commit history or setting
up Git LFS.

### How?

I've opted to follow the recommendations for
non-[Zero-Install](https://yarnpkg.com/features/caching#zero-installs)
configurations as Zero-Install may necessitate additional configuration
and present additional complications for unsuspecting users, so I think
it's best left up to the user to opt-in.

Contrary to the example `.gitignore`s provided by Yarn, I've excluded
the `.yarn/sdks` directory as it contains IDE-specific tooling which I
think is also best left up to the user to opt-in to including.

I have retained the current `.gitignore`'s exclusion of the `/.pnp`
directory for backwards compatibility with older versions of Yarn.
2024-05-26 17:06:24 -07:00
vercel-release-bot
6fc03e70b6 v14.3.0-canary.84 2024-05-26 23:23:17 +00:00
Igor Gassmann
527e118f16
docs: fix Migrating from Create React App (#65994)
### What?

This fixes the "Migrating from Create React App" guide and add some
minor improvements

### Why?

The existing guide was broken due to `next start` not working anymore
when using `output: 'export'` and because the TypeScript configuration
was outdated.

### How?

I've validated the guide by going through each steps on [this
PR](https://github.com/IGassmann/cra-to-nextjs/pull/1).

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-05-26 09:03:53 -05:00
vercel-release-bot
4df90ac6ff v14.3.0-canary.83 2024-05-26 10:42:09 +00:00
Tim Neutkens
216ce33b5b
Implement typeof window inlining for Turbopack (#66128)
## What?

Update: Implemented a feature in Turbopack for `typeof window` inlining:
https://github.com/vercel/turbo/pull/8211. Verified the changes in that
PR + this PR fix the test 💯


Turbopack upgrade:

* https://github.com/vercel/turbo/pull/8081 <!-- Alexander Lyon - add
support for upload speed / remaining in the cache upload step -->
* https://github.com/vercel/turbo/pull/7673 <!-- Alexander Lyon -
[turbo-trace] add additional filter modes for allocs over time -->
* https://github.com/vercel/turbo/pull/8191 <!-- Will Binns-Smith -
Turbopack: Register react refresh exports in module factory -->
* https://github.com/vercel/turbo/pull/8195 <!-- Donny/강동윤 - feat:
Remove lint for `grid-template-areas`" -->
* https://github.com/vercel/turbo/pull/8207 <!-- Benjamin Woodruff -
chore: Remove unused `base16` dependency and dead `hex` wrapper function
-->
* https://github.com/vercel/turbo/pull/8185 <!-- Tim Neutkens - Update
contributing guide to mention snapshot test updating -->
* https://github.com/vercel/turbo/pull/8211 <!-- Tim Neutkens - Add
option for inlining typeof window -->
* https://github.com/vercel/turbo/pull/8214 <!-- Will Binns-Smith -
Revert "Turbopack: Register react refresh exports in module factory
(#8191)" -->

---

Previous PR description::

Implements a failing test for issue #66058.
The test only fails when using Turbopack.

While digging into that issue I found that `typeof window` replacement
is either not applied or does not cause `import()` or `require()` to be
removed. In the reproduction that approach is used to load a particular
package only in Node.js and another only in the browser.

<!-- 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-26 12:25:40 +02:00
vercel-release-bot
20201a11a2 v14.3.0-canary.82 2024-05-25 23:21:46 +00:00
Sayakie
9866f3ce9d
docs: minor syntax typo for missed const (#66154) 2024-05-25 16:07:24 -05:00
Eng Zer Jun
e502b07b0a
docs: fix incorrect link to React cache function (#66156)
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-05-25 16:07:08 -05:00
vercel-release-bot
0f1d9e9f7b v14.3.0-canary.81 2024-05-24 23:21:57 +00:00
Loren ☺️
a0911afbe0
Clarify create-next-app question wording (#66157)
### Why?

The current wording leaves room for questions/misinterpretations like:

- What does "use `src/`" mean? Does this affect my build, like compile
`src/*.ts` to `lib/*.js`?
- Oh, I can customize import aliases to use @ for project root instead
of doing relative everywhere? I'll choose Yes!

I think the proposed wording clarifies ^

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-24 16:11:30 -07:00
Sam Ko
b4eff7020b
docs(community): remove Grammarly extension recommendation (#66195)
## Why?

The Grammarly extension is no longer active.

- https://github.com/znck/grammarly
- Closes https://github.com/vercel/next.js/issues/66194
2024-05-24 16:20:14 -05:00
Wyatt Johnson
02522212c6
[ppr] Data route fix (#66190)
Fixes a typo in the logic for checking if it should add the prefetch
data doute.
2024-05-24 19:24:48 +00:00
Tim Neutkens
08b75b77b0
Handle next/navigation import in middleware (#66175)
## What?

Ensures that `next/navigation` and React is aliased in middleware in the
same way that it's aliased in Route Handlers. This matches the behavior
we have in Next.js with webpack.

Fixes #66162

<!-- 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: Hendrik Liebau <mail@hendrik-liebau.de>
2024-05-24 15:39:08 +00:00
Alexander Lyon
82a7c9c2c0
add bash script to run a benchmark (#64717) 2024-05-24 16:00:23 +01:00
Alexander Lyon
2966b85bcc
add arlyon to turbopack team (#66177) 2024-05-24 14:10:30 +00:00
Alexander Lyon
f993ea3d04
add next-build-test binary / library (#64121)
This adds a new target in the next-swc package designed as an entrypoint
for collecting memory benches. Later PRs in the stack add a script to
run the benches and finally a manual-triggered CI step
2024-05-24 15:14:39 +02:00
vercel-release-bot
dfe7fc03e2 v14.3.0-canary.80 2024-05-23 23:23:20 +00:00
Zack Tanner
1aa567f74e
clarify interception modal docs (#66143)
There's a lot of confusion surrounding soft-navigation & parallel
routes, particularly with modals. This fixes the example to clarify the
dismissing a modal pattern when navigating to a "root" page, since
regular catch-all slots do not match the index.

This won't be necessary once we support optional catch-all parallel
routes, and can instead be solved via `[[...catchAll]]`

x-ref:
- https://github.com/vercel/next.js/issues/65510
- https://github.com/vercel/next.js/issues/65239
- https://github.com/vercel/next.js/issues/64808
- https://github.com/vercel/next.js/issues/64807

<!-- 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-23 12:47:31 -07:00
Zack Tanner
94a970a78d
update typescript plugin to support experimental_ppr (#66141)
Before:
![CleanShot 2024-05-23 at 11 51
21@2x](https://github.com/vercel/next.js/assets/1939140/a8be7baf-71aa-4fa6-8400-892dc06ca7d7)


After:
![CleanShot 2024-05-23 at 12 00
59@2x](https://github.com/vercel/next.js/assets/1939140/61d6aa88-9f2d-4274-bd87-93be68bee569)


<!-- 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-23 19:21:11 +00:00
Benjamin Woodruff
5017a41c75
feat(turbopack): Attempt to detect and warn about slow file IO (#66057)
We'd like to warn users if they have particularly slow file IO, so that they can correct the problem themselves, and don't send us reports of poor performance.

- Feature request: https://vercel.slack.com/archives/C03KAR5DCKC/p1716051650641529
- Tweet about how Bun does this: https://x.com/jarredsumner/status/1637549427677364224
- Bun implementation: 06a9aa80c3/src/install/install.zig (L3038)

**Why 100ms?** Bun used to use 10ms, found it too noisy, and switched to 100ms.

This benchmark should run non-blocking in the background and should not meaningfully slow down server startup (even on slow disks).

## Simulated Testing

I looked around and found https://github.com/schoentoon/slowpokefs/. It hasn't been updated in 10 years, but still seems to build fine.

In a nextjs project directory, turn `.next` into an artifically slow mount point:

```
fusermount -uz .next; rm -rf .next .next.real && mkdir .next .next.real && ~/slowpokefs/slowpokefs -m 50 -M 50 --no-slow-read -F .next.real .next
```

<img width="695" alt="Screenshot 2024-05-21 at 4 14 58 PM" src="https://github.com/vercel/next.js/assets/180404/217d7692-33cf-42b7-bbf7-5a530b9e0df1">

Run `pnpm dev --turbo` and see that the warning is generated.

## "Real World" Testing

The following tests are from a linux VM using virtiofs to connect to a 5400 RPM USB 2.0 HDD with APFS:

Only the .next is on an HDD (bind mount):
Otherwise idle disk: `4.86ms 4.44ms 5.31ms`
Otherwise busy disk (copying files): `69.34ms 53.75ms 25.12ms`

The whole project directory is on the HDD (more realistic):
Otherwise idle disk: `20.29ms 35.61ms 48.12ms`
Otherwise busy disk (copying files): `131.40ms 21.71ms 87.33ms`

Most of the time the threshold was not reached, but the 131.40ms test did trigger the warning!

Fixes PACK-3087
2024-05-23 09:52:33 -07:00
Sebastian Silbermann
e62bc11358
Check access token early during release (#66133) 2024-05-23 15:33:37 +00:00
Benjamin Woodruff
99fff19d97
next-swc: Update from tokio 1.32.0 to 1.37.0 (#66087)
Matches the version in turbo, unbreaking our cargo lockfile syncing
mess.
2024-05-23 08:17:15 -07:00
JJ Kasper
f6db3b79b1 add missing -y to start-release 2024-05-23 08:09:29 -07:00
vercel-release-bot
7fe4f41e13 v14.3.0-canary.79 2024-05-23 14:45:18 +00:00
Sebastian Silbermann
41a80533f9
Revert "Don't fail the build if @types/ packages appear to be missing" (#66130)
This reverts commit
637033c410.

What wasn't clear originally is that we require that required packages
have their `package.json` resolvable. So either they don't have an
`exports` field, or their `package.json` is listed in the `exports`
field. The React beta types didn't have `package.json` entry in
`exports` so we accidentally thought they weren't installed.

I published [`19.0.0-beta.2` that has `package.json` in
`exports`](13879ee571 (diff-81cc573aa0c2bd0e13f9463499747741704aabccd7474f544db710befd7bcfc4R44))
so we can restore the old behavior. It's still questionable IMO to do
all that I/O work just for a nicer error message that may contain
false-positive but that's for another time.
2024-05-23 09:01:10 -05:00
JJ Kasper
11c19cfbf6 Fix validate externals docs 2024-05-23 06:56:52 -07:00
JJ Kasper
0bf384bf02
Stabilize swrDelta config (#66108)
Alternative to https://github.com/vercel/next.js/pull/65867 this
stabilizes our `swrDelta` config that allows customizing the
`stale-while-revalidate` period that is included in the `Cache-Control`
header for ISR enabled routes.

This is not a breaking change itself as no default value is provided as
is the case already.
2024-05-23 08:46:57 -05:00
Delba de Oliveira
93c861d67b
Docs: Next.js 15 updates (#65603)
React 19
- [x] React Compiler
- [x] Check all examples for new API usage e.g.`useActionState`, `use`
- [x] Review Server Actions page and link to React docs.


Next.js 15

- [x] PPR incremental adoption and placeholder page - for SEO
- [x] `next/after`
- [x] Package bundling
- [x] Upgrade guide
- [x] Clarify new `fetch` behavior
- [x] Route handlers - dynamic 
- [x] Client-side router cache
- [x] Add "Good to know" about metadata route handlers being cached

15 and beyond
- [x] Remove recommendations for `revalidate = low value` 
- [x] Review and consolidate data fetching section
  - [ ] Client-side data fetching patterns 
    - [ ] Streaming data pattern with React `use`
    - [ ] Seeding initial data from the server

Redirects and blog post: https://github.com/vercel/front/pull/32249

---------

Co-authored-by: Ahmed Abdelbaset <A7med3bdulBaset@gmail.com>
Co-authored-by: Anthony Shew <anthonyshew@gmail.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
Co-authored-by: StephDietz <steph.dietz@vercel.com>
Co-authored-by: Stephanie Dietz <49788645+StephDietz@users.noreply.github.com>
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-05-23 13:41:29 +00:00
Sebastian Silbermann
59ce87e522
Don't fail the build if @types/ packages appear to be missing (#66127)
Co-authored-by: Alessio Gravili <alessio@gravili.de>
2024-05-23 12:39:27 +00:00