Commit graph

16424 commits

Author SHA1 Message Date
Shu Ding
0123a9d5c9
Optimize inlined Flight data array format (#52028)
When looking at [some sites](https://rsc-llm-on-the-edge.vercel.app/) with a large amount of chunks streamed, I noticed that the inlined Flight data array can be optimized quite a lot. Currently we do:

```js
self.__next_f.push([1,"d5:[\"4\",[\"$\",\"$a\",null,..."])
```

1. The `self.` isn't needed (except for the initial bootstrap tag) as React itself has `<script>$RC("B:f","S:f")</script>` too.
2. After the bootstrap script tag, all items are an array with `[1, flight_data]` and `flight_data` is always a string. We can just push only these strings.
3. We use `JSON.stringify(flight_payload)` to inline the payload where the payload itself is a string with a lot of double quotes (`"`), this results in a huge amount of backslashes (`\`). Here we can instead replace it to use a pair of single quotes on the outside and un-escape the double quotes inside.

Here's a side-by-side comparison of a small page:

<img width="1710" alt="CleanShot 2023-06-30 at 11 41 02@2x" src="https://github.com/vercel/next.js/assets/3676859/398356ec-91d5-435c-892d-16fb996029e8">

For a real production page I saw the HTML payload reduced by 11,031 bytes, a 3% improvement.

Note that all the tests are not considering gzip here, so the actual traffic impact will be smaller.
2023-06-30 13:27:38 +00:00
vercel-release-bot
0dd225b128 v13.4.8-canary.13 2023-06-30 12:25:06 +00:00
Shu Ding
61ac92995a
Refactor some loaders to be synchronous (#51997)
This PR changes some Webpack loaders to be synchronous as they don't have async code inside. Some of them will scale quiet a lot such as `next-flight-client-module-loader` and we don't want to waste some extra ticks there, as well as got potentially queued after some other events like file I/O.
2023-06-30 12:19:58 +00:00
Jiachi Liu
54a963b666
Update displayed error message for rsc case (#52004)
We show the "Application error: a client-side exception has occurred (see the browser console for more information)" error incorrectly when a server-side error occurs (a digest is present) when we should be showing an error saying it is in fact a server side error and should check the logs there. This change will make the error message more accurate for users to look up

Fixes NEXT-1263
2023-06-30 11:31:19 +00:00
Josh Story
d02f60b998
Loosen metatdata test matcher (#52007)
the metadata tests have an unnecessarily strict matcher which will fail if the matched metadata isn't the first instance of the element tag type. This will cause a problem when we start to preload bootstrap scripts which will cause preload links in all test cases that did not come from the metadata api itself


Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-06-30 10:11:24 +00:00
Shu Ding
0fb5fa550c
Avoid disposing middleware and instrumentation hook during development (#52022)
Unlike other routes, these two entries are needed for every request so there is no reason to have them disposed. This avoids wasting extra dev server resource to get them re-compiled.
2023-06-30 09:15:11 +00:00
Shu Ding
80e05a881c
Increase time and size windows for cached on-demand entries (#52019)
Increase `maxInactiveAge` to be `60` seconds and `pagesBufferLength` to be `5`. This change makes it infrequent to have expired entry compilations from recent accessed routes when running the dev server.
2023-06-30 08:35:36 +00:00
vercel-release-bot
27953213f8 v13.4.8-canary.12 2023-06-29 23:30:23 +00:00
Justin Ridgewell
aec3c58d1c
Update edge-runtime to latest (#51944)
### What?

The updates `edge-runtime` to the latest version

### Why?

https://github.com/vercel/edge-runtime/pull/428 fixes `consumeUint8ArrayReadableStream` so that when we break iteration early (due to client disconnect), we cleanup the inner stream. That will fire the stream's `cancel` handler, and allow devs to disconnect from an AI service fetch.

### How?

`edge-runtime` maintain a `try {} finally {}` over the inner stream's iteration. When we early break, JS will call `it.return()`, and that will resume `consumeUint8ArrayReadableStream` with an abrupt completion (essentially, the `yield` turns into a `return`). We'll be able to trigger the `finally {}` block with that, and we call `inner.cancel()` to cleanup.

Fixes https://github.com/vercel-labs/ai/issues/90
2023-06-29 23:15:20 +00:00
Jiachi Liu
dfe08aed33
Fix NextRequest constructor parameters (#52001)
FIx the type change introduced in #51727
2023-06-29 22:50:53 +00:00
Jiachi Liu
2f42cf557e
Filter invalid image descriptor from metadata images (#51992)
Filter out the invalid images in metadata og/twitter `images` filter to avoid crash when falsy image slides in.
Add filtering for now as the erroring doesn't show the proper trace pointing to where it's original introduced, might introduce other validation in the future.
2023-06-29 22:17:25 +00:00
Steven
efdc026ac7
chore(docs): explain NODE_ENV environment variable (#52003)
This PR documents the `NODE_ENV` environment variable behavior.

This feature was originally added in
152c2c2af3 which was released in `next@5`.

See the current source code here:


e3e76a45ee/packages/next/src/bin/next.ts (L82)

---------
2023-06-29 14:12:37 -07:00
Timothy Vernon
0759104287
Docs: Fix broken link (#51991)
Link leads to a 404 page
2023-06-29 20:39:49 +00:00
Tim Neutkens
e10431612d
Remove test skip (#51988)
Re-enables the test disabled in #51879 as it was fixed in #51973
2023-06-29 20:23:55 +00:00
Tyler Lutz
a2df492957
Update next lint section (#51898)
App directory is stable so you no longer need appDir.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-06-29 19:56:45 +00:00
Delba de Oliveira
18406adf9c
Make sure DevEx can approve docs PRs / Remove Spaces (#51996) 2023-06-29 17:10:53 +00:00
vercel-release-bot
152cfed6e8 v13.4.8-canary.11 2023-06-29 15:40:12 +00:00
vercel-release-bot
9ff526056b v13.4.8-canary.10 2023-06-29 13:55:17 +00:00
Tim Neutkens
ed280d2c46
Add shared input filesystem (#51879)
## What?

Currently we use 3 separate webpack compilers:

- server
- client
- edge

All of these were creating their own input filesystem (which is used to
read file, stat, etc.). Changing them to share a single inputFileSystem
allows the `cachedFileSystem` to be reused better, as `stat` and
`readFile` can be cached across the 3 compilers.

For the page on vercel.com we've been testing this shaves off 300-400ms
on a cold compile (no cache, deleted `.next`).

<!-- 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: Shu Ding <g@shud.in>
2023-06-29 15:49:05 +02:00
Jimmy Lai
8703c55f9f
export config into functions config manifest (#51700)
remaining:
- add tests

caveat: this only works at the route level, we won't inherit from the layout or anything. I think that's fine




Co-authored-by: Florentin / 珞辰 <8146736+ecklf@users.noreply.github.com>
2023-06-29 13:42:25 +00:00
Leah
484bdebc24
Update turbopack and swc_core to v0.78.24 (#51943)
Reverts #51940

### What?

Update SWC crates and turbopack

### Turbopack Updates

* https://github.com/vercel/turbo/pull/5366 <!-- Justin Ridgewell - Fix
bug with `imports` field from a nested directory -->
* https://github.com/vercel/turbo/pull/5361 <!-- Tobias Koppers - update
for next.js changes to env vars -->
* https://github.com/vercel/turbo/pull/5311 <!-- OJ Kwon -
test(filetrace): skip failing tests -->
* https://github.com/vercel/turbo/pull/5402 <!-- Leah - reduce indent in
`analyze_ecmascript_module` by splitting the function up -->
* https://github.com/vercel/turbo/pull/5412 <!-- Leah - Update
`swc_core` to `v0.78.24` -->

Closes WEB-1174

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

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-29 15:11:57 +02:00
Tim Neutkens
3773c5be8c
Ensure metadata test is not affected by other tests (#51973)
Turn out the `should error when id is missing in generateSitemaps` test
was passing because of this test passing: `should error when id is
missing in generateImageMetadata`

<!-- 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: Jiachi Liu <inbox@huozhi.im>
2023-06-29 15:10:19 +02:00
Ngô Đức Anh
c897933b6e
fix(typedRoutes): added missing anchor props to LinkRestProps (#51977)
### What?
This PR fixes `next/link`'s `<Link />` missing many `<a />` props when
`experimental.typedRoutes` is enabled.

### How?
It does that by changing `AnchorHTMLAttributes<HTMLAnchorElement>` in
LinkRestProps to
`DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement>`, which contains all `<a />` props.

Fixes #51907

---------

Co-authored-by: Shu Ding <g@shud.in>
2023-06-29 14:24:44 +02:00
Delba de Oliveira
7c5eb3191e
[Docs] Remove unnecessary mention of scroll false (#51964) 2023-06-29 12:21:49 +00:00
vercel-release-bot
68075376f0 v13.4.8-canary.9 2023-06-29 11:27:00 +00:00
Shu Ding
922a45839a
Optimize next-app-loader file resolution (#51924)
This PR changes `fs.stat` calls (to check if a file exists or not) to be
aggregated as `fs.readdir` calls and cached during the entire loader
pass. This is because we have a huge amount of file to check, but they
are always in a small amount of directories.

For example, a route that's 5-directory deep (`/a/b/c/d/page.js`) can
have up to 4,000 special segments and metadata files to check. However
they're always under these 5 directories. So instead of 4,000 `fs.stat`
calls let's just do 5 `fs.readdir` calls.

Didn't measure it carefully but a quick local test shows a 20~30%
improvement.

<details>
<summary>Another idea for future improvements</summary>
Currently, we create a MissingModuleDependency for any combination of
possible metadata filename. But in reality, we only need to track them
incrementally by index. For example if `icon1.js` is missing, it's kinda
waste to still track `icon2.js`~`icon9.js` because `icon1.js` will be
added first. This change should at least reduce the number of file
watchers by 80% and the initial compilation time by 0.5~1s, depending on
the actual route.
</details>

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-06-29 13:21:32 +02:00
Tim Neutkens
b236670f97
Fix entrypoints.get and entrypoints.stream from turbopack (#50733)
## What?

Both `entrypoints.get` and `entrypoints.stream` threw an error because it was using the wrong tasks implementation. @sokra helped fix it.
2023-06-29 09:40:02 +00:00
Francesco Sansalvadore
b636d3d755
[examples] Update styling for with-supabase example (#51751)
### Adding or Updating Examples

Improve styling for the `with-supabase` example.

<img width="2048" alt="Screenshot 2023-06-24 at 15 07 46"
src="https://github.com/vercel/next.js/assets/25671831/0bba9a0a-a660-411e-b960-ea933aa2750a">
<img width="2048" alt="Screenshot 2023-06-24 at 15 07 58"
src="https://github.com/vercel/next.js/assets/25671831/00f70c8b-e6ea-47ac-8a2e-829b4b808280">

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 21:11:13 -07:00
Balázs Orbán
3dcaf922de
docs: clarify reactStrictMode: true by default (#51931)
Closes #51841

[Slack thread](https://vercel.slack.com/archives/C03S9JCH2Q5/p1687815414309519?thread_ts=1687814821.415089&cid=C03S9JCH2Q5)

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-06-29 03:48:29 +00:00
Olivier Tassinari
60d27380f7
fix modularizeImports with @mui/material (#51953)
Fixes #51872. We were exploring in
https://github.com/mui/material-ui/pull/35457 the option to move the
`modularizeImports` config to our Next.js examples to fix
https://github.com/mui/material-ui/issues/35450 however, we never got to
complete the work.

We are not yet in a position where we can apply modularizeImports to
`@mui/material`. We still have folders to create to make it work.

Maybe we should close https://github.com/mui/material-ui/pull/35457?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 20:26:04 -07:00
Jiachi Liu
f4b947fb56
Fix eslint async client component (#51952)
Fixes #51917 

It's throwing error in arrow function, should also be covered in the
lint rule
fix NEXT-1326
2023-06-28 20:03:32 -07:00
JJ Kasper
15b84c1dd3
lint fix 2023-06-28 20:00:37 -07:00
Lee Robinson
e602207cb0
docs: make custom image loader a client component. (#51858) 2023-06-28 19:36:20 -07:00
Charles Dudley
f17614abd1
[Docs] Fix run-on sentence (#51956)
As stated in title :)
2023-06-29 02:28:28 +00:00
Steven
946c9c5c46
Add unstable_getImgProps export from next/image (#51205)
### Description 

This PR refactors the Image component so that the core logic can be consolidated into a single function.

This allows usage outside of `<Image>`, such as:

1. Working with [`background-image`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-image) or [`image-set`](https://developer.mozilla.org/en-US/docs/Web/CSS/image/image-set)
2. Working with canvas [`context.drawImage()`](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images) or simply `new Image()`
3. Working with [`<picture>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) media queries to implement Art Direction or Light/Dark Mode images

### Example

```tsx
import { unstable_getImgProps as getImgProps } from 'next/image'

export default function Page() {
  const common = { alt: 'Hero', width: 800, height: 400 }
  const { props: { srcSet: dark } } = getImgProps({ ...common, src: '/dark.png' })
  const { props: { srcSet: light, ...rest } } = getImgProps({ ...common, src: '/light.png' })

  return (<picture>
  <source media="(prefers-color-scheme: dark)" srcSet={dark} />
  <source media="(prefers-color-scheme: light)" srcSet={light} />
  <img {...rest} />
</picture>)
}
```

### Related

fix NEXT-257

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-06-29 01:35:08 +00:00
Mrxbox98
bd1fc78bd8
Add cpu-features to server external packages (#51946)
<!-- 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?
Adds [cpu-features](https://www.npmjs.com/package/cpu-features) to
external server packages.

### Why?
To prevent developers from having to add ``cpu-features`` to their next
config.
2023-06-28 17:52:04 -07:00
Jiachi Liu
3fb41561c4
Support react profiling option for app dir client components (#51947)
`reactProductionProfiling` was a next config working for pages before mainly for profiling react, this PR also enables it for pages.

### Chanegs

* Add react profiling entry and related alias
* Fix `reactProductionProfiling` is missing in next config type and schema

Closes #51131
2023-06-29 00:00:11 +00:00
Tyler Lutz
1f19a5b810
Add separate links in shared documentation (#51733)
### What?
- Added separate links for the app and pages router in the shared documentation.
- Added comment at the top of all shared documentation.
- Fixed typos in pages documentation comment.

### Why?
- To limit the switching between the different routers in shared documentation when clicking the links.
2023-06-28 23:37:56 +00:00
VelociRaptor
64c297f194
[docs] fix curly brackets in mdx (#51916)
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-28 23:19:49 +00:00
Christian Ivicevic
73491308b4
[docs] Replace the term "hole" with "slot" (#51919)
It feels more natural to use the actual term "slot" when describing how
to interweave server and client components since it's used in other
frameworks as well.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 16:07:15 -07:00
VelociRaptor
d390d75e1f
[docs] fix angle bracket in mdx (#51920) 2023-06-28 23:01:24 +00:00
Josh Goldberg ✨
0bd9b4bbdf
fix(next): improve error for using <Html> outside of document (#45056)
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added -> this is a pretty niche edge case, do
you want me to?
- [x] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Fixes #45024

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 15:40:35 -07:00
Jacob Fletcher
d206c68ad7
adds payload to server-external-packages.json (#51933)
### What?
Adds `payload` to the external package list

### Why?

To prevent developers using
[Payload](https://github.com/payloadcms/payload) modules within Next.js
from having to add this in their next config.
2023-06-28 13:03:08 -07:00
Jiachi Liu
e7b9b9a816
Update codeowners (#51935)
revert to the previous version of codeowners before vercel spaces is
applied
2023-06-28 12:17:41 -07:00
Leah
fd13fb5e64
Revert "Update swc_core to v0.78.24" (#51940)
Reverts vercel/next.js#51857

Because a turbopack update with the matching swc versions wasn't
included, this would increase the binary size
2023-06-28 19:35:04 +02:00
Justin Ridgewell
525ecf4158
Ensure edge runtime Pages API/App Route handlers AbortSignal aborts on client disconnect (#51727)
### What?

This ensures the `request.signal` `AbortSignal` that every Pages API and App Route handler receives aborts when the client disconnects.

### Why?

Now that we [support cancelling](https://github.com/vercel/next.js/pull/51594) responses mid-stream, it's important that we can communicate that abort to developer code. Eg, for AI endpoints that have an streaming `fetch` connection to the some 3p AI service, it's important that they're able to abort that stream when the client's browser disconnects.

### How?

Just need to listen for `error` events on Node's `IncomingMessage` request object, and forward that to an `AbortController`. After that, propagate the signal through the server to web-style handlers.
2023-06-28 16:50:45 +00:00
Donny/강동윤
e05c8c2d7e
Update swc_core to v0.78.24 (#51857)
### What?

Update SWC crates

### Why?

There were many fixes.

### How?

Closes WEB-1174


Turbopack counterpart: https://github.com/vercel/turbo/pull/5288
2023-06-28 16:04:35 +00:00
Leah
f2dc6c87e9
error recovery during turbopack hydration (#51882)
### What?

Makes sure the next.js hydration code can run and that we can open the error overlay when there's an error in the entry page

Fixes WEB-1168
2023-06-28 14:50:04 +00:00
Leah
f1a4f7ad7d
fix turbopack mdx import map (#51881)
I accidentally broke this with #49818
2023-06-28 14:19:33 +00:00
Sukka
e7a692537c
Reduce the client bundle size of App Router (#51806)
After migrating a Next.js app from Pages Router to App Router and using as many RSC as possible, I notice that the client js bundle size actually increases by 5%. It turns out that Next.js has introduced a lot of code to the client bundle.

<img width="1354" alt="image" src="https://github.com/vercel/next.js/assets/40715044/c7216fee-818b-4593-917e-bf0d2a00967a">

The PR is an attempt to reduce the client bundle size.
2023-06-28 13:32:10 +00:00