Commit graph

12880 commits

Author SHA1 Message Date
Steven
9c5bb5bfe9
BREAKING CHANGE: Remove target: serverless (#41495)
The `target: serverless` config was deprecated a year ago starting in
[Next.js 12](https://nextjs.org/blog/next-12).

Tests were disabled in #41252 so we can now remove `target: serverless`
and all usage of `target` in `next.config.js`.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-18 09:47:13 -07:00
Kiko Beats
ebae05eeed
Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40
2022-10-18 13:57:11 +00:00
Steven
9775111ab6
Add swcMinify to the Upgrade Guide (#41521)
Follow up to:

- #41506
2022-10-18 13:29:08 +00:00
Balázs Orbán
a36798968f
fix(ts): Cookies -> NextCookies (#41491) 2022-10-18 15:13:42 +02:00
JJ Kasper
df0e61b023
Fix app sc_client componet HMR server-side (#41510)
This ensures we properly clear the `sc_client` component cache from
`react-server-dom-webpack` in development so that HMR works properly
after a refresh.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

Fixes: [slack
thread](https://vercel.slack.com/archives/C043ANYDB24/p1666051202574509)
2022-10-18 00:48:27 -07:00
Jiachi Liu
fcac2e2b8a
Move fetch revalidate config under next options (#41505)
x-ref:
[slack-thread](https://vercel.slack.com/archives/C035J346QQL/p1665425741387879)
2022-10-18 00:44:30 -07:00
Anish Paudel
1e47930d5f
[docs] fix grammatical error #41507 (#41508)
Closes: https://github.com/vercel/next.js/issues/41507
2022-10-18 06:47:34 +00:00
JJ Kasper
45c36e66d8
Enable swcMinify by default (#41506)
x-ref: [slack
thread](https://vercel.slack.com/archives/CGU8HUTUH/p1666067928896099?thread_ts=1666066448.770739&cid=CGU8HUTUH)
2022-10-17 23:33:04 -07:00
Tim Neutkens
c5896f2850
Add vary header to fix incorrectly caching RSC as HTML response (#41479)
Add failing test for the back button download bug. Created it as a new
app given that adding it to the existing `app` suite did not reproduce
the issue for some reason.

The underlying reason is that we need to add `Vary: __rsc__,
__next_router_prefetch__` to ensure Chrome does not cache the response
and serve it on back button.

The download was caused by the `application/octet-stream` content type,
but that was just a consequence of serving the wrong response.

<!--
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 that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-17 22:34:29 -07:00
Lee Robinson
6101bf69ad
Add remotePatterns link to next-image-unconfigured-host (#41504)
Didn't realize the `remotePatterns` usage was already in here (not live
yet, but merged into `canary`) - so just also added on this link for the
end 👍
2022-10-17 22:06:50 -07:00
Seiya Nuta
366da263df
Append the fragment in NextUrl.toString() (#41501)
<!--
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 that you're making:
-->

Consider the following middleware which redirects to
`/path/to#fragment`.

```ts
import { NextResponse } from 'next/server';

export async function middleware(request) {
  const url = new URL('/path/to#fragment', request.url);
  return NextResponse.redirect(url);
}
```

However, it actually redirects to `/path/to`, namely it discards the
fragment part in the destination URL `#fragment`. This is because
`NextURL.toString()` does not append that part. This PR fixes the bug.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-17 21:56:28 -07:00
Shu Ding
c5c2c9d38b
Fix global css being marked as side effect free (#41481)
It’s possible that global CSS imports, that come from node_modules, are
marked as side effect free because of possible `sideEffects: false` in
the external package's package.json. In that case, we still need to
handle global CSS imports as side effects on the server because we need
to collect them and avoid tree-shaking for these modules.

You can take a look at the test case to see what exactly happened.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-17 21:34:47 -07:00
Shu Ding
0c2c48e536
Avoid using the CSS href as the link tag key (#41493)
There is no need to use the href as key in our case because it's pure
during SSR and it won't re-order on the client. By using `index` we can
avoid some duplicate bytes here:

![CleanShot 2022-10-18 at 00 21
20@2x](https://user-images.githubusercontent.com/3676859/196295175-c5b437f7-0ae9-4d89-9d96-9594686168ae.png)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-17 21:30:23 -07:00
Tonye Jack
3a19b8ae05
chore(examples): fix typo (#41496)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-18 04:10:33 +00:00
Tim Neutkens
f260328900
BREAKING CHANGE: Enable newNextLinkBehavior (#41459)
- Enable newNextLinkBehavior. See #36436 
- Run next/link codemod on test suite

Note that from when this lands on apps trying canary will need to run
the new-link codemod in order to upgrade.
Ideally we have to detect `<a>` while rendering the new link and warn
for it.

Co-authored-by: Steven <steven@ceriously.com>
2022-10-17 21:20:28 -04:00
Alexander Sviridov
f5cb7bd829
fix(41456): check src/app folder too in getHasAppDir (#41458)
fixes https://github.com/vercel/next.js/issues/41456

When we check if app folder exists, check for src/app path too

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-17 15:32:44 -07:00
Felipe Barso
6249307b75
fix(stream): Allows body larger than 16 KiB with middleware (#41270)
Fixes #39262

The solution is to call `stream.push(null)` to trigger the `end` event
which allows `getRawBody` to run completely.

<!--
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 that you're making:
-->

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-17 15:26:16 -07:00
Charly POLY
ec94e68cc7
examples(with-routes-graphql): update GraphQL Yoga to v3 (#41478)
Update the `with-routes-graphql` example to [GraphQL Yoga](https://www.the-guild.dev/graphql/yoga-server/) new major ([migration guide](https://www.the-guild.dev/graphql/yoga-server/v3/migration/migration-from-yoga-v2)).
2022-10-17 17:13:48 +00:00
Tim Neutkens
ce60157b1b
Fix useSearchParams comment (#41483)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-17 19:07:07 +02:00
Donny/강동윤
7a8c58fedd
chore: Update swc_core to v0.38.22 (#41477) 2022-10-17 17:08:14 +02:00
Steven
df35cf32d4
Update docs with minimum node version 14.x (#41482)
- Follow up to https://github.com/vercel/next.js/pull/41150
2022-10-17 11:06:05 -04:00
Steven
e2f16f96c2
Update next/image docs and examples (#41434)
This PR updates the docs for the following code change:

- #41399

There are a few updates here:

- [x] Update docs
- [x] Update links to docs inside component
- [x] Update examples
- [x] Fix corner cases in codemod
2022-10-17 10:41:35 -04:00
Steven
e61820e04d
Fix typo and add comment to next/image SyntheticEvent (#41480)
- Fix typo 
- Add comment
- Link back to react docs
- Remove unnecessary variable
2022-10-17 10:40:40 -04:00
Shu Ding
a75b323877
Include frameworks in main-app (#41465)
There is no need to have a separate `framework` chunk for React and React DOM, as they're already included in the `main-app` entry. With this PR, React and React DOM will be included in `main-app` directly and app is no longer depending on the `framework` chunk.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-17 13:48:52 +00:00
Tim Neutkens
7be2ef0fcf
Ignore serverComponentChanges in pages (#41464)
Slightly different version of #41020 where it does not end up being an unknown event.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-16 21:34:33 +00:00
Sukka
7c2fd34510
fix(app-render): make css and font respect assetPrefix (#41455)
Add missing `assetPrefix` for link tags (`@next/font` and CSS).
The PR also merges multiple duplicated `renderOpt.assetPrefix || ''`.
2022-10-16 19:56:15 +00:00
Tim Neutkens
1d37afb351
Disable isNavigatingToNewRootLayout (#41457)
Hannes is going to change the approach to be compatible with static.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-16 15:41:13 +00:00
Tim Neutkens
bc3d8be4ee v12.3.2-canary.29 2022-10-16 11:49:30 +02:00
Tim Neutkens
fb30be485d
Rename reload to refresh in new router (#41448)
Renames `router.reload` to `router.refresh` to better reflect that it refreshes the rendered page instead of being a blank slate.


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-15 20:29:09 +00:00
Sukka
85f7d4b396
perf(#41392): improve cache busting inject performance (#41443)
The PR continues from #41392.

In #41392 the `dev ? cache-busting : empty` is executed per stylesheet instead of per page rendering. Since rendering link tags would be a hot path at the server, it might have accidentally introduced a performance overhead. The PR fixes that.

Note, this change also makes `Date.now()` only execute once instead of per stylesheets, however, this will most likely not cause any issues.
2022-10-15 19:42:48 +00:00
Tim Neutkens
482e3fbffa
Change useSearchParams to URLSearchParams (#40978)
Similar to #40872 `useSearchParams` now returns a `URLSearchParams` instance instead of a plain object.


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-15 19:16:50 +00:00
JJ Kasper
ad1e8dd65d
Bump test timeout-minutes for test dev 2022-10-15 11:42:11 -07:00
Tim Neutkens
1b8478270c
Don't show error overlay for not found and redirect (#41438)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-10-15 18:46:36 +02:00
Donny/강동윤
59eefb2aba
chore: Update swc_core to v0.38.4 (#41401)
This PR updates swc crates to 3ff55caa38

This PR applies various improvements, and more importantly https://github.com/swc-project/swc/pull/6142
2022-10-15 02:18:38 +00:00
JJ Kasper
8c3366a9f4
Fix middleware dynamic route param on query hydration (#41436)
Ensures query params aren't included when parsing dynamic route params
during query hydration for a middleware matched path.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

Fixes: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1665692236623799)
2022-10-14 18:46:28 -07:00
Sukka
ff70562e8d
chore: bump server pre-compiled target to Node.js 14 (#41424)
Follows #41150, bump the server-side code pre-compile target to Node.js
14.0.0.

This could also potentially reduce the size of the server bundle and
increase the performance (less transformation and fewer inlined swc
helpers).

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-14 18:40:57 -07:00
JJ Kasper
c66b8f3926
Update bench options in stats-config (#41432)
x-ref:
https://github.com/vercel/next.js/actions/runs/3252514635/jobs/5338830017
x-ref:
https://github.com/vercel/next.js/actions/runs/3250842765/jobs/5335182082
2022-10-14 18:17:45 -07:00
Hannes Bornö
974e8b61c7
Move root layout validation (#41338)
Moves where the validation is made to make sure the error reaches the
client. Tests that an error overlay is shown on the client.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-14 13:55:09 -07:00
Justin Ridgewell
af066d9679
Add new diagnostics (#41429)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-14 13:38:27 -07:00
JJ Kasper
0d376b3684
Update flakey dev AMP tests (#41428)
These tests have been flakey for a quite a while and this blocks changes
that are unrelated so this skips them for now.

x-ref:
https://github.com/vercel/next.js/actions/runs/3250190671/jobs/5333599972
x-ref:
https://github.com/vercel/next.js/actions/runs/3219413821/jobs/5264815514
2022-10-14 12:04:55 -07:00
Kiko Beats
8c4ef5cbc7
Update edge runtime to 1.1.0-beta.39 (#41418)
https://github.com/vercel/edge-runtime/compare/edge-runtime%401.1.0-beta.37...edge-runtime%401.1.0-beta.39
2022-10-14 09:48:32 -07:00
Tim Neutkens
8f49ffc488
Upgrade React experimental (#41419) 2022-10-14 16:25:49 +02:00
Jiachi Liu
7297942cfb
Remove edge shared deps (#41413)
Since we have already bundled dependencies for server layer, so the
shared deps chunk group is not needed anymore.
Also changing to esm assets import with next internals for edge function
and middleware build.

The changes are originally from #41337, try to land them separately.
2022-10-14 06:08:48 -07:00
JJ Kasper
889af9fd2c
Fix edge workers being re-used unexpectedly (#41402)
This ensures we don't re-use edge workers locally as they are meant to
be isolated.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

Fixes: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1665708744315109)
2022-10-13 22:56:42 -07:00
Steven
241195ddd6
BREAKING CHANGE: Rename next/image to next/legacy/image & rename next/future/image to next/image (#41399)
This PR introduces breaking changes by renaming components.

- Rename `next/image` to `next/legacy/image`
- Rename `next/future/image` to `next/image`

The diff is very confusing because both components are very similar so git got confused.
2022-10-14 01:59:22 +00:00
JJ Kasper
560e93ef77
v12.3.2-canary.28 2022-10-13 15:30:56 -07:00
Jimmy Lai
70d7d68337
perf: lazy evaluate more modules (#41354)
In this PR, I'm inlining the require for some of the modules that I
noticed take a bit of time to evaluate on a cold boot and are not needed
most of the time.

With this, it's an extra ~15ms win on cold boots (tested locally) and we
are now at around 68ms (started from 110+).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-13 14:59:46 -07:00
JJ Kasper
a1d830eec8
Fix prefetching for static app paths (#41398)
Ensures we delete the prefetch header when the path is static as it
can't be honored and the full tree must be sent instead.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

x-ref: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1665610012952039?thread_ts=1665582783.184029&cid=C035J346QQL)
2022-10-13 14:44:54 -07:00
Néstor
5cd31e41ca
Add npm to create-next-app environment package manager parser (#41279)
Gracefully parse the environment package manager when calling
`create-next-app` instead of passing extra arguments.

Reference: #41090

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-13 14:34:55 -07:00
LongYinan
e505e7545b
Upgrade next-swc-napi to NAPI-RS v2 (#40094)
Build succeed https://github.com/vercel/next.js/actions/runs/3243091429
2022-10-13 13:07:14 -07:00