Commit graph

17937 commits

Author SHA1 Message Date
Balázs Orbán
523474c8be
chore: lower Node.js version requirement (#56943) 2023-10-17 23:15:31 +02:00
Steven
3a459ca986
chore(next/image)!: mark onLoadingComplete as deprecated in favor of onLoad (#56944)
## History

We used to pass `onLoad` through directly to the underlying img so `onLoadingComplete` was introduced in order to handle the case when `placeholder="blur"` was used and `onLoad` would trigger before the placeholder was removed.

We have since changed the behavior of `onLoad` so that it acts the same as `onLoadingComplete` and therefore `onLoadingComplete` is no longer needed.

## What is this PR doing?

This PR marks `onLoadingComplete` as deprecated in favor of `onLoad`. In the future, we may remove `onLoadingComplete`.
2023-10-17 21:12:22 +00:00
Steven
6ed4fddf8a
chore(test): set COREPACK_ENABLE_STRICT: 0 for create-next-app tests (#56955)
I think some of the runners are missing `yarn` globally installed so its attempting to install with corepack. But the default behavior of corepack is to use the repo version (pnpm in this case) so running `yarn` will error. This PR disables corepack strict mode to avoid that problem.
2023-10-17 19:56:06 +00:00
Sukka
17553c5e25
chore: reduce fs-extra usage in scripts/ (#56917)
The PR follows #56536 and #56491, replacing `fs-extra` usages inside the `scripts/` folder.

Note that the `copy` and `move` haven't been replaced yet. Currently, there is no better recursive copy (lightweight, promise-based, Node.js built-in `copyFile` API-based, support the `filter` option) library alternative available on npm, and Node.js built-in `fs.rename` doesn't support `overwrite`.

The PR also replaces many async fs API usage with their sync versions.

cc @wbinnssmith
2023-10-17 19:31:19 +00:00
Wyatt Johnson
255cc9b9a7
Replace Promise.withResolvers polyfill with DetachedPromise (#56954)
In an attempt to avoid introducing experimental features into the Next.js userland space, we're reverting the `Promise.withResolvers` polyfill and preferring an internal `DetachedPromise` interface.
2023-10-17 19:15:44 +00:00
Janicklas Ralph
5e474a3f19
Adding useGoogleTagManager hook to @next/third-parties (#56106)
This PR adds the `useGoogleTagManage` hook to `@next/third-parties` repo.
2023-10-17 18:04:53 +00:00
vercel-release-bot
df1d4a16aa v13.5.6-canary.3 2023-10-17 16:36:35 +00:00
Jimmy Lai
451a54cb2e
cache: add unstable_noStore API (#56930)
This PR introduces a new API, `unstable_noStore`, which will allow users to declaratively opt out of caching anywhere during static generation in the same way that you can specify `cache: 'no-store'` on a fetch call in Next.js.

An important caveat and difference from just calling `cookies()` to opt-out of static generation is that this won't opt you out when called from within `unstable_cache` and instead defers to the cache configuration to it.

```
import {unstable_noStore as noStore} from 'next/cache';

export default async function Component() {
  noStore();
  const result = await db.query(...);
}
```
2023-10-17 14:52:46 +00:00
dpnolte
218d0709eb
feat: set status code to 500 if unexpected error occurs before streaming in app router (#56236)
<!-- 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 #

-->

This PR therefore introduces to always set response status code to 500
unless it is a `NotFoundError` or `RedirectError`. This PR would fix
issue #56235. See also:
https://codesandbox.io/p/sandbox/nice-panini-2z3mcp .

**Current Behavior**
At the moment, when an unexpected error occurs during app server
rendering, a 200 ok is returned as status code. This seems to be
undesirable because of the success status CDNs will cache the error
pages and crawlers will index the page considering the error content as
the actual content.

**Desired Behavior**
This issue is related to discussion
https://github.com/vercel/next.js/discussions/53225. Even though I
understand that the response status code cannot be set if streaming has
started, in my view it would be best to set the response status to 500
whenever it can (so before the streaming has started) for SEO and (CDN)
http caching. This would also be consistent with how 404s currently
work; that is, response status code is set to 404 if `NotFoundError`
occurred before streaming (related
[issue](https://github.com/vercel/next.js/issues/43831) &
[PR](https://github.com/vercel/next.js/pull/55542)).

Ideally, when a runtime error happens after streaming, a `<meta
name="robots" content="noindex" />` would also be added. But I didn't
want to make the PR too complex before receiving feedback.

---------

Co-authored-by: Vũ Văn Dũng <me@joulev.dev>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-10-17 15:32:20 +02: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
Jimmy Lai
552b9747ff
perf: fix tracing for routes (#56924)
follow up to #56898 where I noticed that we don't apply any filtering to the trace files for the user routes, resulting in files that would need to be filtered like `caniuse` not being filtered out correctly. This fixes that.

A lambda in my test project goes from `2.7MB` to `1.4MB`

followup: add some snapshot tests

before
```
Serverless function size info
Serverless Function's pages: _not-found.js, index.js
Large Dependencies                                                     Uncompressed size  Compressed size
node_modules/.pnpm/next@13.5.6-canary.1_react-dom@18.2.0_react@18.2.0            4.61 MB          1.35 MB
node_modules/.pnpm/caniuse-lite@1.0.30001517                                   909.73 KB        327.14 KB
node_modules/.pnpm/react-dom@18.2.0_react@18.2.0                               546.21 KB        138.87 KB

All dependencies                                                                 3.66 MB          2.01 MB
Serverless Function's page: favicon.ico.js
Large Dependencies                                                     Uncompressed size  Compressed size
node_modules/.pnpm/next@13.5.6-canary.1_react-dom@18.2.0_react@18.2.0            6.71 MB          2.05 MB
node_modules/.pnpm/caniuse-lite@1.0.30001517                                   909.73 KB        327.14 KB
node_modules/.pnpm/react-dom@18.2.0_react@18.2.0                               546.21 KB        138.87 KB

All dependencies                                                                 5.78 MB          2.71 MB
Serverless Function's page: api/hello-world.js
Large Dependencies                                                     Uncompressed size  Compressed size
node_modules/.pnpm/next@13.5.6-canary.1_react-dom@18.2.0_react@18.2.0            4.61 MB          1.35 MB
node_modules/.pnpm/caniuse-lite@1.0.30001517                                   909.73 KB        327.14 KB
node_modules/.pnpm/react-dom@18.2.0_react@18.2.0                               546.21 KB        138.87 KB

All dependencies                                                                 3.65 MB          2.01 MB
```

after

```
Large Dependencies                                                                          Uncompressed size  Compressed size
node_modules/.pnpm/file+next-canary+next-13.5.6-canary.1.tgz_react-dom@18.2.0_react@18.2.0            2.87 MB         844.1 KB

All dependencies                                                                                    341.31 KB        992.45 KB
Serverless Function's page: favicon.ico.js
Large Dependencies                                                                          Uncompressed size  Compressed size
node_modules/.pnpm/file+next-canary+next-13.5.6-canary.1.tgz_react-dom@18.2.0_react@18.2.0            4.97 MB          1.52 MB

All dependencies                                                                                      2.45 MB          1.67 MB
Serverless Function's page: api/hello-world.js
Large Dependencies                                                                          Uncompressed size  Compressed size
node_modules/.pnpm/file+next-canary+next-13.5.6-canary.1.tgz_react-dom@18.2.0_react@18.2.0            2.87 MB         844.1 KB

All dependencies                                                                                    328.64 KB        989.23 KB
````
2023-10-17 09:09:40 +00: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
Dmitriy Glazkov
26d0bf27fb
Update 05-mdx.mdx . Fix key of the prop (#56883)
Fix key of the prop

Also the same key prop we can find in `next-mdx-remote` [example with getStaticProps](https://github.com/hashicorp/next-mdx-remote#typescript)
2023-10-16 22:21:44 +00:00
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