Commit graph

20883 commits

Author SHA1 Message Date
vercel-release-bot
6475431a4c v14.3.0-canary.36 2024-05-01 23:22:31 +00:00
Ryota Murakami
dbf22166ca
[create-next-app] remove "text-balance" custom class (#63742)
### What?
Remove "text-balance" custom class from create-next-app tailwindCSS
templates.
### Why?
TailwindCSS has exact same class since v3.4.0.
https://tailwindcss.com/docs/text-wrap

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-01 23:01:56 +00:00
vercel-release-bot
673abe469b v14.3.0-canary.35 2024-05-01 22:36:34 +00:00
Andrew Gadzik
bb7f5a317f
Provide non-dynamic segments to catch-all parallel routes (#65233)
Fixes an issue with https://github.com/vercel/next.js/pull/65063 where
the catch-all param only contains dynamic segments and is missing
non-dynamic route segments.

This makes building breadcrumbs extremely hard as we're missing
information to properly render the correct breadcrumb components.

This fix makes parallel route catch-all params behave like the standard
catch-all params in non-parallel routes

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-05-01 15:32:45 -07:00
Sam Ko
f2e7c8eeec
docs(staletime): add clarification around prefetch false (#65252)
## Why?

Add clarification around when the `prefetch` prop on the `Link`
component is set to `false`.

- x-ref:
https://github.com/vercel/next.js/issues/51788#issuecomment-2088521708
-
https://github.com/vercel/next.js/blob/canary/test/e2e/app-dir/app-client-cache/client-cache.test.ts#L202

Closes NEXT-3275
2024-05-01 14:26:10 -07:00
onFire(Abhi)
dcb7e681fd
fix redirect to url with semicolon (#65165)
Closes https://github.com/vercel/next.js/issues/64904

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-01 13:11:41 -07:00
Tommy D. Rossi
ad0c5bb083
Use POST for invokeIpcMethod (#65238)
args can be arbitrarily big, even MBs of data. But an url has a limit,
in Node.js it's 15Kb. This will cause the Node.js server to fail with
ECONNRESET

Fixes: https://github.com/vercel/next.js/issues/56005
Partially fix ECONNRESET errors in
https://github.com/vercel/next.js/issues/57491

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-01 12:29:34 -07:00
Steven
68d5a3892b
fix(next/image): detect react@19 for fetchPriority prop (#65235)
In a previous PR, https://github.com/vercel/next.js/pull/47302,
detection for `fetchPriority` assumed that
https://github.com/facebook/react/pull/25927 would land in react@18.3.0
because that was the react@canary version at the time. However, it
didn't land in react@18.3.0 and it is expected to land in react@19.0.0
due to the breaking change.

This means that users upgrading to react@18.3.0 will see a warning.

The fix is to stop looking at the `React.version` string and instead
check for `React.use`, a feature that [will land in
react@19.0.0](https://react.dev/blog/2024/04/25/react-19#new-feature-use)
but is also available in react@canary and react@beta today.

Note: There were tests added for App Router and Pages Router in a
previous PR https://github.com/vercel/next.js/pull/47302 but they seem
to run on react@18.2.0 which is why we don't see failures.

Fixes https://github.com/vercel/next.js/issues/65161
2024-05-01 15:17:54 -04:00
Sam Ko
9a5b971fc6
chore(github-workflow): update to check all reactions (#65228)
## Why?

We should check `reaction.total_count`, not just 👍🏼 reactions.

Closes NEXT-3271
2024-05-01 11:33:16 -07:00
Gabriel F
9870faf789
Fix export function name on docs/routing/layouts-and-templates (#65240)
### What?
Fix export function name on docs/routing/layouts-and-templates

### Why?
The way it is, it will return an error to the user following the
tutorial: `Unsupported Server Component type: undefined / next js 13`

### How?
- Change `Links()` function export to `NavLinks()`

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-01 11:20:45 -07:00
Jamie Barton
a0df9860c4
feat(examples): add with-turso (#61291) 2024-05-01 11:41:47 -05:00
vercel-release-bot
c9a34f8b5c v14.3.0-canary.34 2024-05-01 15:38:17 +00:00
Vercel Release Bot
d62b68fb04
Update Turbopack development test manifest (#65226)
This auto-generated PR updates the development integration test manifest
used when testing Turbopack.
2024-05-01 12:02:20 +02:00
Vercel Release Bot
9f9428d81e
Update Turbopack production test manifest (#65225)
This auto-generated PR updates the production integration test manifest
used when testing Turbopack.
2024-05-01 10:57:48 +02:00
DuC
7bd39f7b01
docs(app-routing-layoutsand-template): use the correct path (#65085)
The import path of the context is different. Does this cause ambiguity?
I'm not sure if this is intentional by the author.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-01 07:00:25 +00:00
Tobias Koppers
77706b68a7
Turbopack: rename source map prefix (#64965)
### What?

see https://github.com/vercel/turbo/pull/8034

### Why?

### How?
2024-05-01 05:21:50 +00:00
vercel-release-bot
34a96e126a v14.3.0-canary.33 2024-04-30 23:21:55 +00:00
Zack Tanner
b1ce1b24b3
docs: fix skipTrailingSlashRedirect middleware example (#65220)
The example here only updates the pathname, but the redirect path is
determined by taking the `req.nextUrl` object and stringifying it, which
means it would return the wrong redirect location.

Closes NEXT-3260
2024-04-30 15:51:20 -07:00
Thomas Marrec
cf0414d0d0
fix(next): add missing browser.major type (#65185)
Adding the missing `major` type, see
https://docs.uaparser.js.org/v2/api/ua-parser-js/get-browser.html#major-string

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-30 21:38:33 +00:00
Jiachi Liu
ecbf5373f6
Only apply metadata manifest credentials for preview deployment (#64940)
### What

Follow up for #62873
Only apply credentials in metadata manifest tag for preview deployment

### Why

When the CORS header is "\*" and if you're including credentials in
request it will block by browser. For manifest's case, if it's fetching
from a publich CDN with responsing the CORS header "\*" and mismatching
with the current website domain it will get blocked. Previously we
introduced that change mostly for vercel deployment auth protection, now
we're going to check if it's preview deployment and also the same
origin, if yes then we'll include credentails for manifest request

Closes NEXT-3208
2024-04-30 20:50:42 +00:00
Jiachi Liu
029d1da228
Remove extra suspense boundary for default next/dynamic (#64716)
### What

Removing the Suspense boundary on top of `next/dynamic` by default, make
it as `React.lazy` component with preloading CSS feature.

### Why

Extra Suspense boundary is causing extra useless rendering. For SSR, it
shouldn't render `loading` by default

Related: #64060
Related: #64687
Closes
[NEXT-3074](https://linear.app/vercel/issue/NEXT-3074/app-router-content-flickering-with-reactcreatecontext-and-nextdynamic)

This is sort of a breaking change, since removing the Suspense boundary
on top of `next/dynamic` by default. If there's error happening in side
the dynamic component you need to wrap an extra Suspense boundary on top
of it
2024-04-30 22:40:11 +02:00
Esteban Munoz Facusse
aaf8b0b8f7
docs: Add @fluentui/react-components to list of libraries that support css-in-js with app router (#61521)
PR to add @fluentui/react-components to the list of libraries that
support app router with css-in-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 #

-->

Co-authored-by: Sam Ko <sam@vercel.com>
2024-04-30 11:43:26 -07:00
mknichel
2c0aeeebbd
[trace] Reduce the size of .next/trace files (#65101)
- Remove `next-swc-*` and `read-resource` spans since they are high
volume and generally very fast
- Added `NEXT_TRACE_SPAN_THRESHOLD_MS` env var to only record trace
spans that take longer than a threshold.
2024-04-30 16:39:50 +00:00
Karl Horky
03c8780e77
Ensure latest canary of Next.js is installed in repros (#65197) 2024-04-30 18:01:26 +02:00
Tim Neutkens
1b0273c221
Add oslo, @node-rs/argon2, and @node-rs/bcrypt to external packages (#65204)
## What?

Initially added `@node-rs/argon2` to the list as `argon2` was already in
the list to make the provided reproduction pass, however, when digging
deeper into Lucia I found that `oslo` also uses `@node-rs/bcrypt`.

I also looked at Lucia example
[1](https://github.com/lucia-auth/examples/blob/main/nextjs-app/username-and-password/next.config.js#L2-L6)
and
[2](https://github.com/lucia-auth/examples/blob/main/nextjs-app/username-and-password/next.config.js#L2-L6)
which show that this configuration is always added:
`serverComponentsExternalPackages: ["oslo"]`.

That shouldn't be needed as we keep a list of packages that can't be
bundled in Next.js itself, so I've updated the list to add `oslo`,
`@node-rs/argon2`, and `@node-rs/bcrypt`.

This makes it so that you don't have to add additional configuration to
use Lucia.

Fixes #63850


<!-- 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-3264
2024-04-30 08:40:58 -07:00
Balázs Orbán
4d8436c2b0
chore: add more labels (#65209) 2024-04-30 15:26:06 +00:00
Sebastian Silbermann
2c98c11e01
Resolve global next Webpack alias last (#65123)
Closes NEXT-3249
2024-04-30 12:59:00 +02:00
vercel-release-bot
a55b912f41 v14.3.0-canary.32 2024-04-30 09:29:58 +00:00
Tim Neutkens
bbd8452d6b
Fix crypto import in edge runtime with Turbopack (#65171)
## What?

Ensures just importing `crypto` does not error, only when it is used it
shows an error in the edge runtime. This matches webpack behavior. The
`crypto` module was missing the list of unsupported packages in the
Next.js Turbopack integration.

Fixes #64464
Fixes PACK-2954

## TODO

While adding tests for this issue I found another bug that only happens
with webpack.

Specifically these 4 packages are accidentally being polyfilled even
when they're not set up to be polyfilled. i.e. there's no npm package
installed for polyfilling them through aliasing or such. Even in that
case `punycode`, `process`, `querystring`, and `string_decorder` get
polyfilled regardless, this causes the newly added test to fail.

Removing the polyfills would be potentially breaking so we'll want to
change it in Next.js 15 instead.

<!-- 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-3252
2024-04-30 11:26:52 +02:00
Tobias Koppers
49e561e30e
update turbopack (#65191)
* https://github.com/vercel/turbo/pull/8020 <!-- Tobias Koppers - Turbopack Tracing: show memory consumption -->
* https://github.com/vercel/turbo/pull/8029 <!-- Will Binns-Smith - Remove `can_be_in_same_chunk` -->
2024-04-30 16:59:44 +09:00
vercel-release-bot
3ec0a137d5 v14.3.0-canary.31 2024-04-29 23:21:59 +00:00
Sam Ko
a673e84aaa
chore(github-templates): update docs_report template, update template descriptions (#65178)
## Why?

- Update **Docs Request for an Update or Improvement** to **Docs
Report**, similar to **Bug Report**
- Update template descriptions

Closes NEXT-3255
2024-04-29 16:10:16 -07:00
Jiachi Liu
eb89e392cf
Fix next/dynamic with babel and src dir (#65177)
### What

* Fix `next/dynamic` with babel config and `src/` directory
* Separate the existing `next/dynamic` dev tests, make it easier to
cover more cases, add `.babelrc` + `src/` folder coverage case

### Why

* The new transform is using `src/` or root dir as the base directory
`next/dynamic` for generating relative module path as unique key for
`next/dynamic` modules. The babel one was always using the root dir
(`cwd`), which is incorrect. It should use the `src/` dir.

In the future we could make the different solution to generate the
unique id simpler, instead of using relative paths

Closes NEXT-3254
Closes NEXT-3251
Fixes #64741
2024-04-29 23:02:52 +00:00
Jiachi Liu
1df2f3ef3c
Use vercel deployment url for metadataBase fallbacks (#65089)
Leveraging the system env vars for fallback logic

x-ref:
https://vercel.com/docs/projects/environment-variables/system-environment-variables

For preview deployment: prefer using `VERCEL_BRANCH_URL`, fallback to
`VERCEL_URL`
For production deployment: prefer using `VERCEL_PROJECT_PRODUCTION_URL`

Closes NEXT-3237
2024-04-29 21:35:20 +00:00
Sam Ko
b04cc939e4
chore(github-workflow): update popular workflows cron time, fix undef… (#65172)
## Why?

- Fix total reactions from being undefined, also switch it to ↑ instead
of 👍🏼
- Update cron times to be 3 hours earlier (better suit EU timezone)

Closes NEXT-3253
2024-04-29 19:34:36 +00:00
Zack Tanner
5c9b06256a
fix unhandled runtime error when notFound() triggered in generateMetadata w/ parallel routes (#65102)
### What
When a page throws a `notFound()` error in `generateMetadata`, and the
page contains parallel route(s), an unhandled runtime error would be
thrown rather than displaying the not found page.

### Why
We use the `<MetadataOutlet />` component to throw any errors caught
during metadata resolution once the metadata is rendered by React so
that it can be caught by an error boundary, so that it doesn't throw
during metadata resolution. A promise is tracked & resolved with an
error once the metadata tree is rendered. Once the promise resolves, the
outlet component will throw.

However, every `__PAGE__` segment that would be rendered as part of the
page the user is on will render this `<MetadataOutlet />` component. We
only need a single outlet per segment as only a single error needs to be
thrown & caught.

### How
This will only render a `MetadataOutlet` for the first parallel route
that is encountered at each segment depth, as we only need a single
handler to throw the error.

Fixes #65013
Closes NEXT-3222
2024-04-29 08:25:57 -07:00
jonathan-ingram
15f7418fd6
docs: Fix typo for ReactDOM.prefetchDNS method inside Resource Hints section (#65111) 2024-04-29 13:37:58 +02:00
Sebastian Silbermann
c31b7615fc
Bump @testing-library/react to 15.0.3 (from 13.x) (#65119)
Closes NEXT-3247
2024-04-29 11:11:27 +02:00
vercel-release-bot
c24987b06f v14.3.0-canary.30 2024-04-28 23:21:28 +00:00
Jiachi Liu
b9c98a8866
Fix: strip _rsc query for client navigation rsc request (#65084)
When you do client navigation to a dynamic page with call like
`headers()`, it wil send RSC request for that page. We want to skip the
`_rsc` query in the logging as it's disruptive.

Closes NEXT-3077
Closes #64355
2024-04-28 20:15:38 +00:00
vercel-release-bot
3f907d38cb v14.3.0-canary.29 2024-04-27 20:33:30 +00:00
Zack Tanner
3050f45a0a
fix node.js module warning in middleware (#65112)
`server-utils` should not be imported into middleware as it contains
imports that won't work in the edge runtime. Those imports aren't
technically used, but it was causing a warning nonetheless.

This adds a regression test to confirm the warning is only present when
actually importing a Node.js module in userland.

Closes NEXT-3246

<!-- 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-27 07:36:23 -07:00
vercel-release-bot
5897fc051d v14.3.0-canary.28 2024-04-26 23:21:55 +00:00
Will Binns-Smith
9a3c9ed29f
Turbopack: Allow client components from foreign code in app routes (#64751)
This extends #64520 to cover cases where client components originate
from node_modules (foreign code).

Test Plan: Extended the integration test to cover this

Closes #64412
Fixes PACK-3014

---------

Co-authored-by: OJ Kwon <1210596+kwonoj@users.noreply.github.com>
2024-04-26 15:26:33 -07:00
Will Binns-Smith
474432e831
Tracing: allow opt-in flag to send build traces to url (#65019)
Like #53880 did for `next dev`, this adds support to `next build` to
send a high-level subset of the next trace to a remote endpoint. This
can contain sensitive information, and it is **opt-in** and must be
provided when `next build` is invoked.
2024-04-26 14:24:25 -07:00
vercel-release-bot
f4be4dbb3f v14.3.0-canary.27 2024-04-26 19:59:09 +00:00
Zack Tanner
2c80a0f535
update redirect handling on forwarded action requests (#65097)
If a forwarded server action redirects, don't attempt to follow the
redirect as it can lead to errors. For example, if the forwarded request
followed a redirect to the same URL and had to forward the request
again, it'd hit a loop. The redirect will be handled by the
`X-Action-Redirect` which will be set when the forwarded action hits the
`createRedirectRenderResult` case.

<!-- 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-3243
2024-04-26 19:55:57 +00:00
OJ Kwon
fa9f684e76
fix(page-static-info): refine warning message to emit once (#65091)
### What

- closes #65052 

Emitting warning itself is correct, however

- we emit warning multiple times
- missing additional detail to provide link to the docs

PR fixes those 2.
2024-04-26 12:03:30 -07:00
Wyatt Johnson
f64db5550d
[unstable_cache] Don't track dynamic fetches in an unstable_cache callback (#65010)
<!-- 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?

When pages are rendered using partial prerendering (PPR), they can
easily trigger cases that attempt to interrupt static rendering. If a
user calls `fetch` from within a `unstable_cache` callback with `cache:
"no-store"`, we currently break out, as that fetch operation is called
within a cached callback.

### Why?

Without this change, using `unstable_cache` would have limited affect
when dealing with external code that explicitly sets `cache: "no-store"`
preventing it from utilizing the user-specified-cache.

### How?

This modifies the fetch patching so it doesn't bail static rendering due
to dynamic fetches within an `unstable_cache` callback.

Closes NEXT-3220
2024-04-26 18:43:42 +00:00
JonLuca De Caro
5449196b7d
chore(logging): Disable info logging of critters in production (#62776)
Critters uses the `info` logLevel by default. This means that when you
enable the experimental `optimizeCss` property, your production logs
will be polluted with their logs

This sets the log level to warn by default in production, and allows
configuration via an environment variable

![CleanShot 2024-03-02 at 18 12
46@2x](https://github.com/vercel/next.js/assets/13029040/aca150e2-31e5-4a3d-a01d-91fce0590c1e)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-04-26 11:41:05 -07:00