Skip to content

Docs: Align with react docs server functions #79442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from

Conversation

icyJoseph
Copy link
Contributor

@icyJoseph icyJoseph requested a review from delbaoliveira May 21, 2025 09:30
@icyJoseph icyJoseph self-assigned this May 21, 2025
@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels May 21, 2025
Copy link

changeset-bot bot commented May 21, 2025

⚠️ No Changeset found

Latest commit: 2cd2220

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@delbaoliveira delbaoliveira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light of your explanation, do you think it's worth updating the mentions of server functions to server actions in this page?

icyJoseph and others added 2 commits May 21, 2025 13:36
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
@@ -80,6 +80,8 @@ export function Button() {
}
```

> **Good to know**: The React documentation, considers the `create` function to be Server Function. [Learn more here](/app/getting-started/updating-data#server-functions).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would instead replace the paragraph before the code snippet and say "server function", with a link

- Passed to a `<button>` using the `formAction` prop
- Passed to `useActionState`

> **Good to know**: As of September 2024, the React team started to use the term, Server Functions. Initially these were called Server Actions. For the purposes of this document, when used to mutate server-side data, we use the term Server Action.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably remove this

@icyJoseph
Copy link
Contributor Author

In light of your explanation, do you think it's worth updating the mentions of server functions to server actions in this page?

I think so... though, most of the Server Functions on that page are Server Actions. The button onClick are Server Functions, which is why I put that Good to know there, but as Lee says, it is better to change the paragraph above it instead.

The useEffect use case is now wrapped in startTransition so it is a Server Action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants