Commit graph

18690 commits

Author SHA1 Message Date
Tobias Koppers
99b9304bf1
disable unused next/dynamic walking in app dir (#59338)
### What?

remove expensive unused code


Closes PACK-2108
2023-12-06 17:34:06 +01:00
Tobias Koppers
34e9d65d29
update turbopack (#59334)
* https://github.com/vercel/turbo/pull/6716 <!-- Tobias Koppers - add
support for export renaming in side effects optimization -->
* https://github.com/vercel/turbo/pull/6718 <!-- Tobias Koppers - cache
the chunking work -->
2023-12-06 17:20:52 +01:00
Vercel Release Bot
8db04a8332
Update Turbopack test manifest (#59326)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2023-12-06 14:49:58 +01:00
Tobias Koppers
182a4b44f4
reduce function calls in walk (#59332)
### What?

Reduce the number of function calls

### Why?

Performance on incremental builds

### How?


Closes PACK-2104
2023-12-06 14:48:05 +01:00
vercel-release-bot
f6ebc2be77 v14.0.4-canary.45 2023-12-06 11:10:39 +00:00
Tim Neutkens
4f67cbfe4a
Move App Router client-side constants to separate file (#59239)
## What?

Noticed constants.js was included in the client-side bundle. This
ensures only the needed constants are included.


## How?

Created a separate file for client-side constants.

<!-- 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 #

-->


Closes NEXT-1789
2023-12-06 12:07:33 +01:00
vercel-release-bot
50d4578791 v14.0.4-canary.44 2023-12-06 08:50:05 +00:00
Tobias Koppers
0082d54893
side effects optimization (#58972)
### What?

Code update for refactoring in https://github.com/vercel/turbo/pull/6590


Closes PACK-2043
2023-12-06 08:23:46 +00:00
Tobias Koppers
06cf74a66a
add module tracing for client reference and next/dynamic walking (#59306)
### What?

add tracing to the module graph walking


Closes PACK-2090
2023-12-06 06:57:13 +00:00
Zack Tanner
59f7ca85c2
remove additional static prefetch code (#59313)
This is a continuation from https://github.com/vercel/next.js/pull/58783
to remove the remaining code related to static prefetching.
2023-12-05 21:29:23 -08:00
Zack Tanner
f431600ce4
Revert "added comma to the props list" (#59314)
Reverts vercel/next.js#58596

This is failing lint checks


[x-ref](https://github.com/vercel/next.js/actions/runs/7109843046/job/19355454595)
2023-12-05 20:39:45 -08:00
Justin Pfifer
3f20b46b59
docs: Add note about middleware and runtimes (#58873)
Co-authored-by: Justin Pfifer <justin.pfifer@carvana.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-12-05 21:34:37 -06:00
Peter Kellner
4a52268907
docs: Update route handles TS code snippets (#59021) 2023-12-05 21:34:19 -06:00
Thoushif Aazam Shaik
3caa2891c7
docs: added missing comma to the props list (#58596) 2023-12-05 21:33:47 -06:00
Jackie
d0159160dc
docs: update Firebase link to with-firebase example (#58621) 2023-12-05 21:33:14 -06:00
Willem-Jaap
75975dd5e4
docs: Fix incorrect prop name in client component (#58591)
`updateItem` is the name of the action, not the passed prop. The correct
property name is `myAction`.
2023-12-05 21:31:58 -06:00
Jiwon Choi
caa05b4753
docs: Remove invalid URL (#58823)
This PR removes guidance to invalid URL
2023-12-05 21:30:27 -06:00
Mustafa Çor
873bd82ff9
docs: Server Action example (#59159) 2023-12-05 21:21:56 -06:00
Wyatt Johnson
eab1fe8397
Enable PPR for dynamic = "force-dynamic" (#58779)
This makes some critical modifications to the app render pipeline when
PPR has been enabled for pages with segments defining:

```js
export const dynamic = "force-dynamic"
```

Importantly, it no longer modifies the revalidation time to zero for
those pages, and now falls back to the provided default revalidation
time. When static render occurs, if the page being rendered has a
segment config defining `dynamic === "force-dynamic"`, then it will
postpone at the root of the component tree. This ensures that no render
code is executed for the page, as the entirety of the tree will have
postponed. This fixes the bug where the flight prefetch wasn't generated
correctly as well.
2023-12-06 01:10:00 +00:00
vercel-release-bot
6387c9cbcb v14.0.4-canary.43 2023-12-05 23:22:24 +00:00
Shu Ding
1436a3606e
Clean up builtin modularizeImports configs (#59294)
Most of them can now be handled by `optimizePackageImports` as I
manually tested them locally. The main benefit is that structural
updates from these libs won't affect our internal configurations
anymore, as they're automatic with the new approach. The little downside
is that the automatic way is a bit slower than the `modularizeImports`
config as it needs to do extra analyzation. But overall, this is a good
direction.

Depends on #59254.
2023-12-06 01:49:51 +09:00
Zack Tanner
78a2eb0b9b
fix interception routes with dynamic segments (#59273)
### What?
Using an interception marker next to a dynamic segment does not behave
properly when deployed to Vercel

### Why?
The named route regex that gets created is not accounting for the
interception marker, which is causing the non-intercepted route to match
the intercepted serverless function.

### How?
This factors in the interception marker when building the named route
regex so that the non-intercepted route regex properly matches when
loading the non-intercepted page.

Deployment verified here: https://test-intercept-mu.vercel.app/

Closes NEXT-1786
Fixes #54650
2023-12-05 08:47:40 -08:00
vercel-release-bot
2003f5f848 v14.0.4-canary.42 2023-12-05 16:33:54 +00:00
Shu Ding
6790004d79
Fix barrel optimization to ignore layers (#59254)
Fixes #57624. The recent issue was an unexpected side effect caused by
305bb01506,
which only affects specific packages like `@mui/material`.

The problem was that the entry file of `@mui/material` has `"use
client"` at top, which affects the compilation result to output
reference info only (when on the RSC layer), instead of keeping the
original export statements. And the fix here is to ignore all layer info
and React specific transforms here, as barrel optimization isn't related
to all these framework features at all. To keep all directives
unchanged, the SWC transform needs to parse and pass that info to the
Webpack loader.

This PR adds a test to ensure that `@mui/material` is working as
expected (less than 1500 modules compiled). Without this feature it'll
be ~2400 modules.

Closes NEXT-1793, closes NEXT-1762.
2023-12-06 01:17:31 +09:00
Leah
b88e263f4c
fix dev parallelism in daily turbopack tests (#59287)
Also fixes the retry running on forks (hopefully for real this time)

Closes PACK-2087
2023-12-05 15:41:49 +01:00
Lee Robinson
bb3f0a21a0
docs: fix broken link to learn course (#59288)
Addresses https://github.com/vercel/feedback/issues/47802.
2023-12-05 08:39:54 -06:00
Leah
2cd3bf4618
feat(turbopack): support loading WebAssembly in the edge runtime (#59013) 2023-12-05 14:28:21 +01:00
vercel-release-bot
b2084ea0ac v14.0.4-canary.41 2023-12-05 13:10:07 +00:00
Tobias Koppers
2b473970ef
update turbopack (#59285)
* https://github.com/vercel/turbo/pull/6588 <!-- Leah - ci: remove daily
turbopack next.js integration test workflow -->
* https://github.com/vercel/turbo/pull/6666 <!-- Will Binns-Smith -
Turbopack css: treat `composes` and `@import` as urls when resolving -->
* https://github.com/vercel/turbo/pull/6701 <!-- Tobias Koppers - add
user level tracing -->
* https://github.com/vercel/turbo/pull/6616 <!-- Leah - feat(turbopack):
support "loading" WebAssembly injected as global varables in edge
runtime -->

Closes PACK-2086
2023-12-05 14:06:49 +01:00
Tim Neutkens
9f29b270bd
Fix app-dir - logging test in Turbopack (#59261)
Ensures the app-dir - logging tests pass with Turbopack enabled.

<!-- 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 #

-->


Closes NEXT-1795
2023-12-05 13:47:32 +01:00
Tobias Koppers
3e8fe3c763
add user-level tracing (#59284)
### What?

add a few user-focused info-level spans to allow high-level tracing on a
normal build.

`NEXT_TURBOPACK_TRACING=1` can be used to generate a `.next/trace.log`
file

### Why?

Gain insight into build performance and module cost 



Closes PACK-2083
2023-12-05 13:08:39 +01:00
Shohei Maeda
faa4421034
fix: properly call normalizeDynamicRouteParams in NextWebServer.handleCatchAllRenderRequest (#58949)
fixes https://github.com/vercel/next.js/issues/53682

This follows the same implementation as
`Server.handleCatchallRenderRequest` (base-server).
2023-12-05 09:43:32 +01:00
Vercel Release Bot
40cb6f4eb9
Update font data (#59271)
This auto-generated PR updates font data with latest available
2023-12-04 16:49:30 -08:00
Dima Voytenko
7852224b6a
Testmode: support edge functions inside a sandbox (#59179)
Testmode is refactored to support both serverless and edge functions
under a sandbox.
2023-12-04 16:47:34 -08:00
Jiří Hofman
b9d0d6c255
docs: fix remotePatterns link in image-config.ts (#59197)
### What?
The link in `@see - Remote Patterns` leads to
-
https://nextjs.org/docs/pages/api-reference/components/image#remote-patterns,
but it should lead to
-
https://nextjs.org/docs/pages/api-reference/components/image#remotepatterns
<img width="591" alt="image"
src="https://github.com/vercel/next.js/assets/12988096/a6ed727f-e601-460d-9cf2-5bbb0faf7527">

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-12-04 15:22:16 -08:00
Shohei Maeda
edf19014f1
feat: support outputFileTracing in App Router (#59139)
Fixes https://github.com/vercel/next.js/issues/54245

https://nextjs.org/docs/app/api-reference/next-config-js/output#caveats

Currently, `outputFileTracingExcludes`/`outputFileTracingIncludes` only
works with Pages router. This PR adds support for App router.
2023-12-04 15:15:39 -08:00
OJ Kwon
936ae3de8f
fix(next-core): adjust edge entry path (#59265) 2023-12-04 14:40:52 -08:00
vercel-release-bot
708f85b9df v14.0.4-canary.40 2023-12-04 22:27:15 +00:00
Rishabh Poddar
484efaec85
examples: Updates with-supertokens example app (#58525)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-12-04 16:17:46 -06:00
Jiachi Liu
42b87892e4
Fix non bundler module resolution in ts for third-parties pkg (#59244) 2023-12-04 20:40:25 +01:00
Tim Neutkens
f05b503182
Add app router name to font tests (#59257)
## What?

Ensures this is reported correctly. 

<!-- 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 #

-->


Closes NEXT-1794
2023-12-04 20:25:41 +01:00
Wyatt Johnson
f99812727d
Delete unused static prefetch code (#58783)
This removes the dead code related to prefetching until it can reland.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-12-04 17:54:32 +00:00
Leah
2cc88d7b11
fix missing checkout in daily turbopack reporting (#59256) 2023-12-04 18:54:00 +01:00
Leah
d348e4b569
fix missing echo in daily turbopack reporting (#59255)
### What?

GitHub workflow commands need to be echoed

Closes PACK-2075
2023-12-04 18:02:08 +01:00
Jiachi Liu
065d196b5e
Fix dynamic transform ssr:false case for pages router with ESM (#59246) 2023-12-04 17:48:46 +01:00
Andrew Clark
f64e92ba4d
Add process.env.__NEXT_PPR to build config (#59253)
Adds process.env.__NEXT_PPR as static flag that it gets inlined by
DefinePlugin during build.

This matches what we do for other experiments, but I do wonder, why do
we bother with process.env at all instead of a global __NEXT_PPR symbol?
I'll leave that for later discussion.

Closes NEXT-1792
2023-12-04 11:32:46 -05:00
Andrew Clark
65a74b1bef
Remove mutable field from action types (#59221)
Similar in spirit to #58938.

The app router reducer state used to be managed by useReducer, so it was
written to be resilient to rebasing — the same action may be processed
multiple times. Now that we've lifted the reducer outside of React
(#56497), each action runs only a single time. So we can simplify some
of the logic.

The purpose of the `mutable` field was so that if an action is processed
multiple times, state could be reused between each run; for example, to
prevent redundant network fetches. Now that this scenario can no longer
happen, we can remove it.

I had to update some of the unit tests in navigate-reducer because they
were written with the assumption that the reducer was called multiple
times. As far as I can tell, most of this behavior is covered by e2e
tests anyway, so I don't think it's too risky.

Closes NEXT-1782
2023-12-04 11:31:41 -05:00
Leah
b2e183ec1d
fix typo in daily turbopack integration test reporting (#59251) 2023-12-04 17:08:46 +01:00
Leah
15215d4c96
ci: report daily turbo integration test results from this repo (#58965)
### What?

A follow up for #58267 and #58394.

We no longer need the git branch for history it's stored in datadog now
and we also decided that we no longer need slack reporting.


Closes PACK-2039

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-12-04 16:18:42 +01:00
Delba de Oliveira
63a578f1c3
Docs: Fix upgrade guide files (#59249)
- Add v14 update guide to /app router docs
- Fix duplicate /upgrading folders
2023-12-04 08:55:46 -06:00