Commit graph

17920 commits

Author SHA1 Message Date
vercel-release-bot
3c7d15b992 v13.5.6-canary.0 2023-10-16 22:04:56 +00:00
Zack Tanner
e7fc6f3708
ensure kodiak is re-added to apps list after code-freeze action (#56907)
ensures that after the code-freeze action, Kodiak is re-added to the restrictions list

[slack x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1697491473466249)
2023-10-16 22:00:02 +00:00
Balázs Orbán
1ff7f07875
feat: drop Node.js 16 (#56896)
### What?

BREAKING CHANGE: Bump the minimum required Node.js version.

### Why?

Node.js 16 has reached end-of-life in September.

Bumped to `18.18.2` since it contained some security-related patches: https://nodejs.org/en/blog/vulnerability/october-2023-security-releases

### How?

Bumped `engines` where needed, upgraded the workflows.

This will allow us to remove quite a few polyfills, I'll open separate PRs for those.
2023-10-16 21:41:38 +00:00
Jimmy Lai
9fda481af1
perf: fix server trace file logic (#56898) 2023-10-16 22:29:07 +02:00
Steven
d32121b736
chore(test): test remote image from proxy (#56895)
This PR adds a test to ensure we don't regress again when using proxies
in front of Next.js with `connection: 'upgrade'`.

- Regression introduced in https://github.com/vercel/next.js/pull/56226
- Issue reported in https://github.com/vercel/next.js/issues/56038
- Rolled back in https://github.com/vercel/next.js/pull/56836
2023-10-16 14:48:29 -04:00
Zack Tanner
3e77d69ca0
improve next-image-proxy test (#56893)
This fixes a warning where the test server was exiting before all the
proxy requests finished. This also throws an error to fail the test if
any of the proxied requests aren't fulfilled.

[slack
x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1697465502593889?thread_ts=1697143786.511779&cid=C04DUD7EB1B)
2023-10-16 08:36:34 -07: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
Tobias Koppers
8a51ebcb67
Revert "feat(turbopack): support basic next/dynamic" (#56885) 2023-10-16 06:37:41 -07:00
vercel-release-bot
c1c419fde0 v13.5.5-canary.18 2023-10-16 12:28:32 +00:00
Tim Neutkens
4e435e2fe6
Skip webpack specific tests in Turbopack test run (#56877)
Looked for `webpack(config` in the test suites and disabled the ones that are testing webpack specifically. There are a few more that are not skipped as they should be implemented for Turbopack.
2023-10-16 10:34:50 +00:00
OJ Kwon
5b52e7772d
feat(turbopack): support basic next/dynamic (#56389)
Closes WEB-1702

This PR implements initial support for the `next/dynamic` in Turbopack,
more specifically resolving some hydration errors and other components
boot up cases.

Previously, turbopack had partial next/dynamic support via its own mode
(https://github.com/vercel/next.js/pull/56389/files#diff-e1af4f79cb88a73f819a25443d15ed4b1ffabcbb879256caa59b751fad46d7c4L68),
which does a transform against `next/dynamic` wrapped import to embed
dynamically resolvable chunk ids like
(ad42b610c2/packages/next-swc/crates/next-transform-dynamic/tests/fixture/wrapped-import/output-turbo-dev-server.js).

However, since next.js relies on static path to the chunks to the
dynamic import and passing those ids in between client-server to ensure
component load (and avoid hydration errors), it doesn't work out of the
box. This PR changes turbopack's behavior to closely mimic what current
next.js's webpack plugin does, by

1. Traverse the module graph, find out `dynamic(import())`
2. Generate chunks for those imports, creates a partial LoadableManifest
per each imports
3. Merge partial manifest into a single `react-loadable-manifest.json`
4. For the id, use static (Webpack mode) instead of dynamic so we can
embed it in `react-loadable-manifest` as well as next.js can use it to
pass it between server-client context.

I left a small comment to the implementation
(https://github.com/vercel/next.js/pull/56389/files#diff-bf12ed2c69d0bc89a06884779da4ae44967eb8becada031dea12bedef28e2622R155)
for the lifecycle of this feature in case to fix further.

This makes to pass most of the basic next-dynamic related integration
tests, except if the import have webpack specific features like
ad42b610c2/test/development/basic/next-dynamic/pages/dynamic/multiple-modules.js (L5).

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-10-16 10:24:54 +02: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
Joris Tirado
21fadd3358
Fix typo (#56863) 2023-10-15 17:18:00 +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
Diana Gouveia
db188e480f
docs: fix cypress script typo in 10-testing.mdx (#56765)
fix cypress script name typo to run `cypress:open` as declared on package.json script example
2023-10-14 22:43:32 +00:00
Tim Neutkens
82e1057a7f
Fix CSP test when using Turbopack (#56833)
Since Turbopack doesn't use eval-source-map the CSP nonce will pass correctly, nice improvement over the current state where you can't check CSP in dev.
2023-10-14 20:07:29 +00:00
Tim Neutkens
c6fe20a31f
Remove specific hash checks for metadata.test.ts (#56843)
This ensures the tests pass in both webpack and Turbopack.

<!-- 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-14 19:54:55 +02:00
Tim Neutkens
dc1b565f58
Implement getOptimizedModuleAliases for Turbopack (#56839)
This ensures `import url from 'url'` works in the edge runtime when using Turbopack. It also ensures the stubs for fetch / object.assignare applied to the client and edge compilation.
2023-10-14 17:21:52 +00:00
Jiachi Liu
5d9f4193f9
Revert "Drop ipc server headers filters (#56226)" (#56836)
x-ref: https://github.com/vercel/next.js/issues/56038#issuecomment-1762855556
x-ref: https://github.com/vercel/next.js/issues/56038#issuecomment-1746864558

http header `connection` could still fail the image requests while running next build
2023-10-14 12:51:20 +00:00
Tim Neutkens
83d8867470
Add missing nanoid dependency to app-dir tests (#56830)
Fixes a bunch of the Turbopack test failures for `test/e2e/app-dir/app/index.test.ts`. Not sure how this passed with webpack before as the dep was indeed missing.
2023-10-14 11:32:10 +00:00
JJ Kasper
d390c3d56e
Fix build traces case (#56817)
This ensures our `readFile` handling for tracing we previously had is
maintained.

Test deployment with the provided reproduction can be seen here:
https://react-pdf-repro-jeqgyhmek-vtest314-ijjk-testing.vercel.app/

Fixes: https://github.com/vercel/next.js/issues/56676
2023-10-13 16:46:56 -07: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
VAS
14aeb49662
Update supported-browsers.mdx (#56815)
Fixed a typo -
docs/04-architechture/supported-browsers.mdx

Changes(s) made -
Fixed a typo for improving clarity
[includes -> include]
'your dependencies includes' -> 'your dependencies include'

Please review and merge it.
2023-10-13 21:04:49 +00:00
JJ Kasper
329cd71f66
Skip artifact download for test e2e deploy workflow (#56807)
x-ref: https://github.com/vercel/next.js/actions/runs/6502354559
2023-10-13 20:00:34 +00:00
Surav Shrestha
869d93c777
docs: fix several typos (#56788)
`Enviroment -> Environment`

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-10-13 15:40:14 -04:00
Tim Neutkens
313ceac475
Implement preferredRegion array in Turbopack (#56743)
This implements support for `export const preferredRegion = ['sfo1', 'lhr1']` in Turbopack. Previously this caused an error.
2023-10-13 18:58:03 +00:00
Leah
f9d12d1092
fix(turbopack): middleware path and aliases (#56804)
### Description

- Adds the page path to the middleware template (and also uses the template from the next.js loader)
- ESM aliases for the edge context
- Fix for the process polyfill to make it possible to import from `dist/esm`
- Fix for the `server-only`/`client-only` aliases


Closes WEB-1779
2023-10-13 18:41:52 +00:00
Balázs Orbán
fe0bfbf911
fix: add x-forwarded-* headers (#56797)
### What?

Adding back `x-forwarded-*` headers.


### Why?

Starting with #52492, these headers were lost.

### How?

We can populate these headers before executing a request.

Closes NEXT-1663
Fixes #55942
2023-10-13 17:58:33 +00:00
Alex Yang
ac8a6035df
fix: http2 example issue (#56768)
### What?

If the custom server uses `app.render(xxx)` will render the normal js files as server components in dev mode and cause 404 error when loading every non-HTML file.

### How?

Fixes https://github.com/nodejs/help/issues/4253, fixes https://github.com/vercel/next.js/issues/50270
2023-10-13 16:55:48 +00:00
vercel-release-bot
f95a11f804 v13.5.5-canary.13 2023-10-13 16:34:44 +00:00
Tobias Koppers
cb8361aca6
put app code into a separate layer (#56800)
### What?

app code is different from pages code and need to be in a separate layer

### Why?

Otherwise it tries to share chunks and will cause conflicting writes

### How?


Closes WEB-1778
2023-10-13 18:29:48 +02: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
Tobias Koppers
e8a92a9507
update manifest (#56737)
### What?

updates from daily test run


Closes WEB-1766
2023-10-13 11:19:54 +02:00
Zack Tanner
3264d91dab
memoize useParams (#56771)
`useParams` is not referentially equal between renders which can lead to unexpected behavior when used as a dep. 
This memoizes the response from `useParams` similar to `useSearchParams`.

[slack x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1697145987740229)
2023-10-13 07:47:05 +00:00
vercel-release-bot
e0cd06531b v13.5.5-canary.11 2023-10-12 23:23:04 +00:00
Michael Novotny
fd2724ace0
Changes codeblock filename delimiter (#56712)
Based on feedback from #56603, the `/` can be interpreted as file paths instead of filename separators / delimiters. We'll change them to use pipes `|` instead.
2023-10-12 23:18:22 +00:00
vercel-release-bot
f306108b37 v13.5.5-canary.10 2023-10-12 23:09:37 +00:00
Zack Tanner
10ba5f772b
Revert static worker refactor (#56767)
The changes to this worker from #55841 seem to also cause strange behavior where the process doesn't exit despite sending an exit signal. Reverting until we can spend the time to investigate what the issue is. 

[slack x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1697129702263269)
[slack x-ref](https://vercel.slack.com/archives/C056QDZARTM/p1697149427099799?thread_ts=1696351087.736439&cid=C056QDZARTM)
2023-10-12 23:03:48 +00:00
Wyatt Johnson
786ef25e52
Revalidate Type (#56763)
This adds a new `Revalidate` type which is used internally by Next.js to associate the user inputted value of `revalidate` from `getStaticProps` or the exported `revalidate` variable in app directory.
2023-10-12 22:20:50 +00:00
Hamir Mahal
9288ef4921
feat: add self-documenting .env.example file (#56469)
- fixes #56468

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-10-12 21:55:14 +00:00
Zack Tanner
476af24628
Revert "Prefer module over main on main fields for app router server compiler" (#56766)
This was causing some issues with our deployments.

[slack x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1697146531305779)
2023-10-12 21:38:44 +00:00
Wyatt Johnson
961fd01ebc
Utilize Promise.withResolvers (#56764)
This utilizes `Promise.withResolvers` in a few places where it was done the old way. This also rearranges some imports and typings.
2023-10-12 21:10:19 +00:00
Mayank
0b5251c2f0
chore(example): bump @radix-ui/react-icons (#56452)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-10-12 20:38:09 +00:00
Leah
230099b57f
fix(turbopack): always alias server-only and client-only (#56760)
Closes WEB-1773
2023-10-12 19:17:01 +00:00