Commit graph

19898 commits

Author SHA1 Message Date
vercel-release-bot
330b04ff55 v14.1.2-canary.4 2024-03-04 12:29:28 +00:00
Tobias Koppers
92eecbfdff
Turbopack: sass support (#62717)
### What?

* upgrades turbopack for `getResolve` in webpack loaders
* add missing resolve-url-loader to turbopack for full sass support

Closes PACK-2634
2024-03-04 11:56:55 +00:00
OJ Kwon
e9862a80f8
build(cargo): update turbopack (#62744)
### What

* https://github.com/vercel/turbo/pull/7544 <!-- Tobias Koppers -
extract a turbopack-resolve crate -->
* https://github.com/vercel/turbo/pull/7547 <!-- Tobias Koppers - only
register once -->
* https://github.com/vercel/turbo/pull/7447 <!-- Leah - fix(turbopack):
catch invalid source map paths -->
* https://github.com/vercel/turbo/pull/7503 <!-- Leah -
fix(turbopack-node): don't bundle postcss config -->
* https://github.com/vercel/turbo/pull/7445 <!-- Tobias Koppers - allow
to set a name on the virtual file system -->
* https://github.com/vercel/turbo/pull/7552 <!-- Tobias Koppers - add
default_files, prefer_relative and fully_specified resolve options -->
* https://github.com/vercel/turbo/pull/7560 <!-- Tobias Koppers - remove
unused code -->
* https://github.com/vercel/turbo/pull/7562 <!-- Tobias Koppers - add
getResolve to webpack loader context -->
* https://github.com/vercel/turbo/pull/7564 <!-- Tobias Koppers - fix
serde deserialization -->
* https://github.com/vercel/turbo/pull/7566 <!-- Tobias Koppers - Revert
"add getResolve to webpack loader context" -->
* https://github.com/vercel/turbo/pull/7565 <!-- Tobias Koppers - Ignore
circular aliasing with alias field -->
* https://github.com/vercel/turbo/pull/7320 <!-- OJ Kwon -
feat(turbo-tasks-fetch): allow specifying a proxy -->
* https://github.com/vercel/turbo/pull/7573 <!-- OJ Kwon - Revert
"Remove mopa dependency in turbo-tasks" -->
* https://github.com/vercel/turbo/pull/7526 <!-- Alexander Lyon - Handle
logging story better on daemon -->

Closes PACK-2639

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-03-04 11:33:21 +01:00
vercel-release-bot
9fb18e6739 v14.1.2-canary.3 2024-03-03 23:21:56 +00:00
Tim Neutkens
b7871953b2
Fix cms-plasmic example (#62790)
## What?

The `@plasmicapp/loader-nextjs` was outdated and doesn't work with the
latest version of Next.js.

<!-- 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-2675
2024-03-03 19:32:48 +01:00
Tim Neutkens
a33ed996df
Fix error in api-routes-middleware example (#62788)
## What?

Currently it shows `TypeError [ERR_INVALID_ARG_TYPE]: The "string"
argument must be of type string or an instance of Buffer or
ArrayBuffer.`. It just needs to `JSON.stringify` the value as it can be
an array.

<!-- 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-2674
2024-03-03 18:43:41 +01:00
Tim Neutkens
d01d6d9c35
Update with-emotion example (#62771)
## What?

Consolidates all emotion examples into a single one that uses the SWC
plugin by default, making sure you get the best experience.

Added the missing `@emotion/cache` dependency which also makes this
example work 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 #

-->
2024-03-03 08:04:32 +01:00
Tim Neutkens
79f103fb79
Fix invalid / import in with-facebook-pixel example (#62772)
## What?

This is an undocumented edge case in webpack handling of resolving.
Updates the import to be a normal path.

<!-- 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-2672
2024-03-03 07:25:43 +01:00
Tim Neutkens
8c2edb4746
Update with-react-bootstrap to be Turbopack compatible (#62773)
## What?

This example used the legacy `~` operator which is no longer required in
latest webpack.

In case you land here trying Turbopack and running into the can't
resolve error this will be useful to know:

If you still need `~` it can be aliased using the `resolveAlias` option
in Turbopack:


```
module.exports = {
  experimental: {
    turbo: {
      resolveAlias: {
        '~*': '*',
      },
    },
  },
}
```

<!-- 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-2673
2024-03-03 07:25:30 +01:00
vercel-release-bot
f2d4d04ff8 v14.1.2-canary.2 2024-03-02 23:21:32 +00:00
Lee Robinson
1d00ed4bf1
docs: clarify client component intro (#62767)
"Render on the client" could sound like client-only rendering.
2024-03-02 16:39:04 -06:00
Tim Neutkens
bd28752495
Fix conflicting-app-page-error test for Turbopack (#62747)
## What?

Fixes the check for Turbopack. Follow-up to #62531 which fixes the
underlying issue but it wasn't checking the right value.

<!-- 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-2665
2024-03-02 11:00:05 +00:00
JJ Kasper
04b13f52a5
Update error handling in publish scripts (#62754)
Seems we aren't ignoring the already published error correctly.

x-ref:
https://github.com/vercel/next.js/actions/runs/8118349923/job/22192598805

Closes NEXT-2668
2024-03-02 00:40:51 +00:00
Will Binns-Smith
be87132327
Turbopack: Trace server app render errors through source maps (#62611)
Previously, errors shown in the error overlay, these stir were left
untraced through source maps.

Test Plan: `TURBOPACK=1 pnpm test-dev
test/development/app-render-error-log/app-render-error-log.test.ts`

Closes PACK-2608
2024-03-01 16:31:02 -08:00
vercel-release-bot
d70a554032 v14.1.2-canary.1 2024-03-01 23:17:20 +00:00
Sam Ko
492156b4c5
chore: add new codeowners for cli refactor (#62749)
- https://github.com/vercel/next.js/pull/61877#discussion_r1509561939

Closes NEXT-2666
2024-03-01 15:13:19 -08:00
Sam Ko
ccbd69ff9a
docs: update Next.js CLI docs (#62304)
## Description

It made sense to improve our <picture data-single-emoji=":nextjs:"
title=":nextjs:"><img class="emoji" width="20" height="auto"
src="https://emoji.slack-edge.com/T0CAQ00TU/nextjs/2a85d633ae594556.png"
alt=":nextjs:" align="absmiddle"></picture> CLI docs after refactoring
the CLI!

## Important Changes
- Removes mention of `next export`, which was moved to `next.config.js`
- Adds mention of `--turbo`
- Adds all the expected help outputs

## Related
- https://github.com/vercel/next.js/pull/61877
- Fixes https://github.com/vercel/next.js/issues/59226

Closes NEXT-2545

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-01 15:13:08 -08:00
Sam Ko
47f73cd8ec
refactor(cli): refactor cli to commander (#61877)
## Description
Refactor the [Next.js
CLI](https://nextjs.org/docs/app/api-reference/next-cli) to use
[commander](https://github.com/tj/commander.js) instead of
[arg](https://github.com/vercel/arg).

## Why?
- Auto-generated, properly formatted help command + output. With `arg`,
much of the help commands were manually added via a single
`console.log`, causing deviations over time.
- Ergonomic, ease of adding new subcommands and rules

## Breaking Changes
- Update the experimental `next experimental-compile` and `next
experimental-generate` build commands in favor of `next build
--experimental-build-mode=compile/generate`

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-01 23:12:47 +00:00
vercel-release-bot
2f7721a632 v14.1.2-canary.0 2024-03-01 21:49:46 +00:00
Zack Tanner
9529a874bd
Add a flag to disable MergeCssChunksPlugin (#62746)
This is currently on by default, but this adds a flag to allow disabling
it if it causes issues with your application's CSS.

Closes NEXT-2664
2024-03-01 21:44:28 +00:00
JJ Kasper
8562680f23
Update version from backport (#62745)
Ensures new canaries start from correct version as we did a backport for
`v14.1.1`

Closes NEXT-2663
2024-03-01 21:35:18 +00:00
Max Leiter
6ffbdc5db1
Route static render error message: remove duplicate word (#62738)
### What?
Removes an extra word from an error message

### Why?
It bothered me 

### How?
I opened it in VS Code and removed it

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-01 21:35:15 +00:00
Tim Neutkens
8a2460ccb1
Revert "Migrate Sass tests to test/e2e" (#62735)
Reverts vercel/next.js#62321

This needs to land with @sokra's work on Sass but that couldn't land
yet.

Closes NEXT-2661
2024-03-01 20:02:22 +01:00
Jiachi Liu
4d4b45ec2c
fix dev overlay pseudo html collapsing (#62728)
Dev overlay should show the full stack trace after clicking the
uncollase button to display the full component stack

Closes NEXT-2658
2024-03-01 19:13:57 +01:00
Tim Neutkens
8034042215
Add compiler error for conflicting App Router and Pages Router in Turbopack (#62531)
## What?

Working on fixing `test/e2e/conflicting-app-page-error`, this adds a
compiler error for the case where App Router routes conflict with Pages
Router routes. It's not 1:1 the same error as in webpack because in the
webpack version we hijacked the App Router resolving logic to assume
there's a certain set of paths, where Turbopack has the full route to
route tree resolving implementation which doesn't assume there's a
single page that can be resolved.

The tests are updated to reflect this change.


<!-- 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-2592
2024-03-01 17:39:39 +01:00
Tim Neutkens
d12693e779
Handle top level errors coming from Turbopack entrypoints subscription (#62528)
## What?

Adds handling for issues that are emitted during the entrypoints
subscription, before the changes in this PR any issue (i.e. compiler
errors) that was emitted during the collection of which entrypoints
exist in the application were ignored.

<!-- 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-2591
2024-03-01 14:47:41 +01:00
Balázs Orbán
7593039b4c
fix(error-overlay): improve a11y, minor refactors (#62723)
### What?

- Use `button` instead of `span` to allow keyboard navigation
- match tabindex with other items in the overlay to include it in the
natural focus sequence
- the style is kept, but we might need a better contrasting icon for the
dark background
- use same file conventions with existing files
  - match file casing
  - move icons to the `icons` folder
- Improve PseudoHtml internal docs
  - use code guards ``` for code snippets
- drop the `any` type (long-term, we really should disallow `any` types)

Closes NEXT-2657
2024-03-01 14:40:46 +01:00
Vercel Release Bot
2dab0b6ec8
Update Turbopack test manifest (#62715)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2024-03-01 09:56:27 +00:00
Tim Neutkens
c0b1383c39
Migrate Sass tests to test/e2e (#62321)
## What?

Migrates the Sass support tests from `test/integration` (legacy test
suite) to `test/e2e`, this way all these tests run against both
development and production, whereas previously most of them would only
run against production.

This is helpful as it ensures the tests are running against Turbopack
too, which is highlighting some missing features in Sass support for
Turbopack.

I've had to rewrite most of the tests to check against the actual
rendered output in the browser instead of CSS output in the `.next`
folder, the majority of these now run regardless of implementation
details.

<details>
<summary>Tests that failed with Turbopack</summary>

```
 FAIL  e2e/app-dir/scss/url-global-partial/url-global-partial.test.ts (84.9 s)
  ● SCSS Support loader handling › CSS URL via file-loader sass partial › should render the page

    thrown: "Exceeded timeout of 60000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      13 |     })
      14 |
    > 15 |     it('should render the page', async () => {
         |     ^
      16 |       const browser = await next.browser('/')
      17 |       expect(
      18 |         await browser.elementByCss('.red-text').getComputedCss('color')

      at it (e2e/app-dir/scss/url-global-partial/url-global-partial.test.ts:15:5)
      at describe (e2e/app-dir/scss/url-global-partial/url-global-partial.test.ts:7:3)
      at Object.describe (e2e/app-dir/scss/url-global-partial/url-global-partial.test.ts:6:1)

 FAIL  e2e/app-dir/scss/composes-external/composes-external.test.ts (84.765 s)
  ● CSS Module Composes Usage (External) › should render the module

    thrown: "Exceeded timeout of 60000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      12 |   })
      13 |
    > 14 |   it('should render the module', async () => {
         |   ^
      15 |     const browser = await next.browser('/')
      16 |     expect(
      17 |       await browser.elementByCss('#verify-yellow').getComputedCss('color')

      at it (e2e/app-dir/scss/composes-external/composes-external.test.ts:14:3)
      at Object.describe (e2e/app-dir/scss/composes-external/composes-external.test.ts:6:1)

 FAIL  e2e/app-dir/scss/composes-basic/composes-basic.test.ts (35.629 s)
  ● CSS Module Composes Usage (Basic) › should render the module

    expect(received).toBe(expected) // Object.is equality

    Expected: "rgb(255, 255, 0)"
    Received: "rgb(0, 0, 0)"

      16 |     expect(
      17 |       await browser.elementByCss('#verify-yellow').getComputedCss('color')
    > 18 |     ).toBe(colorToRgb('yellow'))
         |       ^
      19 |     expect(
      20 |       await browser
      21 |         .elementByCss('#verify-yellow')

      at Object.toBe (e2e/app-dir/scss/composes-basic/composes-basic.test.ts:18:7)

 FAIL  e2e/app-dir/scss/npm-import-nested/npm-import-nested.test.ts (90.889 s)
  ● Good Nested CSS Import from node_modules › should render the page

    thrown: "Exceeded timeout of 60000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      12 |   })
      13 |
    > 14 |   it('should render the page', async () => {
         |   ^
      15 |     const browser = await next.browser('/')
      16 |     expect(
      17 |       await browser.elementByCss('.red-text').getComputedCss('color')

      at it (e2e/app-dir/scss/npm-import-nested/npm-import-nested.test.ts:14:3)
      at Object.describe (e2e/app-dir/scss/npm-import-nested/npm-import-nested.test.ts:6:1)

 FAIL  e2e/app-dir/scss/nm-module-nested/nm-module-nested.test.ts (81.941 s)
  ● Valid Nested CSS Module Usage from within node_modules › should render the page

    thrown: "Exceeded timeout of 60000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      12 |   })
      13 |
    > 14 |   it('should render the page', async () => {
         |   ^
      15 |     const browser = await next.browser('/')
      16 |     expect(await browser.elementByCss('#other2').getComputedCss('color')).toBe(
      17 |       colorToRgb('red')

      at it (e2e/app-dir/scss/nm-module-nested/nm-module-nested.test.ts:14:3)
      at Object.describe (e2e/app-dir/scss/nm-module-nested/nm-module-nested.test.ts:6:1)

```

</details>

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

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-03-01 09:43:21 +00:00
Tobias Koppers
744d9f464e
Turbopack: remove node_modules error filter (#62586)
### What?

This isn't needed

### Why?

### How?


Closes PACK-2604
2024-03-01 10:26:08 +01:00
Vercel Release Bot
ec1cd79138
Update Turbopack test manifest (#62674)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2024-03-01 07:58:23 +01:00
Vercel Release Bot
35aab7eee3
Update font data (#62704)
This auto-generated PR updates font data with latest available

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-03-01 01:17:52 +00:00
JJ Kasper
dc41d9c644
Add param to debug PPR skeleton in dev (#62703)
This adds an experimental query `__nextppronly` to allow debugging PPR
skeletons in development to avoid having to do numerous builds to be
able to debug this experience.

x-ref: [slack
thread](https://vercel.slack.com/archives/C05KYT5S9FF/p1709151588583179?thread_ts=1708474869.960689&cid=C05KYT5S9FF)
2024-02-29 16:30:56 -08:00
Jiachi Liu
7d8a923f8d
chore: remove unused helper (#62701)
This code is removed in #62585 , remove it and related imports

Closes NEXT-2652

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-29 23:41:52 +00:00
vercel-release-bot
c77454a02a v14.1.1-canary.82 2024-02-29 23:21:48 +00:00
JJ Kasper
41564fd5d1
Fix lint check (#62702)
x-ref:
https://github.com/vercel/next.js/actions/runs/8103553122/job/22149048179

Closes NEXT-2653
2024-02-29 15:16:16 -08:00
Jiachi Liu
ce422240e3
feat: display text diff for text mismatch hydration errors (#62684)
### What

Keep improving the hydration erros. Currently we divide the hydration
mismatch types into two categories, html tag mismatch and text mismatch.
We're displaying the mismatched text content between server and client
here since we have it in the component stack and warnings.

We've already made some improvements in #62590 , here we carry on
improving the highlited text into red and bold that is much easier for
you to spot on.

This updated a few long snapshots that we could collapse and show only
the text content difference instead of all the component stack.

### Screenshots

(Dark and light modes)

#### Mismatch html tags
<img width="360"
src="https://github.com/vercel/next.js/assets/4800338/f721b374-69cc-4600-a09d-bef87e885fab"><img
width="360"
src="https://github.com/vercel/next.js/assets/4800338/1abf2572-2be8-4359-a652-8ba39aaccfd3">


#### Mismatch text content
<img width="360"
src="https://github.com/vercel/next.js/assets/4800338/7f0d2215-8bc0-4fba-9c92-6c44efa29531"><img
width="360"
src="https://github.com/vercel/next.js/assets/4800338/656d1e1a-3157-4bcf-a239-74bb81fcb4c4">


#### Large content mismatch

### Why

I was intended to bring a html diff between server and client html
content but turns out the diff result could be giant and not ideal due
to few reasons. So we switched to the path of leveraging component stack
and mismatch contents.
React reordering the tags after hydration. For instance the `script` or
`link` tags could be hoist by React Float, so the lines of html is are
to preserved. so the diff is hard to be super accurate unless your
mismatch is small. If you're mismatch a component with rich html
content, it could be a pretty large diff.

Another case is if you have a bad nesting html like `<p> ...<span>...
<p>my text</p> ...</span>... <p>` where there're many span in between,
the final different could also be hudge as browser will close the first
`<p>` tag and the rest content will go into the diff. Hence we're going
with the component and text content diff.


Closes NEXT-2645
2024-02-29 23:36:38 +01:00
Jiachi Liu
28c2832405
Update precompiled for mini-css-extract-plugin (#62699)
Update precompiled related to below dependencies upgrades 

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

Closes NEXT-2649

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-29 22:36:23 +00:00
JJ Kasper
d0fc16defe
Revert "chore: drop npm-run-all" (#62700)
Reverts vercel/next.js#62642

Closes NEXT-2650
2024-02-29 13:59:24 -08:00
neomad1337
c6e865bf6f
Upgrade mini-css-extract-plugin (#62698)
## For Contributors

### What?
This PR upgrades the mini-css-extract-plugin dependency

### Why?
In this
[version](https://github.com/webpack-contrib/mini-css-extract-plugin/releases/tag/v2.4.4),
the bug related to content hash is fixed. This bug causes different
hashes of CSS chunks in the webpack chunk.

### How?

Closes
[NEXT-1146](https://linear.app/vercel/issue/NEXT-1146/hashes-are-different-between-multiple-servers-with-generatebuildid)
Fixes #49230

Co-authored-by: Madiyar Turkenov <tagwriter@mail.ru>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 21:20:50 +00:00
Wes Bos
b1089d3691
Update unstable_cache docs for revalidate option (#62689)
Clarifies what passing false or undefined to the revalidate property
option of unstable_cache does.

Context: I didn't want my DB query to be cached at all, but I did use
this API because I wanted to refresh a component's data after submitting
a server action. I thought I had to pass 0, or false to get it to not
cache at all.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 19:49:15 +00:00
Spencer Zeng
24b7175dcf
Correct format for autoplay attribute in NextJS video docs (#62695)
### What?
Updates the format of the `autoplay` attribute in the [videos
documentation](https://nextjs.org/docs/app/building-your-application/optimizing/videos#common-video-tag-attributes)
to camel case, which is the correct format for the attribute in JSX,
matching the format of `playsInline`.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 19:27:09 +00:00
OJ Kwon
ecec67d3f5
refactor(next-swc): remove unused features (#62696)
### What

Remove unused features for the turbopack.

Closes PACK-2628
2024-02-29 11:14:16 -08:00
Jan Nicklas
56c8792698
add native css nesting support (#62644)
today ~83% of all browsers support css nesting:
https://caniuse.com/css-nesting

![CSS Nesting Browser
Support](https://github.com/css-modules/postcss-modules-local-by-default/assets/4113649/141f8dce-a8bd-4df4-b2bd-210252189711)
https://caniuse.com/css-nesting  
https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector

therefore this pr upgrades postcss-modules-local-by-default which fixes
a bug in
https://github.com/css-modules/postcss-modules-local-by-default/pull/64)

-  `.foo { &:hover { a_value: some-value; } }` is pure
-  `.foo { html &:hover { a_value: some-value; } }` is pure
-  `.foo { &:global(.bar) { a_value: some-value; } }` is pure
-  `:global(.foo) { &:hover { a_value: some-value; } }` is **not** pure


upgrading the package will allow using css nestings with or **without**
postcss compilation

it fixes the following error:

```
CssSyntaxError: postcss-modules-local-by-default: <css input>:1:8: Selector "&:hover" is not pure (pure selectors must contain at least one local class or id)
```

Fixes #55053
Fixes #33734
Fixes #10475

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-29 18:13:10 +00:00
Leah
a34bfcdd11
perf: don't emit issues via websocket for now (#59024) 2024-02-29 17:32:35 +00:00
Leah
9f72146dd7
fix(turbopack): don't emit issues for deleted pages (#62012)
### What?

We now keep track of all client assets emitted for each route in
`ClientAssetMapper` and remove all issues associated with them when a
route get deleted.

Fixes #61384  
Closes PACK-2487
2024-02-29 16:55:49 +00:00
vercel-release-bot
603b3771ce v14.1.1-canary.81 2024-02-29 16:38:01 +00:00
JJ Kasper
01b9603edc
Revert "Ensure dynamic routes dont match _next/static unexpectedly" (#62691)
Reverting temporarily to allow investigation into separate issue
eliminating this as also an issue.

Reverts vercel/next.js#62559
2024-02-29 08:34:11 -08:00
Tobias Koppers
5b204be07d
Turbopack: remove unused code (#62690)
### What?

No longer used with nexturbo


Closes PACK-2624
2024-02-29 16:32:39 +00:00
JJ Kasper
2bdcaa0fda
Add experimental config for navigation raf test (#62668)
This adds a new experimental config for testing. 

x-ref: [slack thread](https://vercel.slack.com/archives/C06LP23L4NT)

Closes NEXT-2644
2024-02-29 08:30:09 -08:00