### What?
Adds a videos example to the `openGraph` object in `metadata`.
### Why?
I came to the docs looking for `openGraph` video info and luckily
checked in the actual type definitions to find it was there and easy to
add. Figured some others would come looking for it as well and would be
good to have a quick example in the docs.
---------
Co-authored-by: Sam Ko <sam@vercel.com>
This PR fixes the same case mention in #66464. Instead of collecting all
values eagerly, here we merge fields (on any level of depth) of the same
value and skip methods. For example:
```ts
foo.bar
foo.bar.baz
qux.fn()
```
Previously we're (wrongly) collecting `[foo.bar, foo.bar.baz, qux.fn]`,
and now it will be just `[foo.bar, qux]`.
Merging of fields is critical for collecting methods correctly because
in theory we can't tell if an object member is a method or not:
```ts
data.push.call(data, 1)
// or inside a function that does the same:
doPush(data.push, data)
```
If we don't merge fields we'll collect `[data.push, data]` which still
fails.
### What & Why
Fixes NEXT-3498
Fixed loading shows up and disappear during client navigation, when you
defined `prefetch` is enabled and slow `generateMetadata` is defined. In
#64532, where in layout-router, we removed the place of infinite
suspense, adding it back so that the app can still remain suspensy
during navigation.
#### Behavior before fix
Prefetch -> Link Navigation -> Show `loading.js` -> RSC payload fetched
(no page content) -> the page content will display later when the
promise is resolved
#### Behavior after the fix
Prefetch -> Link Navigation -> Show `loading.js` -> RSC payload fetched
-> suspensy page content still triggering `loading.js` -> display the
resolved page content when the promise is resolved
---------
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
cc @samcx
### Why?
The previous change on `lint-staged` dropped, ignoring files from
eslint, resulting in errors on files that should be ignored (e.g. `dist`
inside `.github/actions/`).
x-ref: #66383
### How?
This PR reverts PARTIAL commit 0558f61c41.
### RFC
> ESLint v8.51.0 introduced [--no-warn-ignored CLI
flag](https://eslint.org/docs/latest/use/command-line-interface#--no-warn-ignored).
It suppresses the warning File ignored because of a matching ignore
pattern. Use "--no-ignore" to override warning, so manually ignoring
files via eslint.isPathIgnored is no longer necessary.
How about we convert current config as flat config, which would be
necessary if we upgrade to v9, and use the `--no-warn-ignored` flag on
`lint-staged` to reduce the operation introduced in #65861?
x-ref:
https://github.com/lint-staged/lint-staged?tab=readme-ov-file#eslint--8510--flat-eslint-config
---------
Co-authored-by: Sam Ko <sam@vercel.com>
New PR
Update DevDependecies "validate-npm-package-name" and type
PR closed: #66420
---------
Co-authored-by: torresgol10.itd <torresgol10.itd@gmail.com>
Co-authored-by: Sam Ko <sam@vercel.com>
We've been testing React v19 and we're mostly ready. Since we have a
number of upstream packages we have to update peer deps from:
```json
{
"peerDependencies": {
"react": "^18.3",
"react-dom": "^18.3"
}
}
```
to:
```json
{
"peerDependencies": {
"react": "^18.3 || ^19",
"react-dom": "^18.3 || ^19"
}
}
```
We are choosing to change the `next` semver from `latest` to `^14.2.3`.
This is to avoid the template from breaking after v15 becomes `latest`,
since package manager default behaviour doesn't handle conflicting peer
dep ranges for react very well 🙌
When `router.refresh` or a server action creates a new `CacheNode` tree,
we were erroneously not copying over the `loading` segment in the new
tree. This would cause the subtree to be remounted as the loading
segment switched from having a Suspense boundary to not having one.
Fixes#66029Fixes#66499
This removes the previous `server/future` directory and moves everything
into the `server` or `server/lib` directories. This is aimed to start to
flatten the server application structure.
### What?
optimize allocations in server actions transform
In one edge case it reduces allocations from 30GB to 4.5MB and time from
760ms to 11ms.
### Why?
make it faster
### What?
* order of CSS between layout and page
* order of CSS between page and next/dynamic
### Why?
### How?
* overrides webpack CSS chunk loading to use react CSS loading to allow
them to share the order
This takes the `layerAssets` property from the previous PR and actually
renders it, replacing the previous style handling. This ensures that
when multiple page segments are rendered on screen, all of their
associated CSS files are loaded. The existing `findHeadInCache` method
only ever returns a single head node, which means it’d miss stylesheets.
Fixes#59308Fixes#63465
This adds a new `layerAssets` property (containing styles and script
tags) to `FlightDataPath`. Previously these were lumped in with the
`head` node, but we intentionally only ever render a single `head`, to
avoid duplicating metadata. This would mean `<AppRouter />` would only
ever render imported stylesheets for a single page in a racey way.
However, since Float handles hoisting and deduping these style tags,
we're safe to render them for each segment.
This PR introduces no change in behavior, aside from sending
`layerAssets` down from the server and storing it in the client router
cache. These nodes aren't rendered -- this is done in #66300.
This adds details for every ISR cache request if the page being
requested supports PPR. If it does, it'll attempt to load the
`.prefetch.rsc` payload instead of the `.rsc` payload. This corrects a
bug that was present in deployed environments.
This additionally refactors the `isAppPPREnabled` out of most of the
application, as it's only used to determine if we should add to the
`prefetchDataRoute` fields in the `prerender-manifest.json`. To support
loading the prefetch file or not, we pass the `isRoutePPREnabled`
through with the cache get/set operations instead.
x-slack-ref:
https://vercel.slack.com/archives/C075MSFK9ML/p1717094328986429
One-word 'checkout' is a noun or adjective that refers to the act of
taking items out of a store after paying for them. 2. Two-words 'check
out' is a verb that refers to request someone to look at something.
Corrected the spelling of "checkout" to "check out" in the documentation
to improve readability and accuracy. This change ensures proper usage of
the phrase when referring to the installation guide.
<!-- 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>
### What?
If the error message contains a reference to `node_modules` it would
omit the error message, but actually we only want to omit the stack
frames
### Why?
### How?
### What?
We have a GC with rough edges, but it is worth exposing a flag to be able to try it out.
### Why?
I think it would be useful to set up a benchmark that tests the GC perf on new canary builds to make sure we are going in the right direction.
### How?
Add a new flag in the experimental settings and wire it up to the existing native bindings.
Closes PACK-3093