Commit graph

20483 commits

Author SHA1 Message Date
Tobias Koppers
2766ebc8d3
improve turborepo caching (#64493)
### What?

There is a race condition in the `pull-build-cache` script. When the
remote cache entry was removed between the dry run and the real run, it
will run the command and caches whatever is in the native folder.

Seems like there are some very old leftover files there which lead to an
broken publish.

This changes the command to fail when there are no files and empties the
folder before running the script. This should lead to pull-build-cache
to failing instead.

Closes PACK-2957
Fixes #64468
2024-04-15 12:42:28 +02:00
vercel-release-bot
33e8334d35 v14.2.1-canary.5 2024-04-14 21:39:40 +00:00
Jiachi Liu
cb8fb3291a
Fix client boundary inheritance for barrel optimization (#64467)
### What

Inherit the client boudaries from the found matched target in load
barrel

### Why
The root cause with the barrel transform, we missed the client boundary
directive during the transform.
Since the new version of mui's case looks like this:

Import path
page.js (server module) -> `<module>/index.js` (shared module) ->
`<module/subpath>/index.js` (client module) ->
`<module/subpath/sub-module.js> (client module)

After our transform, we lost the `"use client"` which causes the
mismatch of the transform:

In `rsc` layer: the file pointing to the sub module entry
(`<module/subpath>/index.js`), but without the client boundary.


Fixes #64369 
Closes NEXT-3101
2024-04-14 23:36:20 +02:00
Lee Robinson
50ed4542df
docs: fix config variable usage in memory docs (#64469)
Closes https://github.com/vercel/feedback/issues/61864
2024-04-14 11:00:36 -05:00
vercel-release-bot
2a605af154 v14.2.1-canary.4 2024-04-13 23:23:45 +00:00
Michael Novotny
fbc0a0eb8c
docs: Adds MDX Components file convention page and updates MDX page (#63568)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
2024-04-13 13:07:18 -05:00
Zack Tanner
a5bb7c46b1
router restore should take priority over pending actions (#64449)
Since the router processes events sequentially, we special case
`ACTION_NAVIGATE` events to "discard" a pending server action so that it
can process the navigation with higher priority. We should apply this
same logic to `ACTION_RESTORE` events (e.g. `router.back()`) for the
same reason.

Fixes #64432


Closes NEXT-3098
2024-04-13 10:49:57 -07:00
Zack Tanner
f602b2979c
default fetchCache to no-store when force-dynamic is set (#64145)
`fetchCache` is a more fine-grained segment level cache-control
configuration that most people shouldn't have to use. Current semantics
of `dynamic = "force-dynamic"` will still treat the fetch as cacheable
unless explicitly overriding it in the fetch, or setting a segment level
`fetchCache`.

The `dynamic` cache configuration should be seen as a "top-level"
configuration, while more fine-grained controls should inherit logical
defaults from the top-level. Otherwise this forces people to opt-into
the `fetchCache` configuration, or manually override each `fetch` call,
which isn't what you'd expect when forcing a segment to be dynamic.

This will default to not attempting to cache the fetch when
`force-dynamic` is used. As a result, I had to update one of the
`app-static` tests to use `revalidate: 0` rather than `force-dynamic`,
as the revalidate behavior is slightly different in that it won't modify
the revalidation time on a fetch if it's non-zero.

Closes NEXT-2067
2024-04-13 17:05:47 +00:00
Zack Tanner
14ed612dbc
tweak test for Azure (#64424)
Looks like the `useTempDir` function throws when running in Azure rather
than piping the message to stderr. This makes the test resilient to both
cases.

<!-- 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-3095
2024-04-13 10:05:25 -07:00
kxlow
9b77edee06
Fix optimizePackageImports docs for Pages Router (#64439)
The current documentation displays the docs for the `compress` option
instead of the `optimizePackageImports` option.


https://nextjs.org/docs/pages/api-reference/next-config-js/optimizePackageImports
2024-04-13 16:46:06 +00:00
Jiachi Liu
7ef6c4eb17
Revert "Fix: css in next/dynamic component in edge runtime" (#64442)
The fix is not correct, we already have request ALS wrapping the request
in app-render, shouldn't get another one for edge adapter. This is
actually a bundler bug

Reverts vercel/next.js#64382

Closes NEXT-3097
2024-04-13 13:32:18 +02:00
Hung Doan
904908cf33
docs(pages): update slug value for optional catch all routes (#64381)
## Why?

When you do, →

```
  const router = useRouter()
  console.log('[test] router =', router.query.slug)
 ```
 
 the value of `router.query.slug` should be undefined in this instance.
 
 (screenshot from current docs)
![CleanShot 2024-04-13 at 00 18 14@2x](https://github.com/vercel/next.js/assets/28912696/6cd79b3e-9258-4fcb-8685-dc6fe4d336e8)

it should be `slug: undefined`.
2024-04-13 04:23:45 +00:00
vercel-release-bot
68f722ba2d v14.2.1-canary.3 2024-04-12 23:19:45 +00:00
Colton Ehrman
9994e74a6c
fix(next-lint): update option --report-unused-disable-directives to --report-unused-disable-directives-severity (#64405)
## Why?

The Option name and type has been incorrect for
`--report-unused-disable-directives` (it's likely that
https://github.com/vercel/next.js/pull/61877 exposed this.

For correctness, we have updated the name to
`--report-unsed-disable-directives-severity` →
https://eslint.org/docs/v8.x/use/command-line-interface#--report-unused-disable-directives-severity.

- Fixes https://github.com/vercel/next.js/issues/64402

---------

Co-authored-by: samcx <sam@vercel.com>
2024-04-12 22:09:05 +00:00
Shu Ding
d06c54767b
Fix the method prop case in Server Actions transform (#64398)
This PR fixes the case where object method and class method prop
functions are not considered as a new scope. Closes #63603.

Closes NEXT-3088
2024-04-13 00:05:50 +02:00
Shu Ding
52ae1f8a55
Improve rendering performance (#64408)
This PR improves the server rendering performance a bit, especially for
the App Router. It has mainly 2 changes.

A rough benchmark test with a 300kB Lorem Ipsum page, SSR is about 18%
faster.

### Improve `getServerInsertedHTML`

- Avoid an extra `renderToReadableStream` if we already know the content
will be empty
- Avoid `await stream.allReady` for better parallelism with
`streamToString()`
- Increase the `progressiveChunkSize`

### Improve `createHeadInsertionTransformStream`

- Only do chunk splitting and enqueuing if the inserted string is not
empty
2024-04-13 00:03:11 +02:00
Will Binns-Smith
b7b7f97359
Update lockfile for compatibility with turbo (#64360)
Closes PACK-2940
2024-04-12 12:12:47 -07:00
Anatolii Kurochkin
fdeff57c7d
docs: clarify Internationalization (i18n) Routing (#63853)
## Description

Updated [Internationalization (i18n)
Routing](https://nextjs.org/docs/pages/building-your-application/routing/internationalization#leveraging-the-next_locale-cookie)
to clarify that `NEXT_LOCALE` does not override the `accept-language`
header value; rather, it prioritizes the `NEXT_LOCALE` cookie value over
`accept-language`.

## How has this been tested?

Ran `pnpm prettier-fix`
2024-04-12 18:56:08 +00:00
vercel-release-bot
6fb9efbcaa v14.2.1-canary.2 2024-04-12 18:01:43 +00:00
Tobias Koppers
fbf9e12de0
use pathToFileUrl to make esm import()s work with absolute windows paths (#64386)
### What?

Fixes #64371
Fixes #63359


Closes PACK-2946

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-04-12 19:58:13 +02:00
Vivek Kaushik
bf45353af1
Update 13-debugging.mdx (#64344)
This doc is outdated as mentioned as this issue has been going on for
years now where people are unable to debug/set breakpoints in VSCode due
to some mismatch of port/process configuration b/w VSC, Next/Node or
Browser(Chrome Dev tools).

Regardless, I found the fix on
https://github.com/vercel/next.js/issues/47561#issuecomment-1549241442
and it works like a charm.

Kindly update your docs accordingly. Thanks.

<!-- 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: samcx <sam@vercel.com>
2024-04-12 15:55:02 +00:00
Sir Tangale
41b18b3959
Update 04-cypress.mdx (#64375)
Cypress supports TypeScript 5 with moduleResolution: "bundler" starting
from version 13.6.3 and later.

<!-- 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-04-12 15:43:16 +00:00
Gediminas
322ecdf287
Update 02-server-actions-and-mutations.mdx (#64248)
### Improving Documentation

mistake in the docs.

action should not be apply on the button.
only formAction or onClick is allow.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-04-12 08:28:53 -07:00
Cody Olsen
cb60718be9
Add TypeGen to Sanity example (#64198)
Adds support for the [newly introduced Sanity
TypeGen](https://www.sanity.io/blog/introducing-sanity-typegen)! 🥳
2024-04-12 08:28:35 -07:00
Tim Neutkens
c9c074c18d
Fix more Turbopack build tests (#64384)
## What?

- Removes the node-file-trace options from being unsupported as they are
passed to node-file-trace in build/index.ts
- Ensures `import next from 'next'` is handled in the same way as
webpack: creating an empty module. Currently it tried to bundle all
Next.js internals which is wrong.

<!-- 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-3086
2024-04-12 15:52:32 +02:00
MC Naveen
3b838e297d
docs: update tree to include mdx-components.tsx file (#64376) 2024-04-12 08:31:04 -05:00
Paul Asjes
a66676a64e
docs: Add WorkOS to list of auth solutions (#64395) 2024-04-12 08:14:22 -05:00
vercel-release-bot
c2b62d49c7 v14.2.1-canary.1 2024-04-12 10:09:21 +00:00
Jiachi Liu
56d0988af7
Fix: css in next/dynamic component in edge runtime (#64382)
### What

Wrap async local storage for all edge runtime routes in adapter 

Basically fixed the case reported in [this
tweet](https://x.com/keegandonley/status/1778538456458854880)

### Why

We're relying on the ALS for dynamic css preloading but we didn't wrap
the ALS for request handlers for edge. So if you have CSS imports in
`next/dynamic` in edge runtime it would break.

Closes NEXT-3085
2024-04-12 10:52:40 +02:00
Jiachi Liu
0b3ead5e6b
test: skip turbopack build test (#64356)
x-ref:
https://github.com/vercel/next.js/actions/runs/8649384009/job/23715530094?pr=64348

Closes NEXT-3079
2024-04-12 09:23:01 +02:00
Wyatt Johnson
4b44857159
[PPR] Added generateMetadata tests (#64080)
<!-- 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 #

-->

### What?

This adds a missing test case for a page which accesses dynamic API's
within `generateMetadata`. It also adds a test case to verify that any
of the URL's being tested can succeed based on the components link
components (it relies on finding a link to click in the browser).

Closes NEXT-3004
2024-04-11 21:38:57 -06:00
Wyatt Johnson
b016c3c61f
Freeze loaded manifests (#64313)
Manifests in the runtime should be treated as immutable objects to
ensure that side effects aren't created that depend on the mutability of
these shared objects. Instead, mutable references should be used in
places where this is desirable.

This also introduces the new `DeepReadonly` utility type, which when
paired with existing manifest types, will modify every field to be read
only, ensuring that the type system will help catch accidental
modifications to these loaded manifest values as well.

Future work could eliminate these types by modifying the manifest types
themselves to be read only, only allowing code that generated them to be
writable.

Closes NEXT-3069
2024-04-11 21:07:37 -06:00
Wyatt Johnson
6bc9f79e48
Shared Revalidate Timings (#64370)
<!-- 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 #

-->

### What?

This creates a new `SharedRevalidateTimings` type that is safe to share
amongst different points within the framework for sharing revalidation
timings. This is a precursor to #64313 which freezes loaded manifests.

### Why?

Using the `SharedRevalidateTimings` type, we no-longer have to modify
the in-memory instance of the prerender manifest to share the
revalidation timings for different routes.

Closes NEXT-3083
2024-04-11 17:55:30 -06:00
Shu Ding
34524f01ad
Fix Server Action error logs for unhandled POST requests (#64315)
## Why

Currently, Server Action handlers are just normal routes and they
accepting POST requests. The only way to differentiate a normal request
(page access, API route, etc.) from a Server Action request is to check
that if it's a POST and has a Server Action ID set via headers or body
(e.g. `multipart/form-data`).

Usually, for existing page and API routes the correct handlers (page
renderer, API route handler) will take precedence over Server Action's.
But if the route doesn't exist (e.g. 404) it will still go through
Server Action's handler and result in an error. And we're eagerly
logging out that error because it might be an application failure, like
passing a wrong Action ID.

## How

In this PR we are making sure that the error is only logged if the
Action ID isn't `null`. This means that it's an intentional Server
Action request with a wrong ID. If the ID is `null`, we just handle it
like 404 and log nothing.

Fixes #64214.

Closes NEXT-3071
2024-04-12 01:21:28 +02:00
vercel-release-bot
6d96c3f468 v14.2.1-canary.0 2024-04-11 20:33:27 +00:00
Jiachi Liu
23bfce621f
refactor: next-flight-client-module-loader return conditions (#64348)
* Early return if the `this._module` doesn't exist, aligning with the
type
* If the source is changed, we should return the changed source
otherwise the indexes in source map will be wrong unless the modified
code is appended to the source code, but in this loader it's a different
case

Closes NEXT-3075
2024-04-11 21:56:36 +02:00
vercel-release-bot
774563f2b9 v14.2.0 2024-04-11 19:35:36 +00:00
mknichel
ab262348a6
Add documentation for --experimental-debug-memory-usage (#64322)
<!-- 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: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-11 21:14:11 +02:00
Delba de Oliveira
d94466c780
Docs: Add recommendations for CSS import order (#64321) 2024-04-11 20:59:38 +02:00
vercel-release-bot
7aabb1d5ce v14.2.0-canary.67 2024-04-11 17:23:54 +00:00
Tobias Koppers
cbee70991f
update turbopack (#64347)
* https://github.com/vercel/turbo/pull/7409 <!-- hrmny - chore: add
parallel rust frontend and remove unused rust dependencies -->
* https://github.com/vercel/turbo/pull/7920 <!-- Tobias Koppers - remove
warning when there is no PostCSS config -->
* https://github.com/vercel/turbo/pull/7856 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.90.29` -->
* https://github.com/vercel/turbo/pull/7941 <!-- Tobias Koppers - fix
recursion cycle when having a cycle of dynamic imports -->
* https://github.com/vercel/turbo/pull/7943 <!-- Tobias Koppers - fix
HMR by removing chunks from chunk list hash -->
2024-04-11 19:16:27 +02:00
JJ Kasper
83675cea72
Ensure build-native is in needs properly (#64357)
This ensures we don't un-necessarily re-run the `build-native` job
across all CIs from cache misses while a build is pending.



Closes NEXT-3080
2024-04-11 18:54:36 +02:00
Tobias Koppers
b912492392
Turbopack: import webpack loader rules conditions (#64205)
### What?

* remove custom next-* conditions
* add `foreign` condition
* allow `false` in turbo.rules
* improve schema for turbo.rules

### Why?

### How?



Closes PACK-2913

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2024-04-11 17:35:43 +02:00
vercel-release-bot
265d7b97ba v14.2.0-canary.66 2024-04-11 15:14:55 +00:00
Jiachi Liu
ce81bbb383
metadata: prefer og title rather than metadata title for fallback twitter title (#64331)
Like the No.2 point mentioned in #63489, metadata's title and
description should be the last fallback, if you specify `title` or
`description` in `openGraph` but not in `metadata.twitter`, they should
inherit from open graph first.

For `metadata.twitter`'s fallback order should be: 

twitter's title/description > opengraph's title/description > metadata's
title/description

Resolves #63489 
Closes NEXT-3073
2024-04-11 16:07:57 +02:00
Delba de Oliveira
38850bf1ee
Docs: Instructions on how to generate turbopack trace file (#64325)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2024-04-11 11:55:18 +02:00
Tobias Koppers
6224b9e29f
Revert "build: Update swc_core to v0.90.30" (#64329)
Reverts vercel/next.js#63790
2024-04-11 11:47:50 +02:00
Jiachi Liu
cd09f8b815
Inject preview props into edge manifest (#64108)
### What

Bump the edge runtime manifest version and add `environments` property
to each route for inlining values for deployment build.

### Why

In edge runtime, extract the preview props into edge functions manifest
that holding the non-deterministic inline values, then the output build
will be more deterministic that helps deployment speed

x-ref: https://github.com/vercel/vercel/pull/11390
x-ref: https://github.com/vercel/vercel/pull/11395
Closes NEXT-3012
Closes NEXT-1912
2024-04-11 11:18:49 +02:00
Balázs Orbán
b93ead0c9c
chore: add test mapping script (#63757)
### What?

This adds a script that first gets a list of changed files compared to
our base branch (`canary`) in PRs and identifies related test files by
looking them up from a `related-tests-manifest.json`, then runs them.

### Why?

We would like to be able to run related E2E tests when certain files
change, so we can test deployment stability.

NOTE: We still want to run all E2E tests on PRs, but this script can be
used to also test deployments for hot paths. Since these tests can take
up to [3-4
hours](https://github.com/vercel/next.js/actions/workflows/test_e2e_deploy.yml),
we aim to run a subset of these tests first.


Closes NEXT-2947
2024-04-11 09:44:47 +02:00
Maia Teegarden
2670e1c034
Add Ben's handle to labeler (#64312)
Closes PACK-2932
2024-04-11 08:20:58 +02:00