You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce confusion between Server Components and Server Actions
Make the directive's purpose self-documenting
Align naming with the actual feature ("Server Actions")
Non-Goals
Changing the behavior of Server Actions
Modifying "use client" or other directives
Deprecating "use server" immediately (could coexist during transition)
Background
The "use server" directive is frequently misunderstood as the counterpart to "use client", leading developers to assume it means "this is a Server Component."
The server-only package adds to this confusion. Both contain the word "server," but they do opposite things:
import "server-only" — forbids client imports (build fails if bundled)
Server Components have no directive—they're the default. "use server" exists solely to create Server Actions, but the name doesn't reflect this. Renaming it to "use actions" would.
Proposal
Rename "use server" to "use actions".
Clearer intent: the directive creates callable actions, not "server components"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
"use client"or other directives"use server"immediately (could coexist during transition)Background
The
"use server"directive is frequently misunderstood as the counterpart to"use client", leading developers to assume it means "this is a Server Component."The
server-onlypackage adds to this confusion. Both contain the word "server," but they do opposite things:"use server"— enables client imports (exposes functions as callable RPCs)import "server-only"— forbids client imports (build fails if bundled)Server Components have no directive—they're the default.
"use server"exists solely to create Server Actions, but the name doesn't reflect this. Renaming it to"use actions"would.Proposal
Rename
"use server"to"use actions"."use client"and"use server"suggest false equivalence"use server"I'm not planning to contribute an implementation, but happy to help with documentation or further discussion.
Beta Was this translation helpful? Give feedback.
All reactions