Commit graph

966 commits

Author SHA1 Message Date
vercel-release-bot
1045644655 v13.4.9 2023-07-06 20:50:37 +00:00
vercel-release-bot
21392cb4e0 v13.4.9-canary.3 2023-07-06 17:07:58 +00:00
Alex Kirszenberg
ec19537127
Named page chunks (#51921)
Depends on https://github.com/vercel/turbo/pull/5398 (and downstack) on
the Turbo side.

This PR makes it so the output path of Node.js entry chunks for pages is
determined solely from the pathname. This isn't actually necessary for
pages, but it makes for easier debugging anyway. See the Turbo PR for
more details.

This also changes the page structure so it also works if there is no
`pages` directory. In this case, we still want to use pages' default
_app, _document, and _error pages, even with existing app routes. So an
empty page structure should still have an effect.

## Turbopack updates

* https://github.com/vercel/turbo/pull/5415 <!-- Will Binns-Smith -
Turbopack: Execution tests in node.js -->
* https://github.com/vercel/turbo/pull/5461 <!-- Tobias Koppers - use a
lock to ensure atomic invalidation from file changes -->
* https://github.com/vercel/turbo/pull/5398 <!-- Alex Kirszenberg -
Configure the path of the Node.js entry chunk -->
* https://github.com/vercel/turbo/pull/5469 <!-- Tobias Koppers - allow
hmr tests to correctly detect hmr event -->
2023-07-06 16:31:22 +02:00
Andrew Clark
bb8cf5e3f2
Update eslint-plugin-react-hooks to 5.0.0-canary-7118f5dd7-20230705 (#52275)
*This is a resubmit of https://github.com/vercel/next.js/pull/52268
because I neglected to run `pnpm install` last time and it was
accidentally automerged before I could fix it.*

5.0.0-canary-7118f5dd7-20230705 includes a new lint error for hook calls
inside an async component, a common mistake when refactoring Server
Components to Client Components, or vice versa.

This updates the dependency in eslint-config-next.

<!-- 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: Tim Neutkens <tim@timneutkens.nl>
2023-07-06 14:23:14 +02:00
Steven
6dafc4229d
chore(deps): bump react to 7118f5dd7 (#52282)
Fixes #49409

### React upstream changes

- https://github.com/facebook/react/pull/27045
- https://github.com/facebook/react/pull/27051
- https://github.com/facebook/react/pull/27032
- https://github.com/facebook/react/pull/27031
- https://github.com/facebook/react/pull/27029
- https://github.com/facebook/react/pull/27028
- https://github.com/facebook/react/pull/27027
- https://github.com/facebook/react/pull/27019
- https://github.com/facebook/react/pull/26954
- https://github.com/facebook/react/pull/26987
- https://github.com/facebook/react/pull/26985
- https://github.com/facebook/react/pull/26933
- https://github.com/facebook/react/pull/26625
- https://github.com/facebook/react/pull/27011
- https://github.com/facebook/react/pull/27008
- https://github.com/facebook/react/pull/26997
- https://github.com/facebook/react/pull/26989
- https://github.com/facebook/react/pull/26955
- https://github.com/facebook/react/pull/26963
- https://github.com/facebook/react/pull/26983
- https://github.com/facebook/react/pull/26914
- https://github.com/facebook/react/pull/26951
- https://github.com/facebook/react/pull/26977
- https://github.com/facebook/react/pull/26958
- https://github.com/facebook/react/pull/26940
- https://github.com/facebook/react/pull/26939
- https://github.com/facebook/react/pull/26887
- https://github.com/facebook/react/pull/26947
- https://github.com/facebook/react/pull/26945
- https://github.com/facebook/react/pull/26942
- https://github.com/facebook/react/pull/26938
- https://github.com/facebook/react/pull/26844
- https://github.com/facebook/react/pull/25510
- https://github.com/facebook/react/pull/26932
- https://github.com/facebook/react/pull/26896
- https://github.com/facebook/react/pull/26913
- https://github.com/facebook/react/pull/26888
- https://github.com/facebook/react/pull/26827
- https://github.com/facebook/react/pull/26889
- https://github.com/facebook/react/pull/26877
- https://github.com/facebook/react/pull/26873
- https://github.com/facebook/react/pull/26880
- https://github.com/facebook/react/pull/26842
- https://github.com/facebook/react/pull/26858
- https://github.com/facebook/react/pull/26754
- https://github.com/facebook/react/pull/26753
- https://github.com/facebook/react/pull/26881

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-07-06 14:04:21 +02:00
vercel-release-bot
0b470753b7 v13.4.9-canary.2 2023-07-05 10:26:56 +00:00
Alex Kirszenberg
3406e13ab0
Update Turbopack (#52198)
## Turbopack updates

* https://github.com/vercel/turbo/pull/5457 
* https://github.com/vercel/turbo/pull/5458
2023-07-04 15:56:09 +00:00
Alex Kirszenberg
13cfc2bf4d
Update CustomModuleType import (#52133)
https://github.com/vercel/turbo/pull/5397

## Turbopack updates

* https://github.com/vercel/turbo/pull/5419 
* https://github.com/vercel/turbo/pull/5397
2023-07-04 12:39:41 +00:00
Tobias Koppers
532f779782
update turbopack (#52186)
* https://github.com/vercel/turbo/pull/5395 
* https://github.com/vercel/turbo/pull/5452
2023-07-04 11:54:40 +00:00
Tobias Koppers
12f2a66ff0
Revert "chore(deps): bump react 18.3.0-canary-1fdacbefd-20230630" (#52192)
Reverts vercel/next.js#52005
2023-07-04 12:59:14 +02:00
Steven
9e4b87d502
chore(deps): bump react 18.3.0-canary-1fdacbefd-20230630 (#52005)
This PR updates the vendored react dependencies using `pnpm sync-react`

### React upstream changes

- https://github.com/facebook/react/pull/27028
- https://github.com/facebook/react/pull/27027
- https://github.com/facebook/react/pull/27019
- https://github.com/facebook/react/pull/26954
- https://github.com/facebook/react/pull/26987
- https://github.com/facebook/react/pull/26985
- https://github.com/facebook/react/pull/26933
- https://github.com/facebook/react/pull/26625
- https://github.com/facebook/react/pull/27011
- https://github.com/facebook/react/pull/27008
- https://github.com/facebook/react/pull/26997
- https://github.com/facebook/react/pull/26989
- https://github.com/facebook/react/pull/26955
- https://github.com/facebook/react/pull/26963
- https://github.com/facebook/react/pull/26983
- https://github.com/facebook/react/pull/26914
- https://github.com/facebook/react/pull/26951
- https://github.com/facebook/react/pull/26977
- https://github.com/facebook/react/pull/26958
- https://github.com/facebook/react/pull/26940
- https://github.com/facebook/react/pull/26939
- https://github.com/facebook/react/pull/26887
- https://github.com/facebook/react/pull/26947
- https://github.com/facebook/react/pull/26945
- https://github.com/facebook/react/pull/26942
- https://github.com/facebook/react/pull/26938
- https://github.com/facebook/react/pull/26844
- https://github.com/facebook/react/pull/25510
- https://github.com/facebook/react/pull/26932
- https://github.com/facebook/react/pull/26896
- https://github.com/facebook/react/pull/26913
- https://github.com/facebook/react/pull/26888
- https://github.com/facebook/react/pull/26827
- https://github.com/facebook/react/pull/26889
- https://github.com/facebook/react/pull/26877
- https://github.com/facebook/react/pull/26873
- https://github.com/facebook/react/pull/26880
- https://github.com/facebook/react/pull/26842
- https://github.com/facebook/react/pull/26858
- https://github.com/facebook/react/pull/26754
- https://github.com/facebook/react/pull/26753
- https://github.com/facebook/react/pull/26881

### Related

Closes #49409 (by https://github.com/facebook/react/pull/26977)
fix NEXT-1189

Co-authored-by: Shu Ding <g@shud.in>
2023-07-04 11:32:31 +02:00
vercel-release-bot
4f75c79938 v13.4.9-canary.1 2023-07-04 08:30:06 +00:00
vercel-release-bot
f60b5621ac v13.4.9-canary.0 2023-07-04 00:05:08 +00:00
Jiachi Liu
cd9372c175
Reland "ReverseTopological -> AdjacencyMap"" (#52142)
Reverts vercel/next.js#52139
2023-07-03 19:13:50 +00:00
vercel-release-bot
b4a875eb57 v13.4.8 2023-07-03 17:00:28 +00:00
Jiachi Liu
4b4731dfbe
Revert "ReverseTopological -> AdjacencyMap" (#52139)
Reverts vercel/next.js#52032

Will reland after the release
2023-07-03 16:33:24 +00:00
Alex Kirszenberg
f6a152287a
ReverseTopological -> AdjacencyMap (#52032)
See https://github.com/vercel/turbo/pull/5430

## Turbopack changes

* https://github.com/vercel/turbo/pull/5430 <!-- Alex Kirszenberg -
ReverseTopological -> AdjacencyMap -->
2023-07-03 14:40:41 +02:00
vercel-release-bot
eca315308a v13.4.8-canary.15 2023-07-03 10:21:27 +00:00
Alex Kirszenberg
805bfa45e0
Remove EnvironmentIntention (#51965)
See https://github.com/vercel/turbo/pull/5420

# Turbopack changes

* https://github.com/vercel/turbo/pull/5420 
* https://github.com/vercel/turbo/pull/5387
2023-07-03 09:03:37 +00:00
vercel-release-bot
9f6cf08fd4 v13.4.8-canary.14 2023-06-30 22:36:17 +00:00
Tobias Koppers
d443778163
Refactor ContentSources to RouteTree (#51660)
### What?

This fixes a performance problem when many pages are involved.

fixes WEB-1067

see also https://github.com/vercel/turbo/pull/5360

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5416 
* https://github.com/vercel/turbo/pull/5360
2023-06-30 16:03:24 +00:00
vercel-release-bot
0dd225b128 v13.4.8-canary.13 2023-06-30 12:25:06 +00:00
vercel-release-bot
27953213f8 v13.4.8-canary.12 2023-06-29 23:30:23 +00:00
Justin Ridgewell
aec3c58d1c
Update edge-runtime to latest (#51944)
### What?

The updates `edge-runtime` to the latest version

### Why?

https://github.com/vercel/edge-runtime/pull/428 fixes `consumeUint8ArrayReadableStream` so that when we break iteration early (due to client disconnect), we cleanup the inner stream. That will fire the stream's `cancel` handler, and allow devs to disconnect from an AI service fetch.

### How?

`edge-runtime` maintain a `try {} finally {}` over the inner stream's iteration. When we early break, JS will call `it.return()`, and that will resume `consumeUint8ArrayReadableStream` with an abrupt completion (essentially, the `yield` turns into a `return`). We'll be able to trigger the `finally {}` block with that, and we call `inner.cancel()` to cleanup.

Fixes https://github.com/vercel-labs/ai/issues/90
2023-06-29 23:15:20 +00:00
vercel-release-bot
152cfed6e8 v13.4.8-canary.11 2023-06-29 15:40:12 +00:00
vercel-release-bot
9ff526056b v13.4.8-canary.10 2023-06-29 13:55:17 +00:00
Leah
484bdebc24
Update turbopack and swc_core to v0.78.24 (#51943)
Reverts #51940

### What?

Update SWC crates and turbopack

### Turbopack Updates

* https://github.com/vercel/turbo/pull/5366 <!-- Justin Ridgewell - Fix
bug with `imports` field from a nested directory -->
* https://github.com/vercel/turbo/pull/5361 <!-- Tobias Koppers - update
for next.js changes to env vars -->
* https://github.com/vercel/turbo/pull/5311 <!-- OJ Kwon -
test(filetrace): skip failing tests -->
* https://github.com/vercel/turbo/pull/5402 <!-- Leah - reduce indent in
`analyze_ecmascript_module` by splitting the function up -->
* https://github.com/vercel/turbo/pull/5412 <!-- Leah - Update
`swc_core` to `v0.78.24` -->

Closes WEB-1174

Turbopack counterpart: https://github.com/vercel/turbo/pull/5412

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-29 15:11:57 +02:00
vercel-release-bot
68075376f0 v13.4.8-canary.9 2023-06-29 11:27:00 +00:00
vercel-release-bot
e33b87d894 v13.4.8-canary.8 2023-06-28 09:04:46 +00:00
vercel-release-bot
2c856cb256 v13.4.8-canary.7 2023-06-27 23:04:22 +00:00
vercel-release-bot
363b2368b3 v13.4.8-canary.6 2023-06-27 11:04:35 +00:00
vercel-release-bot
57ab2818b9 v13.4.8-canary.5 2023-06-26 16:18:48 +00:00
vercel-release-bot
c8f3897fe2 v13.4.8-canary.4 2023-06-26 15:27:18 +00:00
vercel-release-bot
913b365d85 v13.4.8-canary.3 2023-06-26 12:07:28 +00:00
vercel-release-bot
74a5d2068a v13.4.8-canary.2 2023-06-24 02:20:39 +00:00
Leah
5d54eaaf18
type check tests (and convert next-test-utils.js to ts) (#51071)
Enables type checking for tests in CI and fixes a bunch of things related to that
2023-06-23 17:42:50 +00:00
JJ Kasper
d457e989ff
Revert "Update swc_core to v0.78.15" (#51716)
Reverts vercel/next.js#51269

This is breaking some builds it looks like

x-ref: https://github.com/vercel/next.js/actions/runs/5357843108/jobs/9719367732
x-ref: https://github.com/vercel/next.js/actions/runs/5357843108/jobs/9719368519
2023-06-23 17:12:47 +00:00
Donny/강동윤
5f3d7c43ea
Update swc_core to v0.78.15 (#51269)
### What?

Update SWC crates to 8b765e6763

### Why?

There were many patches.

### How?

Closes WEB-1174

Turbopack counterpart: https://github.com/vercel/turbo/pull/5288
2023-06-23 11:40:11 +00:00
Tobias Koppers
5abeb99b49
add edge rendering for app dir for Turbopack (#51666)
relanding #50830 and #51631 

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5254 <!-- OJ Kwon - ci(workflow):
upload daily next.js test trace -->
* https://github.com/vercel/turbo/pull/5363 <!-- Tobias Koppers -
disable default features for turbopack-ecmascript-plugins -->
2023-06-23 07:08:17 +02:00
vercel-release-bot
d0a1e64962 v13.4.8-canary.1 2023-06-22 23:16:54 +00:00
vercel-release-bot
554e58c31a v13.4.8-canary.0 2023-06-22 18:19:20 +00:00
JJ Kasper
d0e7d04dc5
Revert "add edge rendering for app dir for Turbopack" (#51659)
Reverts vercel/next.js#51631

This breaks the windows builds

x-ref:
https://github.com/vercel/next.js/actions/runs/5344032749/jobs/9687974376
x-ref:
https://github.com/vercel/next.js/actions/runs/5344032749/jobs/9687973522
2023-06-22 08:49:50 -07:00
Tobias Koppers
99ec3057d7
add edge rendering for app dir for Turbopack (#51631)
## What

* reland #50830 
* remove Object.hasOwn
* fix CSS chunks in edge runtime

## Turbopack Changes

* https://github.com/vercel/turbo/pull/5253 <!-- OJ Kwon -
fix(turbopack): enable runtime flag -->
* https://github.com/vercel/turbo/pull/5295 <!-- Will Binns-Smith -
remove `__internal_nextjs_integration_test` compile-time feature -->
* https://github.com/vercel/turbo/pull/4362 <!-- Donny/강동윤 - Make build
faster -->
* https://github.com/vercel/turbo/pull/5352 <!-- Tobias Koppers - only
wait for JS chunks in none runtime backend -->
2023-06-22 11:43:59 +02:00
vercel-release-bot
4e5fef4f36 v13.4.7 2023-06-21 21:12:57 +00:00
vercel-release-bot
6dd06dbe4d v13.4.7-canary.4 2023-06-21 20:38:43 +00:00
Leah
c1c3675fc4
refactor tests for readability (#51051)
You'll probably want to disable whitespace in the diff

## Description

This allows for better editor support by using `describe` or functions called `describe` with the same syntax instead of custom names.

Changes:
- `nextTestSetup` can be used instead of `createNextDescribe` keeping the same behaviour but being called inside a `describe` "block" (not applied everywhere)
- `getSnapshotTestDescribe` replaced with a custom `describe.each`
- `sandbox` helper function for `acceptance`/`acceptance-app` merged into a single shared one
- `outdent` to remove the indent from inline files in tests which helps with consistent snapshots
2023-06-21 19:47:21 +00:00
vercel-release-bot
c30f21fa77 v13.4.7-canary.3 2023-06-21 18:59:34 +00:00
vercel-release-bot
3d23faa6cd v13.4.7-canary.2 2023-06-20 22:12:57 +00:00
Jiachi Liu
bd466842a0
Fix pnpm lock (#51503)
Reverting unexpected pnpm-lock changes from a3ef99acd9
2023-06-19 11:48:41 +00:00
vercel-release-bot
a3ef99acd9 v13.4.7-canary.1 2023-06-16 13:57:51 +00:00
vercel-release-bot
cbb69b2cfc v13.4.7-canary.0 2023-06-16 01:02:52 +00:00
vercel-release-bot
ce4aa787e8 v13.4.6 2023-06-15 21:21:35 +00:00
vercel-release-bot
019ed1c39b v13.4.6-canary.8 2023-06-15 20:08:03 +00:00
Tobias Koppers
a806f1ad84
Update turbopack (#51336)
### What?

update Turbopack and sync dependencies with turbo

### Turbopack changes

* https://github.com/vercel/turbo/pull/5303
2023-06-15 09:39:17 +00:00
vercel-release-bot
c59c39a431 v13.4.6-canary.7 2023-06-15 03:58:41 +00:00
vercel-release-bot
dde67aec5a v13.4.6-canary.6 2023-06-15 01:39:48 +00:00
vercel-release-bot
40ce621901 v13.4.6-canary.5 2023-06-14 21:54:03 +00:00
vercel-release-bot
cbeecba83b v13.4.6-canary.4 2023-06-14 11:21:24 +00:00
vercel-release-bot
c8f65ede87 v13.4.6-canary.3 2023-06-14 06:52:30 +00:00
vercel-release-bot
b80dc83b23 v13.4.6-canary.2 2023-06-13 13:13:56 +00:00
vercel-release-bot
6e9113fe59 v13.4.6-canary.1 2023-06-12 22:32:21 +00:00
OJ Kwon
bcb63f3250
ci(workflow): enable test trace upload (#51107)
### What?

WEB-1150. 

This PR is an attempt to upload next.js's test results into datadog test trace to track its status. 

Originally it tried to use automatic trace injection (dd-trace/ci/init). However, due to some of custom environments / setup we use it was not compatible out of the box. Instead, this PR injects a new test reportert to generate junit report, then upload it at once at the end of the testing pipeline.

The reporter is configured to run when necessary variables set, local run should not be affected. 

One thing to note is this report will not count retry results, as it'll create duplicated test entry with multiple results since we runts jest per individual test. This'll allow to detect flaky test easier, but also it means we'll get bit of skewed test results compare to the real world as first failure will be accounted as test fail immediately.
2023-06-12 17:14:13 +00:00
Tobias Koppers
6b0a6f0c25
add turbopack integration tests to CI (#50904)
### What?

* enable turbopack tests in new CI
* split pre-build step into native and JS builds to allow to start
native tests faster
* update swc_core to sync with turbo
* update turbopack

### Why?

Running our test suite is still important as long we don't have the full
integration test suite enabled.

### Turbopack updates

* https://github.com/vercel/turbo/pull/5215 <!-- OJ Kwon - ci(workflow):
upload benchmark results to datadog -->
* https://github.com/vercel/turbo/pull/5239 <!-- OJ Kwon -
fix(swc_plugin): use shared runtime -->
* https://github.com/vercel/turbo/pull/3090 <!-- CHEN Yuan - Docs: prior
to run testcases, add guides to install dependencies for testcases. -->
* https://github.com/vercel/turbo/pull/5264 <!-- Tobias Koppers - update
test runner -->

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-12 07:47:43 -07:00
vercel-release-bot
bb092bc127 v13.4.6-canary.0 2023-06-12 11:38:47 +00:00
vercel-release-bot
db10dd6740 v13.4.5 2023-06-10 22:03:48 +00:00
vercel-release-bot
d683006526 v13.4.5-canary.12 2023-06-10 21:17:36 +00:00
vercel-release-bot
41d92fe3fd v13.4.5-canary.11 2023-06-10 19:47:11 +00:00
vercel-release-bot
387430c659 v13.4.5-canary.10 2023-06-09 23:46:48 +00:00
Steven
2226d2935f
chore: drop unused @webassemblyjs (#51045)
Remove these dependencies since they appear to be unused

- Closes https://github.com/vercel/next.js/pull/50928
- Closes https://github.com/vercel/next.js/pull/50123
2023-06-09 16:03:15 +00:00
Michael Novotny
55b29fb351
Updates prettier to latest version. (#51000)
There are some incoming docs / MDX changes where prettier will throw an error when using the older version. Updating prettier before I bring in those changes.

Looks like the most notable change is adding parentheses around `typeof` checks in TypeScript. 

**Before**

```
export type Locale = typeof i18n['locales'][number]
```

**After**

```
export type Locale = (typeof i18n)['locales'][number]
```
2023-06-09 14:58:19 +00:00
vercel-release-bot
f2dfa1a92a v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
Jiachi Liu
f2e637d24d
Upgrade webpack to 5.86.0 (#50992)
To resolve issue #49382, we found layer doesn't get applied for dynamic imports, so we fixed it on webpack side in https://github.com/webpack/webpack/pull/17310

This PR is to upgrade webpack to 5.86.0 with that patch as a precedence. After this we need to fix the `next/image` client components is missing in client reference manifest when using dynamic imports to fix the issue.
2023-06-08 20:35:12 +00:00
Steven
9a9d095b54
Bump to typescript@5.1 (#50557)
We need to upgrade TypeScript to land the following fixes:

- https://github.com/vercel/next.js/pull/50289
- https://github.com/vercel/next.js/pull/48018

And it should fix async components:
- https://twitter.com/sebsilbermann/status/1664356039876124672

Also see this related TS 5.0 issue:

- https://github.com/microsoft/TypeScript/issues/53402
2023-06-08 17:18:37 +00:00
Jiachi Liu
a035224dc3
Pick esm main fields and condition names first for RSC server layer (#50548)
For RSC server layer so far we bundle all dependencies, ESM format is the better one rather than CJS to analyze and tree-shake out the unused parts. This PR changes pick the condition names that are in ESM format first for server layer.

Also fixes the misorder of condition names of edge runtime, `conditionNames` should only contain either ESM or CJS, previously the main fields are mixed with conditon names which is not expected for webpack, we separate them now.

Since we're picking ESM instead CJS now, the error of require `exports * from` doesn't exist anymore, but if you're using a CJS dependency which require a ESM package, it will error. This is the existing behavior for our webpack configuration but could happen on server layer bundling

Other related changes:

* Imports are hoisted in ESM, so migrate`enhanceGlobals` to a imported module
* Use `...` to pick the proper imports by import expression, and prefer the `react-server` / `edge-light` condition names for corresponding cases
* Remove edge SSR duplicated `middleware` export checking
2023-06-08 16:24:03 +00:00
Wyatt Johnson
ea63e92e87
Bump @types/node (#50940)
This bumps @types/node to 20.2.5 to prepare for upgrades to other packages requiring updated Node.js typescript types.
2023-06-08 15:52:17 +00:00
vercel-release-bot
d52c030d94 v13.4.5-canary.8 2023-06-08 15:01:09 +00:00
OJ Kwon
534414d54e
ci(workflow): enable test trace again (#50817)
### What?

Another attempt to https://github.com/vercel/next.js/pull/50619 and WEB-1150, trying to apply setup guard more throughly.

I still do not know why original PR passed CI but fails to subsequent PRs after merge, but hope this could be a right guard to prevent unexpected failures.
2023-06-08 10:52:49 +00:00
JJ Kasper
22ea7d9909
Revert "Revert "update turbopack"" (#50947)
Fixed in https://github.com/vercel/next.js/pull/50946

Reverts vercel/next.js#50942
2023-06-08 04:02:03 +00:00
Jiachi Liu
e562ddf990
remove unused dev dep ts-node (#50939)
`ts-node` was added in #44715 but not used anymore, it has a `@types/node` dep, this alsos helps to bump node typing later
2023-06-08 02:44:16 +00:00
JJ Kasper
2a62513ecd
Revert "update turbopack" (#50942)
The builds are failing 

x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392872573
x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392873009
x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392873120

Reverts vercel/next.js#50819
2023-06-07 19:02:29 -07:00
Leah
0d46361f8e
update turbopack (#50819)
### Turbopack Updates
* https://github.com/vercel/turbo/pull/5156 
* https://github.com/vercel/turbo/pull/5159 
* https://github.com/vercel/turbo/pull/5162 
* https://github.com/vercel/turbo/pull/5161 

* https://github.com/vercel/turbo/pull/5174 
* https://github.com/vercel/turbo/pull/5178 
* https://github.com/vercel/turbo/pull/5121 
* https://github.com/vercel/turbo/pull/5200 
* https://github.com/vercel/turbo/pull/5207 
* https://github.com/vercel/turbo/pull/5211 
* https://github.com/vercel/turbo/pull/5210 
* https://github.com/vercel/turbo/pull/5221 
* https://github.com/vercel/turbo/pull/5218 
* https://github.com/vercel/turbo/pull/5226 
* https://github.com/vercel/turbo/pull/5139 
* https://github.com/vercel/turbo/pull/5227 
* https://github.com/vercel/turbo/pull/5189
2023-06-08 01:23:14 +00:00
vercel-release-bot
e19007df42 v13.4.5-canary.7 2023-06-07 09:53:16 +00:00
Josh Story
92b29d2f17
Update react to latest versions (#50604)
Update Vendored React Dependencies
2023-06-07 09:50:27 +00:00
Justin Ridgewell
1a2fac2b5a
[turbopack]: Use tip-of-branch for benchmarks (#50615)
With vercel/turbo#5156, we'll be able to install our the locally built `next` package. Before, we'd test the tip-of-branch `next-dev` binary against the last cut `next` canary, which causes headaches when we make breaking changes.

With this PR, we'll now test tip-of-branch `next-dev` binary against a tip-of-branch `next` package, and breaking changes can be properly benched.

Fixes WEB-1133
2023-06-06 20:36:11 +00:00
Kiko Beats
218c683db7
upgrade edge-runtime dependency (#50636)
Hello,

We removed some core non-necessary dependencies that make Edge Runtime
smaller 🙂.

Also, Edge Runtime is exposing `WebSocket`, so nothing additional should
be done.

Closes https://github.com/vercel/next.js/issues/50760

---------

Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
2023-06-06 16:13:44 +02:00
vercel-release-bot
b04c70573a v13.4.5-canary.6 2023-06-05 13:13:22 +00:00
Tim Neutkens
8ab38cef41
Improve compile time on large application (#50792)
## What?

While investigating slow compilation for a page on vercel.com in
development I found that there was close to 10 seconds of time
unaccounted for in `.next/trace`. Ran a profile and found that time was
spent in watchpack `batch`, specifically calling `close` many times.
When I tried to debug this further by running unbundled webpack I
noticed the same issue didn't exists.

### Before

<img width="1329" alt="Before"
src="https://github.com/vercel/next.js/assets/6324199/9ace4628-db04-4de7-993f-65aef9dffc55">

### After

<img width="1278" alt="After"
src="https://github.com/vercel/next.js/assets/6324199/55d5e58b-4a27-4235-8dea-723a7a78c117">

## Raw numbers

<table>
<tr>
 <td>Before</td>
 <td>After</td>
 <td>Delta</td>
 <td>Delta (percent)</td>
</tr>
<tr>
 <td>13840 ms</td>
 <td>3580 ms</td>
 <td>-10260 ms</td>
  <td>-74.13%</td>
</tr>
</table>

## How?

Investigated further and found that specifically not minifying watchpack
solved the issue.

<!-- 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 or adding/fixing 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 #

-->
2023-06-05 15:05:54 +02:00
vercel-release-bot
ccee374e2a v13.4.5-canary.5 2023-06-05 07:18:40 +00:00
vercel-release-bot
793d9bfc6a v13.4.5-canary.4 2023-06-02 17:59:01 +00:00
Leah
eb85e79941
fix @vercel/turbopack-node types (and more turbopack updates) (#50605)
for #50557 

## Turbopack Updates

* https://github.com/vercel/turbo/pull/5131 <!-- Tobias Koppers - sync
dependencies with next.js -->
* https://github.com/vercel/turbo/pull/5138 <!-- Justin Ridgewell - Fix
`vdbg!` depth and JSON error messages -->
* https://github.com/vercel/turbo/pull/5141 <!-- Leah - fix
`@vercel/turbopack-node` types by adding reference to compiled package
-->
2023-06-01 15:27:13 +00:00
vercel-release-bot
e40e6b64bf v13.4.5-canary.3 2023-06-01 08:46:09 +00:00
Gal Schlezinger
a2c27aab1c
[edge] bump @edge-runtime/* package suite (#49092)
Bumping `@edge-runtime/*` <picture data-single-emoji=":edge-runtime:" title=":edge-runtime:"><img class="emoji" width="20" height="auto" src="https://emoji.slack-edge.com/T0CAQ00TU/edge-runtime/b940e917443aa49f.png" alt=":edge-runtime:" align="absmiddle"></picture>  packages to their latest beta, as we had some huge improvements and big changes on how it works internally.

* Using the latest `undici` which provides a WebSocket implementation
* Less polyfill usage as we load modules in the Node.js realm, and can reuse modules from Node.js as time goes on <picture data-single-emoji=":just-right2:" title=":just-right2:"><img class="emoji" width="20" height="auto" src="https://emoji.slack-edge.com/T0CAQ00TU/just-right2/588cf34d02f4b3bd.png" alt=":just-right2:" align="absmiddle"></picture> 
* `instanceof` checks now work within the realm <picture data-single-emoji=":mind_blown:" title=":mind_blown:"><img class="emoji" width="20" height="auto" src="https://emoji.slack-edge.com/T0CAQ00TU/mind_blown/0186b6f181040126.gif" alt=":mind_blown:" align="absmiddle"></picture>
2023-05-31 08:03:20 +00:00
Tobias Koppers
0539b9c96e
update swc_core and turbopack (#50519)
## What

* updates swc_core
* updates turbopack

# Turbopack Changes

* https://github.com/vercel/turbo/pull/5050 
* https://github.com/vercel/turbo/pull/5107 
* https://github.com/vercel/turbo/pull/5094
2023-05-30 15:46:46 +00:00
vercel-release-bot
a4f2bbbe20 v13.4.5-canary.2 2023-05-30 12:00:55 +00:00
vercel-release-bot
e8bf78591f v13.4.5-canary.1 2023-05-30 10:12:56 +00:00
JJ Kasper
a3ab542630
Add new build and test workflow (#50436)
This adds new `build and test` and `build and deploy` workflows in favor
of the existing massive `build, test, and deploy` workflow. Since the
new workflows will use `pull_request_target` this waits to remove the
existing workflow until the new one is tested.

While testing this new workflow flakey behavior in tests have also been
addressed. Along with the new workflow we will also be leveraging new
runners which allow us to run tests against the production binary of
`next-swc` so this avoids slight differences in tests we've seen due to
running against the dev binary.

Furthermore we will have a new flow for allowing workflow runs on PRs
from external forks which will either require a comment be checking a
box approving the run after each change or a label added by the team.

The new flow also no longer relies on `actions/cache` or similar which
have proven to be pretty unreliable.

Tests runs with the new workflow can be seen here
https://github.com/vercel/next.js/actions/runs/5100673508/jobs/9169416949
2023-05-27 21:02:31 -07:00
Tobias Koppers
fe6bb0ace9
Refactor internal modules (#50338)
### What?

create internal modules via `context.process` with
`ReferenceType::Internal`

### Why?

We need this for future refactoring where we want to the internal
modules with transitions.

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5095 <!-- Tobias Koppers - allow
to create internal modules via AssetContext -->
* https://github.com/vercel/turbo/pull/5104 <!-- Alex Kirszenberg -
Stable chunk list ident -->
* https://github.com/vercel/turbo/pull/5106 <!-- Tobias Koppers -
followup fix -->

---------

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
2023-05-27 08:22:15 +02:00
Jiachi Liu
b993949155
Upgrade vendored @vercel/og (#50395)
* upgrade `@vercel/og` to latest
* fix precompile script
2023-05-26 19:02:53 +00:00
Alex Kirszenberg
62af2007ce
Next.js Turbo build: turbopack-ecmascript-runtime and ChunkData (#50375)
This PR is extracted from https://github.com/vercel/next.js/pull/49942
and mostly contains changes necessary after the Turbopack PR adding the
Node.js production runtime https://github.com/vercel/turbo/pull/4998,
without any of the actual Next Build stuff, in order to be able to merge
both quickly.

* ChunkData moved from tp-dev to tp-core, the ES-serializable part moved
to tp-ecmascript;
* all runtime types moved to tp-ecmascript-runtime

This also upgrades Turbopack to turbopack-230526.2:

* https://github.com/vercel/turbo/pull/5102 <!-- Donny/강동윤 - refactor:
Fix binary bloat caused by `ValueDebugFormat` impl -->
* https://github.com/vercel/turbo/pull/4998 <!-- Alex Kirszenberg -
Node.js production runtime POC -->
2023-05-26 13:38:25 +02:00
vercel-release-bot
5d9597879c v13.4.5-canary.0 2023-05-26 10:36:33 +00:00
vercel-release-bot
26835bdba5 v13.4.4 2023-05-25 22:02:44 +00:00
vercel-release-bot
8c17a4b688 v13.4.4-canary.13 2023-05-25 21:31:39 +00:00
vercel-release-bot
0c968b8e2a v13.4.4-canary.12 2023-05-25 18:50:55 +00:00
vercel-release-bot
3870abf049 v13.4.4-canary.11 2023-05-25 16:20:33 +00:00
vercel-release-bot
831a1a99c3 v13.4.4-canary.10 2023-05-25 04:20:36 +00:00
vercel-release-bot
ed60646a19 v13.4.4-canary.9 2023-05-24 22:21:36 +00:00
vercel-release-bot
f1df0d009b v13.4.4-canary.8 2023-05-24 11:08:12 +00:00
vercel-release-bot
0e339a8542 v13.4.4-canary.7 2023-05-24 06:12:54 +00:00
vercel-release-bot
fce5fa6ff0 v13.4.4-canary.6 2023-05-23 23:07:34 +00:00
vercel-release-bot
ba9aa63417 v13.4.4-canary.5 2023-05-23 19:34:54 +00:00
Tobias Koppers
33b8e6157f
change static path to /_next/static/media (#50207)
### What?

align output path of turbopack and webpack

### Why?

passing test cases

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5072 <!-- Tobias Koppers -
improve asset path -->
2023-05-23 18:39:27 +02:00
vercel-release-bot
9eaf4f5dc8 v13.4.4-canary.4 2023-05-23 16:03:50 +00:00
Jesse Koldewijn
2fa58c3a88
fix: Added blockfrost-js, lucid-cardano & mongoose package to srvExtPackages to prevent issue #49783 from happening. (#49938)
fixes #49783

### What?
Added the following packages to the server component exclusion list
which prevents these packages from going through the currently default
compile pipeline for apps that use the App Router. Packages added are:
"@blockfrost/blockfrost-js", "@jpg-store/lucid-cardano" and "mongoose".
(For instance, mongo was already in this exclusion list)

### Why?
These packages are required by the
"@emurgo/cardano-serialization-lib-nodejs" packages and break when not
added to this list while using the app router.

### How?
I've added these packages to the server-external-packages json file in
the Next.js package's lib directory.
2023-05-23 17:41:59 +02:00
Tobias Koppers
3d40cb01ab
refactor webpack loaders (#49535)
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* https://github.com/vercel/turbo/pull/4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* https://github.com/vercel/turbo/pull/4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-23 17:21:25 +02:00
vercel-release-bot
fa9c6021b4 v13.4.4-canary.3 2023-05-23 11:17:35 +00:00
Tobias Koppers
df85ad1ec0
add tracing for turbopack (#49920)
### What?

adds `NEXT_TURBOPACK_TRACING` env var to enable tracing. Writes into `.next/trace.log`

There are 4 presets:

* `NEXT_TURBOPACK_TRACING=overview` gives a overview of requests and modules processed.
* `NEXT_TURBOPACK_TRACING=next` above plus details for next.js
* `NEXT_TURBOPACK_TRACING=turbopack` above plus details for turbopack
* `NEXT_TURBOPACK_TRACING=turbo-tasks` above plus details for turbo-tasks

Published release builds will only allow `overview` to work, since all detailed instrumentation is statically disabled.

see https://github.com/vercel/turbo/pull/4966 for more details

### Why?

get more insight into build times

### Turbopack changes

* https://github.com/vercel/turbo/pull/4995 
* https://github.com/vercel/turbo/pull/5049 
* https://github.com/vercel/turbo/pull/5053 
* https://github.com/vercel/turbo/pull/4966
2023-05-23 05:25:56 +00:00
vercel-release-bot
3b6f286d4c v13.4.4-canary.2 2023-05-23 04:29:21 +00:00
vercel-release-bot
789f253e7a v13.4.4-canary.1 2023-05-22 15:12:14 +00:00
vercel-release-bot
804ca09383 v13.4.4-canary.0 2023-05-19 22:20:30 +00:00
JJ Kasper
d6a3e7d07b
Remove node-sass from peerDependencies (#50065)
This removes `node-sass` from being explicitly marked as a peer
dependency as it's not recommended anymore and `sass` is already marked
as a `peerDependency`, further when auto-install peer dependencies is
enabled it can cause this to be pulled in unexpectedly
2023-05-19 13:10:10 -07:00
Justin Ridgewell
448b74291e
[turbopack]: Update renamed SubpathValue (#49636)
https://github.com/vercel/turbo/pull/4895 renamed `ExportsValue` into
`SubpathValue`

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-19 18:46:10 +02:00
vercel-release-bot
66a0083235 v13.4.3 2023-05-19 06:20:19 +00:00
vercel-release-bot
f299b0d86e v13.4.3-canary.3 2023-05-19 03:14:37 +00:00
vercel-release-bot
20db2f3b0d v13.4.3-canary.2 2023-05-17 16:59:53 +00:00
Alex Kirszenberg
051c90d43c
Introduce NextMode (#49852)
This introduces a `NextMode` enum that controls which mode Next.js Turbo
is currently running in:
* `NextMode::Development`: `next dev`
* `NextMode::Build`: `next build`

Requires https://github.com/vercel/turbo/pull/4972

This also update Turbopack to `turbopack-230517.2` with the following
changes:

* https://github.com/vercel/turbo/pull/4972 <!-- Alex Kirszenberg -
Configure React development flag, inherit NODE_ENV from execution
context -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-17 16:22:50 +02:00
Donny/강동윤
e5ad96edd5
chore(turbopack): Update swc_core to v0.76.6 (#49792)
### What?

Updates `swc_core` to `v0.76.x`, which adds support for `Explicit Resource Management` (stage 3)

### Why?

It's stage 3

### How?

Closes WEB-1040


---

turbopack counterpart: https://github.com/vercel/turbo/pull/4937

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-05-16 05:08:17 +00:00
vercel-release-bot
33bdf6105c v13.4.3-canary.1 2023-05-16 03:01:47 +00:00
Leah
aeed1c770a
add support for globally providing mdx components to turbopack (#49818)
### What?

Adds support for `mdx-components` at the root/src directory.
This is a feature `next-mdx` already has:
https://github.com/vercel/next.js/tree/canary/packages/next-mdx#usage-1

Fixes WEB-1012

Depends on https://github.com/vercel/turbo/pull/4944

### Turbopack updates

* https://github.com/vercel/turbo/pull/4949 <!-- OJ Kwon -
refactor(turbopack): deprecate single react_refresh options -->
* https://github.com/vercel/turbo/pull/4944 <!-- Leah - add mdx
`providerImportSource` option -->
2023-05-16 00:45:08 +00:00
vercel-release-bot
a9e204ca8c v13.4.3-canary.0 2023-05-12 11:58:04 +00:00
vercel-release-bot
328cc8ffa8 v13.4.2 2023-05-11 23:37:55 +00:00
vercel-release-bot
5ef99faa28 v13.4.2-canary.6 2023-05-11 20:41:36 +00:00
Alex Kirszenberg
34f551d9b7
Rename Turbopack/tasks crates to common prefixes (#49446)
See https://github.com/vercel/turbo/pull/4866

This also updates Turbopack to turbopack-230511.2 with the following
changes:

* https://github.com/vercel/turbo/pull/4636 <!-- Alex Kirszenberg - Add
support for logging events and intervals in the macOS profiler -->
* https://github.com/vercel/turbo/pull/4793 <!-- OJ Kwon - ci(workflow):
enable more test -->
* https://github.com/vercel/turbo/pull/4886 <!-- OJ Kwon -
refactor(ecmascript-plugins): update serverdirective signature -->
* https://github.com/vercel/turbo/pull/4866 <!-- Alex Kirszenberg -
Rename Turbopack/tasks crates to common prefixes -->
2023-05-11 11:34:36 +00:00
vercel-release-bot
062fbf6d2d v13.4.2-canary.5 2023-05-11 05:02:19 +00:00
Steven
11a7117d40
chore: cross-platform rm -rf script (#49529)
- Closes https://github.com/vercel/next.js/issues/42433
- Closes https://github.com/vercel/next.js/pull/43105
- Closes https://github.com/vercel/next.js/pull/49522
2023-05-10 01:14:37 +00:00
vercel-release-bot
f02cc9f849 v13.4.2-canary.4 2023-05-10 00:28:37 +00:00
vercel-release-bot
8d228780e7 v13.4.2-canary.3 2023-05-09 01:27:04 +00:00
vercel-release-bot
3a5501e678 v13.4.2-canary.2 2023-05-08 19:41:35 +00:00
vercel-release-bot
660d531b6a v13.4.2-canary.1 2023-05-08 16:14:45 +00:00
vercel-release-bot
c93747eb33 v13.4.2-canary.0 2023-05-08 09:19:39 +00:00
Andrew Clark
7e02f11e3a
Upgrade React to 18.3.0-canary-16d053d59-20230506 (#49402)
Fixes a bug where `useFormStatus` crashed during SSR.

Includes the following upstream changes:

- [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([#26788](https://github.com/facebook/react/pull/26788)) (Andrew Clark)
- [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([#26783](https://github.com/facebook/react/pull/26783)) (dan)
- [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([#26554](https://github.com/facebook/react/pull/26554)) (Samuel Susla)
- [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([#26780](https://github.com/facebook/react/pull/26780)) (Ruslan Lesiutin)
- [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([#26779](https://github.com/facebook/react/pull/26779)) (Ruslan Lesiutin)
2023-05-07 16:43:06 +00:00
vercel-release-bot
92ff2dd7bb v13.4.1 2023-05-05 12:31:07 +00:00
vercel-release-bot
2c37ec01c5 v13.4.1-canary.2 2023-05-05 11:07:10 +00:00
vercel-release-bot
fd319d3922 v13.4.1-canary.1 2023-05-04 23:10:22 +00:00
Jiachi Liu
d37043f51a
Upgrade react types (#49222) 2023-05-05 01:03:26 +02:00
vercel-release-bot
acd22802e0 v13.4.1-canary.0 2023-05-04 19:35:52 +00:00
vercel-release-bot
fb12a6dc87 v13.4.0 2023-05-04 16:35:51 +00:00
JJ Kasper
4c407c1635
v13.3.5-canary.12 2023-05-04 09:21:03 -07:00
Tim Neutkens
fe15a42077
Enable App Router for all applications (#49088)
Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
Co-authored-by: Shu Ding <g@shud.in>
2023-05-04 17:47:10 +02:00
vercel-release-bot
10af8c80ca v13.3.5-canary.11 2023-05-04 13:53:41 +00:00
Tobias Koppers
e96fce41c4
render app pages with original url (#49198)
### What?

Use pre-rewrite URL for rendering

### Why?

Rendering app pages needs the original user facing URL.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4818 <!-- Tobias Koppers - pass
original url with content source data -->
* https://github.com/vercel/turbo/pull/4817 <!-- Tobias Koppers - avoid
errors in computing issue details -->
2023-05-04 15:46:36 +02:00
vercel-release-bot
83e7d6be8e v13.3.5-canary.10 2023-05-04 12:57:28 +00:00
Tobias Koppers
d908bd89bf
update turbopack (#49196)
* https://github.com/vercel/turbo/pull/4815 <!-- Tobias Koppers - fix
CSS HMR -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 14:24:36 +02:00
vercel-release-bot
dc99c18ef1 v13.3.5-canary.9 2023-05-04 10:32:05 +00:00
vercel-release-bot
c5406fc67e v13.3.5-canary.8 2023-05-04 01:58:22 +00:00
Andrew Clark
d543fd19db
Upgrade React to 18.3.0-canary-aef7ce554-20230503 (#49181)
Includes the following upstream changes:

- [aef7ce554](https://github.com/facebook/react/commits/aef7ce554)
[Flight] Progressively Enhanced Server Actions
([#26774](https://github.com/facebook/react/pull/26774)) (Sebastian
Markbåge)
- [c10010a6a](https://github.com/facebook/react/commits/c10010a6a)
[Fizz] Gracefully handle suspending in DOM configs
([#26768](https://github.com/facebook/react/pull/26768)) (Sebastian
Markbåge)
- [f533cee8c](https://github.com/facebook/react/commits/f533cee8c) Add
useFormStatus to Flight fixture
([#26773](https://github.com/facebook/react/pull/26773)) (Andrew Clark)
- [2c1117a8d](https://github.com/facebook/react/commits/2c1117a8d) Reuse
request so that a ReabableStream body does not become disturbed
([#26771](https://github.com/facebook/react/pull/26771)) (Andrew Gadzik)
- [fa7a447b9](https://github.com/facebook/react/commits/fa7a447b9)
[Fizz] Check for nullish values on ReactCustomFormAction
([#26770](https://github.com/facebook/react/pull/26770)) (Sebastian
Markbåge)

<!-- 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 or adding/fixing 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 #

-->
2023-05-04 01:48:40 +00:00
Andrew Clark
e659653e48
Upgrade React to 18.3.0-canary-b7972822b-20230503 (#49158)
Includes the following upstream changes:

- [b7972822b](https://github.com/facebook/react/commits/b7972822b)
useOptimisticState -> useOptimistic
([#26772](https://github.com/facebook/react/pull/26772)) (Andrew Clark)
- [388686f29](https://github.com/facebook/react/commits/388686f29) Add
"canary" to list of allowed npm dist tags
([#26767](https://github.com/facebook/react/pull/26767)) (Andrew Clark)
- [8a25302c6](https://github.com/facebook/react/commits/8a25302c6)
fix[dynamic-scripts-injection]: unregister content scripts before
registration ([#26765](https://github.com/facebook/react/pull/26765))
(Ruslan Lesiutin)
- [2c2476834](https://github.com/facebook/react/commits/2c2476834)
Rename "next" prerelease channel to "canary"
([#26761](https://github.com/facebook/react/pull/26761)) (Andrew Clark)
- [fa4314841](https://github.com/facebook/react/commits/fa4314841)
Remove deprecated workflow key from Circle config
([#26762](https://github.com/facebook/react/pull/26762)) (Andrew Clark)
- [5dd90c562](https://github.com/facebook/react/commits/5dd90c562) Use
content hash for react-native builds
([#26734](https://github.com/facebook/react/pull/26734)) (Samuel Susla)
- [559e83aeb](https://github.com/facebook/react/commits/559e83aeb)
[Fizz] Allow an action provide a custom set of props to use for
progressive enhancement
([#26749](https://github.com/facebook/react/pull/26749)) (Sebastian
Markbåge)
- [67f4fb021](https://github.com/facebook/react/commits/67f4fb021) Allow
forms to skip hydration of hidden inputs
([#26735](https://github.com/facebook/react/pull/26735)) (Sebastian
Markbåge)
- [8ea96ef84](https://github.com/facebook/react/commits/8ea96ef84)
[Fizz] Encode external fizz runtime into chunks eagerly
([#26752](https://github.com/facebook/react/pull/26752)) (Josh Story)
- [491aec5d6](https://github.com/facebook/react/commits/491aec5d6)
Implement experimental_useOptimisticState
([#26740](https://github.com/facebook/react/pull/26740)) (Andrew Clark)
- [9545e4810](https://github.com/facebook/react/commits/9545e4810) Add
nonce support to bootstrap scripts and external runtime
([#26738](https://github.com/facebook/react/pull/26738)) (Dan Ott)
- [86b0e9199](https://github.com/facebook/react/commits/86b0e9199) Gate
DevTools test to fix CI
([#26742](https://github.com/facebook/react/pull/26742)) (Andrew Clark)
- [b12bea62d](https://github.com/facebook/react/commits/b12bea62d)
Preinits should support a nonce option
([#26744](https://github.com/facebook/react/pull/26744)) (Josh Story)
- [efbd68511](https://github.com/facebook/react/commits/efbd68511)
Remove unused `initialStatus` parameter from `useHostTransitionStatus`
([#26743](https://github.com/facebook/react/pull/26743)) (Sebastian
Silbermann)
- [18282f881](https://github.com/facebook/react/commits/18282f881) Fix:
Update while suspended fails to interrupt
([#26739](https://github.com/facebook/react/pull/26739)) (Andrew Clark)
- [540bab085](https://github.com/facebook/react/commits/540bab085)
Implement experimental_useFormStatus
([#26722](https://github.com/facebook/react/pull/26722)) (Andrew Clark)

---------
2023-05-03 14:03:19 -07:00
vercel-release-bot
b7c213fc8e v13.3.5-canary.7 2023-05-03 20:18:25 +00:00
Alex Kirszenberg
7092266076
Add support for app global and segment 404 pages (#49085)
See https://github.com/vercel/turbo/pull/4776

This adds support for:

* Default and custom global app 404 pages (`app/not-found`).
* Segment-level 404 pages (`app/segment/not-found`).

This also updates Turbopack:

* https://github.com/vercel/turbo/pull/4787 <!-- Tobias Koppers -
Bugfixes for free var and binding replacement -->
* https://github.com/vercel/turbo/pull/4789 <!-- Alex Kirszenberg -
Print a warning when importing Sass files -->
* https://github.com/vercel/turbo/pull/4776 <!-- Alex Kirszenberg -
Leave pathname formatting up to the caller -->
* https://github.com/vercel/turbo/pull/4790 <!-- Tobias Koppers - remove
inital compilation message by default -->

## TODO:

- [ ] ~~The dev overlay shows up when `notFound()` is called, it should
be hidden~~ (moved to WEB-980)
- [ ] ~~Navigating to the global 404 page doesn't work~~ (this is a bug
in Next.js, see NEXT-963)
- [x] Tests.

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-03 18:10:17 +00:00
vercel-release-bot
467539c19e v13.3.5-canary.6 2023-05-03 15:08:15 +00:00
vercel-release-bot
56de0b2ba8 v13.3.5-canary.5 2023-05-03 06:00:23 +00:00
Tobias Koppers
194da0b3e3
add test case for non-enumerable exports (#49106)
### What?

test case for https://github.com/vercel/turbo/pull/4783
2023-05-03 04:23:41 +00:00
vercel-release-bot
3caf6de7a6 v13.3.5-canary.4 2023-05-03 01:01:16 +00:00
Tobias Koppers
fe38369618
add test cases for error handling (#49093)
### What?

test cases for https://github.com/vercel/turbo/pull/4779
2023-05-02 22:09:55 +02:00
vercel-release-bot
d539c764d1 v13.3.5-canary.3 2023-05-02 09:54:31 +00:00
Tobias Koppers
90153ffd8d
update turbopack (#49071)
* https://github.com/vercel/turbo/pull/4691 
* https://github.com/vercel/turbo/pull/4765 
* https://github.com/vercel/turbo/pull/4772
2023-05-02 08:19:30 +00:00
vercel-release-bot
191e4977a5 v13.3.5-canary.2 2023-05-02 00:31:46 +00:00
vercel-release-bot
95d41fbcb1 v13.3.5-canary.1 2023-05-01 14:23:49 +00:00
Shu Ding
5bc1e65efd
Add flag to switch to the experimental channel (#48896)
This PR does three things:
- Vendors the package `react-server-dom-webpack@experimental` as
`react-server-dom-webpack-experimental` similar to React and React DOM
- Upgrades all vendored React packages
- Re-lands the `experimentalReact` flag to switch between `@next` and
`@experimental` channels of React for app dir.

Fix NEXT-926.
2023-05-01 15:49:10 +02:00
vercel-release-bot
c1f15b0ee6 v13.3.5-canary.0 2023-05-01 12:55:41 +00:00
Tobias Koppers
dbccc794e3
fix GlobalError interop and add test case (#49033)
### What?

fixes handling of GlobalError interop
adds a test case for client component bug

### Why?

app dir client component interop is broken

### Turbopack changes

* https://github.com/vercel/turbo/pull/4597 <!-- Tobias Koppers - add
rspack to our benchmark suite -->
* https://github.com/vercel/turbo/pull/4761 <!-- Tobias Koppers - Do not
use interop logic on proxy modules -->
2023-05-01 14:51:37 +02:00
Alex Kirszenberg
3362851b92
More fluent GraphTraversal API (#49028)
See https://github.com/vercel/turbo/pull/4598

### Turbopack changes

* https://github.com/vercel/turbo/pull/4754 <!-- Justin Ridgewell -
Match TS's extends resolution algorithm -->
* https://github.com/vercel/turbo/pull/4598 <!-- Alex Kirszenberg - More
fluent GraphTraversal API -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 14:08:25 +02:00
Donny/강동윤
7e0a6f83f6
chore: Update swc_core to v0.75.41 (#48982)
### What?

Update swc_core and `@swc/core`.

### Why?

https://github.com/vercel/turbo/issues/4747 seems like a critical issue.

### How?

 - Fix WEB-969

### Turbopack changes

* https://github.com/vercel/turbo/pull/4688 <!-- OJ Kwon - ci(workflow):
add appdir underscore test to subset -->
* https://github.com/vercel/turbo/pull/4751 <!-- Justin Ridgewell -
Cleanup "started server on" message -->
* https://github.com/vercel/turbo/pull/4756 <!-- Donny/강동윤 - chore:
Update `swc_core` to `v0.75.41` -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 13:15:24 +02:00
vercel-release-bot
48323c9dfe v13.3.4 2023-05-01 10:35:36 +00:00
vercel-release-bot
bc8f5d8afc v13.3.4-canary.0 2023-05-01 10:04:08 +00:00
vercel-release-bot
0b07616eb2 v13.3.3 2023-05-01 09:07:32 +00:00
vercel-release-bot
b2c6f01242 v13.3.3-canary.2 2023-05-01 07:42:45 +00:00
vercel-release-bot
8e4888f1f6 v13.3.3-canary.1 2023-04-30 18:41:24 +00:00
vercel-release-bot
ae00e1206f v13.3.3-canary.0 2023-04-30 13:26:24 +00:00
vercel-release-bot
57878be65f v13.3.2 2023-04-29 19:17:57 +00:00
vercel-release-bot
6668e97666 v13.3.2-canary.14 2023-04-29 17:53:12 +00:00
vercel-release-bot
e66c6250ce v13.3.2-canary.13 2023-04-28 22:55:36 +00:00
Alex Kirszenberg
7b348fa0f2
Use ProxiedAsset instead of css_chunk_root_path to expose RSC CSS chunks (#48946)
See https://github.com/vercel/turbo/pull/4740

This enables RSC CSS HMR. The `css_chunk_root_path` way somehow broke
the propagation of invalidation for CSS chunks.

This also updates Turbopack with the following changes:

* https://github.com/vercel/turbo/pull/4738 <!-- Tobias Koppers -
improve commonjs esm interop and node ESM -->
* https://github.com/vercel/turbo/pull/4740 <!-- Alex Kirszenberg -
Replace css_chunk_root_path with ProxiedAsset -->
* https://github.com/vercel/turbo/pull/4741 <!-- Tobias Koppers - add
svg size extraction -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-04-28 20:37:34 +02:00
vercel-release-bot
c94122dc2c v13.3.2-canary.12 2023-04-28 09:25:25 +00:00
Justin Ridgewell
a2a3f5e378
turbopack: parse and propagate output: 'export' (#48046)
Depends on https://github.com/vercel/turbo/pull/4491

This adds support for the new `output: 'export'` configuration, and
propagates the value through to our Node.js rendering code to render.
Unfortunately, we don't support page-level configs at the moment, so we
can't set a `export const config = { dynamic: 'force-dynamic' }` and
test that the export value is being received (I've manually verified it,
though).

Fixes WEB-842
2023-04-28 06:36:32 +00:00
Donny/강동윤
e260adb805
fix: Enable CJS annotations for next.js files (#48811)
### What?

Enable import/export annotations for next.js files.

### Why?

It's required to allow importing next.js modules from node.
`cjs-module-lexer` needs these annotations to import CJS modules.

### How?

Closes WEB-949
Fixes #48801
2023-04-27 23:13:40 +00:00
Kiko Beats
678c69753b
Upgrade Edge Runtime (#46818)
Hello,

This Edge Runtime update fix some small bugs, and also it allows using `TextDecoderStream` and `TextEncoderStream` for development (aka `next dev`)

Related: https://github.com/vercel/edge-runtime/releases/tag/edge-runtime%402.1.0

Fixes #47189
fix NEXT-833 ([link](https://linear.app/vercel/issue/NEXT-833))
2023-04-27 17:04:14 +00:00
vercel-release-bot
3efbb1a14f v13.3.2-canary.11 2023-04-27 15:21:01 +00:00
Alex Kirszenberg
3ed412a308
Selectively load runtime CSS modules to avoid rule duplication (#48866)
See https://github.com/vercel/turbo/pull/4695

### Turbopack changes

* https://github.com/vercel/turbo/pull/4683 <!-- Alex Kirszenberg -
Update benchmark data -->
* https://github.com/vercel/turbo/pull/4695 <!-- Alex Kirszenberg -
Selectively load runtime CSS modules to avoid rule duplication -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-27 13:47:36 +02:00
vercel-release-bot
80a9454faf v13.3.2-canary.10 2023-04-27 10:56:05 +00:00
Josh Story
7a5ef27b5e
Preload css (#48840)
This PR implements preloading of CSS from RSC.

1. The underlying Flight protocol was extended in
https://github.com/facebook/react/pull/26502 to allow sending hints from
RSC to SSR and Client runtimes. React was updated to include these
changes.
2. We now call `ReactDOM.preload()` for each stylesheet used in a
layout/page layer

There are a few implementation details to take note of
1. we were previously using the `.browser` variant of a few React
packages. This was a holdover from when there was just browser and node
and we wanted to use the browser variant b/c we wanted the same code to
work in edge/node runtimes. React now publishes a `.edge` variant which
is like `.browser` but expects to be server only. This is necessary to
get the opt-in for `AsyncLocalStorage`.
2. Even with the above change, AsyncLocalStorage was not patched on the
global scope until after React was loaded. I moved this into a module
which is loaded first
3. The component passed to RSC's `renderToReadableStream` is not
actually part of the RSC module graph. If I tried to call
`ReactDOM.preload()` inside that function or any other function defined
inside `app-render.tsx` file it would actually see the wrong instance of
`react-dom`. I added a new export on the RSC top level export which
exposes a `preloadStyle(...)` function which just delegates to
`ReactDOM.preload(...)`. This makes the preload run in the right module
graph


~There are a couple of bugs in React that this work uncovered that I
will upstream. We may want to delay merging until they are addressed.
I'll update this comment when that is complete.~
1. ~React, during SSR, can emit a preload for a style twice in some
circumstances because late discovered stylesheets don't consider whether
a preload has already been flushed when preparing to reveal a boundary
they are within~
2. ~React, during RSC updates on the client, can preload a style that is
already in the document because it currently only looks for existing
preload links and does not consider if there is a stylesheet link with
the same href.~

~both of these issues will not break functionality, they just make the
network tab look at bit more noisy. We would expect network deduping to
prevent multiple actual loads~

The above React bugs were fixed and included now in the React update in
this PR

---------

Co-authored-by: Shu Ding <g@shud.in>
2023-04-27 12:51:52 +02:00
vercel-release-bot
ffefb31efb v13.3.2-canary.9 2023-04-27 08:27:05 +00:00
vercel-release-bot
0cfa3fce23 v13.3.2-canary.8 2023-04-27 03:40:24 +00:00
Tobias Koppers
219d1d49c7
update turbopack (#48893)
### What?

* https://github.com/vercel/turbo/pull/4700 <!-- Tobias Koppers - update
deps -->
* https://github.com/vercel/turbo/pull/4706 <!-- Tobias Koppers - make
library code less verbose in stack traces -->
* https://github.com/vercel/turbo/pull/4705 <!-- Tobias Koppers -
improve error handling in update stream -->
* https://github.com/vercel/turbo/pull/4667 <!-- Caleb Webber - remove
box_syntax -->
* https://github.com/vercel/turbo/pull/4714 <!-- Tobias Koppers - chunk
hash need to include availability root -->
* https://github.com/vercel/turbo/pull/4709 <!-- Alex Kirszenberg -
Allow the dev server socket to be reused immediately -->
* https://github.com/vercel/turbo/pull/4716 <!-- Tobias Koppers - errors
lead to consistent exit code in issue detail -->
2023-04-27 00:46:04 +02:00
Kiko Beats
1274713b1a
edge: expose Websocket constructor (#48870)
This PR make possible to use WebSocket in an Edge Function 🙂
2023-04-26 17:38:39 +02:00
vercel-release-bot
1c0c61a66c v13.3.2-canary.7 2023-04-26 08:38:47 +00:00
Tobias Koppers
5a46b01ab9
update turbopack (#48846)
* https://github.com/vercel/turbo/pull/4692 
* https://github.com/vercel/turbo/pull/4595 
* https://github.com/vercel/turbo/pull/4690 
* https://github.com/vercel/turbo/pull/4663
2023-04-26 06:55:37 +00:00
Shu Ding
287e379b92
Vendor react@experimental (#48697)
Part of #47759 (which had been reverted twice so here we only land a part of the change), relates to NEXT-926. Thanks to #48506 we can soon switch between these two channels during runtime.

Also fixes a problem of `renderKind` (only revealed after upgrading React), it should be also based on the `match` kind.
2023-04-25 14:29:02 +00:00
vercel-release-bot
9863935f44 v13.3.2-canary.6 2023-04-25 09:13:29 +00:00
Donny/강동윤
a18f50a321
fix: Update @swc/helpers to v0.5.1 (#48808)
### What?

Update `@swc/helpers` to `v0.5.1`.

### Why?

Webpack merges `@swc/helpers@v0.4.x` and `@swc/helpers@v0.5.x`, due to `resolve.alias` config in 2f6ff0dab3/packages/next/src/build/webpack-config.ts (L1070-L1072)

To workaround it, `@swc/helpers@v0.5.1` reexports from entries just like `v0.4`.

### How?

Closes WEB-948
Fixes #48593
2023-04-25 04:32:27 +00:00
vercel-release-bot
79c73887cd v13.3.2-canary.5 2023-04-25 01:30:47 +00:00
vercel-release-bot
2f6ff0dab3 v13.3.2-canary.4 2023-04-24 22:21:45 +00:00
vercel-release-bot
2196cbe405 v13.3.2-canary.3 2023-04-24 14:16:49 +00:00
Alex Kirszenberg
7fdcb172f9
Lazy DevHtmlAsset chunk generation (#48768)
This fixes a perf regression introduced in the chunking refactor, where
we would be eagerly generating all assets from the web entry and
fallback sources.

See https://github.com/vercel/turbo/pull/4679

This also brings the following updates from vercel/turbo:

* https://github.com/vercel/turbo/pull/4669 <!-- Tobias Koppers - make
the invalidation reason easier to read -->
* https://github.com/vercel/turbo/pull/4670 <!-- Tobias Koppers -
dev-server content might change any time, we can't cache them -->
* https://github.com/vercel/turbo/pull/4653 <!-- OJ Kwon -
fix(ecmascript): displayname for styled_components -->
* https://github.com/vercel/turbo/pull/4679 <!-- Alex Kirszenberg - Lazy
DevHtmlAsset chunk generation --> (this change)
2023-04-24 12:11:24 +02:00
vercel-release-bot
1e9d53ebae v13.3.2-canary.2 2023-04-24 09:23:39 +00:00
vercel-release-bot
e720a1efa4 v13.3.2-canary.1 2023-04-24 08:14:15 +00:00
vercel-release-bot
2bfde63b78 v13.3.2-canary.0 2023-04-23 21:57:48 +00:00
vercel-release-bot
6423285451 v13.3.1 2023-04-21 22:04:41 +00:00
vercel-release-bot
455de08b30 v13.3.1-canary.19 2023-04-21 20:59:00 +00:00
vercel-release-bot
a06fef0906 v13.3.1-canary.18 2023-04-21 17:50:15 +00:00
Sebastian Silbermann
db0086703e
Upgrade @types/react to latest 18.x (#48645)
Required for  https://github.com/vercel/next.js/pull/48641

[React 18 types
changelog](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210)

Revealed some bugs in `React.Children` typings that were hidden due to
`{}` being part of `ReactNode` before 18.x types.
The rest is mostly missing `children` props types.
2023-04-21 09:33:23 +00:00
vercel-release-bot
682fb27ab4 v13.3.1-canary.17 2023-04-20 22:14:05 +00:00
JJ Kasper
652ba8a0ec
Fix version bump 2023-04-20 17:47:31 -04:00
Tobias Koppers
ec385decd3
replace defined values and add __NEXT_HAS_REWRITES define (#48628)
### What?

This fixes a problem when the router fails to load the correct JS file
from the page_loader and opts out to full refresh

### Why?

The router behaves incorrect when `__NEXT_HAS_REWRITES` is missing in
turbopack

### How?

see also https://github.com/vercel/turbo/pull/4652

### Turbopack changes

* https://github.com/vercel/turbo/pull/4650 <!-- Tobias Koppers - reduce
size of TypeType from 32bytes to 16bytes -->
* https://github.com/vercel/turbo/pull/4648 <!-- Tobias Koppers - handle
chunk register in the sync runtime.none correctly -->
* https://github.com/vercel/turbo/pull/4609 <!-- OJ Kwon -
fix(ecmascript): eval assignop to the ident -->
* https://github.com/vercel/turbo/pull/4652 <!-- Tobias Koppers - allow
to pass constant values to free var references -->
* https://github.com/vercel/turbo/pull/4649 <!-- Tobias Koppers - Image
processing improvements -->
2023-04-20 20:02:39 +02:00
Tobias Koppers
189e6a3687
use structured images with metainfo (blur placeholder) (#48531)
### What?

add support for blur placeholder generation to turbopack

add `StructuredImageModuleType` which is used with `ModuleType::Custom`
to allow importing an image as `{ url, width, height, blurDataURL,
blurWidth, blurHeight }`

in contrast to next.js with webpack this will also generate blur
placeholder in development instead of using a _next/image reference.
This should lead to more production-like experience (at the cost of a
little bit of compilation time).

turbo PR: https://github.com/vercel/turbo/pull/4621

### Why?

Turbopack was crashing on `placeholder="blur"` before.

fixes WEB-534

### Turbopack changes

* https://github.com/vercel/turbo/pull/4521 <!-- OJ Kwon -
feat(contextcondition): support InPath contextcondition -->
* https://github.com/vercel/turbo/pull/4601 <!-- Alex Kirszenberg -
Chunking Context Refactor pt. 3: Address PR comments from pt. 2 -->
* https://github.com/vercel/turbo/pull/4623 <!-- Tobias Koppers -
exclude turborepo from turbopack bench tests -->
* https://github.com/vercel/turbo/pull/4399 <!-- Leah - support
require.context -->
* https://github.com/vercel/turbo/pull/4610 <!-- OJ Kwon - test(subset):
add mdx test into subset -->
* https://github.com/vercel/turbo/pull/4624 <!-- Tobias Koppers - run
benchmarks on windows and macOS too -->
* https://github.com/vercel/turbo/pull/4620 <!-- Alex Kirszenberg - Make
ContainmentTree fully generic -->
* https://github.com/vercel/turbo/pull/4600 <!-- Tobias Koppers - add
getChunkPath method -->
* https://github.com/vercel/turbo/pull/4621 <!-- Tobias Koppers - add
turbopack-image -->
* https://github.com/vercel/turbo/pull/4639 <!-- Tobias Koppers -
restrict snapshot path for windows path length limit -->
* https://github.com/vercel/turbo/pull/4641 <!-- Tobias Koppers - put
webp behind a feature flag -->
2023-04-20 02:18:59 +02:00
Tim Neutkens
925bb3b025
Upgrade React (#48589)
Second try for #48561

<!-- 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 or adding/fixing 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: Sophie Alpert <git@sophiebits.com>
Co-authored-by: Shu Ding <g@shud.in>
2023-04-20 02:05:49 +02:00
JJ Kasper
f078da3f31 v13.3.1-canary.16 2023-04-19 19:16:09 +00:00
JJ Kasper
7f2a4ac1d2 v13.3.1-canary.15 2023-04-19 14:25:33 +00:00
JJ Kasper
7350c5fb34 v13.3.1-canary.14 2023-04-18 20:02:39 +00:00
JJ Kasper
3a133d2dde v13.3.1-canary.13 2023-04-18 12:41:57 +00:00
JJ Kasper
6106666d3e v13.3.1-canary.12 2023-04-18 07:04:31 +00:00
Maia Teegarden
43d09ce2fd
Update swc_core to v0.75.23 (#48098)
Depends on https://github.com/vercel/turbo/pull/4470

---

 - Closes https://github.com/vercel/next.js/issues/46989
 - Fixes WEB-879
 - Fixes WEB-813

---------

Co-authored-by: OJ Kwon <1210596+kwonoj@users.noreply.github.com>
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
Co-authored-by: Shu Ding <g@shud.in>
2023-04-18 08:59:52 +02:00
JJ Kasper
af64047d99 v13.3.1-canary.11 2023-04-17 22:40:37 +00:00
Connor Prussin
a92c5465ca
Make jest config serializable (#47620)
### What?

This PR ensures the jest configuration is json-serializable. It also
adds a bunch of typescript types.

### Why?

Jest requires that the configuration be json-serializable. See #47407
for details on the issues caused when it isn't. However, prior to this
commit, we were passing the entire next config as a property in the swc
jest transformer options. The next config includes some fields that are
not serializable, such as some functions.

### How?

In this PR we instead pluck the fields out of the next config that we
actually need and pass only those into the swc transformer.

This PR also adds a bunch of more precise typescript types where we were
previously just using `any`. This helps confirm that the configs are
being threaded through correctly. I think this type safety is enough to
confirm this commit and adding tests would just be redundant.

Closes NEXT-901
Fixes #47407
fix NEXT-901 ([link](https://linear.app/vercel/issue/NEXT-901))

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-04-17 18:52:52 +00:00
JJ Kasper
e329b31d90 v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
Tobias Koppers
6be8c59075
app dir fixes (#48025)
### What?

* fix app dir chunking
* fix app dir 404s
* improve app dir performance
* rerender shadowportal on errors to re-add nextjs-portal to avoid empty
page
* inject polyfills before user code
* fix manifest generation

see also https://github.com/vercel/turbo/pull/4488

### Why?

App dir was very slow and lead to 404 errors

### How?

add included metadata to chunks to allow deduplicate chunk loads at
runtime
2023-04-17 17:58:33 +02:00
JJ Kasper
bc5be2f76c v13.3.1-canary.9 2023-04-17 13:46:08 +00:00
Shu Ding
f6604d4afe
Revert "Re-land "Vendor react@experimental under an experimentalReact flag"" (#48478)
Reverts vercel/next.js#48041
fix NEXT-926
2023-04-17 15:00:02 +02:00
JJ Kasper
20c5a23a90 v13.3.1-canary.8 2023-04-15 15:24:28 +00:00
Tobias Koppers
51defb249a
provide the PORT env var based on server port, update turbopack (#48347)
### What?

gives user code access to `process.env.PORT` as current server port
avoid injecting env vars into code on server

### Why?

it might need construct an addr to fetch from api routes

fixes WEB-868

### Turbopack changes

* https://github.com/vercel/turbo/pull/4565 <!-- Tobias Koppers - Bind
to IPv6 and IPv4 -->
* https://github.com/vercel/turbo/pull/4570 <!-- Tobias Koppers - review
follow ups -->
* https://github.com/vercel/turbo/pull/4585 <!-- Tobias Koppers - fixup
bind v6 PR: add missing listen call -->
* ~https://github.com/vercel/turbo/pull/4546~ <!-- Alex Kirszenberg -
Chunking Context Refactor pt. 3: Address PR comments from pt. 2 -->
* https://github.com/vercel/turbo/pull/4580 <!-- Tobias Koppers - remove
circular dependency -->
* https://github.com/vercel/turbo/pull/4582 <!-- Tobias Koppers - ignore
internal and server-relative url() in CSS -->
* https://github.com/vercel/turbo/pull/4579 <!-- Tobias Koppers - make
node bootstrap asset lazy -->
* https://github.com/vercel/turbo/pull/4581 <!-- Tobias Koppers - allow
to create stress test for client components -->
* https://github.com/vercel/turbo/pull/4584 <!-- Tobias Koppers -
improve node.js receive timeout -->
* https://github.com/vercel/turbo/pull/4583 <!-- Tobias Koppers - remove
panic since this might happen due to eventual consistency -->

fixes WEB-871
2023-04-14 23:04:14 +02:00
JJ Kasper
54fb4b6e0b v13.3.1-canary.7 2023-04-14 17:02:43 +00:00
JJ Kasper
557084a331
Fix fetch cache body handling and update edge-runtime deps (#48365)
This ensures we don't fail to return the full body when storing to
fetch-cache in edge-runtime. Also ensures the fetch cache tests are
running for Node.js v16 correctly.

Fetch handling was also failing on Node.js v16 due to react's use of
`res.clone()` being broken with undici which is fixed in the latest
version of edge-runtime so this bumps that.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1681310566927429)
2023-04-13 22:00:20 -07:00
Tobias Koppers
d4d779145c
refactor shared logic for turbopack-cli (#48307)
### What?

* move some shared runtime logic to turbopack
* use relative imports from internal code when possible
* move react-refresh logic to turbopack
* move benchmark code logic to turobpack

see https://github.com/vercel/turbo/pull/4553

### Why?

We want to have benchmarking again for turbopack PRs
We want to have a standalone turbopack cli (eventually)
We want to avoid duplicating the runtime code

### How?

refactoring, moving code
2023-04-13 14:54:34 +02:00
JJ Kasper
e8f6ddcae8 v13.3.1-canary.6 2023-04-13 01:22:55 +00:00
JJ Kasper
8273ba5660 v13.3.1-canary.5 2023-04-12 13:16:22 +00:00
Alex Kirszenberg
ce42173eae
Chunking Refactor pt. 2 (#47961)
See https://github.com/vercel/turbo/pull/4450

This PR updates Turbopack to turbopack-230411.2:

## Miscellaneous

* https://github.com/vercel/turbo/pull/4450 <!-- Alex Kirszenberg -
Chunking Refactor pt. 2 -->
2023-04-11 11:08:37 -07:00
JJ Kasper
b896a12867 v13.3.1-canary.4 2023-04-10 17:07:34 +00:00
Shu Ding
9c0e520896
Re-land "Vendor react@experimental under an experimentalReact flag" (#48041)
Reverts vercel/next.js#48038

fix NEXT-926

---

The root cause was that when copying the package.json, I removed all
fields except for a few (such as `exports`) but missed the `browser`
field. That caused the client bundle to resolve to the Node.js version
of React DOM, and then we had the `async_hooks` error. Added it back in
99c9b9e51f8b0d4e4503ece9d07bce09161f3341.

I reproduced the error with next-site earlier and confirmed that this
fix is good.
2023-04-08 17:16:24 +02:00
JJ Kasper
2bcdfbb6ab v13.3.1-canary.3 2023-04-08 01:47:09 +00:00
JJ Kasper
b5f785aab1 v13.3.1-canary.2 2023-04-07 18:04:26 +00:00
JJ Kasper
0097c12a92 v13.3.1-canary.1 2023-04-07 13:29:08 +00:00
JJ Kasper
883933b6c5 v13.3.1-canary.0 2023-04-07 03:15:57 +00:00
Justin Ridgewell
8d3e42e556
turbopack: bind server to IPv6 loopback (#47948)
This accomplishes 2 things:
1. binds the turbopack dev server to the IPv6 unspecified address
2. initializes our router with the same hostname/port of the turobpack
server

The first matches the behavior of the Node.js dev server. The IPv6
unspecified address is similar to IPv4's `0.0.0.0` address, allowing us
to accept connection from anywhere. Importantly, it _also_ allows
accepting IPv4 connections, making this address truly universal.

The second means the `request` parameter to any middleware will have the
correct origin, and the request's URL can be used to craft fetch
requests to API endpoints. `new URL(req.url).origin` will be the origin
of the turbopack dev server.

Fixes https://github.com/vercel/turbo/issues/4456
Fixes WEB-855
2023-04-06 17:58:26 -07:00
JJ Kasper
79031e608a
v13.3.0 2023-04-06 13:47:03 -07:00
JJ Kasper
b8e7646fdc v13.2.5-canary.34 2023-04-06 19:48:01 +00:00
JJ Kasper
9448913149
Revert "Vendor react@experimental under an experimentalReact flag" (#48038)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1680804950611789?thread_ts=1680791613.468109&cid=C04DUD7EB1B)

Reverts vercel/next.js#47759
fix NEXT-926
2023-04-06 11:48:09 -07:00
JJ Kasper
200e83245c v13.2.5-canary.33 2023-04-06 14:52:28 +00:00
JJ Kasper
5eec452f78 v13.2.5-canary.32 2023-04-06 06:23:44 +00:00
JJ Kasper
be2237fc92 v13.2.5-canary.31 2023-04-05 23:30:33 +00:00
Shu Ding
89b4605f1a
Vendor react@experimental under an experimentalReact flag (#47759)
Next.js includes various feature sets that depend on specific release
channels of React. However, our current setup only includes the `next`
channel of React, which restricts our ability to integrate with features
available on the `experimental` channel.

To address this limitation, this pull request introduces the following
changes:
- Vendors the `react@experimental` version, along with the corresponding
`react-dom` and `scheduler` packages.
- Modifies the `sync-react` script to also update the `experimental`
channel and removes `--version` as they're always synced to the latest
now.
- Retains the default behavior of using the `next` channel in the
`appDir` directory.
- Adds an option to switch to the `experimental` channel by setting
`experimental.experimentalReact: true` in the configuration.

fix NEXT-926 ([link](https://linear.app/vercel/issue/NEXT-926))
2023-04-05 14:05:47 +00:00
JJ Kasper
95ca6f48c6 v13.2.5-canary.30 2023-04-04 19:41:51 +00:00