Commit Graph

6 Commits

Author SHA1 Message Date
Jiachi Liu 3aad67b75c feat: server action logging (#88277) 2026-01-16 15:09:02 +01:00
Hendrik Liebau acac0b0567 Fix compilation of exported server functions (#86296)
With this PR we are restructuring how the Next.js compiler transforms server function modules (`'use server'` or `'use cache'` directive at the top of the file).

The workaround for skipping the registration of exported `'use cache'` functions is removed. All exported server functions are now properly registered during visitor traversal, which fixes incorrect server reference information bytes in server reference IDs in some circumstances (see #86292 for example).

We're also adding support for string literal exports, e.g.:

```js
'use server'

async function foo() {}
export { foo as '📙' }

```
2025-11-24 13:54:17 +01:00
Niklas Mischkulnig 33e1764252 Bump swc to 48 (#86240)
Upgrade swc from 45 to 48

Based on #85540

- In the AST, strings now contain a `Wtf8Atom` (= not utf8), while `Ident`s keep using the utf8 `Atom`.
- swc's comment printing logic also changed slighted, moving some comments around
- ~~Some comments are getting lost along the way and/or attached to the wrong line. This also broke server actions which rely on a `__next_internal_client_entry_do_not_use__` at the very top~~
2025-11-21 12:47:13 +01:00
Hendrik Liebau ba20a5e8f2 Fix false-positive build error for cacheLife & cacheTag (#85875)
When functions exported from a module with a top-level `'use cache'`
directive are imported into client modules, the compiler should allow
`cacheLife` and `cacheTag` usage within those functions.

This PR updates the `react_server_components` transform to properly
track module directives (`'use client'`, `'use server'`, `'use cache'`)
and skip client graph validation for modules with `'use cache'`,
identical to how modules with `'use server'` are already handled. Those
modules are transformed anyway for the client graph by the
`server_actions` transform, which is applied after the
`react_server_components` transform, in which their implementation is
replaced by server function references.

closes NAR-498
2025-11-11 17:30:41 +01:00
Donny/강동윤 2cee0de01f feat(turbopack): Allow type-only import of usePathname (#68643)
### What?

Type-only imports of `usePathaname` from server components are fine.

### How?

Closes PACK-3186
2024-08-08 16:23:47 +09:00
hrmny cad3a51049 refactor: move rust crates to the repo root directory (#67780)
### Why?
In preparation for moving all turbopack crates

Also makes them easier to work with in general.

Closes PACK-3164
2024-07-22 18:41:27 +02:00