Commit graph

20783 commits

Author SHA1 Message Date
Jiachi Liu
ce99c61b9e
build(edge): extract buildId into environment (#64521)
### What

* Extract `buildId` and server action encryption key into environment
variables for edge to make code more deterministic
* Fixed the legacy bad env names from #64108
* Always sort `routes` in prerender manifest for consistent output
* Change `environments` to `env` in middleware manifest, confirmed with
@javivelasco this is a fine change without need to bumping the version

### Why

Dynamic variants like `buildId`, SA `encryptionKey` and preview props
are different per build, which results to the non determinstic edge
bundles. Once we extracted them into env vars then the bundles become
deterministic which give us more space for optimization


Closes NEXT-3117

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-06 16:52:24 -07:00
vercel-release-bot
69baf6d8ae v14.3.0-canary.44 2024-05-06 23:21:59 +00:00
Steven
3dc2e672f1
fix(next/image): add missing svg test refactor missing types (#65345)
The tests added in https://github.com/vercel/next.js/pull/46219 were
never correctly testing the headers because `detectContentType()` is
called first and only when we can't detect the type from the response
body do we fallback to the `Content-Type` header.

I also refactored some of the tests because the `ctx: any` type was
causing some tests to not run when testing different configuration
options.

Closes NEXT-3321
2024-05-06 22:32:26 +00:00
vercel-release-bot
180d4f5a6e v14.3.0-canary.43 2024-05-06 22:21:45 +00:00
OJ Kwon
8a1ac28d7b
fix(next-core): mark turbopack embed fs to be internals (#65420)
### What?

We were marking only next.js specific embed_fs as internals, in result
user transform runs against turbopack's runtime.
2024-05-06 14:38:05 -07:00
Zack Tanner
7051d25519
docs: update revalidatePath & fix cache debug logic (#65365)
When revalidating a page that corresponds with a dynamic path and when
using the “type” parameter, eg `revalidatePath(“/dynamic/1”, “page”)`
corresponding with `/dynamic/[id]`, the wrong cache tags would be
checked to determine if a revalidation occurred.

This is because the “derived” cache tags created for a
`/dynamic/[id]/page` are:

- /dynamic/[id]/layout
- /dynamic/[id]/page

Additionally, a tag is added for the current canonical URL, so the final
tag would be:
- /dynamic/1

Thus a fetch on `/dynamic/1` would be tagged with the following:
- /layout
- /dynamic/layout
- /dynamic/[id]/layout
- /dynamic/[id]/page
- /dynamic/1

Calling `revalidatePath(“/dynamic/1”, “page”)` would signal to
revalidate caches tagged `/dynamic/1/page` in the current logic.
However, this tag doesn’t exist given the above, so it would be a no-op
and wouldn't properly re-invoke the fetch.

This updates the docs to explicitly call out that if you are attempting
to revalidate a path that corresponds with a dynamic page, that you
should not provide a "type" argument.

Fixes #62071
Closes NEXT-3302
2024-05-06 21:35:19 +00:00
Markus Renken
d8e866686d
fix: replace deprecated/removed functions in eslint-plugin-next (#64251)
<!-- 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 everyone, this is my first PR to such a large project so please be
gentle. 😄 I'm also new to publishing packages so I'm not sure if I'm
missing any steps.

ESLint 9.0.0 came out a few days ago and unfortunately,
`eslint-plugin-next` is not compatible as it uses deprecated (and with
ESLint 9.0.0 removed) functions.
In this PR, I replaced the deprecated functions with the suggested
replacements ([check this
out](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/)).

Regarding backwards compatibility, everything I used is available since
ESLint 8.40 (released May 2023). I'm not sure how far back Next.js
support goes but it feels fine to me.

I successfully tested some rules locally with ESLint 9.0.0 and this
`eslint.config.js` (flat config format):
```js
import js from '@eslint/js';
import nextPlugin from '@next/eslint-plugin-next';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import importSortPlugin from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tseslint from 'typescript-eslint';

/**
 * TypeScript config with strict type checking and no type checking for JS files.
 */
const typeScriptConfig = [
  ...tseslint.configs.strictTypeChecked,
  {
    plugins: {
      '@typescript-eslint': tseslint.plugin,
    },
    languageOptions: {
      parser: tseslint.parser,
      parserOptions: {
        project: true,
      },
    },
  },
  {
    // disable type-aware linting on JS files
    files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
    ...tseslint.configs.disableTypeChecked,
  },
];

/**
 * Next.js config with recommended and core web vitals rules.
 */
const nextConfig = {
  plugins: {
    '@next/next': nextPlugin,
  },
  rules: {
    ...nextPlugin.configs.recommended.rules,
    ...nextPlugin.configs['core-web-vitals'].rules,
  },
};

/**
 * Import sort config with simple-import-sort plugin.
 */
const importSortConfig = {
  plugins: {
    'simple-import-sort': importSortPlugin,
  },
  rules: {
    'simple-import-sort/imports': 'error',
    'simple-import-sort/exports': 'error',
  },
};

/**
 * The final ESLint config wrapped with the tseslint.config helper for type hinting.
 */
export default tseslint.config(
  {
    ignores: ['.next', '.yarn', '**/*.d.ts', 'node_modules'],
  },
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node,
      },
    },
  },
  js.configs.recommended,
  ...typeScriptConfig,
  nextConfig,
  prettierRecommended,
  importSortConfig,
);

```

It has a few more configs but I'm sure you can remove most of them. The
important one is the `nextConfig`. Also important: Run `eslint` and not
`next lint`, it's currently not compatible with the new flat config
format.

Related discussion: https://github.com/vercel/next.js/discussions/54238

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-06 14:22:18 -07:00
Wyatt Johnson
cdb415451a
[PPR] Enable incremental adoption (#63847)
Enabling Partial Prerendering (PPR) for an entire application is
ideally, the goal for teams wanting to test out the feature or adopt it
in their applications to get ready for when it becomes the default
rendering pattern. For large applications, with many routes the new
behaviours of old API's may prove a difficult pill to swallow all at
once.

This aims to enable incremental adoption of PPR for pages and routes
that want to support it in a similar way to how existing segment-level
configurations. Segments can now add:

```ts
export const experimental_ppr = true
```

To enable PPR for that segment and those descending segments. Any subset
of those routes that have it enabled can add:

```ts
export const experimental_ppr = false
```

<details>
<summary>An aside on the choice of <code>experimental_ppr</code>
name</summary>
<blockquote>
<p>It is against common JS semantics to use snake-case, and preference
is given to camel-case instead. The choice to make this snake-case was
to re-enforce that this is an experimental feature, an ugly incremental
path, and ideally, developers should aim to remove all references of it
from their codebase.</p>
<p>Additionally, this mirrors what we've done for unstable API's like
`unstable_cache`.</p>
</blockquote>
</details> 

To disable PPR for that segment and those descending segments. To use
this new option, the `experimental.ppr` configuration in
`next.config.js` must be set to `"incremental"`:

```js
// next.config.js
module.exports = {
  experimental: {
    ppr: "incremental",
  },
} 
```

If a segment does not export a `experimental_ppr` boolean, it is
inferred from it's parent. If no parent has it defined, it's default
value is `false` and therefore disabled.

Once all your segments have PPR enabled via this config, it would be
considered safe for teams to set their `experimental.ppr` value in the
`next.config.js` to `true`, enabling it for the entire app and for all
future routes.

### Aside

I also took the liberty to rename `isPPR` and `supportsPPR` to be the
clearer `isAppPPREnabled` and `isRoutePPREnabled`.

---------

Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
2024-05-06 14:55:00 -06:00
Mohd. Nisab
53c08431c5
Fixed wrong highlight in Building your application > authentication > useFormStatus hook example (#65400)
Wrong line highlight for useFormStatus example in authentication module

---------

Co-authored-by: samcx <sam@vercel.com>
2024-05-06 19:55:07 +00:00
Buns Enchantress
93c0e64a36
@emotion/cache version fix (#65422)
<!-- 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?
Version specified for @emotion/cache does not exist, so updated to the
latest working version.

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-06 19:48:31 +00:00
Sebastian Silbermann
79afd61da5
Use @testing-library instead of react-dom/test-utils (#65328)
Closes NEXT-3313
2024-05-06 21:02:25 +02:00
Steven
44a21f4cc2
fix(next/image): bypass icns images (#65414)
Closes NEXT-3329
2024-05-06 19:01:14 +00:00
Sebastian Silbermann
aa1e9676f1
Improve test assertions (#65319)
Closes NEXT-3310
2024-05-06 21:01:02 +02:00
vercel-release-bot
e5b1d50101 v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
JJ Kasper
aa51bedbbe
Revert "Implement Turbopack trace server bindings" (#65419)
This is failing to compile for some of our targets to reverting to
unblock CI

Reverts vercel/next.js#65410

Closes NEXT-3331
2024-05-06 11:25:38 -07:00
Sebastian Silbermann
89d2abdf8c
Pages router: Use attribute-based head children reconciler when strictNextHead is enabled (#65408)
Closes NEXT-3326
2024-05-06 19:32:14 +02:00
Vercel Release Bot
ddc507fe82
Update Turbopack development test manifest (#65404)
This auto-generated PR updates the development integration test manifest used when testing Turbopack.
2024-05-06 10:23:09 -07:00
vercel-release-bot
b6d07bfa82 v14.3.0-canary.41 2024-05-06 15:26:55 +00:00
Tim Neutkens
b85210d64e
Implement Turbopack trace server bindings (#65410)
## What?

Implements support for running the Turbopack trace server, which is the
websocket server that powers https://turbo-trace-viewer.vercel.app/ when
using `NEXT_TURBOPACK_TRACING=1 NEXT_TURBOPACK_TRACE_SERVER=1`.

Currently you have to manually run the server through the Turbo
repository which in practice means that only people working on Turbopack
are able to run it.

With the bindings implemented anyone should be able to run the trace
server.

Note that the traces that come out of Turbopack are very low level,
they're meant for optimizing Turbopack like finding slowdowns / large
memory usage / optimizing performance.

However, it's useful for people that want to peek into why their
application is slow to compile. I.e. we've used
https://turbo-trace-viewer.vercel.app to investigate reports in #48748.

This PR adds support for `trace.log` by default, so if you add
`NEXT_TURBOPACK_TRACING=1 NEXT_TURBOPACK_TRACE_SERVER=1` it will
automatically select the `trace.log` for the current instance of
Next.js. You can only have one trace server running at the same time.

### `next internal` 

In order to support running the trace server standalone, which is useful
for investigating trace files other people have shared, I've added a new
subcommand `internal` that is not covered by semver / use at your own
risk. It's meant for internal tools that are useful to be bound to the
version of Next.js, the turbo-trace-server is a great example of that as
it has an internal binary format for storing data that needs to match
the trace.log file.

If you want to take a look at `.next/trace` instead the new `next
internal` subcommand can be used for that:

```sh
# Replace [path] with a path to a file.
next internal turbo-trace-server [path]
```

For example:

```sh
next internal turbo-trace-server ~/Downloads/trace
```

Currently the trace server does not support loading multiple files, just
hasn't been implemented yet. Once we can load two or more files we can
load both `.next/trace` and `trace.log` when
`NEXT_TURBOPACK_TRACE_SERVER=1` and support multiple paths passed to
`next internal turbo-trace-server`.


### Turbopack upgrade


PR includes a Turbopack upgrade:

* https://github.com/vercel/turbo/pull/8073 <!-- OJ Kwon -
feat(webpack-loaders): support dummy span interface -->
* https://github.com/vercel/turbo/pull/8083 <!-- OJ Kwon - fix(webpack):
print resource, project path when relative calc fails -->
* https://github.com/vercel/turbo/pull/8094 <!-- Tim Neutkens -
Implement bindings for Turbopack trace server -->


<!-- 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-3328
2024-05-06 15:23:40 +00:00
Zack Tanner
c56d69da5d
use correct not-found component when triggered from a parallel route (#65343)
When `notFound()` is thrown from metadata, it's caught by a
`<MetadataOutlet />` rendered as a sibling to the page component. But we
currently only pass the custom not-found component to the
`<NotFoundBoundary />` for the `children` slot. This means that if a
parallel route throws a `notFound()` in `generateMetadata`, it'd be
caught by the root not found, which would be unexpected.

This mirrors the logic for determining whether or not a `notFound`
boundary should be provided. A side effect of this is that if you throw
a `notFound()` in `generateMetadata` for a segment that _only_ has
parallel routes, and no `children` slot, it won't be caught by the
boundary. But fixing this will require a larger refactor.

<!-- 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-3320
2024-05-06 14:46:54 +00:00
Steven
cf0cec1b06
chore(test): add more tests for image optimizer formats (#65363)
There were a few cases that were untested so I added new tests to cover
them.

Closes NEXT-3322
2024-05-06 10:23:44 -04:00
Sebastian Silbermann
581fb0c988
Improve Head > script coverage (#65399)
Closes NEXT-3324
2024-05-06 10:47:18 +02:00
Sebastian Silbermann
7cfe6fd898
Support interrupts and focus in react-profiling-mode test (#65200)
Closes NEXT-3263
2024-05-06 07:28:43 +02:00
Mehdi Mashayekhi
55e6087ab6
Update 05-mdx.mdx (#65392)
There was a typo in the file that I fixed

<!-- 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-05-06 04:04:45 +00:00
tgt
a230495a90
use backticks instead of quotes (#65393)
Fixes minor typo on docs
2024-05-06 04:00:58 +00:00
vercel-release-bot
1ae14bafdb v14.3.0-canary.40 2024-05-05 23:21:26 +00:00
Reza Mauliadi
f713c954a7
Remove duplicate code example in authentication page (#65354)
I found a duplicate code example in
https://nextjs.org/docs/app/building-your-application/authentication#context-providers
for the layout.ts.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-05 17:36:24 +00:00
vercel-release-bot
c9291d6dd5 v14.3.0-canary.39 2024-05-04 23:21:52 +00:00
Tim Neutkens
9ec37c120a
Upgrade Turbopack (#65320)
<!-- 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-3311
2024-05-04 13:18:08 +02:00
vercel-release-bot
7ee16934e9 v14.3.0-canary.38 2024-05-03 23:22:07 +00:00
Sam Ko
34f675a501
docs(unstable_cache): add data cache mentions (#65342)
## Why?

There is no mention that Data Cache is being used for the
`unstable_cache` API in our documentation.

Closes NEXT-3319
2024-05-03 15:41:14 -07:00
Zack Tanner
d89c2e0b0f
add explicit test for parallel routes in a root layout (#65338)
Didn't seem like we had any tests that explicitly check a non-nested
parallel route works in a root layout, so adding one here.

<!-- 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-3317
2024-05-03 15:05:48 -07:00
Benjamin Woodruff
8dc0eff89a
Delete dead concatenate_output_assets function (#65337)
I noticed this was dead while working on other changes to this file.

Checked that it built with:

```
cargo check
```
2024-05-03 14:20:08 -07:00
Benjamin Woodruff
e8acd2d9e5
Remove broken #[turbo_tasks::value(transparent)] attributes (#65336)
The `transparent` option only does something when the struct is a field-less unit struct with a single item.

Right now, an invalid `transparent` option is silently ignored. I'm working on a PR to change this to a compilation error, so that it's obvious that the option won't work. These are the callsites in `next.js` that my tweak brought up as potential issues.

Functionally, this PR should be a no-op.
2024-05-03 14:17:44 -07:00
Vercel Release Bot
287786eb54
Update Turbopack development test manifest (#65312)
This auto-generated PR updates the development integration test manifest
used when testing Turbopack.
2024-05-03 21:00:30 +00:00
Benjamin Woodruff
eba364a985
Emit polyfill-nomodule.js into the build manifest polyfillFiles (#65223)
### Why?

`polyfill-nomodule.js` is a pre-built file containing polyfills for
older browsers (gated by the `<script>` tag `nomodule` attribute).

### How?

- The turbopack server needs to emit a raw OutputAsset for this file, so
that it is copied into the output chunks directory.
- That file needs to be passed into `polyfillFiles`, and preserved when
we're merging manifests inside of the development server.

### Test Plan

```
HEADLESS=true pnpm testonly-dev test/e2e/app-dir/app/index.test.ts -t 'should serve polyfills for browsers that do not support modules'
HEADLESS=true pnpm testonly-dev-turbo test/e2e/app-dir/app/index.test.ts -t 'should serve polyfills for browsers that do not support modules'
```

Build a project with `next dev --turbo` and inspect:

![Screenshot 2024-05-01 at
10.40.39 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/fe0214b2-ca56-4c03-a133-921f1dc51775.png)
![Screenshot 2024-05-01 at
10.40.20 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/d41dbf91-34d2-44c4-90ec-30e3212ce0f8.png)

Verify that the polyfill file exists and resolves in the browser.

Closes PACK-2993
2024-05-02 22:15:09 -07:00
JJ Kasper
64ef34ec7b
Revert "Remove extra suspense boundary for default next/dynamic" (#65309)
Reverting temporarily while we investigate a bug where the page crashes
due to the missing `Suspense`.

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

Reverts vercel/next.js#64716

Closes NEXT-3307
2024-05-02 19:37:18 -07:00
JJ Kasper
025f5b6bf6
Update revalidateTag to batch tags in one request (#65296)
As discussed this collects all `revalidateTag` calls and invokes in a
single request to avoid race conditions and overhead from multiple
pending requests.

x-ref: [slack
thread](https://vercel.slack.com/archives/C0676QZBWKS/p1714688045037509?thread_ts=1710902198.529179&cid=C0676QZBWKS)

Closes NEXT-3306
2024-05-02 19:27:29 -07:00
Vercel Release Bot
ec74cd9cda
Update font data (#65301)
This auto-generated PR updates font data with latest available
2024-05-02 19:14:41 -07:00
vercel-release-bot
50f3823d7e v14.3.0-canary.37 2024-05-02 23:23:31 +00:00
Sam Ko
0864e21931
chore(github-workflow): Update title for update-font-data workflow (#65293)
## Why?

We're constantly getting failures when attempting to update our font
data.

Update: I couldn't find anything why this was failing, so I'm guessing
there just wasn't any changes that were needed? It just worked with the
same code.

-
https://github.com/vercel/next.js/actions/runs/8916579201/job/24488235812
(fail)
- https://github.com/vercel/next.js/actions/runs/8931168481 (successful)

Closes NEXT-3304
2024-05-02 22:55:00 +00:00
Will Binns-Smith
60069e769c
Trace uploader: add worker spans to allowed events (#65255)
These are ancestor spans to most work done when workers are used.
2024-05-02 15:06:32 -07:00
Lee Robinson
d8e1e50524
docs: update Route Handler streaming example (#65286)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-02 16:46:27 -05:00
JJ Kasper
dccff3a82b
Enable preloading entries by default (#65289)
This enables the preloading entries on start flag by default as it has a
great benefit to preload eagerly when starting the server instead of
lazily when requests come in which makes the user eat the module
initialization time.

Closes NEXT-3303
2024-05-02 14:10:59 -07:00
Sebastian Silbermann
01826678fc
Improve test assertions (#65285)
Closes NEXT-3286
2024-05-02 22:40:08 +02:00
Sam Ko
2bbeab878c
chore(github-workflow): add linear: next labels to sync popular issues to linear (#65288)
## Why?

Helps us triage the most popular issues better by also having these in
linear.

Closes NEXT-3290
2024-05-02 19:25:35 +00:00
Rishabh Poddar
91444dfef8
Fixes with-supertokens example (#65267)
This PR fixes how a protected API is called once the user is logged in,
in the `with-supertokens` example app.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-02 19:19:20 +00:00
Sebastian Silbermann
2a2a4e7c05
Remove unnecessary mocks (#65284)
Closes NEXT-3285
2024-05-02 20:49:11 +02:00
Andrew Gadzik
89ad612165
Fix an issue parsing catchall params (#65277)
This should fix the following scenarios,

- Given a page defined like `app/foo/[...bar]/page.tsx`
- Given a page defined like `app/bar/[[...foo]]/page.tsx`
- Given a parallel route defined like `app/@slot/[...catchall]/page.tsx`

If you navigate to `/foo/bar` the `params` prop in the parallel route
would be

```js
params: {
  catchall: [
    'foo',
    [ 'bar' ]
  ]
}
```

And if you navigate to `/bar/foo` the `params` prop in the parallel
route would be

```js
params: {
  catchall: [
    'bar',
    '[ ...foo ]'
  ]
}
```

With the fix in place, the `params` prop in the parallel route will be,

```js
params: {
  catchall: [
    'foo',
    'bar',
  ]
}
```

And

```js
params: {
  catchall: [
    'bar',
    'foo',
  ]
}
```

Respectively
2024-05-02 18:31:39 +00:00
Sebastian Silbermann
06c5ea4f16
Extract slow tests to avoid wasteful start/stop (#65265) 2024-05-02 13:07:23 +02:00