Commit graph

1415 commits

Author SHA1 Message Date
Josh Story
4deb69793e
Update React from 593ecee66 to 2c338b16f. (#58553)
#### Upstream Changes

- https://github.com/facebook/react/pull/27692
- https://github.com/facebook/react/pull/27712
- https://github.com/facebook/react/pull/27659
2023-11-16 22:23:04 +00:00
vercel-release-bot
1ae13b5d9f v14.0.4-canary.0 2023-11-16 21:40:51 +00:00
vercel-release-bot
391471b315 v14.0.3 2023-11-16 18:37:33 +00:00
vercel-release-bot
32875e4fe4 v14.0.3-canary.12 2023-11-16 16:00:52 +00:00
vercel-release-bot
c8bfda4367 v14.0.3-canary.11 2023-11-15 23:22:09 +00:00
vercel-release-bot
a5515693bc v14.0.3-canary.10 2023-11-15 21:51:36 +00:00
Shu Ding
036f4806a6
Upgrade vendored React (#58489)
### React upstream changes

- https://github.com/facebook/react/pull/27694
- https://github.com/facebook/react/pull/27695
- https://github.com/facebook/react/pull/27689
- https://github.com/facebook/react/pull/27687
- https://github.com/facebook/react/pull/27677
- https://github.com/facebook/react/pull/27681
2023-11-15 14:48:27 +00:00
vercel-release-bot
7281cd3fc4 v14.0.3-canary.9 2023-11-15 13:00:05 +00:00
Donny/강동윤
f99242baca
Update turbopack (#58408)
* https://github.com/vercel/turbo/pull/6424 
* https://github.com/vercel/turbo/pull/6433 

Closes PACK-1967
2023-11-15 11:48:31 +00:00
vercel-release-bot
44613dc045 v14.0.3-canary.8 2023-11-14 23:23:29 +00:00
vercel-release-bot
08e5424ddc v14.0.3-canary.7 2023-11-14 10:25:41 +00:00
vercel-release-bot
82821c7942 v14.0.3-canary.6 2023-11-13 23:22:10 +00:00
vercel-release-bot
d7ade76ef8 v14.0.3-canary.5 2023-11-12 23:22:46 +00:00
vercel-release-bot
a794e1f32e v14.0.3-canary.4 2023-11-12 08:17:33 +00:00
vercel-release-bot
00f5b5e789 v14.0.3-canary.3 2023-11-11 23:23:28 +00:00
vercel-release-bot
c74f023b88 v14.0.3-canary.2 2023-11-10 23:21:25 +00:00
vercel-release-bot
7966eaf0f2 v14.0.3-canary.1 2023-11-10 04:31:01 +00:00
Josh Story
37a1342712
Update React from 746890329 to 0e352ea01 (#58279)
Updates React from 746890329 to 0e352ea01.

- https://github.com/facebook/react/pull/27684
- https://github.com/facebook/react/pull/27665
- https://github.com/facebook/react/pull/27671
- https://github.com/facebook/react/pull/27680
2023-11-10 04:25:07 +00:00
vercel-release-bot
52123ccdbc v14.0.3-canary.0 2023-11-09 23:22:17 +00:00
vercel-release-bot
8eba72f30b v14.0.2 2023-11-09 18:32:59 +00:00
vercel-release-bot
fdd6eb990a v14.0.2-canary.27 2023-11-09 17:45:04 +00:00
vercel-release-bot
b740fe8fa4 v14.0.2-canary.26 2023-11-09 09:56:42 +00:00
Tobias Koppers
bf966e370e
update turbopack (#58243)
* https://github.com/vercel/turbo/pull/6399 
* https://github.com/vercel/turbo/pull/6393 
* https://github.com/vercel/turbo/pull/6403 
* https://github.com/vercel/turbo/pull/6404 
* https://github.com/vercel/turbo/pull/6394 
* https://github.com/vercel/turbo/pull/6405 
* https://github.com/vercel/turbo/pull/6351
2023-11-09 09:52:22 +00:00
vercel-release-bot
fd7ea115b5 v14.0.2-canary.25 2023-11-09 02:36:39 +00:00
Josh Story
eb79555827
Updated React from 7508dcd5c to 746890329 (#58233)
Updated React from 7508dcd5c to 746890329.

- https://github.com/facebook/react/pull/27674
2023-11-08 18:30:45 -08:00
vercel-release-bot
b50090bf96 v14.0.2-canary.24 2023-11-08 23:21:44 +00:00
vercel-release-bot
67656c3fec v14.0.2-canary.23 2023-11-08 20:21:15 +00:00
Josh Story
1b5e307f6b
Update React from 2983249dd to 7508dcd5c (#58216)
Updated React from 2983249dd to 7508dcd5c.

- https://github.com/facebook/react/pull/27672
- https://github.com/facebook/react/pull/27132
- https://github.com/facebook/react/pull/27646
- https://github.com/facebook/react/pull/26446
2023-11-08 19:36:54 +00:00
vercel-release-bot
5dc2572dc7 v14.0.2-canary.22 2023-11-08 16:23:23 +00:00
vercel-release-bot
f206573f93 v14.0.2-canary.21 2023-11-08 10:25:06 +00:00
Tobias Koppers
9d3b94b449
update turbopack (#58172)
* https://github.com/vercel/turbo/pull/6376 <!-- OJ Kwon -
feat(turbopack): support url rewrite behavior options -->
* https://github.com/vercel/turbo/pull/6386 <!-- OJ Kwon -
feat(turbopack-ecmascript): support relative url asset ref -->
* https://github.com/vercel/turbo/pull/6382 <!-- Tobias Koppers -
refactor and fix CssEmbed for url() -->
2023-11-08 08:54:36 +01:00
vercel-release-bot
3977f90fd0 v14.0.2-canary.20 2023-11-08 02:39:50 +00:00
Josh Story
fe99b53d7f
Update React from 08a39539f to 2983249dd. (#58154)
Updates React from 08a39539f to 2983249dd.

### React upstream changes

- https://github.com/facebook/react/pull/27641
- https://github.com/facebook/react/pull/27661
- https://github.com/facebook/react/pull/27640
- https://github.com/facebook/react/pull/27595
- https://github.com/facebook/react/pull/27600
- https://github.com/facebook/react/pull/27598
- https://github.com/facebook/react/pull/27590
- https://github.com/facebook/react/pull/27606
- https://github.com/facebook/react/pull/27608
- https://github.com/facebook/react/pull/27601
- https://github.com/facebook/react/pull/27616
- https://github.com/facebook/react/pull/27615
- https://github.com/facebook/react/pull/27614
- https://github.com/facebook/react/pull/27599
- https://github.com/facebook/react/pull/27597
- https://github.com/facebook/react/pull/27525
- https://github.com/facebook/react/pull/27571


Updates @types/react to 18.2.37
Updates @types/react-dom to 18.2.15
2023-11-07 23:55:06 +00:00
vercel-release-bot
0697be3b57 v14.0.2-canary.19 2023-11-07 23:24:29 +00:00
Donny/강동윤
c370c179b5
build: Update swc_core to v0.86.40 and update turbopack (#57904)
### What?

* https://github.com/vercel/turbo/pull/6286 
* https://github.com/vercel/turbo/pull/6367 
* https://github.com/vercel/turbo/pull/6354 
* https://github.com/vercel/turbo/pull/6343 

---

 - Update `swc_core` to `v0.86.40`

 - Revert #56281 and fix `node-fetch` by disabling inlining
   - Use `inline: 2` instead of `keep_fnames: true`

### Why?

`keep_fnames` increases the bundle size too much.

### How?

 - Fixes #56612

 - Fixes #57886 

 - Fixes #55682 (by https://github.com/swc-project/swc/pull/8205)

 - Reverts #56281


 - Closes PACK-1902
2023-11-07 15:26:28 +00:00
Tim Neutkens
b091869f29
Revert "Revert "Add retry for fetching subsetted Google Fonts"" (#58075)
Reverts vercel/next.js#57154

Brings back the changes but uses the compiled version of async-retry instead. Previously these changes causes an error as async-retry wasn't installed.
2023-11-07 11:54:11 +00:00
vercel-release-bot
ded28edeae v14.0.2-canary.18 2023-11-07 04:46:46 +00:00
vercel-release-bot
d95900c7b0 v14.0.2-canary.17 2023-11-07 00:44:19 +00:00
vercel-release-bot
3eaa96fff6 v14.0.2-canary.16 2023-11-06 23:21:39 +00:00
vercel-release-bot
c29c039cf3 v14.0.2-canary.15 2023-11-06 20:56:03 +00:00
vercel-release-bot
38e8b523dc v14.0.2-canary.14 2023-11-06 17:08:35 +00:00
Tobias Koppers
883ab22157
update turbopack (#58080)
* https://github.com/vercel/turbo/pull/6325 <!-- OJ Kwon - build(cargo):
skip external build script with rust-analyzer -->
* https://github.com/vercel/turbo/pull/6318 <!-- OJ Kwon -
feat(turbopack-ecmascript): calculate import.meta.url as an absolute
path -->
* https://github.com/vercel/turbo/pull/6359 <!-- Will Binns-Smith -
Turbopack: Defer calculating source positions until needed -->
* https://github.com/vercel/turbo/pull/6274 <!-- Tobias Koppers - add
backtrace for trait calls -->
* https://github.com/vercel/turbo/pull/6305 <!-- Tobias Koppers - Triple
chunk size heuristic -->
* https://github.com/vercel/turbo/pull/6304 <!-- Tobias Koppers -
improve resolving performance -->
2023-11-06 18:05:13 +01:00
vercel-release-bot
31c2f976cd v14.0.2-canary.13 2023-11-05 23:23:20 +00:00
vercel-release-bot
8536ad98dd v14.0.2-canary.12 2023-11-04 23:21:06 +00:00
vercel-release-bot
d0ac7c2f45 v14.0.2-canary.11 2023-11-03 23:22:55 +00:00
vercel-release-bot
ffdfd33251 v14.0.2-canary.10 2023-11-03 12:13:32 +00:00
Thomas Knickman
348c550120
feat(turbo): use turbo gen instead of plop (#53684)
### What?

Use [Turborepo generators](https://turbo.build/repo/docs/core-concepts/monorepos/code-generation#custom-generators) instead of plop. 

Turborepo generators are built on top of plop, but include some additional tooling to make working in monorepos easier. It also supports zero config typescript for configs. 

### Why?
Same Team!

### How?
Ported the existing plopfile to a turbo generator config


Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-11-03 01:25:18 +00:00
vercel-release-bot
8014866cac v14.0.2-canary.9 2023-11-02 23:21:41 +00:00
vercel-release-bot
f979341f82 v14.0.2-canary.8 2023-11-02 20:34:16 +00:00
vercel-release-bot
ad55d78199 v14.0.2-canary.7 2023-11-02 19:59:43 +00:00
vercel-release-bot
1c5d7782a0 v14.0.2-canary.6 2023-11-01 23:21:29 +00:00
vercel-release-bot
b0509ed53a v14.0.2-canary.5 2023-11-01 13:30:21 +00:00
vercel-release-bot
0f98dccff7 v14.0.2-canary.4 2023-11-01 13:02:40 +00:00
vercel-release-bot
c0baa0ac23 v14.0.2-canary.3 2023-11-01 02:30:21 +00:00
Zack Tanner
c82f6a83ef
Update React from 0c6348758 to 08a39539f (#57852)
Updates React from 0c6348758 to 08a39539f.

### React upstream changes

- https://github.com/facebook/react/pull/27634
- https://github.com/facebook/react/pull/27632
2023-11-01 02:22:59 +00:00
vercel-release-bot
e0cf4e2ebd v14.0.2-canary.2 2023-10-31 23:22:41 +00:00
Jimmy Lai
e3e95b30e5
chore: update otel (#57774)
bumping the vendored otel package
2023-10-31 18:46:38 +00:00
vercel-release-bot
033ba46f56 v14.0.2-canary.1 2023-10-31 09:34:35 +00:00
vercel-release-bot
5eb6607279 v14.0.2-canary.0 2023-10-30 23:23:45 +00:00
vercel-release-bot
4df888a55f v14.0.1 2023-10-30 19:21:25 +00:00
vercel-release-bot
41dec2cbd6 v14.0.1-canary.5 2023-10-30 18:37:29 +00:00
Josh Story
e26c9011d6
Update React from 8c8ee9ee6 to 0c6348758 and types (#57772)
Update React from 8c8ee9ee6 to 0c6348758

- https://github.com/facebook/react/pull/27627
- https://github.com/facebook/react/pull/27624
- https://github.com/facebook/react/pull/27610
- https://github.com/facebook/react/pull/27592
- https://github.com/facebook/react/pull/27593
- https://github.com/facebook/react/pull/27588
- https://github.com/facebook/react/pull/27591
- https://github.com/facebook/react/pull/27587

Update @types/react to 18.2.33
Update @types/react-dom to 18.2.14
2023-10-30 11:31:38 -07:00
vercel-release-bot
9d49afc5ea v14.0.1-canary.4 2023-10-30 17:29:15 +00:00
vercel-release-bot
fc1ecc407c v14.0.1-canary.3 2023-10-29 23:22:02 +00:00
vercel-release-bot
54a9da0a1e v14.0.1-canary.2 2023-10-28 23:21:43 +00:00
vercel-release-bot
c70506de77 v14.0.1-canary.1 2023-10-27 23:22:34 +00:00
vercel-release-bot
6a63c4ffeb v14.0.1-canary.0 2023-10-26 23:22:39 +00:00
vercel-release-bot
b546d8b22c v14.0.0 2023-10-26 16:04:54 +00:00
vercel-release-bot
356dc42f1a v13.5.7-canary.37 2023-10-26 12:34:50 +00:00
vercel-release-bot
fc1b6c4742 v13.5.7-canary.36 2023-10-26 11:42:38 +00:00
vercel-release-bot
c7d02f48b2 v13.5.7-canary.35 2023-10-26 08:44:45 +00:00
Tobias Koppers
936b953eda
update turbopack (#57487)
* https://github.com/vercel/turbo/pull/6290 <!-- Tobias Koppers - fix
hmr client to be actually reliable -->

Closes WEB-1887

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 10:39:33 +02:00
vercel-release-bot
a9fc27a8e5 v13.5.7-canary.34 2023-10-26 07:19:26 +00:00
Tobias Koppers
581b1be064
update turbopack (#57485)
* https://github.com/vercel/turbo/pull/6289 <!-- Tobias Koppers - Revert
"normalize pattern correctly to avoid slow path in matching" -->

Closes WEB-1885
2023-10-26 09:13:00 +02:00
Andrew Clark
00df11b0a7
Update React from a9985529f to 8c8ee9ee6 (#57483)
React upstream changes:

- https://github.com/facebook/react/pull/27594
- https://github.com/facebook/react/pull/27584

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-26 07:10:27 +00:00
vercel-release-bot
abb34da8bd v13.5.7-canary.33 2023-10-26 06:19:34 +00:00
Tobias Koppers
7c3511cd99
update turbopack (#57469)
* https://github.com/vercel/turbo/pull/6268 <!-- Maia Teegarden - Update
Turbopack Docs -->
* https://github.com/vercel/turbo/pull/6278 <!-- Anthony Shew - Clearer
Remote Cache upload spinner message. -->
* https://github.com/vercel/turbo/pull/6288 <!-- Tobias Koppers -
normalize pattern correctly to avoid slow path in matching -->

Closes WEB-1877
2023-10-26 07:41:16 +02:00
vercel-release-bot
0127fc75a1 v13.5.7-canary.32 2023-10-26 05:27:36 +00:00
vercel-release-bot
18d797e3fd v13.5.7-canary.31 2023-10-26 04:47:54 +00:00
vercel-release-bot
668820100a v13.5.7-canary.30 2023-10-26 03:34:50 +00:00
vercel-release-bot
b27aa57908 v13.5.7-canary.29 2023-10-26 01:57:13 +00:00
vercel-release-bot
1df027f46e v13.5.7-canary.28 2023-10-26 01:01:59 +00:00
vercel-release-bot
7274296681 v13.5.7-canary.27 2023-10-25 20:35:14 +00:00
Josh Story
fcc28999bf
Update React from b8e47d988 to a9985529f. (#57442)
React upstream changes:

- https://github.com/facebook/react/pull/27586
- https://github.com/facebook/react/pull/27577
- https://github.com/facebook/react/pull/27576

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-25 13:29:47 -07:00
vercel-release-bot
2b400f8fc3 v13.5.7-canary.26 2023-10-25 20:06:39 +00:00
Tobias Koppers
5f0cfd41be
update turbopack (#57420)
* https://github.com/vercel/turbo/pull/6269 <!-- Tobias Koppers - Upload
data even for non-scheduled runs -->
* https://github.com/vercel/turbo/pull/6270 <!-- Tobias Koppers - Put
ESM in strict mode -->

Closes WEB-1855

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-25 21:53:31 +02:00
vercel-release-bot
1d8764cd1b v13.5.7-canary.25 2023-10-24 23:22:49 +00:00
vercel-release-bot
2b2ad9c7c4 v13.5.7-canary.24 2023-10-24 22:05:40 +00:00
vercel-release-bot
2fc2a52652 v13.5.7-canary.23 2023-10-24 08:22:51 +00:00
vercel-release-bot
c77fec827f v13.5.7-canary.22 2023-10-24 05:34:15 +00:00
Tobias Koppers
a929bf7c04
update turbopack and add HMR test case (#57304)
### What?

adds a test case for HMR, which is fixed by the turbopack update

### Why?

### How?

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6245 
* https://github.com/vercel/turbo/pull/6212 
* https://github.com/vercel/turbo/pull/6255 
* https://github.com/vercel/turbo/pull/6259 
* https://github.com/vercel/turbo/pull/6261 
* https://github.com/vercel/turbo/pull/6260 

Closes WEB-1836
2023-10-24 04:38:05 +00:00
vercel-release-bot
96337342e4 v13.5.7-canary.21 2023-10-24 03:58:21 +00:00
vercel-release-bot
dc7b5d806e v13.5.7-canary.20 2023-10-24 00:35:28 +00:00
vercel-release-bot
7c803a762e v13.5.7-canary.19 2023-10-23 23:24:21 +00:00
Andrew Clark
a77acd22ad
Update React from d803f519e to b8e47d988 (#57296)
React upstream changes:

- https://github.com/facebook/react/pull/27570
- https://github.com/facebook/react/pull/27569
- https://github.com/facebook/react/pull/27550
- https://github.com/facebook/react/pull/27559
- https://github.com/facebook/react/pull/27552
- https://github.com/facebook/react/pull/27504
- https://github.com/facebook/react/pull/27522




Co-authored-by: Josh Story <2716369+gnoff@users.noreply.github.com>
2023-10-23 22:58:50 +00:00
vercel-release-bot
8fb5c8517f v13.5.7-canary.18 2023-10-23 22:17:01 +00:00
vercel-release-bot
799e6ca65a v13.5.7-canary.17 2023-10-23 18:13:11 +00:00
vercel-release-bot
dc88b413f8 v13.5.7-canary.16 2023-10-23 03:07:00 +00:00
Donny/강동윤
652a553a13
Update swc_core to v0.86.10 (#57121)
### What?

Update SWC crates. This PR fixes a regression of `swc_core`.
The important PR: https://github.com/swc-project/swc/pull/8153

### Why?

There was a regression in `swc_core`.

### How?

-  Fixes #56408

Closes WEB-1811

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-23 05:01:31 +02:00
Tobias Koppers
b64c0426bc
update turbopack (#57176)
* https://github.com/vercel/turbo/pull/6241 <!-- Tobias Koppers - make
the daily ci faster -->
* https://github.com/vercel/turbo/pull/6242 <!-- Justin Ridgewell - Add
caching to `chunk_content`'s graph walking -->
* https://github.com/vercel/turbo/pull/6228 <!-- Tobias Koppers - Reduce
resolve and resolving tasks -->
* https://github.com/vercel/turbo/pull/6244 <!-- Tobias Koppers - avoid
cloning list -->
* https://github.com/vercel/turbo/pull/6246 <!-- Tobias Koppers - fix
symlink handling -->

Closes WEB-1819
2023-10-23 02:42:29 +02:00
vercel-release-bot
2762511796 v13.5.7-canary.15 2023-10-22 23:22:41 +00:00
vercel-release-bot
e5c082418d v13.5.7-canary.14 2023-10-21 23:23:17 +00:00
Leah
0d2edbb23f
chore: move layer from chunking context to asset context (#57149)
The asset context is a better place to store the layer, because it's
affected by transitions unlike the chunking context

This PR also removes a bunch of unused code

### Why?

See https://github.com/vercel/turbo/pull/6237 for the rationale
Also needs to wait for that PR to be merged

Closes NEXT-1814

#### Turbopack Changes
* https://github.com/vercel/turbo/pull/6237 <!-- Leah - chore: move
layer from chunking context to asset context -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-10-21 02:05:00 +02:00
vercel-release-bot
d0a1199a36 v13.5.7-canary.13 2023-10-20 23:23:41 +00:00
Steven
4d31506960
Revert "Add retry for fetching subsetted Google Fonts" (#57154)
Reverts vercel/next.js#56583 due to missing dependency

```
app/layout.jsx
An error occured in 'next/font'.
Error: Cannot find module 'async-retry'
Require stack:
- node_modules/•pnpm/next@13.5.7-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@next/font/dist/google/retry.js
- node_modules/-pnpm/next@13.5.7-canary-12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js
```
2023-10-20 22:14:24 +00:00
Balázs Orbán
2277797dc2
chore: drop form-data (#57141)
### What?

Dropping `form-data` polyfill as Node.js 18+ versions all expose it on `globalThis`

### Why?

Reduce the amount of shipped code in Next.js

### How?

Similar to #56899

See: https://nodejs.org/docs/latest-v18.x/api/globals.html#class-formdata
2023-10-20 19:25:42 +00:00
Tobias Koppers
4a75e71d25
prefer Option<Vc<IssueSource>> over Vc<OptionIssueSource> (#57104)
### What?

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

### Why?

### How?


Closes WEB-1808
2023-10-20 18:06:23 +00:00
Josh Story
920a7e8ba6
Update React from a41957507 to d803f519e (#57015)
## React upstream Changes

- https://github.com/facebook/react/pull/27542
- https://github.com/facebook/react/pull/27551
- https://github.com/facebook/react/pull/27537
- https://github.com/facebook/react/pull/27549
- https://github.com/facebook/react/pull/27544
- https://github.com/facebook/react/pull/27543
- https://github.com/facebook/react/pull/27541
- https://github.com/facebook/react/pull/27538
- https://github.com/facebook/react/pull/27536
2023-10-20 17:42:27 +00:00
vercel-release-bot
2b60475c2b v13.5.7-canary.12 2023-10-20 17:19:41 +00:00
berlysia
c84f5ed794
Add retry for fetching subsetted Google Fonts (#56583)
### What?
Add the same re-retrieval process for subseted font files of Google Font as for CSS files.

+ make use of [async-retry](https://github.com/vercel/async-retry)

### Why?
It was reported in #45080 that Japanese fonts such as Noto Sans JP were frequently `Failed to fetch`.
A retry process was added in #51890, but it did not resolve the issue completely ( https://github.com/vercel/next.js/pull/51890#issuecomment-1614558064 ).

Here is my reproduction code with 13.5.5-canary.4 (please run locally).
https://stackblitz.com/edit/stackblitz-starters-n8zxlq?file=app%2Fpage.tsx

<details>
<summary>And my local error log is here(folded)</summary>

```
$ npm run -- dev

> nextjs@0.1.0 dev
> next dev

 ⚠ Port 3000 is in use, trying 3001 instead.
  ▲ Next.js 13.5.5-canary.4
  - Local:        http://localhost:3001

 ✓ Ready in 23.9s
 ○ Compiling /page ...
FetchError: request to https://fonts.gstatic.com/s/notosansjp/v52/-F6jfjtqLzI2JPCgQBnw7HFyzSD-AsregP8VFBEj757Y0rw_qMHVdbR2L8Y9QTJ1LwkRmR5GprQAe69m.4.woff2 failed, reason: 
    at ClientRequest.<anonymous> (/mnt/c/Users/berlysia/Downloads/stackblitz-starters-n8zxlq/node_modules/next/dist/compiled/node-fetch/index.js:1:65756)
    at ClientRequest.emit (node:events:514:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:514:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}
 ⨯ Failed to download `Noto Sans JP` from Google Fonts. Using fallback font instead.

Failed to fetch `Noto Sans JP` from Google Fonts.}
FetchError: request to https://fonts.gstatic.com/s/notosansjp/v52/-F6jfjtqLzI2JPCgQBnw7HFyzSD-AsregP8VFBEj757Y0rw_qMHVdbR2L8Y9QTJ1LwkRmR5GprQAe69m.28.woff2 failed, reason: 
    at ClientRequest.<anonymous> (/mnt/c/Users/berlysia/Downloads/stackblitz-starters-n8zxlq/node_modules/next/dist/compiled/node-fetch/index.js:1:65756)
    at ClientRequest.emit (node:events:514:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:514:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}
...(15 errors emitted)
```
</details>

I've found that the issue is not limited to fetching CSS, fetching subset font files is also failing.
By adding retry handling to the fetch of individual subseted font files as well, I (almost) never see `Failed to fetch` anymore.

The issue tends to become more apparent when downloading a larger number of subsetted fonts.
This suggests that the problem is more likely to occur with larger fonts, such as those designed for CJK languages.

### How?
Add the same re-retrieval process for subseted font files of Google Font as for CSS files.


Related to #51890 #53239 #45080 #53279
2023-10-20 17:10:53 +00:00
Jiachi Liu
5d6592d895
Upgrade edge-runtime/cookies (#57124)
Backport fix on 13.5.6 to canary

x-ref: #57021
2023-10-20 13:56:04 +00:00
vercel-release-bot
e437f72662 v13.5.7-canary.11 2023-10-19 23:22:57 +00:00
vercel-release-bot
143d79f733 v13.5.7-canary.10 2023-10-19 22:41:38 +00:00
vercel-release-bot
ed6b60c55a v13.5.7-canary.9 2023-10-19 19:15:58 +00:00
Jiachi Liu
a6aae865c4
Bump packages version to match canary versions (#57071)
We released 13.5.6 as stable patch, need to bump the canary version
higher than stable to match the semantics
2023-10-19 12:09:06 -07:00
Balázs Orbán
4c46ddd92a
chore: drop undici (#56899)
### What?

Note: This is not a breaking change, just removing some unused code.

### Why?

Since #56896 we don't need this, as Node.js 18+ has `fetch` exposed by default.

### How?

Depends on #56896, #56909

We already didn't load `fetch` if `globalThis` had it (ie. Node.js 18+ environments), and since we are dropping support for Node.js 16, these code paths should have no effect on runtime behavior.
2023-10-19 18:35:12 +00:00
Balázs Orbán
33db463fe4
chore: upgrade jest (#56909)
### What?

Upgrade jest to its latest version

### Why?

#56899 fails because historically Jest stripped the globals in Node.js, but 28+ isn't doing that anymore. If we upgrade, we don't have to keep track of Node.js globals and when they are added. This will be useful in removing even more polyfills for things that are natively shipped in Node.js now.

### How?

Jest 29 introduced a change to the snapshot format: https://jestjs.io/blog/2022/08/25/jest-29

First, I tried setting the old compat option to not require updating snapshots, but some tests were still failing: https://dev.azure.com/nextjs/next.js/_build/results?buildId=70633&view=logs&j=8af7cf9c-43a1-584d-6f5c-57bad8880974&t=7ae70e63-3625-50f4-6764-5b3e72b4bd7a&l=273 So going through the pain now instead.
2023-10-19 17:38:24 +00:00
vercel-release-bot
dc7bc70d4d v13.5.6-canary.8 2023-10-19 16:49:59 +00:00
vercel-release-bot
4c2b34ea7c v13.5.6-canary.7 2023-10-18 23:24:25 +00:00
vercel-release-bot
2c8606e596 v13.5.6-canary.6 2023-10-18 06:59:43 +00:00
Zack Tanner
975c999451
Update React from 09fbee89d to a41957507 (#56970)
Update React from from 09fbee89d to a41957507.

### React upstream changes

- https://github.com/facebook/react/pull/27472
- https://github.com/facebook/react/pull/27512
- https://github.com/facebook/react/pull/27509
- https://github.com/facebook/react/pull/27517
- https://github.com/facebook/react/pull/27523
- https://github.com/facebook/react/pull/27516
- https://github.com/facebook/react/pull/27505
2023-10-18 01:15:55 +00:00
vercel-release-bot
318cbbf9b1 v13.5.6-canary.5 2023-10-17 23:22:33 +00:00
vercel-release-bot
f19dabbc6d v13.5.6-canary.4 2023-10-17 21:22:19 +00:00
vercel-release-bot
df1d4a16aa v13.5.6-canary.3 2023-10-17 16:36:35 +00:00
vercel-release-bot
ee9bee96af v13.5.6-canary.2 2023-10-17 13:26:58 +00:00
Donny/강동윤
4b3dfdaa95
build: Update swc_core to v0.86.1 (#56770)
### What?

Update SWC crates, to apply bugfixes.

### Why?

We adjusted the mangling option to make it identical with `swcMinify:
false` with https://github.com/vercel/next.js/pull/56281, and it
revealed some bugs of the name mangler of the SWC minifier.

### How?


 - Fixes #56550
 - Fixes #56614

 - Turbopack counterpart: https://github.com/vercel/turbo/pull/6171

### Other Turbopack Changes

* https://github.com/vercel/turbo/pull/6177 <!-- Tim Neutkens - Add
support for FreeVarReference::Error -->
* https://github.com/vercel/turbo/pull/6180 <!-- Tobias Koppers - fix
chunk loading in build runtime -->
* https://github.com/vercel/turbo/pull/6191 <!-- Justin Ridgewell -
Deduplicate referenced_output_assets -->
* https://github.com/vercel/turbo/pull/6171 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.86.1` -->

Closes WEB-1775

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-10-17 15:19:28 +02:00
Mateusz Burzyński
db214214d6
Update Babel dependencies (#51962)
### What?

Update Babel packages across the board

### Why?

Since you ship vendored presets and plugins it's impossible for people to update this stuff at their own pace - independently from Next. So users of `next/babel` are currently stuck with old versions and, for example, they might not be able to use the TS `satisfies` operator.

### How?

I just updated ranges (to pinned ones) where I could find them, run `corepack pnpm i` and re-run build scripts in the `packages/next`.

Fixes #43799
2023-10-17 02:25:57 +00:00
Juan Martín Seery
308a327923
feat(env): upgrade dotenv (#38481)
Upgraded dotenv to v16. Breaking changes are:

- Multiline parsing support
- Support inline comments
- Backtick support

[See their changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-10-17 00:57:51 +00:00
vercel-release-bot
24a146680f v13.5.6-canary.1 2023-10-16 23:24:30 +00:00
Josh Story
0a80017d03
Update React from d900fadbf to 09fbee89d. Removes server context and experimental prefix for server action APIs (#56809)
The latest React canary builds have a few changes that need to be
adopted for compatability.

1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the
`formData` opiont in `react-dom/server` are no longer prefixed with
`experimental_`
2. server content (an undocumented React feature) has been removed. Next
only had trivial intenral use of this API and did not expose a coherent
feature to Next users (no ability to seed context on refetches). It is
still possible that some users used the React server context APIs which
is why this should go into Next 14.

### React upstream changes

- https://github.com/facebook/react/pull/27513
- https://github.com/facebook/react/pull/27514
- https://github.com/facebook/react/pull/27511
- https://github.com/facebook/react/pull/27508
- https://github.com/facebook/react/pull/27502
- https://github.com/facebook/react/pull/27474
- https://github.com/facebook/react/pull/26789
- https://github.com/facebook/react/pull/27500
- https://github.com/facebook/react/pull/27488
- https://github.com/facebook/react/pull/27458
- https://github.com/facebook/react/pull/27471
- https://github.com/facebook/react/pull/27470
- https://github.com/facebook/react/pull/27464
- https://github.com/facebook/react/pull/27456
- https://github.com/facebook/react/pull/27462
- https://github.com/facebook/react/pull/27461
- https://github.com/facebook/react/pull/27460
- https://github.com/facebook/react/pull/27459
- https://github.com/facebook/react/pull/27454
- https://github.com/facebook/react/pull/27457
- https://github.com/facebook/react/pull/27453
- https://github.com/facebook/react/pull/27401
- https://github.com/facebook/react/pull/27443
- https://github.com/facebook/react/pull/27445
- https://github.com/facebook/react/pull/27364
- https://github.com/facebook/react/pull/27440
- https://github.com/facebook/react/pull/27436

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-16 15:46:10 -07:00
vercel-release-bot
3c7d15b992 v13.5.6-canary.0 2023-10-16 22:04:56 +00:00
vercel-release-bot
54145b49f9 v13.5.5 2023-10-16 14:54:10 +00:00
vercel-release-bot
1609da2d95 v13.5.5-canary.19 2023-10-16 13:44:03 +00:00
vercel-release-bot
c1c419fde0 v13.5.5-canary.18 2023-10-16 12:28:32 +00:00
Kiko Beats
8f2fd2e7d5
bump: edge-runtime (#56856)
It bumps Edge Runtime to include the latest fixes, such as:

- https://github.com/vercel/edge-runtime/pull/622
- https://github.com/vercel/edge-runtime/pull/640

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-16 09:08:44 +02:00
vercel-release-bot
e5ad069c6a v13.5.5-canary.17 2023-10-15 23:22:55 +00:00
Balázs Orbán
b660eef8a2
chore: bump undici (#56851) 2023-10-14 23:45:02 +00:00
vercel-release-bot
297efa7bc9 v13.5.5-canary.16 2023-10-14 23:22:14 +00:00
vercel-release-bot
46d56c6bca v13.5.5-canary.15 2023-10-13 23:22:28 +00:00
vercel-release-bot
f3973d84a5 v13.5.5-canary.14 2023-10-13 22:44:36 +00:00
vercel-release-bot
f95a11f804 v13.5.5-canary.13 2023-10-13 16:34:44 +00:00
vercel-release-bot
489a528003 v13.5.5-canary.12 2023-10-13 13:23:54 +00:00
Tobias Koppers
a40a350155
Chunking Refactoring followup fixes (#56789)
### What?

fix some minor bugs
Make the page-loader reuse the client chunks

Closes WEB-1777
2023-10-13 12:38:59 +00:00
Tobias Koppers
04bad16bf4
Turbopack: Chunking Refactoring (#56756)
### What?

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

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6116 
* https://github.com/vercel/turbo/pull/6140 
* https://github.com/vercel/turbo/pull/6118 
* https://github.com/vercel/turbo/pull/6128 
* https://github.com/vercel/turbo/pull/6129 
* https://github.com/vercel/turbo/pull/6160 


Closes WEB-1772

Co-authored-by: Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
2023-10-13 11:44:44 +00:00
vercel-release-bot
e0cd06531b v13.5.5-canary.11 2023-10-12 23:23:04 +00:00
vercel-release-bot
f306108b37 v13.5.5-canary.10 2023-10-12 23:09:37 +00:00
vercel-release-bot
8013ef7372 v13.5.5-canary.9 2023-10-12 17:27:01 +00:00
Jimmy Lai
62ab0e33a2
ci: add job summary to the test suite runs (#56742)
This PR adds Github Actions summaries to the test suite that runs in the CI so that you can easily visualise which tests failed + what the relevant log was instead of parsing the logs yourself.

Example here https://github.com/vercel/next.js/actions/runs/6495658699

![CleanShot 2023-10-12 at 14 57 32@2x](https://github.com/vercel/next.js/assets/11064311/7d65496b-6e28-460a-8bef-3f2e91266d00)
2023-10-12 13:57:09 +00:00
vercel-release-bot
7d8cf1f9f3 v13.5.5-canary.8 2023-10-12 00:58:02 +00:00
vercel-release-bot
ec0a8dac03 v13.5.5-canary.7 2023-10-11 13:05:55 +00:00
vercel-release-bot
e8048b9974 v13.5.5-canary.6 2023-10-11 04:25:10 +00:00
vercel-release-bot
1b7895e0a4 v13.5.5-canary.5 2023-10-10 16:04:34 +00:00
Tim Neutkens
c60ecfcc1c
Ensure react-server-dom-turbopack-experimental uses the right package (#56560)
Was investigating why Turbopack with `serverActions: true` sometimes
crashes with a webpack specific error. Found it wasn't using the right
package.

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

-->
2023-10-07 19:37:58 +02:00
vercel-release-bot
78b91243dd v13.5.5-canary.4 2023-10-06 15:46:54 +00:00
Justin Ridgewell
c6f5089ef2
turbopack: Extract as_chunk into shared ChunkType trait (#56506)
### What?

Step 3 in our chunking refactors extracts ChunkItem::as_chunk into a new ChunkType trait. This new trait isn't useful yet, but will eventually allow us to collect ChunkItems of a similar type into a lists, and perform chunking over all similar items at once.

### Why?

In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

https://github.com/vercel/turbo/pull/6123

Re: https://github.com/vercel/next.js/pull/56504

Closes WEB-1724

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-10-06 15:28:57 +00:00
vercel-release-bot
5aca71cfa6 v13.5.5-canary.3 2023-10-06 12:00:47 +00:00
Tobias Koppers
c95e4b7841
update turbopack, fix sass peer dependency (#56508)
* https://github.com/vercel/turbo/pull/6076 <!-- Tobias Koppers -
Performance Improvements (5) !-->

Closes WEB-1725
2023-10-06 10:59:43 +02:00
Justin Ridgewell
2af1e784c2
turbopack: Chunking Refactor Step 2 (#56504)
### What?

The second step in our chunking refactoring, this removes our use of Module::as_chunk and Module::as_root_chunk. Instead, the only way to generate a chunk is directly from a root ChunkItem.

### Why?

In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

https://github.com/vercel/turbo/pull/6120

Re: https://github.com/vercel/next.js/pull/56467
Closes WEB-1721

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-10-06 06:29:14 +00:00
Tobias Koppers
666ce7bd8b
Chunking Refactor Step 1 (#56467)
### What?

This change moves a few methods around.

Module::as_chunk is moved to ChunkItem::as_chunk as temporary intermediate state.
EcmascriptPlaceable::as_chunk_item is moved to ChunkableModule::as_chunk_item. This generalizes the concept of converting a Module into a ChunkItem


### Why?

This is the first step of refactoring the chunking. In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

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

Closes WEB-1715

Co-authored-by: Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
2023-10-05 20:05:05 +00:00
Sukka
d21025cc3a
refactor: rewrite config schema in zod (#56383)
The PR supersedes the https://github.com/vercel/next.js/pull/53150, which is way too outdated, has way too many conflicts, and also heavily relies on GitHub Copilot (which makes the progress slow and tedious).

The PR uses [`json-schema-to-zod`](https://github.com/StefanTerdell/json-schema-to-zod) (instead of the GitHub Copilot) to generate the zod schema, and manually replaces all generated `z.customRefine` with my hand-written zod schema.

TODO:

- [x] Convert schema
- [x] Reduce `z.any()` usage
- [x] Create human-readable errors from the `ZodError`
- [x] Update test cases to reflect the latest error message

-----

The benefit of using zod over ajv:

- Easier maintenance: zod schema is straightforward to compose.
- Better typescript support: config schema now strictly reflects the `NextConfig` type.
- Smaller installation size: by replacing `ajv` and `@segment/ajv-human-errors` w/ `zod`, I am able to reduce installation size by 114 KiB.
- Better Extension: the zod error message is easy to customize.

-----

In the previous PR https://github.com/vercel/next.js/pull/56083, @feedthejim replaces `zod` w/ `superstruct`. `superstruct` is lightweight and fast, which makes it perfect for creating simple schemas for RSC payload. But, this also means `superstruct` has its limitations compared to `zod`:

- `superstruct`'s syntax is different, and some utilities's usage is counter-intuitive:
  - `z.array(z.string()).gt(1)` vs `s.size(s.array(s.string()), 1)`
  - `z.numer().gt(1)` vs `s.size(s.number(), 1)`, `s.min(s.number(), 1)`
  - `z.boolean().optional().nullable()` vs `s.nullable(s.optional(z.boolean()))`
- `superstruct` has weaker TypeScript support and worse DX compared to `zod` when composing huge schema:
  - `zod.ZodType + z.object()` can provide a more detailed type mismatch message on which specific property is the culprit, while `Describe + s.object()` provides almost no information at all.
- `zod`'s schema is more powerful
  - `z.function()` supports `z.args()` and `z.returns()`, while `superstruct` only has `s.func()`
  - zod also has Promise type `z.promise()` and intersection type `z.and()`
- `superstruct`'s error is harder to parse compared to `zod`'s `ZodError` 

So in the PR, I re-introduced `zod` for `next.config.js` validation.
2023-10-05 15:46:53 +00:00
vercel-release-bot
400c679791 v13.5.5-canary.2 2023-10-04 19:01:01 +00:00
vercel-release-bot
28767ad96a v13.5.5-canary.1 2023-10-04 13:17:50 +00:00
Josh Story
09b0ca42fb
App Router - preinitialize chunks during SSR (#54752)
Today when we hydrate an SSR'd RSC response on the client we encounter import chunks which initiate code loading for client components. However we only start fetching these chunks after hydration has begun which is necessarily after the initial chunks for the entrypoint have loaded.

React has upstream changes that need to land which will preinitialize the rendered chunks for all client components used during the SSR pass. This will cause a `<script async="" src... />` tag to be emitted in the head for each chunk we need to load during hydration which allows the browser to start fetching these resources even before the entrypoint has started to execute.

Additionally the implementation for webpack and turbopack is different enough that there will be a new `react-server-dom-turbopack` package in the React repo which should be used when using Turbopack with Next.

This PR also removes a number of patches to React src that proxy loading (`__next_chunk_load__`) and bundler requires (`__next_require__`) through the `globalThis` object. Now the react packages can be fully responsible for implementing chunk loading and all Next needs to do is supply the necessary information such as chunk prefix and crossOrigin attributes necessary for this loading. This information is produced as part of the client-manifest by either a Webpack plugin or Turbopack.

Additionally any modifications to the chunk filename that were previously done at runtime need to be made in the manifest itself now. This means we need to encode the deployment id for skew protection and encode the filename to make it match our static path matching (and resolutions on s3) when using `[` and `]` segment characters.

There are a few followup items to consider in later PRs
1. we currently bundle a node and edge version of react-server-dom-webpack/client. The node version has an implementation for busboy whereas the edge version does not. Next is currently configured to use busboy when handling a fetch action sent as multipart with a node runtime. Ideally we'd only bundle the one platform we are buliding for but some additional refactoring to support better forking is possibly required here

This PR also updates react from 09285d5a7 to d900fadbf.

### React upstream changes

- https://github.com/facebook/react/pull/27439
- https://github.com/facebook/react/pull/26763
- https://github.com/facebook/react/pull/27434
- https://github.com/facebook/react/pull/27433
- https://github.com/facebook/react/pull/27424
- https://github.com/facebook/react/pull/27428
- https://github.com/facebook/react/pull/27427
- https://github.com/facebook/react/pull/27315
- https://github.com/facebook/react/pull/27314
- https://github.com/facebook/react/pull/27400
- https://github.com/facebook/react/pull/27421
- https://github.com/facebook/react/pull/27419
- https://github.com/facebook/react/pull/27418
2023-10-03 21:40:25 +00:00
vercel-release-bot
e34fdf2890 v13.5.5-canary.0 2023-10-03 21:23:02 +00:00
vercel-release-bot
1e8dca4a87 v13.5.4 2023-10-03 01:40:53 +00:00
vercel-release-bot
9e24d6ff3b v13.5.4-canary.11 2023-10-03 00:36:26 +00:00
vercel-release-bot
db48052a5e v13.5.4-canary.10 2023-10-02 23:23:48 +00:00
vercel-release-bot
033e8a5c87 v13.5.4-canary.9 2023-10-02 09:02:04 +00:00
Tobias Koppers
e043e1f1c6
update turbopack (#56285)
* https://github.com/vercel/turbo/pull/6062 
* https://github.com/vercel/turbo/pull/6061 
* https://github.com/vercel/turbo/pull/6045 

Closes WEB-1695
2023-10-02 07:38:44 +00:00
vercel-release-bot
489f7fda4b v13.5.4-canary.8 2023-09-29 22:28:11 +00:00
JJ Kasper
e78eee25c5
Add additional handling for experimental-compile (#56224)
This ensures we properly set the `isReady` flag when building with `experimental-compile` and enables our main app dir test suite to ensure we don't regress on it.
2023-09-29 22:11:45 +00:00
Balázs Orbán
61180cfc84
chore: bump postcss (#56225)
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-09-29 21:57:35 +00:00
Donny/강동윤
bf35b47bb4
Update swc_core to v0.83.28 (#56134)
### What?

 - Use better implementation for `react-remove-properties` and `remove-conosle`.

### Why?


I concluded `react-remove-properties` and `remove-conosle` deserve official plugins, so I promoted them.

 - https://github.com/swc-project/plugins/pull/213
 - https://github.com/swc-project/plugins/pull/215


### How?



 - Closes WEB-1638
 - Closes WEB-1633
 - Closes NEXT-1657
 - Closes #55679

---

# Turbopack changes


* https://github.com/vercel/turbo/pull/6003
2023-09-29 13:08:26 +00:00
vercel-release-bot
af3205637d v13.5.4-canary.7 2023-09-29 12:10:52 +00:00
Tobias Koppers
d75110529b
update turbopack (#56197)
* https://github.com/vercel/turbo/pull/6051 <!-- Tobias Koppers -
Performance Improvements (1) -->
* https://github.com/vercel/turbo/pull/6053 <!-- Tobias Koppers -
Performance Improvements (2) -->
* https://github.com/vercel/turbo/pull/6055 <!-- Tobias Koppers -
Performance Improvements (4) -->

Closes WEB-1684
2023-09-29 10:59:01 +02:00
Will Binns-Smith
741114adea
Turbopack: add support for an assetPrefix and basePath (#56058)
Depends on vercel/turbo#6036

This constructs a general asset prefix (depending on if basePath and/or assetPrefix is defined), and sets it on Next's and Turbopack's chunking context.

Test Plan: Use a `create-next-app` with corresponding Next.js PR and basePath and assetPrefix specified.

Tested:
- Browser (async) chunk loading
- Static asset loading on server and browser

Closes WEB-1666
2023-09-29 01:43:29 +00:00
vercel-release-bot
e18c9dde3f v13.5.4-canary.6 2023-09-28 15:00:44 +00:00
vercel-release-bot
49f646da14 v13.5.4-canary.5 2023-09-28 13:48:17 +00:00
Jimmy Lai
c2fd08063c
perf: replace zod with superstruct (#56083)
This PR replaces the usage of Zod in the App Router in favour of a smaller validation library. We don't use much of zod's more advanced capabilities so it doesn't make sense to import all of it on the server at the moment.

Also added some unit tests.

This results in a 44kb win, which will impact cold boot

Before:
<img width="594" alt="CleanShot 2023-09-27 at 13 34 09@2x" src="https://github.com/vercel/next.js/assets/11064311/43cc7687-947d-40a1-9e1e-c2a60caf53c0">
After:
<img width="564" alt="CleanShot 2023-09-27 at 13 34 48@2x" src="https://github.com/vercel/next.js/assets/11064311/c3d3f5d6-e1f6-4969-bd11-dcd191d34ce6">


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

-->
2023-09-28 11:05:36 +02:00
Tobias Koppers
cd70065bad
Fixes performance problems due to TaskScopes (#55721)
### What?

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

### Turobopack changes

* https://github.com/vercel/turbo/pull/6009 <!-- OJ Kwon - ci(workflow):
update test filter -->
* https://github.com/vercel/turbo/pull/6026 <!-- Will Binns-Smith -
Remove next-dev references and benchmarks -->
* https://github.com/vercel/turbo/pull/6038 <!-- Tim Neutkens - Remove
test-prod action -->
* https://github.com/vercel/turbo/pull/6039 <!-- Tim Neutkens - Fix
action dependency -->
* ~https://github.com/vercel/turbo/pull/6036~ <!-- Will Binns-Smith -
Turbopack: add support for an asset prefix (and basePath in Next.js) -->
* https://github.com/vercel/turbo/pull/5992 <!-- Tobias Koppers -
refactor TaskScopes to use an aggregation tree -->


Closes WEB-1622
2023-09-28 09:40:21 +02:00
vercel-release-bot
f5ac079e54 v13.5.4-canary.4 2023-09-27 23:17:38 +00:00
vercel-release-bot
2ff2c0b4b2 v13.5.4-canary.3 2023-09-27 21:43:46 +00:00
Steven
12c800e35c
chore: remove chalk in favor of picocolors (#55992)
Similar to PR https://github.com/vercel/next.js/pull/53115, this PR removes `chalk` in favor of `picocolors`
2023-09-27 21:00:52 +00:00
Will Binns-Smith
ad63effbc7
Remove unneeded next-dev js in next-core (#56039)
x-ref:
https://github.com/vercel/next.js/pull/55983#issuecomment-1734766241


Closes WEB-1661
2023-09-27 21:00:51 +02:00
vercel-release-bot
778a3c55cf v13.5.4-canary.2 2023-09-27 17:29:49 +00:00
Tobias Koppers
a751bbf642
Revert "Update swc_core to v0.83.26" (#56077)
Reverts vercel/next.js#55780

This should not merge this a Cargo.toml pointing to a branch

@kdy1 

Closes WEB-1669
2023-09-27 11:55:00 +02:00
Donny/강동윤
81d2926e19
Update swc_core to v0.83.26 (#55780)
### What?

 - Use better implementation for `react-remove-properties` and `remove-conosle`.

### Why?


I concluded `react-remove-properties` and `remove-conosle` deserve official plugins, so I promoted them.

 - https://github.com/swc-project/plugins/pull/213
 - https://github.com/swc-project/plugins/pull/215


### How?



 - Closes WEB-1638
 - Closes WEB-1633
 - Closes NEXT-1657
 - Closes #55679
2023-09-27 09:47:57 +00:00
Sukka
f3cb952873
fix(worker): pass env to build worker w/ config.experimental.workerThreads (#55257)
**TL; DR**

The PR updates the `jest-worker` to the latest `@27` (which is `jest-worker@27.5.1`) and pre-compile.

---

I use `config.experimental.workerThreads` for my personal website built with Next.js, and I noticed that the react alias (from `require-hook`) is not working, causing `react-dom-server-webpack/client.edge` to fail to resolve.

So I modify the `node_modules/next/dist/build/worker.js` in my personal website project folder to print `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT`:

<img width="761" alt="image" src="https://github.com/vercel/next.js/assets/40715044/f22d72f8-ffd4-49d0-831a-ee3bfd0513ca">

To my surprise, the `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT` prints `undefined` with `config.experimental.workerThreads: true`:

<img width="760" alt="image" src="https://github.com/vercel/next.js/assets/40715044/ad8add14-7ac3-45f5-8f1e-2fec18397410">

But If I disable worker threads with `config.experimental.workerThreads: false`, the `process.env.__NEXT_PRIVATE_PREBUNDLED_REACT` is passed down correctly.

So I dig a little deeper. It turns out to be an old issue of `jest-worker` and has been fixed in https://github.com/jestjs/jest/pull/12069 (in that PR, the custom `env` was passed down to `jest-worker`'s `forkOption`). The bugfix was released in `jest-worker@27.4.0`, but Next.js is still using `jest-worker@27.0.0-next.5`, hence the issue.
2023-09-27 04:41:26 +00:00
vercel-release-bot
e3a2805151 v13.5.4-canary.1 2023-09-26 13:31:19 +00:00
Shu Ding
974e41ccbb
Update vendored React (#56012)
### React upstream changes

- https://github.com/facebook/react/pull/27417
- https://github.com/facebook/react/pull/27408
- https://github.com/facebook/react/pull/27409
- https://github.com/facebook/react/pull/27405
- https://github.com/facebook/react/pull/27375
- https://github.com/facebook/react/pull/27407
- https://github.com/facebook/react/pull/27365
- https://github.com/facebook/react/pull/27399
- https://github.com/facebook/react/pull/27395
- https://github.com/facebook/react/pull/27394
- https://github.com/facebook/react/pull/27397
- https://github.com/facebook/react/pull/26992
- https://github.com/facebook/react/pull/27388
- https://github.com/facebook/react/pull/27373
- https://github.com/facebook/react/pull/27332
2023-09-26 12:39:09 +00:00
Will Binns-Smith
9ac463b218
Remove next-dev and its test suite and benchmarks (#55983)
We've rearchitected Next.js+Turbopack so Turbopack does not run
reimplement pieces of Next.js in its devserver. This:

- Removes the `next-dev` binary, which is no longer reachable through
`next --turbo`.
- Removes its test suite, as much of it is tested (and often more
thoroughly) by the Next.js test suite
- Removes its benchmark suite, which should be covered by
`Turbopack-bench` by
https://github.com/vercel/turbo/tree/main/crates/turbopack-bench

Test Plan: CI


Closes WEB-1652
2023-09-26 05:22:39 +02:00
vercel-release-bot
df3980da88 v13.5.4-canary.0 2023-09-25 21:03:03 +00:00
vercel-release-bot
76e06d55a8 v13.5.3 2023-09-25 14:24:47 +00:00
vercel-release-bot
b98ebb2806 v13.5.3-canary.4 2023-09-25 13:16:18 +00:00
vercel-release-bot
ec671bb5f5 v13.5.3-canary.3 2023-09-23 02:02:57 +00:00
vercel-release-bot
c923257c1b v13.5.3-canary.2 2023-09-22 19:42:08 +00:00
Tim Neutkens
b5c399698d
Remove next-typescript check in webpack config (#55819)
This package has been legacy for multiple years and has been marked
deprecated, this check is no longer useful.

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

-->
2023-09-22 19:43:16 +02:00
Leah
7fa1618ef7
chore: update turbopack to turbopack-230922.2 (#55828) 2023-09-22 18:52:18 +02:00
vercel-release-bot
0d6f3ac36b v13.5.3-canary.1 2023-09-21 23:58:45 +00:00
vercel-release-bot
e9148eda2a v13.5.3-canary.0 2023-09-21 09:07:13 +00:00
vercel-release-bot
aea80aa53f v13.5.2 2023-09-20 16:19:18 +00:00
vercel-release-bot
0afffdd024 v13.5.2-canary.2 2023-09-20 15:29:17 +00:00
vercel-release-bot
72434c2737 v13.5.2-canary.1 2023-09-20 12:53:30 +00:00
Balázs Orbán
38877dda37
chore: bump @vercel/og and satori (#55654)
### What?

Bump these packages to their latest. (Bumped `satori` too to avoid multiple versions in the repo)

### Why?

Follow-up of https://github.com/vercel/next.js/pull/55187

### How?

Updated the original package applying the changes from #55187

Closes NEXT-1639
Fixes #55604

[Slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1695169119558899)
2023-09-20 12:16:49 +00:00
vercel-release-bot
ac1c062f4f v13.5.2-canary.0 2023-09-20 10:49:22 +00:00
Zack Tanner
bb13bb4799
Update React from d6dcad6a8 to 2807d781a (#55590)
Update React from d6dcad6a8 to 2807d781a.

### React upstream changes

- https://github.com/facebook/react/pull/27387
- https://github.com/facebook/react/pull/27386
- https://github.com/facebook/react/pull/27385
- https://github.com/facebook/react/pull/27379
- https://github.com/facebook/react/pull/27382

Closes NEXT-1637
2023-09-20 00:09:34 +00:00
vercel-release-bot
0c1c7f847e v13.5.1 2023-09-19 17:20:54 +00:00
vercel-release-bot
974428583e v13.5.1-canary.1 2023-09-19 16:31:03 +00:00
vercel-release-bot
c652dc8811 v13.5.1-canary.0 2023-09-19 16:10:26 +00:00
vercel-release-bot
ffafad2c35 v13.5.0 2023-09-19 15:36:42 +00:00
vercel-release-bot
4a589ed83d v13.4.20-canary.41 2023-09-19 13:56:12 +00:00
vercel-release-bot
d01ab6165e v13.4.20-canary.40 2023-09-18 23:29:58 +00:00
vercel-release-bot
41c89f0cd8 v13.4.20-canary.39 2023-09-18 20:12:27 +00:00
Steven
e4439b1430
chore(third-parties): replace rimraf with rm.mjs (#55547)
- Follow up to https://github.com/vercel/next.js/pull/55544
- Same pattern from https://github.com/vercel/next.js/pull/49529
2023-09-18 19:57:45 +00:00
Tobias Koppers
0338dcdf2c
fix next.js own build on windows (#55544)
### What

allow to build next.js on windows

Closes WEB-1597

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-09-18 14:21:51 -05:00
vercel-release-bot
4f98dc6f26 v13.4.20-canary.38 2023-09-18 19:09:41 +00:00
vercel-release-bot
36e12a7415 v13.4.20-canary.37 2023-09-18 14:05:39 +00:00
vercel-release-bot
b2facf5811 v13.4.20-canary.36 2023-09-18 12:03:44 +00:00
Tobias Koppers
eaa4d02ac9
update turbopack (#55515)
And sync deps so they don't conflict

* https://github.com/vercel/turbo/pull/5959 <!-- Tobias Koppers - reduce
number of task in async_module -->
* https://github.com/vercel/turbo/pull/5960 <!-- Tobias Koppers - reduce
unneccessary fs tasks -->
* https://github.com/vercel/turbo/pull/5955 <!-- Tobias Koppers -
bumping minor or major should reset patch/minor -->

Closes WEB-1592

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-18 11:48:36 +02:00
vercel-release-bot
096d910423 v13.4.20-canary.35 2023-09-18 09:27:39 +00:00
vercel-release-bot
8fd2ad27b9 v13.4.20-canary.34 2023-09-18 06:25:35 +00:00
vercel-release-bot
981e8fa945 v13.4.20-canary.33 2023-09-16 10:38:10 +00:00
vercel-release-bot
e262627bd9 v13.4.20-canary.32 2023-09-15 19:55:16 +00:00
Donny/강동윤
ad79325a9f
Update swc_core to v0.83.12 (#55216)
### What?

I made `styled-jsx` configurable. It uses `swc_css` by default, and with
`useLigntningcss: true`, it uses it.

https://github.com/swc-project/plugins/pull/207

### Why?

### How?

Closes NEXT-
Fixes #



Closes WEB-1532
2023-09-15 17:41:05 +02:00
vercel-release-bot
15292da332 v13.4.20-canary.31 2023-09-15 06:05:22 +00:00
Justin Ridgewell
d2641bd072
Update turbopack (#55402)
* https://github.com/vercel/turbo/pull/5952 
* https://github.com/vercel/turbo/pull/5938 

Closes WEB-1566
2023-09-14 22:11:12 +00:00
vercel-release-bot
18d703e0b7 v13.4.20-canary.30 2023-09-14 21:50:52 +00:00
vercel-release-bot
be38d02349 v13.4.20-canary.29 2023-09-14 20:56:41 +00:00
Andrew Clark
6f2e9aec21
Update React from dd480ef92 to d6dcad6a8. (#55399)
### React upstream changes:

- https://github.com/facebook/react/pull/27374
- https://github.com/facebook/react/pull/27369
- https://github.com/facebook/react/pull/27372
- https://github.com/facebook/react/pull/27371
- https://github.com/facebook/react/pull/27370
- https://github.com/facebook/react/pull/27321
- https://github.com/facebook/react/pull/27368
- https://github.com/facebook/react/pull/27367
- https://github.com/facebook/react/pull/27366
- https://github.com/facebook/react/pull/27360
- https://github.com/facebook/react/pull/27361
- https://github.com/facebook/react/pull/27357
- https://github.com/facebook/react/pull/27359
- https://github.com/facebook/react/pull/27358
- https://github.com/facebook/react/pull/27330
- https://github.com/facebook/react/pull/27347
- https://github.com/facebook/react/pull/27307
- https://github.com/facebook/react/pull/27346
- https://github.com/facebook/react/pull/27342
- https://github.com/facebook/react/pull/27340
- https://github.com/facebook/react/pull/27328
- https://github.com/facebook/react/pull/27327
- https://github.com/facebook/react/pull/27325
- https://github.com/facebook/react/pull/27337
- https://github.com/facebook/react/pull/27336
- https://github.com/facebook/react/pull/27323
- https://github.com/facebook/react/pull/27320
- https://github.com/facebook/react/pull/27317
- https://github.com/facebook/react/pull/27318
- https://github.com/facebook/react/pull/27316
- https://github.com/facebook/react/pull/27313
- https://github.com/facebook/react/pull/27309
- https://github.com/facebook/react/pull/27302
- https://github.com/facebook/react/pull/27297
- https://github.com/facebook/react/pull/27295
- https://github.com/facebook/react/pull/27305
- https://github.com/facebook/react/pull/27215
- https://github.com/facebook/react/pull/27304
- https://github.com/facebook/react/pull/27067
- https://github.com/facebook/react/pull/27179
- https://github.com/facebook/react/pull/27278
- https://github.com/facebook/react/pull/27277
- https://github.com/facebook/react/pull/27282
- https://github.com/facebook/react/pull/27230
- https://github.com/facebook/react/pull/27260
- https://github.com/facebook/react/pull/27270
- https://github.com/facebook/react/pull/27273
- https://github.com/facebook/react/pull/27268
- https://github.com/facebook/react/pull/27269
2023-09-14 17:42:33 +00:00
Tobias Koppers
129f56d3e7
more turbopack HMR fixes and test case (#55368)
### What?

improve test case to check HMR
reenable deduplication for server side hmr events
add aggregation of client side HMR events

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5936 <!-- Will Binns-Smith -
Update http mock and clap -->
* https://github.com/vercel/turbo/pull/5948 <!-- Tobias Koppers - CSS
HMR fixes -->



Closes WEB-1557

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-14 15:50:59 +02:00
vercel-release-bot
800fdc11ae v13.4.20-canary.28 2023-09-13 22:47:32 +00:00
Mayank
f94d4f93e4
fix: upgrade listr2 from 5.0.5 to 5.0.8 (#55223)
upgrade listr2 from 5.0.5 to 5.0.8.





Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-09-13 21:02:14 +00:00
vercel-release-bot
32e066ff6c v13.4.20-canary.27 2023-09-13 17:38:35 +00:00
vercel-release-bot
366885f387 v13.4.20-canary.26 2023-09-12 13:20:27 +00:00
vercel-release-bot
8e1626851e v13.4.20-canary.25 2023-09-12 10:34:24 +00:00
OJ Kwon
92e1b3fef9
test(fixture): improve finding ports to reduce flaky (#55151)
### What

Found a flaky test like https://github.com/vercel/next.js/actions/runs/6125719281/job/16628276301?pr=55118#step:29:174, `get-port` throws by port is not available. Peeking bit, there seems an upstream fix hope to improve the situation but unfortunately it happened after get-port switched to native esm only, so bumping is non trivial work. Instead adapting get-port-please as a replacwement but leave get-port as fallback for a while to verify its stability. Once we are certain, we can remove old get-port entirely.
2023-09-11 21:48:29 +00:00
vercel-release-bot
476fe4a1f6 v13.4.20-canary.24 2023-09-11 20:24:23 +00:00
vercel-release-bot
c6ce87f021 v13.4.20-canary.23 2023-09-08 21:41:11 +00:00
vercel-release-bot
d61c6ba4aa v13.4.20-canary.22 2023-09-08 21:10:48 +00:00
Jimmy Lai
5217e7eb06
server: re-land bundled runtimes (#55139)
see https://github.com/vercel/next.js/pull/52997

also added a fix by @jridgewell to fix turbopack





Co-authored-by: Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
2023-09-08 16:05:29 +00:00
vercel-release-bot
904d8eed39 v13.4.20-canary.21 2023-09-07 23:18:04 +00:00
JJ Kasper
7267538e00
Revert "perf: add bundled rendering runtimes (#52997)" (#55117)
This reverts commit a5b7c77c1f.

Our E2E tests are failing with this change this reverts to allow investigating async 

x-ref: https://github.com/vercel/next.js/actions/runs/6112149126/job/16589769954
2023-09-07 21:07:53 +00:00
Balázs Orbán
068002bb3a
chore: upgrade to TypeScript 5.2.2 (#55105)
### What?

Upgrade TypeScript to the latest version as of this PR. **This does not affect users, as the change is only for our repository.**

### Why?

Part of some upcoming PRs to try to clean up cookie handling, now that `getSetCookie` is available. Since we use `undici`, which [implements it](https://github.com/nodejs/undici/pull/1915), we can get rid of some code to rely more on the platform.

This PR is needed to get the types for `Headers#getSetCookie` which was added in 5.2

### How?

I needed to update some dependency types to get build to pass, but other than that, only needed to bump from `5.1.6` to `5.2.2`, so hopefully all is fine.
2023-09-07 18:46:05 +00:00
vercel-release-bot
3062462156 v13.4.20-canary.20 2023-09-07 16:06:41 +00:00
Jimmy Lai
a5b7c77c1f
perf: add bundled rendering runtimes (#52997)
## What?

In Next, rendering a route involves 3 layers:
- the routing layer, which will direct the request to the correct route to render
- the rendering layer, which will take a route and render it appropriately
- the user layer, which contains the user code 

In #51831, in order to optimise the boot time of Next.js, I introduced a change that allowed the routing layer to be bundled. In this PR, I'm doing the same for the rendering layer. This is building up on @wyattjoh's work that initially split the routing and the rendering layer into separate entry-points.

The benefits of having this approach is that this allows us to compartmentalise the different part of Next, optimise them individually and making sure that serving a request is as efficient as possible, e.g. rendering a `pages` route should not need code from the `app router` to be used.

There are now 4 different rendering runtimes, depending on the route type:
- app pages: for App Router pages
- app routes: for App Router route handlers
- pages: for legacy pages
- pages api: for legacy API routes

This change should be transparent to the end user, beside faster cold boots.

## Notable changes

Doing this change required a lot of changes for Next.js under the hood in order to make the different layers play well together.

### New conventions for externals/shared modules

The big issue of bundling the rendering runtimes is that the user code needs to be able to reference an instance of a module/value created in Next during the render. This is the case when the user wants to access the router context during SSR via `next/link` for example; when you call `useContext(value)` the value needs to be the exact same reference to one as the one created by `createContext` earlier.

Previously, we were handling this case by making all files from Next that were affected by this `externals`, meaning that we were marking them not to be bundled.

**Why not keep it this way?**

The goal of this PR as stated previously was to make the rendering process as efficient as possible, so I really wanted to avoid extraneous fs reads to unoptimised code. 

In order to "fix" it, I introduced two new conventions to the codebase:
- all files that explicitly need to be shared between a rendering runtime and the user code must be suffixed by `.shared-runtime` and exposed via adding a reference in the relevant `externals` file. At compilation time, a reference to a file ending with this will get re-written to the appropriate runtime.
- all files that need to be truly externals need to be suffixed by `.external`. At compilation time, a reference to it will stay as-is. This special case is needed mostly only for the async local storages that need to be shared with all three layers of Next.

As a side effect, we should be bundling more of the Next code in the user bundles, so it should be slightly more efficient.

### App route handlers are compiled on their own layer

App route handlers should be compiled in their own layer, this allows us to separate more cleanly the compilation logic here (we don't need to run the RSC logic for example).

### New rendering bundles

We now generate a prod and a dev bundle for:
- the routing server
- the app/pages SSR rendering process
- the API routes process

The development bundle is needed because:
- there is code in Next that relies on NODE_ENV
- because we opt out of the logic referencing the correct rendering runtime in dev for a `shared-runtime` file. This is because we don't need to and that Turbopack does not support rewriting an external to something that looks like this `require('foo').bar.baz` yet. We will need to fix that when Turbopack build ships.

### New development pipeline

Bundling Next is now required when developing on the repo so I extended the taskfile setup to account for that. The webpack config for Next itself lives in `webpack.config.js` and contains the logic for all the new bundles generated.

### Misc changes

There are some misc reshuffling in the code to better use the tree shaking abilities that we can now use.

fixes NEXT-1573

Co-authored-by: Alex Kirszenberg <1621758+alexkirsz@users.noreply.github.com>
2023-09-07 15:51:49 +00:00
vercel-release-bot
9bb9f07e82 v13.4.20-canary.19 2023-09-07 06:36:23 +00:00
Ryota Murakami
7decb13000
chore(ci): bump pnpm v8.6.11 to v8.7.1 (#54873)
My "pnpm@v8.7.0" was not working and I noticed it by accident and sent a PR.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-06 00:39:44 +00:00
vercel-release-bot
cdfb9de498 v13.4.20-canary.18 2023-09-05 22:49:40 +00:00
vercel-release-bot
1b844600ce v13.4.20-canary.17 2023-09-05 18:20:51 +00:00
Kiko Beats
7288c866eb
upgrade edge-runtime (#55005)
Fixing `Headers#getSetCookie` method
2023-09-05 13:29:17 +00:00
Balázs Orbán
3a62a30649
chore: bump undici (#55007)
This bumps `undici` to the latest version to match the one used in newer Node.js versions', potentially fixing compatibility issues.

I also cleaned up some related `global as any` usage.
2023-09-05 12:29:51 +00:00
vercel-release-bot
7a1924ed6d v13.4.20-canary.16 2023-09-04 11:58:51 +00:00
Damien Simonin Feugas
3338dd0b31
fix(next-swc): skips client/server only checks when running with Jest to unblock testing (#54891)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-09-04 13:53:41 +02:00
Justin Ridgewell
2b9ffb009c
Update turbopack (#54909)
Minor update that includes changes necessary to get HMR errors working.

Closes WEB-1494
2023-09-02 10:45:49 +00:00
Donny/강동윤
a5c180388a
Update swc_core to v0.82.11 (#54653)
### What?

Update swc crates to
44de87f481

### Why?

To use `import with` and etc...

### How?

Closes WEB-1460
Fixes #

---

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

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-09-01 15:35:04 +02:00
vercel-release-bot
d172e7b72c v13.4.20-canary.15 2023-08-31 22:23:23 +00:00
vercel-release-bot
e1cc97f3e4 v13.4.20-canary.14 2023-08-31 17:24:11 +00:00
Jiachi Liu
1be02e36fe
Update @vercel/og to latest (#54849)
Upgrade `@vercel/og` to `0.5.12` and satori to the corresponding version
2023-08-31 17:17:07 +00:00
vercel-release-bot
fe191f8e54 v13.4.20-canary.13 2023-08-31 01:53:14 +00:00
Tobias Koppers
56c9ad8d7b
Turbopack: Implement HMR in next-api (#54772)
by @jridgewell:

### What?

This integrates Turbopack's HRM protocol within the existing HMR
WebSocket, and implements the server-side of the Next's and Turbopack's
protocols for use in next-api.

### Why?

HMR makes the development experience.

### How?

The (new) Turbopack HMR protocol allows reusing the existing
`sendMessage` and `addMessageListener` API's already used by our HMR
singleton in Pages. (App apparently doesn't have a per-chunk HMR, only
per-page, so it's HMR signals are describe below.)

For the next-api server-side, I implemented the following events:

- `reloadPage`, for Pages when `_document` changes
- `middlewareChanges` when middleware is added/deleted, or modified
- `serverOnlyChanges` for Pages when a loaded page's server graph
changes
- `serverComponentChanges` for App when a loaded app page's server graph
changes

We reuse the already implemented `addedPage`, `removedPage`, and
`devPagesManifestUpdate` (done via webpack, so we should eventually port
that over to the Turbopack listeners).

I don't know exactly where `built`, `building`, and `sync` should be
integrated, so they're just not sent currently. Additionally, the
client-sent events aren't implemented in the new HMR server.

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

Closes WEB-1453

---------

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2023-08-30 14:55:55 +02:00
Tobias Koppers
523d376ae3
update turbopack (#54768)
* https://github.com/vercel/turbo/pull/5793 <!-- Alex Kirszenberg -
Automatically derive ValueDefault for primitive value types -->
* https://github.com/vercel/turbo/pull/5784 <!-- Tobias Koppers - make
swc comments immutable -->
* https://github.com/vercel/turbo/pull/5627 <!-- Tobias Koppers - avoid
unnessecary indirection in async modules -->
* https://github.com/vercel/turbo/pull/5822 <!-- Tobias Koppers -
continue on failing test steps -->
* https://github.com/vercel/turbo/pull/5814 <!-- Justin Ridgewell -
Update HMR for next-api -->
* https://github.com/vercel/turbo/pull/5821 <!-- Tobias Koppers - avoid
cloning a large list of task ids -->

Closes WEB-1473
2023-08-30 13:55:51 +02:00
Janicklas Ralph
d3a107991c
Updating Third party capital version. (#54418)
Updated Third-party-capital version. Refactored `next/third-parties` to update the way components are built. Updated tests.

cc: @kara @huozhi @gnoff
2023-08-29 23:13:35 +00:00
vercel-release-bot
928c4c097c v13.4.20-canary.12 2023-08-29 10:42:17 +00:00
vercel-release-bot
5b62f15586 v13.4.20-canary.11 2023-08-28 14:27:50 +00:00
vercel-release-bot
1491d4c2ed v13.4.20-canary.10 2023-08-28 13:30:48 +00:00
vercel-release-bot
529a1be6c1 v13.4.20-canary.9 2023-08-25 21:26:50 +00:00
vercel-release-bot
dbfcfd75b7 v13.4.20-canary.8 2023-08-25 14:28:07 +00:00
Tobias Koppers
08d3258762
update turbopack (#54558)
* https://github.com/vercel/turbo/pull/5723 <!-- Alex Kirszenberg - Misc
comments in turbo_tasks -->
* https://github.com/vercel/turbo/pull/5714 <!-- OJ Kwon - test(ci):
update datadog-ci -->
* https://github.com/vercel/turbo/pull/5705 <!-- Justin Ridgewell -
Transformation code necessary to support Server Actions -->
* https://github.com/vercel/turbo/pull/5739 <!-- Justin Ridgewell -
Update rust toolchain -->
* https://github.com/vercel/turbo/pull/5785 <!-- Tobias Koppers - add
evaluatables to chunk list ident -->
* https://github.com/vercel/turbo/pull/5783 <!-- Tobias Koppers -
Tracing improvements -->
* https://github.com/vercel/turbo/pull/5738 <!-- Alex Kirszenberg -
Generic types over Vcs -->
* https://github.com/vercel/turbo/pull/5795 <!-- Leah - fix: snapshot
test path canonicalization -->
* https://github.com/vercel/turbo/pull/5794 <!-- Tobias Koppers - fix
"any" context condition implementation -->
* https://github.com/vercel/turbo/pull/5800 <!-- Tobias Koppers - add
middleware entry type -->
* https://github.com/vercel/turbo/pull/5786 <!-- Tobias Koppers -
perform invalidation directly on writes -->

Closes WEB-1446
2023-08-25 16:22:35 +02:00
vercel-release-bot
d8b1ad41a7 v13.4.20-canary.7 2023-08-25 13:43:11 +00:00
Balázs Orbán
9a2a349639
chore(eslint): bump ESLint plugins (#54490)
Fixes #54480
2023-08-25 10:58:06 +00:00
vercel-release-bot
96f571218b v13.4.20-canary.6 2023-08-24 22:34:30 +00:00
vercel-release-bot
9bcd570bc1 v13.4.20-canary.5 2023-08-24 16:38:19 +00:00
Kiko Beats
08b117ac5c
upgrade Edge Runtime dependency (#54489) 2023-08-24 11:00:31 +00:00
vercel-release-bot
80e6f07f01 v13.4.20-canary.4 2023-08-23 23:32:02 +00:00
Tim Neutkens
00106b7ef4
Optimize webpack memory cache garbage collection (#54397)
## What

Adds a reworked version of webpack's [built-in memory cache garbage
collection
plugin](853bfda35a/lib/cache/MemoryWithGcCachePlugin.js (L15))
that is more aggressive in cleaning up unused modules than the default.

The default marks 1/5th of the modules as "up for potentially being
garbage collected". The new plugin always checks all modules. In my
testing this does not cause much overhead compared to the current
approach which leverages writing to two separate maps. The change also
makes the memory cache eviction more predictable: when an item has not
been accessed for 5 compilations it is evicted from the memory cache, it
could still be in the disk cache.


In order to test this change I had to spin up the benchmarks but these
were a bit outdated so I've cleaned up the benchmark applications.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-23 15:46:32 +02:00
vercel-release-bot
93e4e6d438 v13.4.20-canary.3 2023-08-23 13:13:36 +00:00
Jiachi Liu
9834ab7e15
Fix not found css not being preloaded while navigation (#53906)
### Problem

One style of `not-found` has `precendence` property with "undefined" value, which can't be handled by React Float, then during navigation the style could not load properly, lead to the style missing in issue #53210.

### Solution

Always enable `precendence` for all links, so all the css styles of page and convention components can be hoist by react properly. Float will decide which one should be handled. Previously this change only applies to template, actually we can apply it to all components so that they can all be handled properly especially during client navigation.

Related react change: https://github.com/facebook/react/pull/27265
Fixes #53210
2023-08-23 13:07:30 +00:00
Jiachi Liu
1e3920c3dd
Upgrade precompiled ua-parser-js (#54404)
Upgrade `ua-parser-js` which is used by `userAgentFromString` to latest version

Closes NEXT-1552
2023-08-22 23:56:05 +00:00
Jiachi Liu
6d769d0eb8
Upgrade vendored react (#54399)
### React upstream changes

- https://github.com/facebook/react/pull/27265
- https://github.com/facebook/react/pull/27259
- https://github.com/facebook/react/pull/27264
- https://github.com/facebook/react/pull/27257
- https://github.com/facebook/react/pull/27258
- https://github.com/facebook/react/pull/27187
- https://github.com/facebook/react/pull/27243
- https://github.com/facebook/react/pull/27205
- https://github.com/facebook/react/pull/27220
- https://github.com/facebook/react/pull/27238
- https://github.com/facebook/react/pull/27234
- https://github.com/facebook/react/pull/27224
- https://github.com/facebook/react/pull/27223
- https://github.com/facebook/react/pull/27222

This will help unblock https://github.com/vercel/next.js/pull/53906
2023-08-22 22:27:54 +00:00
vercel-release-bot
8bbf674a4d v13.4.20-canary.2 2023-08-22 12:43:03 +00:00
vercel-release-bot
1a56fb9483 v13.4.20-canary.1 2023-08-21 22:41:53 +00:00
vercel-release-bot
f1c286fff2 v13.4.20-canary.0 2023-08-20 12:56:16 +00:00
Jiachi Liu
311eea4c6a
Fix emotion-js transform for server components (#54284)
### What & Why

emotion-js has its own [jsx transform](https://emotion.sh/docs/typescript#emotionreact) which is being applied when `compiler.emotion` is enabled in `next.config.js`.

Thanks to emotion-js team that provided an emotion-js example setup with app router [here](https://github.com/emotion-js/emotion/issues/2928#issuecomment-1319792703), so that we can use it as test example with app router. Based on the setup, we create a test case working with emotion js but failed with error mentioned in #41994 that some client hooks appearing in server components. That is because the emotion-js jsx factory includes some client hooks.

### How

For server components, css-in-js is not recommended to apply so we disabled the transform before, the emotion jsx factory is a separate config that should also not be applied in server components. So in this case we still use react jsx factory instead of the emotion-js one for server components then it won't error. The test case can also be used as an example for basic emotion-js use case with app router.


Fixes #41994
Closes NEXT-1368
2023-08-20 03:14:16 +00:00
vercel-release-bot
d96e0258de v13.4.19 2023-08-19 00:23:31 +00:00
vercel-release-bot
1cf4aa6e51 v13.4.19-canary.0 2023-08-18 23:39:41 +00:00
Tim Neutkens
819a163fce
Update dd-trace used for internal tools (#54214)
This is only used for internal tools 👍
2023-08-18 13:55:22 +00:00
vercel-release-bot
87b66f64e5 v13.4.18 2023-08-18 00:16:08 +00:00
vercel-release-bot
89ed4dd105 v13.4.18-canary.0 2023-08-17 22:11:33 +00:00
Jiachi Liu
71149293e5
Allow range version for eslint config (#53751)
Fixes #52365

In #52275 that eslint config changed to a fixed canary version to leverage the improvement of `react-hooks` eslint plugin but breaks the installation when 3rd party packages having strict matching for certain version of eslint plugin.

This PR allows both previous version and the canary version be present.
2023-08-17 18:39:03 +00:00
Justin Ridgewell
11dfdf8d7a
Turbopack: Strip relative path prefix when generating PageLoaderAsset (#54040)
### What?

Strip the relative path prefix (`_next/`) when generating the `PageLoaderAsset`. This is necessary because the page loader will internally use `__turbopack_load__`, which prepends the prefix back onto the path.

### Why?

Without this, we'd try loading `_next/_next/path/to/file.js`, because we'd prepend the prefix onto a path that already contains it.

### How?

When generating the page loader asset, we "proxy" the `OutputAsset` onto a path which has the prefix removed.

~~Depends on https://github.com/vercel/turbo/pull/5717~~

Closes WEB-1377
2023-08-17 17:29:30 +00:00
vercel-release-bot
236075362a v13.4.17 2023-08-17 09:32:20 +00:00
vercel-release-bot
645ba004d6 v13.4.17-canary.2 2023-08-17 08:55:11 +00:00
Jiachi Liu
02c258dd91
Revert "fix(47299): allow testing pages with metadata in jsdom test environment" (#54160)
Reverts vercel/next.js#53578

This PR (#53578) will break client components test, revert it for now.

Can repro by adding `"use client"` to `app/page.tsx` in `test/production/jest/server-only.test.ts`

```
    FAIL app/page.test.jsx
      ● Test suite failed to run·
        Cannot find module 'private-next-rsc-mod-ref-proxy' from 'app/page.jsx'·
        Require stack:
```
2023-08-17 08:49:08 +00:00
vercel-release-bot
fc3bf373c5 v13.4.17-canary.1 2023-08-17 07:33:02 +00:00
vercel-release-bot
93259caac4 v13.4.17-canary.0 2023-08-16 21:11:24 +00:00
Kiko Beats
b676fce090
upgrade edge-runtime dependency (#54117)
Hello,

This PR upgrades `edge-runtime` and associated packages, mostly fixing issues.
2023-08-16 13:57:01 +00:00
Damien Simonin Feugas
77acd164d3
fix(47299): allow testing pages with metadata in jsdom test environment (#53578)
### 🧐 What's in there?

This is another attempt to allow testing server-only code with Jest.

### 🧪 How to test?

There's an integration tests which can be triggered with `pnpm testheadless server-only`

Here is a more comprehensive setup:
<details>
<summary><code>app/lib/index.ts</code></summary>

```ts
import 'server-only'

export function add(num1: number, num2: number) {
  return num1 + num2
}
```
</details>
<details>
<summary><code>app/lib/index.test.ts</code></summary>

```ts
import { add } from '.'

it('adds two numbers', () => {
  expect(add(1, 3)).toEqual(4)
})
```
</details>
<details>
<summary><code>app/client-component.tsx</code></summary>

```ts
'use client'

import { useState } from 'react'

export default function ClientComponent() {
  const [text, setText] = useState('not clicked yet')
  return <button onClick={() => setText('clicked!')}>{text}</button>
}
```
</details>
<details>
<summary><code>app/client-component.test.tsx</code></summary>

```ts
import { fireEvent, render, screen } from '@testing-library/react'
import ClientComponent from './client-component'

it('can be clicked', async () => {
  render(<ClientComponent />)
  const button = screen.getByRole('button')
  expect(button).toHaveTextContent('not clicked yet')
  await fireEvent.click(button)
  expect(button).toHaveTextContent('clicked!')
})
```
</details>
<details>
<summary><code>app/server-component.tsx</code></summary>

```ts
import { add } from '@/lib'

export default function ServerComponent({ a, b }: { a: number; b: number }) {
  return (
    <code role="comment">
      {a} + {b} = {add(a, b)}
    </code>
  )
}
```
</details>
<details>
<summary><code>app/server-component.test.tsx</code></summary>

```ts
import { render, screen } from '@testing-library/react'
import ServerComponent from './server-component'

it('renders', () => {
  render(<ServerComponent a={2} b={3} />)
  expect(screen.getByRole('comment')).toHaveTextContent('2 + 3 = 5')
})
```
</details>
<details>
<summary><code>app/page.tsx</code></summary>

```ts
import Link from 'next/link'
import ClientComponent from './client-component'
import ServerComponent from './server-component'

export default function Page() {
  return (
    <>
      <h1>Hello World</h1>
      <Link href="/dave">Dave?</Link>
      <p>
        <ClientComponent />
      </p>
      <p>
        <ServerComponent a={5} b={2} />
      </p>
    </>
  )
}
```
</details>
<details>
<summary><code>app/page.test.tsx</code></summary>

```ts
import { render, screen } from '@testing-library/react'
import Page from './page'

it('greets', () => {
  render(<Page />)
  expect(screen.getByRole('link')).toHaveTextContent('Dave?')
  expect(screen.getByRole('heading')).toHaveTextContent('Hello World')
  expect(screen.getByRole('button')).toHaveTextContent('not clicked yet')
  expect(screen.getByRole('comment')).toHaveTextContent('5 + 2 = 7')
})
```
</details>
<details>
<summary><code>app/[blog]/page.tsx</code></summary>

```ts
import { Metadata } from 'next'
import Link from 'next/link'

type Props = {
  params: { blog: string }
}

export async function generateMetadata({
  params: { blog: title },
}: Props): Promise<Metadata> {
  return { title, description: `A blog post about ${title}` }
}

export default function Page({ params }: Props) {
  return (
    <>
      <div>
        <Link href="/">Back</Link>
      </div>
      <h1>All about {params.blog}</h1>
    </>
  )
}
```
</details>
<details>
<summary><code>app/[blog]/page.test.tsx</code></summary>

```ts
import { render, screen } from '@testing-library/react'
import Page from './page'

it('has the appropriate title', () => {
  const title = 'Jane'
  render(<Page params={{ blog: title }} />)
  expect(screen.getByRole('heading')).toHaveTextContent(`All about ${title}`)
  expect(screen.getByRole('link')).toHaveTextContent('Back')
})
```
</details>
<details>
<summary><code>app/layout.tsx</code></summary>

```ts
export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
```
</details>
<details>
<summary><code>jest.config.js</code></summary>

```ts
const nextJest = require('next/jest')

const createJestConfig = nextJest({ dir: './' })

module.exports = createJestConfig({
  testEnvironment: 'jsdom',
  setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
})
```
</details>
<details>
<summary><code>package.json</code></summary>

```ts
{
  "name": "rsc-test",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "test": "jest"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "latest"
  }
}
```
</details>
<details>
<summary><code>test-setup.ts</code></summary>

```ts
import '@testing-library/jest-dom'
```
</details>
   
The app should run and all test should pass.

###  Notes to reviewers

#### The problem:

1. next/jest configures jest with a transformer ([jest-transformer](https://github.com/vercel/next.js/blob/canary/packages/next/src/build/swc/jest-transformer.ts)) to compile react code with next -swc
2. the transformers configures next -swc for a given environment: Server or Client, based on jest global environment
3. Based on the environment, next -swc checks for invalid usage of `import('server-only')`  `“use client”`, `export const metadata` or `export async function generateMetadata` 
4. Because the global test environment is either jsdom or node, the same test suite can not include both client and server components

#### Possible mitigations

*A. Using jest projects*

When configured with [multiple projects](https://jestjs.io/docs/next/configuration/#projects-arraystring--projectconfig), Jest can launch different runners with different environment. This would allow running server-only code in node and client-only code in jsdom. 

However, it requires user to completely change their jest configuration. It would also require a different setup when scaffolding new app-directory project with create-next.

*B. Using doc blocks*

Jest allows changing the environment per test file [with docBlock](https://jestjs.io/docs/configuration#testenvironment-string). 

However, by the time jest is invoking next -swc on a source file to transform it, this information is gone, and next -swc is still invoked with the (wrong) global environment.

The PR #52393 provides a workaround for files with `import('server-only')`, but does not allow testing pages with metadata.

*C. Always compile for node*

Our jest-transformer could always configure next -swc for server:

- pass Server-specific validations `import('server-only')`  `export const metadata` or `export async function generateMetadata`
- does not complain about `"use client"`

This is what this PR is about!

Fixes #47299

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-08-16 07:14:27 +00:00
Dima Voytenko
88b8d15f41
Test proxy mode: intercept the http and https client APIs (#54014)
Followup on the https://github.com/vercel/next.js/pull/52520. The enhancements:

1. Both `fetch` and `http(s)` APIs are intercepted in the testmode.
2. The loopback mode that would allow the test-side to use any fetch-mocking library of their choice.
2023-08-15 02:31:00 +00:00
vercel-release-bot
2fac86480c v13.4.16 2023-08-15 01:03:24 +00:00
vercel-release-bot
33d9bf2a8f v13.4.16-canary.1 2023-08-15 00:42:45 +00:00