Commit graph

19705 commits

Author SHA1 Message Date
Balázs Orbán
ac1c14b8ce
feat(cli): show available memory/CPU cores in next info (#62249)
### What?

Adds a new line to the `next info` output:

```diff
Operating System:
  Platform: linux
  Arch: x64
  Version: #18~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb  7 11:40:03 UTC 2
+ Available memory (MB): 31795
+ Available CPU cores: 16
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: N/A
  pnpm: 8.15.1
Relevant Packages:
  next: 14.1.1-canary.61 // Latest available version is detected (14.1.1-canary.61).
  eslint-config-next: 14.1.1-canary.61
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A
```

### Why?

This can help in debugging

### How?

Using [`os.totalmem()`](https://nodejs.org/api/os.html#ostotalmem) and
[`os.cpus()`](https://nodejs.org/api/os.html#oscpus)

Closes NEXT-2529
[Slack
thread](https://vercel.slack.com/archives/C046HAU4H7F/p1708359702870269?thread_ts=1708355509.771049&cid=C046HAU4H7F)
2024-02-20 11:46:51 +01:00
Donny/강동윤
2d8462eaf4
Update turbopack (#62263)
### What?


* https://github.com/vercel/turbo/pull/7416 <!-- Donny/강동윤 - Update
`swc_core` to `v0.90.10` -->


### Why?

To keep in sync

### How?



Closes PACK-2540
2024-02-20 08:26:39 +01:00
JJ Kasper
9c44024139
Add test log prefix for otel (#62258) 2024-02-19 21:19:49 -08:00
Donny/강동윤
a78ed66726
Update swc_core to v0.90.10 (#62222)
### What?

Update SWC crates.

### Why?

There was an important bug fix in SWC.

 - https://github.com/swc-project/swc/pull/8647

### How?



Closes PACK-2529
2024-02-20 03:20:56 +00:00
Jiwon Choi
b63196f0fe
fix(next): terser-webpack-plugin path in taskfile.js is missing 'src' (#62229)
### Why?

While developing https://github.com/vercel/next.js/pull/57656, using
`webpack`(which runs `bundle5.js`) gives me the following error:

```
Error: Cannot find module 'next/dist/build/webpack/plugins/terser-webpack-plugin'
Require stack:
- .../node_modules/next/dist/compiled/webpack/bundle5.js
```

### What?

The path to
[terser-webpack-plugin](https://github.com/vercel/next.js/blob/canary/packages/next/src/build/webpack/plugins/terser-webpack-plugin/src/index.ts)
seems to be modified, but the `taskfile.js` for building `bundle5.js`
hasn't been updated since https://github.com/vercel/next.js/pull/29168.

### How?

- Added `src` after the `terser-webpack-plugin` path in `taskfile.js`
- Run `pnpm ncc-compiled` (not sure if this is the right command to
run), built `bundle5.js` only.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-19 16:17:13 -08:00
Sina-Abdollahi
65369991d8
fix: 💯 typescript issue with-jest example (#62227)
So there are some toBe property's with React-testing-library that when
written shows this error for example: Property 'toBeInTheDocument' does
not exist on type 'JestMatchers<HTMLElement>'. the commit fixes it

<!-- 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: Sam Ko <sam@vercel.com>
2024-02-20 00:07:35 +00:00
vercel-release-bot
321e4d0f2e v14.1.1-canary.62 2024-02-19 23:21:18 +00:00
JJ Kasper
1a102fb273
Fix type error in build.ts (#62253)
Fixes:
https://github.com/vercel/next.js/actions/runs/7964464677/job/21742122219

x-ref: https://github.com/vercel/next.js/pull/62234

Closes NEXT-2530
2024-02-19 12:09:21 -08:00
Adrian Hartanto
92fdcc75d4
update: allow providing stale-while-revalidate delta (#61330)
<!-- 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: https://github.com/vercel/next.js/pull/52251
Closes: https://github.com/vercel/next.js/issues/51823

### Adding a feature

Added `stale-while-revalidate` delta amount to indicate that the cache
could reuse a stale response while it revalidates,
[reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).
It's also already supported by
[CloudFront](https://aws.amazon.com/about-aws/whats-new/2023/05/amazon-cloudfront-stale-while-revalidate-stale-if-error-cache-control-directives/).

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-19 11:51:13 -08:00
Tim Neutkens
544444b9da
Ensure handleRouteType does not throw in production builds (#62234)
## What?

Ensures the build can finish before issues are reported with 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-2525
2024-02-19 20:39:33 +01:00
Leah
ecb4d7484e
refactor(turbopack): resolve routes by page name instead of pathname (#61778)
### Why?

We currently use `page` and `pathname` in different places for file
system paths (manifests can be in a different folder to the js entry),
this PR makes more things just use `page` directly instead of going
through `pathname`.

This PR also adds an entry key (similar to the webpack version) uniquely
identifying all entry points (and assets).


Closes PACK-2432
2024-02-19 15:13:39 +00:00
Leah
6926688a1e
refactor(turbopack): wrap manifest loading in helper class (#62118)
### What?

All the manifest loading logic now lives in the
`TurbopackManifestLoader` class.
We have to pass way fewer arguments around to the functions now.

I've also cleaned up / restructured the arguments of the bigger
functions in `turbopack-utils.ts` and gave some functions better names.


Closes PACK-2520
2024-02-19 14:27:09 +00:00
Balázs Orbán
971843d019
fix: clarify Dynamic API calls in wrong context (#62143)
### What?

An unactionable error is thrown when `headers()`, `cookies()` or other
Dynamic API functions are called outside the render/request context.
This PR clarifies what the user can do to fix the problem.

### Why?

The current error is  hard to understand

> Error: Invariant: `cookies` expects to have requestAsyncStorage, none
available.

### How?

I am adding a dedicated error page and rephrasing the error message.

Closes NEXT-2509
2024-02-19 13:41:14 +01:00
Leah
031cf70092
fix(turbopack): catchall route matching (#62114)
This PR adds catch-all matching support to Turbopack. This allows you to
have catch-all parallel slots.

Closes NEXT-2038
Closes PACK-2518

Fixes #59502

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2024-02-19 10:44:53 +01:00
Tobias Koppers
8250a8419a
add turbo.resolveExtensions to allow to customize extensions (#62004)
### What?

* add `turbo.resolveExtensions` to allow to customize extensions in
Turbopack

fixes PACK-2335
Fixes https://github.com/vercel/turbo/issues/4934
2024-02-19 09:07:09 +00:00
Tim Neutkens
7e4be1f014
Add page name to error logged in Turbopack (#62218)
## What?

Ensures you can track what page caused a compiler error.

<!-- 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-2524
2024-02-19 09:38:29 +01:00
Donny/강동윤
d8865d040a
test: Make css bundle assertion work also for turbopack (#62127)
### What?

Fix one assertion about CSS files emitted by turbopack.

### Why?

Turbopack generates `/_next/static/chunks/2225ce._.css`, which does not
match the regex.
Note that it has `._.css`. The previous assertions match on
`[^.]+\.css`, which does not support two dots in the file name.

I tried `/<link rel="stylesheet" href=".+\.css(\?v=\d+)?"/g`, but it
captured 3 `link` tags at once. So I used `/<link rel="stylesheet"
href="[^<]+\.css(\?v=\d+)?"/g`.


### How?

Closes PACK-2413
2024-02-19 03:35:13 +00:00
ArianHamdi
ab487cba92
docs: fix page.js file name in 02-pages-and-layouts.mdx (#62221)
<!-- 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: Sam Ko <sam@vercel.com>
2024-02-19 03:22:24 +00:00
Donny/강동윤
755e88b16b
feat: Lint invalid CSS modules (#62040)
### What?

`css-loader` seems to have a linting rule for invalid CSS Modules.
[My Turbopack PR](https://github.com/vercel/turbo/pull/7381) implements
the same rule for `swc_css` and `lightningcss`, and this PR is for
enabling related test suite and updating the jest snapshot.

### Why?

`css-loader` has a similar linting rule.

### How?

Closes PACK-2408
2024-02-19 03:10:08 +00:00
Jon Meyers
5b48db23b1
Add protected page and pending state to with-supabase example (#62211)
### What?

[1] Add protected page
[2] Add pending state

### Why?

[1] People using incorrect ways to protect pages
[2] No feedback that the login page is doing anything when buttons
clicked

### How?

[1] Redirect user to protected page after successful authentication
[2] Use useFormStatus to determine whether the form is in a pending
state

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-19 01:12:58 +00:00
vercel-release-bot
12411e9fe0 v14.1.1-canary.61 2024-02-19 00:04:04 +00:00
JJ Kasper
8ef58bb113
Ensure webpack build worker defaults on (#62214)
As discussed almost all webpack plugins shouldn't have issues with this
being enabled by default so removing the default condition where we
disable this optimization due to custom webpack config is more
beneficial and in the rare case a custom plugin has issues it can still
be manually disabled.

Closes NEXT-2523
2024-02-18 15:41:35 -08:00
JJ Kasper
0b5f7d9b42
Update split chunk handling for edge/node (#62205)
While investigating OOMs noticed that our split chunks handling for edge
runtime isn't optimized properly causing a lot of duplicate
transpiling/minification which causes exponential memory/cache usage.

On a minimal app before this change the memory usage and cache size were
over `2GB`s after this change they are under `200MB`.

**Before**

![CleanShot 2024-02-17 at 16 08
46@2x](https://github.com/vercel/next.js/assets/22380829/5286e5fb-5e48-4296-a6be-d2ed1455eb95)


**After**

![CleanShot 2024-02-18 at 08 58
51@2x](https://github.com/vercel/next.js/assets/22380829/f813a185-51a7-40e0-b44b-e1ab95649194)



Closes NEXT-2521
2024-02-18 15:27:40 -08:00
vercel-release-bot
7bf825741d v14.1.1-canary.60 2024-02-18 23:21:18 +00:00
Vercel Release Bot
160bb99b06
Update font data (#62173)
This auto-generated PR updates font data with latest available

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-17 23:49:35 +00:00
vercel-release-bot
c62053f30b v14.1.1-canary.59 2024-02-17 23:20:55 +00:00
suu3
e56275974c
docs: updated link in JSDoc for the shallow property in link.tsx (#62181)
<!-- 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 #

-->

Hi there.
I discovered that the JSDoc link in the shallow property of link.tsx was
not updated and I updated it.
2024-02-18 00:07:56 +01:00
Theo
d18335ba43
Fix 02-pages-and-layouts.mdx to show Good to know and contents in the same box (#62203)
**Good to know:** and list should be inside the same box.


![image](https://github.com/vercel/next.js/assets/36564257/072eb7ca-1c95-473b-9d08-c4cea649b7ea)


<!-- 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-17 22:39:18 +00:00
Akbarshokh Sobirov
4fa08dea8c
Fix sendGAEvent function (for real?) (#62192)
The recently merged PR - https://github.com/vercel/next.js/pull/62065,
doesn't seem to fix the issue. As per the comment this seems to be
related to `dataLayer` that does not like working with Arrays, but works
with [arguments
object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments).
Also, when using window.gtag(...) an Arguments() is pushed instead of
Array().

Fixes #61703
2024-02-17 20:00:04 +00:00
vercel-release-bot
da616e56d2 v14.1.1-canary.58 2024-02-16 23:21:11 +00:00
Tobias Koppers
8ee776dd17
add support for esmExternals in pages (#61983)
### What?

* add support for esmExternals in pages
* fix default of esmExternals to true
* fix serverComponentExternalPackages support
* add test case

fixes PACK-2311
fixes PACK-1916

Fixes https://github.com/vercel/turbo/issues/4544
2024-02-16 23:09:45 +00:00
mnjongerius
895e7df860
Patch 2 (#62147)
<!-- 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?
Updating Example for Storyblok

### Why?
While setting up the Storyblok example to do create quick poc I noticed
some documentation missing and some code not working as expected.

### How?
- Updates documentation about Storyblok example in README
- Code change in HeroPost to make Storyblok example work as expected
2024-02-16 20:29:28 +00:00
Ismail Ghallou
ef1fb15260
docs: fix srclang prop (#62164)
### What?
- `srclang` -> `srcLang`

### Why?
React.js!
2024-02-16 19:47:16 +00:00
kevinmitch14
d397832e01
Docs: update link.mdx (#61508)
Updated paths in relation to `<Link />` and middleware rewrites. Feel
free to leave suggestions if needed, this has always confused me a
little bit.

**Old Version**:
For example, if you have a Dynamic Route like `/dashboard/[user]` that
you want to present differently via middleware, you would write: `<Link
href={{ pathname: '/dashboard/authed/[user]', query: { user: username }
}} as="/dashboard/[user]">Profile</Link>`.

The `as` prop should be the URL we want to display while href/pathname
is the actual path. So if we want to present something differently via
middleware, we would do so via `as`. In the example above we want to
display `/dashboard/[user]` differently but we use
`as='/dashboard/[user]'`.
2024-02-16 19:43:11 +00:00
Will Ashe
e71046b610
Fix sendGAEvent function (#62065)
Previous implementation of `sendGAEvent` was pushing arguments to
`dataLayer` via rest parameter syntax, resulting in an actual array,
which GA doesn't seem to process correctly (resulting in the event not
showing up in GA reports). This PR refactors it to a vanilla JS function
passing data via the `arguments` array-like object, which is able to be
processed correctly and results in the event showing up as expected.

fixes [61703](https://github.com/vercel/next.js/issues/61703)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:56:19 +00:00
Bernardo Belchior
f23f57f692
Fix extra const in video docs (#62155)
<!-- 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: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:26:06 +00:00
Phil Z
5f98a8def0
Add puppeteer-core to serverComponentsExternalPackages.mdx (#62156)
<!-- 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 #

-->

This is a docs change that I should have included with
https://github.com/vercel/next.js/pull/62063

Adds `puppeteer-core` to the documented list of external server
dependencies to be ignored by the bundler.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 18:25:16 +00:00
OJ Kwon
2e138532fa
docs(next-api): trying to document project_update_info_subscribe (#61962)
### What?

Closes PACK-2469

Trying to add some description to the one of the public interface.

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-02-16 17:31:00 +00:00
Leah
ca1b6184c8
chore: update test template to use nextTestSetup (#62154)
### Why?

Less indentation and allows for IDE integration.



Closes PACK-2523
2024-02-16 17:30:54 +01:00
Jiachi Liu
cbdd1d2654
Fix handling subpath for server components externals (#62150)
Follow up of #61986 where we didn't handle the subpath externals very
well, found by @sokra

Closes NEXT-2517
2024-02-16 17:24:12 +01:00
vercel-release-bot
646a3d99db v14.1.1-canary.57 2024-02-16 15:27:46 +00:00
Tim Neutkens
212553958c
Fix issue with ComponentMod being read in Turbopack (#62141)
## What?

Fixes an issue where trying to build an edge runtime page with
generateStaticParams fails to read `ComponentMod`. Discussed with @sokra
and found that changing it to `import()` resolves the problem.

<!-- 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-2514
2024-02-16 16:06:38 +01:00
Tim Neutkens
96599a1b1d
Show build errors from Turbopack (#62139)
## What?

Ensures that when errors happen during compilation they are shown and
the build exits because it can't continue.

<!-- 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-2513
2024-02-16 13:55:28 +01:00
Jiachi Liu
dd24033caf
DX: hide the webpack info prefix for module paths (#62101)
### What

Hide the module file path webpack prefix for better visualization.
There're few types of webpack module prefixes 

- `wepack://`
- `wepack:///`
- `webpack://_N_E`
- `webpack-internal:///`

We're stripping them from the module path

### After vs Before
<img width="320"
src="https://github.com/vercel/next.js/assets/4800338/a9f5ae61-4fbf-42d7-b3e0-9bed1c7babb4">
<img width="420"
src="https://github.com/vercel/next.js/assets/4800338/ed6e120a-7c1c-4c31-be5d-9a1726d4e20c">


Closes NEXT-1966
Closes NEXT-1983
Closes NEXT-2504
2024-02-16 11:33:34 +01:00
Donny/강동윤
12639c4847
test: Make css deduplication assertion work for turbopack (#62128)
### What?

Fix one assertion about CSS files emitted by turbopack.

### Why?

Webpack generates 3 links with `?v=` query, and 2 extra links without
`?v=` query. Turbopack does not have query string, so we match 5 links.

### How?

Closes PACK-2414
2024-02-16 17:37:55 +09:00
Remco Haszing
d407a016c0
Fix @next/mdx types (#57580)
It’s not possible to combine `export =` type definitions with ESM-style
exports. To export types for a module that uses `module.exports =`, one
needs to use a namespace.

Also `Options` is now imported from `@mdx-js/loader`. The imports need
to come from a direct dependency or peer dependency. Also
`@mdx-js/loader` is more accurate here, because the options are passed
into `@mdx-js/loader`.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-15 20:54:43 -08:00
Dima Voytenko
b4db808822
OpenTelemetry: trace API routes in page router (#62120)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 03:45:59 +00:00
Erfan
b2e5c014e5
Add polyfill for Object.hasOwn (#60437)
`Object.hasOwn` should be in list of default polyfills. It's a widely
used feature of ES2022

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-16 01:32:05 +00:00
Will Binns-Smith
60b60683bd
Update to turbopack-240215.5 (#62119)
Includes:
- https://github.com/vercel/turbo/pull/7401

This makes “conversion to class component” Turbopack tests pass.
2024-02-16 00:52:29 +00:00
Jiachi Liu
3c4ec650b3
Should not warn metadataBase missing if only absolute urls are present (#61898)
### What

* Narrow down the metadata base warnings only when there's any relative
urls need to be resolved, if there's only absolute urls present, no need
to resolve and we don't warn.
* Polish the error message, updated from "metadata.metadataBase is not
set ..." to "metadataBase property in metadata export is not set ..."

### Why

It will be confusing if we're still show metadataBase warning when
there's no need to set one, since the social image cards only have
absolute urls

Closes NEXT-2426
2024-02-16 00:29:55 +01:00