Commit graph

18188 commits

Author SHA1 Message Date
Shu Ding
a255e02879
Simplify iv prefixing of Server Actions encryption (#57274)
Since we have a fixed length of the random bytes prefixed to the iv,
there's no need to split by `:`.
2023-10-23 11:06:59 -07:00
Steven
ab9bada7b7
chore(export)!: remove next export in favor of output: export in next.config.js (#57085)
BREAKING CHANGE

Since `next export` has been printing a deprecation warning since https://github.com/vercel/next.js/pull/47376, its safe to remove in semver-major.

The upgrade path is to simply add `output: 'export'` in `next.config.js` - everything will continue to work the same.

This config greatly improves the `next dev` experience today. And in the future, it will improve performance of `next build` because we no longer need to do two passes (build then export).
2023-10-23 18:03:58 +00:00
Jimmy Lai
7208535786
perf: fix memory leaks in the edge runtime in dev (#57235)
This PR fixes a memory leak when using `next dev` where on HMR, we would always retain the memory associated with the old VM instance, leading to pretty egregious usage of RAM after only a few edits.

The leak itself comes from methods like `setTimeout` and `setInterval` capturing the context in which they were called and somehow never releasing, even if the timeout happened, when running in a Node.js `vm`. This is probably a Node.js bug.

The fix consists of taking ownership of all timeouts and clearing them ourselves manually at the end of each VM lifecycle.

Tested manually:
- hello world Next.js app with edge runtime
- triggered hmr 10 times
- memory usage
  - base: 400MB
  -  before: 800MB
  - after: 400MB
2023-10-23 17:51:06 +00:00
Shu Ding
eb4b41e513
Fix unmatched WebSocket upgrade requests being closed (#57245)
We should not close unmatched sockets as it might be handled by user's server.

Fixes #56996
Fixes #49334
Fixes #55299
2023-10-23 17:23:34 +00:00
Ahmed Abdelbaset
4a37c2d1a1
chore: fix a typo (#57272) 2023-10-23 17:10:35 +00:00
Shu Ding
67415750f3
Improve encryption of Server Actions closure arguments (#57227)
This change makes sure that the iv of AES-GCM encryption is cryptographically random on each request. Also added a constant prefix as some kind of checksum to ensure the data is not damaged (e.g. wrong key is being used).
2023-10-23 16:53:15 +00:00
Jiachi Liu
b0e3a67edb
Fix relative metadata url resolving on windows (#57265)
x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=71544&view=logs&j=8af7cf9c-43a1-584d-6f5c-57bad8880974&t=7ae70e63-3625-50f4-6764-5b3e72b4bd7a

We need to use poxis join for url pathname

```
- Expected  - 1
+ Received  + 1
  Object {
    "itunes": Object {
-     "appArgument": "http://test.com/base/test/native/app",
+     "appArgument": "d:\\test\\native\\app",
    },
    "metadataBase": "http://test.com/base",
  }
  210 |       ]
  211 |       const metadata = await accumulateMetadata(metadataItems)
> 212 |       expect(mapUrlsToStrings(metadata)).toMatchObject(
      |                                          ^
  213 |         mapUrlsToStrings({
  214 |           metadataBase: new URL('http://test.com/base'),
  215 |           itunes: {

```
2023-10-23 16:38:51 +00:00
Tim Neutkens
e6b103b85b
Simplify options passed to createWebpackAliases (#57239)
Reducing the options so it becomes easier to call it outside of
webpack-config.ts, which would be needed to pass it to 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-23 09:04:05 -07:00
Tobias Koppers
c2ba7e6a16
Turbopack: fix over-invalidation of node.js assets (#57240)
### What?

* no need to clear require cache when assets where not used previously
* make build status reporting more consistent
* report build status to client side for build indicator

### Why?

### How?


Closes WEB-1826
2023-10-23 17:56:47 +02:00
Tim Neutkens
6adb9716c5
Add CompilerAliases Type (#57237)
Ensures all functions in create-compiler-aliases.ts have the same return type.
2023-10-23 15:52:43 +00:00
Tim Neutkens
a65e5c07a8
Remove reactServerCondition property as it is not used (#57236)
Removes the unused properties from createRSCAliases.
2023-10-23 03:23:05 +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
Jiachi Liu
c5207751a2
Polish turbopack start logging (#57203)
Bring a tiny util to get a `(turbo)` label after next.js info for turbopack dev-server logging and also remove the disclaimer of "thank you for trying".

### After

<img width="597" alt="image" src="https://github.com/vercel/next.js/assets/4800338/c3658775-3ce6-48fc-8128-7baebe9f104b">


### Before

<img width="597" alt="image" src="https://github.com/vercel/next.js/assets/4800338/d008dd0b-4c58-4612-b1c4-d5e97e041c1b">


* Fixes the bad dim color
* Colorize the `Next.js (turbo)` label
* Move the learning link down after start message
* Use Log util to format logs
* Remove "v13" related text
2023-10-23 02:53:40 +00:00
Jiachi Liu
ac00e86452
test: stablize the metadata url tests (#57204)
x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=71307&view=logs&j=8af7cf9c-43a1-584d-6f5c-57bad8880974&t=7ae70e63-3625-50f4-6764-5b3e72b4bd7a
2023-10-23 02:18:43 +00:00
Tim Neutkens
823fe7ffa4
Remove scheduler/tracing alias as the file no longer exists (#57234)
This file has been removed from React for a long time, it's no longer relevant.
2023-10-23 02:07:48 +00:00
Tim Neutkens
87c8e01679
Move webpack aliases into separate file (#57233)
Refactoring the webpack-config.ts file to no longer have all aliases defined, instead they are in a separate file which should make refactoring these to use them in Turbopack simpler.
2023-10-23 01:26:46 +00: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
Jimmy Lai
1836998e52
perf: memory usage tweaks (#57163)
This PR does two things:
- bring back the logic to restart the dev server when approaching 80% of
the heap limits
- add some logic to increase the default Node.js memory usage to 50% of
the available RAM

Tested manually

<!-- 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-22 17:26:48 -07:00
vercel-release-bot
2762511796 v13.5.7-canary.15 2023-10-22 23:22:41 +00:00
Tim Neutkens
8074fc171f
Leverage defineEnv for all environment variables in Turbopack (#57196)
This ensures all `process.env` replacement comes from define-env in
Next.js, instead of also applying it partially on the Rust side.
<!-- 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-22 15:37:48 -07:00
OJ Kwon
85c3ea8e5b
fix(next-core): align edge chunking context's asset root (#57022)
### What?

If there's a static asset with edge runtime config, turbopack will bail with

```
 ⨯ ModuleBuildError: Code generation for chunk item errored
An error occurred while generating the chunk item [project]/test/e2e/app-dir/metadata/app/icon.svg (static, edge rsc)

    Caused by:
    - expected output_root to contain asset path

    Debug info:
    - An error occurred while generating the chunk item [project]/test/e2e/app-dir/metadata/app/icon.svg (static, edge rsc)
    - Execution of <DevChunkingContext as ChunkingContext>::asset_url failed
    - expected output_root to contain asset path
```

Since we creates chunking context for the edge with different output_root and asset_root, by using asset_root to be client_root. The other places creating context with  `DevChunkingContext` don't do this, PR simply adjusting root to be output_root.

For the server's chunking context it actually accepts client_root and set the asseturl with client root instead. However not sure if that's what we want with devchunkingcontext.

This is part of metadata fixes for the test; however edge rendering still doesn't work so test doesn't pass yet.

Closes WEB-1798
2023-10-22 19:15:09 +00:00
Tobias Koppers
cf79cbf3b3
update test manifest (#57105)
update test manifest from daily test run

Closes WEB-1809
2023-10-22 19:00:00 +00:00
Shu Ding
7445c35aa4
Polish the error message when using "use client" from a client action (#57164)
Fixes NEXT-1605 - explained in the error message.
2023-10-22 16:55:18 +00:00
vercel-release-bot
e5c082418d v13.5.7-canary.14 2023-10-21 23:23:17 +00:00
Tobias Koppers
31dddcaa47
Turbopack: reenable some skipped test cases (#57177)
### What?

### Why?

better CI coverage

### How?



Closes WEB-1820
2023-10-21 15:11:27 -07:00
Tim Neutkens
488a61fd50
Skip output export production tests for Turbopack (#57197)
- Skips production tests for Turbopack
- Ensures the `suite` is not `undefined` because there was no describe block.
2023-10-21 22:10:36 +00:00
OJ Kwon
3c3744631e
fix(loader_tree): propagate metadata to corresponding layout (#56956)
### What?

- fixes test 17553c5e25/test/e2e/app-dir/metadata/metadata.test.ts (L487)

The way next.js collects static metadata is read static metadata, and then read layout metadata to merge multiple metadatas into a single layout path (17553c5e25/packages/next/src/lib/metadata/resolve-metadata.ts (L347-L352))

When turbopack creates LoaderTree for the corresponding directory tree, it extracts `page` but skips metadata  in result there are orphan components that have a metadata doesn't have layout metadata, as well as a component have a layout doesn't have metadata. Latter is being rendered as a page (since it have correct layout), which eventually falls back to the default metadata instead.

PR trickles down the metadata when extracting page (creating a new component with `page`) to consolidates those.

Also PR expands Metadata to have base_page property to capture where it has been originally exists, as we clone down metadata then do `fillMetadataSegment` against the current page where LoaderTree is being created it creates a wrong relative path. For example, currently

```
/icon.svg
 - opengragph/
      - static -> path being `/opengraph/.../icon.svg` instead of `/icon.svg`
```

When recursively traverse directory tree, capture each components with corresponding base_page to calculate instead.

Unfortunately this doesn't make pass all of the metadata tests; there are lot to dig more. Would like to scope PR in a reasonable size.


Closes WEB-1795
2023-10-21 21:24:40 +00:00
Tim Neutkens
8502d0aab0
Skip webpack test in Turbopack test run (#57195)
This test checks webpack loaders so can be safely disabled for Turbopack.
2023-10-21 20:58:11 +00:00
Tim Neutkens
23bcfffad2
Fix SCSS and SCSS loader handling tests for Turbopack (#57192)
These tests depend on the order of test runs in order to run, so they fail if the first test has not run. This ensures it's skipped for the others.
2023-10-21 20:45:57 +00:00
Tim Neutkens
2bb9b2a7c2
Fix two tests that use exportPathMap for Turbopack (#57194)
More Turbopack test fixes.

<!-- 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-21 13:32:48 -07:00
Zack Tanner
eae65fa7b9
improve server actions error when on unsupported node version (#57191)
When using server actions on an unsupported version of Node, you might see the following errors:

> NotSupportedError: multipart/form-data not supported

Support in Undici was landed in 5.11.0 which made it into Node v18.11.0

> TypeError: e._formData.forEach is not a function

Earlier versions of v18 (such as 18.0.0) did not have a `.forEach` implementation on FormData

This throws a better error before the user can get to the point of seeing these more confusing errors.

Closes NEXT-1658
Fixes #55932
2023-10-21 19:32:46 +00:00
Jiachi Liu
c43c915961
Polish auto create layout warning color (#57190)
### After
<img width="643" alt="image" src="https://github.com/vercel/next.js/assets/4800338/254f2ecf-1a22-4756-baf8-d497fa9485ee">

### Before
![image](https://github.com/vercel/next.js/assets/4800338/8acf8c6e-690f-4827-a8fb-bd729e276f0f)
2023-10-21 19:21:22 +00:00
Shu Ding
458e1998e1
Refactor code (#57189)
Refactored some code.
2023-10-21 18:50:56 +00:00
Tim Neutkens
d99602da87
Remove printing fixed issues for Turbopack (#57188)
We'll revisit this after Turbopack is stable.
2023-10-21 18:30:23 +00:00
Shu Ding
a383b93556
Encoding and decoding variables of Server Actions from the closure (#56377)
This PR implements encryption and decryption for Server Action bound values that are from the closure level. Explicit `.bind` values, function arguments and module-level values are NOT handled.

### Compiler

The compiler now groups all closure bound values to an array which gets wrapped with `encrypt`. And then inside the action body, it prepends an expression to recreate the values via `await decrypt`.

Since closure-closed variables will only exist on the server layer, the encryption utility has `"server-only"` annotated.

### Encryption

During build time, a private AES-GCM encryption key is randomly generated and stored in the built server manifest. Before encrypting/decrypting, an extra round of Flight server and client will be used to serialize/deserialize the value.

When encrypting, a salt that contains the action ID is provided to prevent replay attack towards different API endpoints. The encryption key can be overridden via the `NEXT_SERVER_ACTIONS_ENCRYPTION_KEY` env variable so it can be built on multiple machines on scale.

A global singleton for storing the client reference manifest was made for Flight's serialization/deserialization as that might happen outside of rendering.

After encryption, we then serialize the ArrayBuffer as Base64 to send it to the client.
2023-10-21 17:52:06 +00:00
Ryo Matsukawa
9a8b14632c
chore: Add condition to skip update-fonts workflow on forks (#57165)
<!-- 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 #

-->

### What?
Added a condition to skip the update-fonts workflow for forked
repositories.

### Why?
To optimize CI resources and prevent extra runs on forks.

### How?
By checking the repository name and comparing it with the main
repository before executing the workflow.
2023-10-21 00:50:36 -07:00
Jimmy Lai
4e27b908fe
misc: fix injecting --inspect with NODE_OPTIONS (#57159)
This PR fixes the passing of the `--inspect` option when calling Next.js with it. It's still not great because you need to target the next file in node_modules directly but I'll add a `next --inspect` option in the future.
2023-10-21 00:49:41 +00:00
Will Binns-Smith
1ffef0f1a3
Turbopack: support more server code in tracing error stack frames (#57156)
This:
- Uses `isServer` to use the appropriate Turbopack `FileSystem` when
creating `FileSystemPath`s
- Properly uri decodes path segments originating from `file://` uris
- Correctly reads chunks starting at the project path instead of the
root path


Closes WEB-1815

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-20 17:09:10 -07: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
Wyatt Johnson
8afbce84de
Cleanup Request Meta (#57144)
This cleans up the meta for requests by removing the legacy `_next` prefixes and removing some unused ones.
2023-10-20 23:40:37 +00:00
vercel-release-bot
d0a1199a36 v13.5.7-canary.13 2023-10-20 23:23:41 +00:00
Jiachi Liu
e6fbeabd1a
Display experimental features for next build (#57152)
Display full information of experimental features in `next build`, so we'll have full insights for build logs


Close NEXT-1697

* `next build`
<img width="668" alt="image" src="https://github.com/vercel/next.js/assets/4800338/6ab75923-0336-4624-905f-347fedbff5a9">
2023-10-20 22:37:23 +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
Wyatt Johnson
354705d1c3
Route Handler Types (#57070)
This updates the handle functions on the server to share a common type that simplifies the signature.
2023-10-20 21:21:18 +00:00
Phil Wolstenholme
aa1ee5995c
Mark most GTMParams as optional (#57153)
Fixes #57126

The `<GoogleTagManager>` types in `@next/third-parties` seem incorrect compared to [e2e test usage](https://github.com/vercel/next.js/blob/canary/test/e2e/third-parties/pages/gtm.js#L11) where only the `gtmId` is shown/needed.

```
<GoogleTagManager gtmId="GTM-XYZ" />
```


The extra options (datalayer name etc) are not needed as the `GoogleTagManager` has defaults: https://github.com/vercel/next.js/blob/v13.5.7-canary.11/packages/third-parties/src/google/gtm.tsx#L24-L32
2023-10-20 21:04:00 +00:00
Josh Story
5528cc6d4e
Remove the experimental serverActions flag (#57145)
Remove the experimental `serverActions` flag

Co-authored-by: Shu Ding <3676859+shuding@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-20 20:45:25 +00:00
Leah
2f2e8e26e2
chore: create template from next-edge-ssr-loader (#56715)
### Description

- Splits the generated code of the `next-edge-ssr-loader` out into 2 templates
- This PR also adds support for optional imports in templates

Closes WEB-1761
2023-10-20 20:19:49 +00:00
JJ Kasper
888c3a7439
Reduce e2e deploy concurrency (#57142)
Attempting to reduce our time outs for this job by reducing concurrency
2023-10-20 19:56:13 +00:00
Balázs Orbán
f9bd6f7621
chore: drop web streams polyfilling on globalThis (#57077)
### What?

`globalThis.ReadableStream` and `globalThis.WriteableStream` has been exposed since Node.js 18, which is our new default requirement. (#56943)

### Why?

This simplifies the code and might result in slightly better performance.

### How?

Drop any checks of `globalThis` properties that are always defined now.
2023-10-20 19:38:35 +00:00