Server Action — async + 'use server', runs only server, callable from client; Next compiles в public POST endpoint с stable ID. Mutation half of RSC: forms без JS, без hand-written API route.
Разбор
Server Components solved reading. Server Actions solve writing. Вместо fetch('/api/todos', { method: 'POST' }) — function + 'use server' + call; Next wires transport.
Mental model for safety: не «trusted server call», а public HTTP endpoint с funny name. Anyone POST generated ID с any payload. Authenticate и validate как raw route handler.
Bound to <form> → progressive enhancement: submit и mutate до/без JS hydration.
Итог
Ergonomic sugar не убирает network boundary — auth, validate, revalidate обязательны на каждой action.