Commit Graph

6 Commits

Author SHA1 Message Date
Zack Tanner 85c3d20a91 [cache components]: move flag out of experimental (#85035)
This moves `experimental.cacheComponents` to a top level config. As part
of this, I disabled some tests in `build-output-prerender` that assert
on `cacheComponents` appearing in the experimental list. In a separate
PR, I'm going to show that Cache Components is enabled next to the
bundler info.

This also updates some docs pages to remove "experimental" language.
2025-10-18 14:13:44 -07:00
Wyatt Johnson d81ef2691c feat(breaking): Hard Deprecate PPR Configuration (#84280)
This hard deprecates the `experimental.ppr` configuration, requiring
users to opt-in instead via `experimental.cacheComponents`. This does
mean that the previous `experimental.ppr = "incremental"` will no longer
be supported.

NAR-433
2025-10-08 19:55:52 -06:00
Sebastian "Sebbie" Silbermann 0c0dc4865e [sourcemaps] Ensure codeframe when calling Client Functions from Server (#81918)
We just need to give a special name to that module so that we can ignore-list it later.

For Webpack I chose the same approach as https://github.com/vercel/next.js/pull/81229. Turbopack already sourcemapped the generated module.

Closes https://linear.app/vercel/issue/NAR-234

RSPack team is informed. Their compat layer doesn't implement `createFilename`
2025-07-22 18:29:39 +02:00
Sebastian "Sebbie" Silbermann 4699f8416e [test] Add dedicated test for error when client functions are called from server components (#81930)
We have a more specific one for `use cache`. This is the counterpart for the default environment.
2025-07-22 18:07:41 +02:00
Hendrik Liebau c54b8a3a36 Assign proper function names to server actions (#71478)
This PR adjusts the server action transforms to assign proper function names for the generated server reference proxies.

- If the original function has a name, this name is used.
- If a function expression is assigned to a variable, the variable's name is used.
- If an anonymous function expression is assigned to a prop, the prop's name is used.

In addition, this PR simplifies the output for exported functions, avoiding unnecessary `registerServerReference` calls.

It also fixes the source mapping of default exported server actions.

**Before:**

<img width="890" alt="before" src="https://github.com/user-attachments/assets/a3d6a5f8-d48e-474d-8f03-b49306fb704f">

**After:**

<img width="890" alt="after" src="https://github.com/user-attachments/assets/8f332690-6c26-46f1-9eef-7680f47ea578">

Next up, we will do the same for `'use cache'` functions.
2024-10-19 00:53:21 +02:00
Hendrik Liebau 490704430b Add source map support for server components/actions in the browser (#71042)
This PR adds support for showing the original server sources of server
components and server actions in the browser's developer tools.

To accomplish that, we're building on top of #69190, #70563, and #70564,
in which we prepared the proper generation of the source maps.

This PR completes the feature, by wiring up `findSourceMapURL` (see
https://github.com/facebook/react/pull/30741) with a new dev server
middleware that serves those source map files to the browser.

Another change we had to make is disabling the dead-code elimination of
server actions in client bundles (see #70103), but only in development
mode. This optimization is primarily intended for production bundles, so
the change should not pose a problem.

With that, it's now possible to jump directly into the server sources
from the browser's dev tools, e.g. for component stacks of server logs
that are replayed in the browser, or when inspecting server action props
in the React DevTools.
2024-10-11 13:53:39 +00:00