Docs: inconsistent usage of "server function" and "server action"
What is the documentation issue?
The documentation for Server Actions and Mutations is inconsistent both with the React docs and with Next JS's own How to update data page. I have noticed that this has created confusion in the community about what is a server function and what is a server action.
Is there any context that might help us understand?
The React docs state: "Add 'use server' at the top of an async function body to mark the function as callable by the client. We call these functions Server Functions."
The Next JS How to update data page correctly states: "A Server Function is an asynchronous function that is executed on the server. [...] When invoked as part of an action, they are also called Server Actions." So here we see the correct nuance: server function is the more general term and we find out that some server functions are also server actions.
But then the Server Actions and Mutations incorrectly states: "Server Actions are asynchronous functions that are executed on the server." This indicates that "server action" is the more general term, which isn't true anymore. This seems to be referring to the old terminology that was used before this technology became more stable.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations
👋 Hi! I'd like to work on this documentation issue.
I’ve noticed the terminology around Server Functions and Server Actions is inconsistent across the Next.js docs and React docs. I'd like to help clarify this in the Server Actions and Mutations page by aligning with the latest React terminology.
If no one else is working on this, I’ll start a PR soon. Thanks!
👋 Hi! I'd like to work on this documentation issue.
I’ve noticed the terminology around Server Functions and Server Actions is inconsistent across the Next.js docs and React docs. I'd like to help clarify this in the Server Actions and Mutations page by aligning with the latest React terminology.
If no one else is working on this, I’ll start a PR soon. Thanks!
Umm, I'll be honest, that really looks like an AI account...
Sorry for that, i just took help from chatgpt to rewrite the message properlly.
My approch is as below :
I will replace the text in Doc with the below : - >
Server Functions are asynchronous functions that are executed on the server.
When used as part of a form submission or mutation workflow, they are referred to as Server Actions.
Note: Server Actions are a specific use case of Server Functions that can be invoked from the client using
use server.
We've been doing some alignment here. There should be some updates coming up soon.
Any update on this?
I have a PR open, not sure it lands enough changes for this issue though https://github.com/vercel/next.js/pull/86827 - always open to feedback/comments