Commit graph

19449 commits

Author SHA1 Message Date
Tim Neutkens
dbb2d86ae8
Skip Relay test for Turbopack (#61578)
## What?

This feature will be implemented after Turbopack is stable.

<!-- 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-2339
2024-02-02 17:07:36 +01:00
Abdul Haseeb
f59540fedc
Fixing a case sensitivity error (#61563)
Fixing a simple case sensitivity error in the import statement,
"storeProvider" should be "StoreProvider".

Co-authored-by: Steven <steven@ceriously.com>
2024-02-02 09:33:32 -05:00
Tim Neutkens
9f5462ca23
Fix .env HMR for Turbopack in Edge runtime (#61565)
## What?

Fixes the `should update server components pages when env files is
changed (edge)` tests. In order for changes to the environment to apply
to edge-runtime routes we need to call `clearModuleContext`, currently
that only supports a single path being provided, but in Turobpack the
compilation is much more granular than webpack, in case of webpack we
loop through all items coming out of the compilation and invalidate them
regardless, which is not needed for Turbopack. Instead, when an
entrypoint (route) is recompiled it'll automatically only invalidate
that part. For `.env` changes that don't affect compilation, which is
what the test checks, this wouldn't be sufficient as there is no
compilation difference between changing those env vars. In the case that
you change `.env` / tsconfig/jsconfig we have to clear all module
contexts, which is what this PR implements.

<!-- 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-2337
2024-02-02 11:48:16 +01:00
Leah
2afb6379d1
feat: first pass of next/font manifest (#61424)
### What?

We need the manifest to pass a bunch of preloading tests.

Currently, this is just a dumb implementation that preloads all fonts
and always sets size-adjust to true.

Google fonts are also still requested from Google directly it seems and
therefore never preloaded.
2024-02-02 09:42:36 +01:00
Donny/강동윤
a77f8a9165
Update turbopack (#61553)
# Turbopack

* https://github.com/vercel/turbo/pull/7207 <!-- Donny/강동윤 -
feat(turbopack): Enable error recovery of lightningcss -->
* https://github.com/vercel/turbo/pull/7096 <!-- Tobias Koppers -
migrate type references to primary references -->
* https://github.com/vercel/turbo/pull/7225 <!-- Donny/강동윤 -
fix(turbopack): Fix css var issue and font issue when using
`lightningcss` -->

### What?

Update turbopack 

### Why?

To test https://github.com/vercel/turbo/pull/7225 against internal apps.


### How?



Closes PACK-2364
2024-02-02 08:27:00 +00:00
Balázs Orbán
d43a387d27
chore: update ESLint and plugins to latest (#61544)
Bumping ESLint to the newest version.

Related: #61525

Closes NEXT-2336
2024-02-01 20:06:02 -05:00
Steven
804cb937fe
chore(docs): add // @ts-check to next.config.js docs (#61543)
This PR updates the docs to add `// @ts-check` at the top of each
`next.config.js` or `next.config.mjs`.

Even though you can't use `next.config.ts`, you can still get some type
checking to catch typos such as wrong type or even duplicate keys.


<img width="322" alt="image"
src="https://github.com/vercel/next.js/assets/229881/fcaba393-3560-4d16-95bf-a0504e66fa26">

<img width="325" alt="image"
src="https://github.com/vercel/next.js/assets/229881/e7156dd4-7b79-4f08-b843-4431b56b1c50">



Closes NEXT-2335
2024-02-02 00:36:00 +01:00
vercel-release-bot
5cd7790091 v14.1.1-canary.28 2024-02-01 23:21:30 +00:00
Steven
5ee6a07d74
fix: bump @vercel/nft@0.26.3 (#61538)
- Release notes https://github.com/vercel/nft/releases/tag/0.26.3
- Fixes https://github.com/vercel/next.js/issues/59346
- Related to https://github.com/lovell/sharp/issues/3967

Closes NEXT-2334
2024-02-01 16:46:38 -05:00
Leah
1240cda484
chore: update github actions (#61517)
### Why?

They used the `node16` runner which is deprecated

### Notable breaking changes

#### `dessant/lock-threads@v5`
[link](https://github.com/dessant/lock-threads)

Now also locks discussions (in addition to issues and pull requests):
https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md#500-2023-11-14

#### `actions/stale@v9` [link](https://github.com/actions/stale)

Is now stateful: If the action ends because of
[operations-per-run](https://github.com/actions/stale#operations-per-run)
then the next run will start from the first unprocessed issue skipping
the issues processed during the previous run(s).
https://github.com/actions/stale/releases/tag/v9.0.0


Closes PACK-2347

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-02-01 22:13:29 +01:00
Zack Tanner
c60967328c
remove unnecessary PPR branch in non-PPR reducer (#61176)
PPR flows through the `navigateReducer_PPR` branch. This handling is vestigial from before proper PPR navigation support was added.

Closes NEXT-2244
2024-02-01 12:26:29 -08:00
JA
b654effd53
fix(with-docker): resolve build with pnpm (#61529)
### Adding or Updating Examples

- Example:
[with-docker](https://github.com/vercel/next.js/tree/canary/examples/with-docker)
- Update: The latest change introduced in #61466 on the building process
of NextJS when the package manager is PNPM is currently throwing an
error (it works for npm though).

**To replicate the error:**

1. Checkout on the **with-docker** example
2. Install with PNPM so that it generates the pnpm-lock.yaml
3. Build the Docker image -> This will fail on the _builder stage_ step
that runs `pnpm run build`.

**Possible Solution:**
- Run `corepack enable pnpm` before building with pnpm
2024-02-01 19:32:57 +00:00
Tim Neutkens
c99bf673fe
Fix env-config tests for Turbopack (#61503)
## What?

This test was checking internals, specifically the written files. I've
refactored it to only depend on page in the application itself, the
functionality worked fine already 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 #

-->


Closes NEXT-2325
2024-02-01 18:24:28 +01:00
Tim Neutkens
ffd5732187
Fix .env hmr for Node.js runtime in Turbopack (#61504)
## What?

Whenever `.env` related files or tsconfig/jsconfig changes there's a
call to `invalidate()`, as far as I found the only call to
`invalidate()` even, which wasn't implemented for Turbopack yet. For
`NEXT_PUBLIC_` changes normal Turbopack HMR will kick in already but
this test was checking env vars that do not affect the compiled output,
so Turbopack would not trigger a HMR as no inputs changed. Similarly
webpack doesn't either and it implements this call in a similar way.

For edge runtime there's a different bug where changes are not
propagated even when you refresh, so while this change does fix another
bug for edge runtime it doesn't solve that underlying issue where the
values don't update to begin with. I'll investigate that 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 #

-->
2024-02-01 18:00:05 +01:00
Jiachi Liu
edb9371443
Fix experimental react support in app-route runtime (#61511)
Follow up for #61463

Basically the fix in #61463 was not correct. I added a log to see which
react is resolved in `dynmiac-rendering` module, and the got this:

The module with incorrect react version is from
`next.js/packages/next/dist/compiled/next-server/app-route.runtime.prod.js`
which resolves `react` as `./dist/compiled/react/index.js` even
experimental react should pop in here.

Then I found the app-route runtime doesn't have check for the react exp
env, then I added there to make it aligned with app-page runtime


Closes NEXT-2327
Closes NEXT-2294
2024-02-01 17:13:28 +01:00
Kiko Beats
461aa5108e
build: upgrade edge-runtime (#61030)
It exposes `performance` constructor

Closes #60433 
Closes NEXT-2195
2024-02-01 13:10:12 +01:00
Tim Neutkens
0237e60a3d
Fix emotion test (#61499)
## What?

Ensures that the `@emotion/cache` dependency is installed in the project
as it is used in `_app.js`. Ensures this test passes in Turbopack too.

<!-- 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-2322
2024-02-01 12:14:54 +01:00
Tim Neutkens
b5155e166b
Fix styled-components test for Turbopack (#61496)
## What?

Fixes one of the styled-components tests. Somehow the test that checks
the warning shows up without the transform is not showing the warning
but the transform is also not enabled, so I've skipped the test as it's
not important for stable.

<!-- 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-2321
2024-02-01 11:10:51 +01:00
Vercel Release Bot
2e3b88dcf1
Update font data (#61479)
This auto-generated PR updates font data with latest available

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-01 01:12:13 +00:00
Steven
9d949fd428
chore(deps): bump swr to 2.2.4 (#61480)
- Closes https://github.com/vercel/next.js/pull/61478

Closes NEXT-2319
2024-02-01 00:29:04 +00:00
vercel-release-bot
a35f689c5b v14.1.1-canary.27 2024-01-31 23:21:57 +00:00
Jiachi Liu
be37d3eaab
Fix build worker callback arg missing correct page path (#61347)
### What

The `arg` in the worker callback is alwasy `any`, when we access the
page path the argument could be in different form as the arg types are
different.

This PR align the argument type to object for `isPageStatic`,
`getDefinedNamedExports`, `hasCustomGetInitialProps` methods in static
worker. So they can share the similar shape of type of argument when
accessing `page` path. This will avoid the case that logged `page` in
the warning is `undefined`

Import the helpers from utils instead of workers as the worker itself
don't need to contain other exports that is not used for static worker.

### Why

This PR align the callback type of callback argument type of static
worker, so that we could get the actual page path value in a type-safe
way. We have 4 methods for static worker, `exportPage`, `isPageStatic`,
`getDefinedNamedExports`, `hasCustomGetInitialProps`, which the rest of
3 methods share the same format of warnings but their argument are
different. It's easily ended up with wrong argument type, and log with a
bad page path in the warning.


Closes NEXT-2289
2024-02-01 00:04:34 +01:00
Jiachi Liu
92125f07b4
Always show version text in error overlay (#61421)
Make sure the version is always display on error overlay if possible, to
avoid that we saw it's "update to date" in screenshot but still no idea
about the version


![image](https://github.com/vercel/next.js/assets/4800338/22d932ce-6176-4cbd-be66-3db1eda259aa)


Closes NEXT-2307
2024-02-01 00:04:00 +01:00
Will Binns-Smith
c7ba7b8d8c
Turbopack: fix telemetry attributes for swc options (#61474)
Previously, this considered explicitly `false` options as true, as they
were still `Some(_)`.


Closes PACK-2340
2024-01-31 13:58:08 -08:00
Thomas Knickman
7943ef8ed8
feat(next): trace build dependencies for turborepo (#59553)
### What?

This adds a method to optionally detect disk, network, and env access
access during a build and write this to a file.

### Why?

This will be consumed by Turborepo to determine **if** a build can be
cached, and if so, **how** it should be cached.

### How?

This implements a proxy that can be selectively applied to functions to
watch their access to disk, network, and env. For Turborepo, we only
care about what can alter the build output, to achieve this, we trace
the config load, and the static page generation.

Closes
https://linear.app/vercel/issue/TURBO-1904/support-build-access-tracing-in-nextjs

Performance Testing:

Repo -
https://github.com/tknickman/nextjs-turborepo-build-trace-performance-testing

```
- - - - - - - - - - - - - - - - - Performance - - - - - - - - - - - - - - - - -
pages-single-app:
  44629.53301 ms (+/- 6313.82757 ms) from 5 iterations (223318.53692 ms total)
local-pages-single-app-with-trace:
  45684.00503 ms (+/- 6570.85083 ms) from 5 iterations (228585.01729 ms total)
local-pages-single-app-without-trace:
  45938.76231 ms (+/- 6816.13022 ms) from 5 iterations (229830.15925 ms total)
approuter-single-app:
  49517.23156 ms (+/- 7820.20687 ms) from 5 iterations (247725.16713 ms total)
local-approuter-single-app-with-trace:
  50019.98247 ms (+/- 9443.82537 ms) from 5 iterations (250224.62496 ms total)
local-approuter-single-app-without-trace:
  50124.07092 ms (+/- 9656.22047 ms) from 5 iterations (250726.35688 ms total)
local-large-pages-single-app-without-trace:
  51582.92992 ms (+/- 12179.09895 ms) from 5 iterations (258469.36942 ms total)
local-large-pages-single-app-with-trace:
  51740.25813 ms (+/- 12601.02878 ms) from 5 iterations (259329.50946 ms total)
local-xlarge-pages-single-app-with-trace:
  234111.66735 ms (+/- 74629.30509 ms) from 5 iterations (1191018.63608 ms total)
local-xlarge-pages-single-app-without-trace:
  239621.11837 ms (+/- 84629.16374 ms) from 5 iterations (1218078.41921 ms total)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
```

<details>
<summary>Test case keys</summary>

* `local-xlarge-pages-single-app-without-trace`: this branch, built and
linked to a local project with 5000 SSG pages and trace **disabled**
* `local-xlarge-pages-single-app-with-trace`: this branch, built and
linked to a local project with 5000 SSG pages and trace **enabled**
* `local-large-pages-single-app-with-trace`: this branch, built and
linked to a local project with 100 SSG pages and trace **enabled**
* `local-large-pages-single-app-without-trace`: this branch, built and
linked to a local project with 100 SSG pages and trace **disabled**
* `local-approuter-single-app-without-trace`: this branch, built and
linked to a local default approuter starter and trace **disabled**
* `local-approuter-single-app-with-trace`: this branch, built and linked
to a local default approuter starter and trace **enabled**
* `local-pages-single-app-with-trace`: this branch, built and linked to
a local default pages starter and trace **enabled**
* `local-pages-single-app-without-trace`: this branch, built and linked
to a local default pages starter and trace **disabled**
* `approuter-single-app`: next@latest running on the default approuter
starter
* `pages-single-app`: next@latest running on the default pages starter


</details>


TODO:
- [ ] Telemetry events
2024-01-31 14:18:27 -07:00
JJ Kasper
55c3baa8b1
Replace image optimizer IPC call with request handler (#61471)
This ensures we don't do un-necessary IPC calls during image optimizing
and leverage the internal request handler for fetching internal static
images/resources.

x-ref: https://github.com/vercel/next.js/issues/58248

Closes NEXT-2318
2024-01-31 15:17:52 -05:00
Stefan Generalao
e0c63aca99
fix: dockerfile npm run build (#61466) 2024-01-31 18:46:33 +00:00
vercel-release-bot
dbd9598f56 v14.1.1-canary.26 2024-01-31 18:11:07 +00:00
Jiachi Liu
cbcee50f19
Pass down __NEXT_EXPERIMENTAL_REACT env to webpack build worker explicitly (#61463)
Make sure `__NEXT_EXPERIMENTAL_REACT` env is alwasy available in webpack
build worker, like we've done for the other worker before

Closes NEXT-2294
2024-01-31 18:58:08 +01:00
Tim Neutkens
724c4462d5
Support crossOrigin in Turbopack (#61461)
## What?

Implements `crossOrigin` in the React Client Components manifest for
Turbopack. This feature was missing.

Removes the `false` value as it doesn't actually do anything, the
default is no crossorigin property.

<!-- 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-2313
2024-01-31 18:37:34 +01:00
Tobias Koppers
d6badf82b7
avoid sending issues turbopack messages to browser (#61443)
### What?

avoid sending issues turbopack messages to browser

### Why?

they trigger fake HMR events and are not used on client side anyway


Closes PACK-2338
2024-01-31 09:30:07 -08:00
Stephanie Dietz
9945e8706d
remove note about updating next.config with hostname as this is not n… (#61458)
Since we do not optimize videos, we do not need to add the hostname to
the `next.config.js` file. This PR removes the note telling the reader
to do this.
2024-01-31 11:12:13 -05:00
Zack Tanner
871416655e
fix issues loading CSS in default slots (#61428)
### What
When using a default slot that re-exports another page, the CSS entries
(and presumably other client reference modules, like JS entries) that
correspond with the re-exported page won't be loaded, resulting in CSS
styles not being applied.

### Why
`next-app-loader` constructs the path to the default segment but special
cases the `children` slot (which is used as the page), to mark the
segment as an empty string. This is so that the parallel default file
can be loaded. However the way that `defaultPath` is constructed, it
assumes that `actualSegment` won't be an empty string, and constructs an
invalid path like so:

`app/example//default.tsx`

When we go to look up the JS/CSS entries from the client reference
manifest, the key will be incorrect and so it won't find the files for
it, resulting in this bug.

### How
This moves the `/` delimiting to be part of the creation of the
`actualSegment` variable so that we only append it when we know we
aren't setting it to be an empty string.

Fixes #52245
Fixes #49871
Closes NEXT-2309
Closes NEXT-2310
2024-01-31 07:25:38 -08:00
Delba de Oliveira
70900cebfd
Docs: Add note on default.js receiving params (#61454) 2024-01-31 06:59:36 -08:00
Chris Weber
6efe76f954
CNA: exclude ts(js)conf.json as well as .git folder (#61412)
### What?

On windows the .git/* files are read only, when the CNA "import path" script attempts to open one of the .git/* files

### Why?

attempting to open any of the .git/* files results in an error thrown by CNA and CNA exists, hence not finishing the setup of a new project

### How?

My suggested fix uses the fast-glob ignore option to exclude the .git folder, I also moved the the ts(js)config.json exclusion into the ignore (was an "if" before)

- Fixes #61411 
- Discussion https://github.com/vercel/next.js/discussions/61261
2024-01-31 09:36:31 -05:00
Delba de Oliveira
5d21c6cba1
Docs: Document prefetch null for App Router (#61203)
As per: https://github.com/vercel/next.js/pull/48383
2024-01-31 08:00:30 -06:00
Delba de Oliveira
91cbe61e75
Docs: Add instrumentation.ts API reference, improve instrumentation docs (#61403)
- Add instrumentation.ts API reference
- Polish and restructure instrumentation docs
2024-01-31 07:54:32 -06:00
Delba de Oliveira
68c5edf7ed
Docs: Update migration wording for /pages (#61453) 2024-01-31 07:52:39 -06:00
Jiachi Liu
fd6db76ae0
Fix next dynamic import named export from client components (#61378)
When using `next/dynamic` in server components to load a client
component with named export, we shouldn't dot into the prop name since
client component reference as it's already a valid react component type.
It would work with `default` prop but not other named exports.

Let's say `mod` is a dynamic imported module
```
mod.Button.default
```

will become the client reference key
```
mod#Button#default
```
Which means in module `mod`, get `Button` export, then `default`
property of it, which is wrong but it's a valid key in the client
reference roxy.

This PR checks if they're client module, then return itself as dynamic
imported component type for `next/dynamic` if it is one.


Fixes #61046
Closes NEXT-2229
2024-01-31 14:50:20 +01:00
Tobias Koppers
e5b514692e
fix a perf problem in VersionedContentMap (#61442)
### What?

Avoid a dependency from the emit operation to the `get_and_write`
lookup.

### Why?

This makes HMR much faster since the `get_internal` method is pretty
slow.


Closes PACK-2337
2024-01-31 11:50:00 +01:00
Donny/강동윤
fafcb5fbfe
Update turbopack (#61433)
# Turbopack

* https://github.com/vercel/turbo/pull/7167 <!-- Leah - fix: catch
import map lookup error properly in `ResolvingIssue` -->
* https://github.com/vercel/turbo/pull/7182 <!-- Donny/강동윤 - feat:
Re-enable `preset-env` mode of `styled-jsx` in turbopack -->
* https://github.com/vercel/turbo/pull/7161 <!-- Tobias Koppers - add
support for globs in sideEffects field in package.json -->
* https://github.com/vercel/turbo/pull/7184 <!-- Donny/강동윤 - chore:
Update `swc_core` to `v0.89.6` -->

### What?

Update turbopack

### Why?

To test https://github.com/vercel/turbo/pull/7182 against internal
webapps.

### How?

 - Closes #57718

Closes PACK-2334
2024-01-31 19:33:37 +09:00
Vercel Release Bot
cd6bd77017
Update Turbopack test manifest (#61435)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2024-01-31 11:29:44 +01:00
Donny/강동윤
ead21691b6
chore: Update swc_core to v0.89.6 (#61426)
### What?

Update SWC crates

### Why?

To apply the latest bugfixes

### How?

Fixes #40385



Closes PACK-2332
2024-01-31 18:35:20 +09:00
Stephanie Dietz
0964c12983
Remove the regions option from the config section of the middleware file conventions doc (#61425) 2024-01-30 21:23:12 -06:00
Balázs Orbán
3a923d5eda
chore: add resolved label (#61416)
### What?

- Add a comment to issues labeled with `resolved`

Note to maintainers: it won't autoclose the issue. (This would need to
be added to [`nissuer`](https://github.com/balazsorban44/nissuer) as a
new feature)

Rendered comment
[here](b868cf95f2/.github/good-first-issue.md)

- I also reorganized the label comments to its own folder since we have
a few now.

### Why?

After verifying if an open issue has been fixed, a common task is to
comment on it and tell people to upgrade or open a new issue if it
persists. (Ideally, PRs would reference every issue they fix, but
sometimes we need to do this chore manually)

### How?

Using `nissuer`'s
[comment-label](https://github.com/balazsorban44/nissuer#label-management).


Closes NEXT-2306
2024-01-31 02:50:23 +01:00
Leah
44b589e8ec
chore: use real font files for font tests (#61399)
### Why?

Turbopack throws a build error (next just logs an error).
Also probably better to test with real font files in general.



Closes PACK-2324
2024-01-31 01:22:25 +00:00
vercel-release-bot
6df41fde43 v14.1.1-canary.25 2024-01-31 00:29:05 +00:00
Tobias Koppers
328673d193
fix hmr telemetry reporting (#61420)
### What?

We sometimes send events with `start: null`...


Closes PACK-2327
2024-01-31 01:18:31 +01:00
Zack Tanner
31a0edbd1b
parallel routes: fix catch-all slots being treated as optional catch-all (#61174)
### What
Catch-all parallel slots were being incorrectly matched to the root of their segment. For example, `@foo/[...catchAll]/page` as a parallel route on `/page.tsx` should not match on `/`, but it should match on `/foo`, `/bar`, ...etc

### Why
The catch-all route normalization logic doesn't treat optional catch-all routes differently from catch-all routes. The assumption was if any catch-all route was found, that it should match the path that shared its prefix.

### How
This updates the normalization logic to handle optional-catchall as it was in the original implementation. For regular catch-all, we ensure that the catch-all base path (for `/[...slug]` that'd be `/`) isn't identical to the path we'd match it to.

Fixes #60613
Closes NEXT-2243
2024-01-30 15:28:47 -08:00
vercel-release-bot
7c4d724e57 v14.1.1-canary.24 2024-01-30 23:22:57 +00:00