Commit graph

17920 commits

Author SHA1 Message Date
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
Tim Neutkens
7cb88871cd
Add next.config.js options to turbopack warning file (#56207)
Went through all options listed in config-shared.ts and added them to
the turbopack warning file so that there is a clear list of what is not
implemented yet.

<!-- 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-29 14:08:40 +02:00
Tim Neutkens
590798b40b
Add support for experimental.logging.level in Turbopack (#56201)
Adds logging.level support, doesn't require changes to Turbopack.

Also addresses a review on my earlier PR:
https://github.com/vercel/next.js/pull/56200#discussion_r1341131069
<!-- 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-29 12:52:52 +02:00
Tim Neutkens
5521d0ed82
Update supported options list to reflect #56188 (#56200)
Updated to reflect #56188.

<!-- 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-29 11:30:14 +02: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
Lokesh Singh
a623685f44
chore(examples): remove deprecated dependency from with-jest (#56152)
Fixes #56151
Tests added: none
Errors: https://ibb.co/MnTDChy

@testing-library/jest-dom provides its own type definitions

@types/testing-library__jest-dom has been deprecated 
ref: https://www.npmjs.com/package/@types/testing-library__jest-dom
2023-09-29 01:56:09 +00: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
boylett
769d27aacc
correcting link to useSearchParams ref (#56169)
The link to the useSearchParams ref within the File Conventions > layout.js page currently links to the useParams ref, which is wrong and may lead to confusion as the useParams and useSearchParams APIs operate differently.
2023-09-28 23:11:33 +00:00
Tim Neutkens
5415811037
Implement list of config options for Turbopack (#56188)
This adds the define env for listed options below:

- `crossOrigin`
- `devIndicators`
- `output`
- `analyticsId`
- `optimizeFonts`
- `experimental.useDeploymentId`
- `experimental.useDeploymentIdServerActions`
- `experimental.deploymentId`
- `experimental.manualClientBasePath`
- `experimental.optimisticClientCache`
- `experimental.middlewarePrefetch`
- `experimental.optimizeCss`
- `experimental.nextScriptWorkers`
- `experimental.webVitalsAttribution`

For some there might still be missing pieces, for example `crossOrigin` needs something in Turbopack's script injection but most others will "just work" after this PR. 

Added the few ones that did not come directly from config as todos, this PR can be landed without those.
2023-09-28 22:48:16 +00:00
Tim Neutkens
59ce492dfe
Add support for i18n config in Turbopack (#56182)
Add support for `i18n` in 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 #

-->

---------

Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
2023-09-28 22:12:40 +02:00
Vũ Văn Dũng
7f6a494e9e
docs: Use Response.json over NextResponse.json (#56173)
TypeScript 5.2 now supports `Response.json` (https://github.com/microsoft/TypeScript/issues/52841). That means, if we just need to return a JSON `Response`, we no longer need to import `NextResponse`. This PR updates all such instances in the documentation to use `Response.json`.
2023-09-28 19:36:21 +00:00
Shu Ding
141ccef608
App render related code clean up (#56178)
This PR renames some confusing parts of app-render to explicitly name things as Fizz or Flight streams. There're also 2 memory optimizations that in `streamToBufferedResult` we don't need to buffer these chunks and `join` them later. Also the `rscChunks` array isn't used but it is kept in memory for the entire request lifetime.
2023-09-28 19:21:04 +00:00
Balázs Orbán
4ec443931a
fix(cna): pin dependency versions (#56177)
### What?

This PR is pinning the installed versions of dependencies in `create-next-app`

### Why?

Currently, we write `latest` to `package.json`, 

### How?
As far as I can tell, there is no way to update the `package.json` file based on the lockfile (which does have the information needed).

Major versions are bumped less frequently, so this should be fine to update manually.

Other alternatives would be:
- return to the previous way of running `npm i --save` and `npm i --save-dev` instead (ref: #55730). This might be slightly slower than one `npm i` pass though.
- fetch the latest versions of each package from the registry. Might be even slower

NOTE: The user has always the alternative to update the versions to their desired ones afterward.

Fixes #56174
2023-09-28 18:22:02 +00:00
JJ Kasper
403cb4a6ac
Update experimental compile cache handling (#56139)
This ensures we properly set a cache-control header for automatically statically optimized pages so we aren't re-re-rendering every time for them when leveraging this mode.
2023-09-28 18:13:05 +00:00
Shu Ding
fe90b04f95
(docs) Document Server Actions .bind method (#56164)
This will be the recommended way of passing extra arguments to a Server Action. A couple of reasons behind:

- This is better than putting a hidden `<input hidden value={userId}/>` because that will appear in the SSR'd HTML as full text and cannot be encoded. With `.bind`, we can handle that in the future.
- This is better than event callbacks `onSubmit={(e) => { await updateUser(userId, e.target.formData) }}` as this supports progressive enhancement.
- This is better than re-creating a new action `action={async (formData) => { "use server"; return updateUser(userId, formData) }}` as inlined `"use server"` only works in Server Components.
2023-09-28 16:20:53 +00:00
Bozhen
9cd46e335c
docs: Renamed function that is used by other name (#56170)
In "app/actions.ts" the function is named like create(), but in "app/add-form.tsx" file "createTodo" function is imported and used. This is related to TypeScript examples, .js files are ok.

### What?

Renamed a function.

### Why?

There are two example files in docs ([Error Handling](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#error-handling) section) and the `app/add-form.tsx` is importing function `create` from `app/actions.ts` by another name (`createTodo`).

### How?

Fixed by renaming function to `createTodo`, to match .js file with the same example.
2023-09-28 15:05:24 +00:00
vercel-release-bot
e18c9dde3f v13.5.4-canary.6 2023-09-28 15:00:44 +00:00
Jiachi Liu
48093b87a9
Allow jest to run with use server directive (#56148)
Disable server components and server actions SWC transform when it's running jest. You can only do basic DOM testing like what we described in #54891 instead the server action itself.

Closes #53065 
Closes NEXT-1473
2023-09-28 14:15:51 +00:00
Jimmy Lai
8f0f8236ab
perf: add option to bundle pages externals (#56162)
This PR adds an option to forcefully bundle node_modules packages in `pages` on the server. This should benefit cold boots for projects that uses pages, at the cost of build time increase.
2023-09-28 14:01:42 +00:00
vercel-release-bot
49f646da14 v13.5.4-canary.5 2023-09-28 13:48:17 +00:00
Jimmy Lai
57bd3232f6
misc: refactor handleExternals (#56161)
This PR just moves handleExternal off the main webpack config file for better readability.
2023-09-28 13:26:18 +00:00
Tim Neutkens
f95f8c52d5
Add experimental.scrollRestoration for Turbopack (#56150)
Skipping this one was as much work as implementing it, so I've just
implemented the flag.

This option is no longer relevant for `app` though.

<!-- 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 13:22:42 +02:00
Tim Neutkens
e4d072f35d
Add support for skipTrailingSlashRedirect and skipMiddlewareUrlNormalize in Turbopack (#56147)
This one only requires the environment variable to be set. Existing
tests already cover this feature.

With these changes `test/e2e/skip-trailing-slash-redirect` can run,
didn't check if there are failing tests yet.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-28 13:16:35 +02:00
Tim Neutkens
711fa2133d
More test updates (#56146)
Follow-up to #56089

<!-- Thanks for opening a PR! Your contribution is much appreciated.i
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 13:11:11 +02:00
Jimmy Lai
3e32378c73
misc: refactor node utils (#56096)
This PR just splits apart a big file. Not a big size improvement but still worthwhile.


<!-- 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:07:34 +02:00
Jimmy Lai
e9c264db56
perf: externalise ws for bundled server (#56095)
This PR makes `ws` an external. AFAIK we don't really need it on prod, so this saves around 40KB on the server.


<!-- 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:06:30 +02: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
Jimmy Lai
3b0ee4e5f8
perf: remove react dom legacy from app router (#56082)
This PR includes changes to Next.js bundling in order to aliases references to the `react-dom/server` legacy build to a no-op in order to save KBs. We don't use any of the legacy methods so it's best to just shave it off. This should improve cold boots for both edge and regular servers.

Before:
<img width="622" alt="CleanShot 2023-09-27 at 13 30 47@2x" src="https://github.com/vercel/next.js/assets/11064311/fa383000-c71e-420e-9daa-b8d93ff242e7">

After:
<img width="622" alt="CleanShot 2023-09-27 at 13 31 32@2x" src="https://github.com/vercel/next.js/assets/11064311/702f083a-705f-4b12-9133-9bb7eb02109e">

A win of 70KBs.

<!-- 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:03:32 +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
Tobias Koppers
b689f84600
Turbopack: update test manifest (#56133)
Closes WEB-1672
2023-09-28 08:23:26 +02:00
JJ Kasper
2820b2bf4a
special case timeout on windows (#56120)
windows is slower so need to increase the timeout for that one
2023-09-28 03:46:04 +00:00
walker flynn
8f3eb01193
Update revalidatePath.mdx to fix confusing wording of arguments section. (#56099)
This part of the documentation was confusing and did not match the below examples.
2023-09-28 01:11:00 +00:00
Leah
293de45acf
feat(turbopack): port bloom filter to nexturbo (#55678)
Closes WEB-1096
2023-09-28 01:00:49 +00:00
Jonathan Summers-Muir
06705a4815
Chore/update with supabase demo deploy button (#52483)
### What?

- added correct deploy button urls
  - uses new supabase integration
- updated readme for local development, more clearer instructions
- added opengraph image

### Why?

- old supabase integration is buggy
- readme is more clear for local development

---------

Co-authored-by: Steven Tey <stevensteel97@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-09-27 17:36:17 -07:00
Jimmy Lai
341b67859d
misc: stop hiding node_modules in vscode (#56081)
I find myself digging a lot through node_modules so I'd rather have it displayed in VSCode.
2023-09-28 00:35:53 +00:00
Vercel Release Bot
4444631526
Update font data (#56121)
This auto-generated PR updates font data with latest available
2023-09-28 00:18:59 +00:00
JJ Kasper
fb04b85bb6
Decrease default test timeouts (#56116)
When tests are timing out we shouldn't wait for 4 minutes before it officially fails so this brings down the default test timeouts
2023-09-27 23:55:20 +00:00
vercel-release-bot
f5ac079e54 v13.5.4-canary.4 2023-09-27 23:17:38 +00:00
JJ Kasper
eba9fca3ff
Optimize build trace handling (#56048)
This consolidates our trace handling between turbotrace and the default
`nodeFileTrace` handling to prevent over-tracing. With node-file-trace
it's extremely more efficient to trace in a single `nodeFileTrace` run
so that all resolving/analysis etc can be efficiently cached.

Furthermore, this reduces the amount of chunks we need to trace by
waiting until post build since automatically statically optimized paths
don't need to be traced as they are rendered to purely HTML and never
re-rendered.

This reduces builds times by upwards of 4 - 5 minutes on larger
projects.
2023-09-27 16:07:57 -07:00
Jiachi Liu
7b48a1e2f0
fetching logging on edge (#56108)
Support fetching logging working with edge runtime. When you enable edge runtime and experimental logging config in `next.config.js` you should be able to see the data fetching logs like edge runtime

```
 GET /default-cache 200 in 4304ms
 │ GET https://next-data-api-endpoint.vercel.app/api/random?no-cache 200 in 373ms (cache: SKIP)
 │  │  Cache missed reason: (cache: no-cache)
 │  │ GET https://next-data-api-endpoint.vercel.app/api/random?force-cache 200 in 163ms (cache: SKIP)
 │  │  │  Cache missed reason: (cache-control: no-cache (hard refresh))
 │  │ GET https://next-data-api-endpoint.vercel.app/api/random?revalidate-0 200 in 196ms (cache: SKIP)
 ```

Closes #55495
Closes NEXT-1661
2023-09-27 22:39:42 +00:00
vercel-release-bot
2ff2c0b4b2 v13.5.4-canary.3 2023-09-27 21:43:46 +00:00
Zack Tanner
4cfb0acd72
Revert: "Generate prefetch RSC payload during build for SSR paths (#54403)" (#56059)
Investigating problems this is causing where incorrect flight data is being generated (potentially not correctly bailing on non-static data) causing navigation issues. 

Reverts #54403
2023-09-27 21:38:49 +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
Adrien KISSIE
72cc94013c
Fix: Use boolean instead of false for experimental logging config (#56110)
This PR changes the type for the config `experimental.logging.fullURL` from `false` to `boolean`, i tested it and this config can accept both true and false and will work as expected, it is just the types that are wrong.
2023-09-27 20:42:53 +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
Tim Neutkens
c59de31a9b
Ensure unique name for app dir css tests (#56088)
Ensures this and the other describe block in the codebase have unique
names so that they're reported separately.

<!-- 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-27 18:38:01 +02:00
Jimmy Lai
8372bd13e6
misc: add node-version file (#55938)
Adding a node-version file to be used by fnm/nvm.

Currently, the version chosen is the one specified in package.json aka node 16. We're soon deprecating 16 so let's use 18 in development.
2023-09-27 14:29:44 +00:00
Tim Neutkens
633719e8cf
Skip Babel tests for Turbopack (#56091)
Follow-up to #56089, skips the Babel tests.

<!-- 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-27 16:12:43 +02:00