Skip to content
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

Capitalize Server Action #6417

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Capitalize Server Action #6417

merged 1 commit into from
Nov 7, 2023

Conversation

Huxpro
Copy link
Member

@Huxpro Huxpro commented Nov 7, 2023

"Server Action", like "Effect", is a React-specific notion
that would be benefited from captailization to be distinguished
from its genertic meaning.

It seems like Next doc
has also adopted such connventions and we should probably do the same.

Summary of changes:
"Server Action", like "Effect", is a React-specific notion
that would be benefited from captailization to be distinguished
from its genertic meaning.

It seems like [Next doc](https://nextjs.org/docs/app/api-reference/functions/server-actions)
has also adopted such connventions and we should probably do the same.
Copy link

github-actions bot commented Nov 7, 2023

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Member

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

yes. should also do this for Client and Server when they’re used in the React sense (eg “Client component”.

@gaearon gaearon merged commit 42ca996 into main Nov 7, 2023
4 checks passed
@Huxpro
Copy link
Member Author

Huxpro commented Nov 7, 2023

@gaearon do you have a list of things that should be treated like this? It seems like "prop", "state", "ref", "context", etc. are treated in lowercase.

I'm asking because, in many languages (at least in Chinese and Japanese writings), English words should be written in their canonical case without considering English rules (e.g. first words, title case).

Huxpro pushed a commit that referenced this pull request Nov 7, 2023
Summary of changes:
following <#6417>
gaearon pushed a commit that referenced this pull request Nov 7, 2023
Summary of changes:
following <#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
@gaearon gaearon deleted the xuan/capitalizeServerAction branch November 7, 2023 12:33
@gaearon
Copy link
Member

gaearon commented Nov 7, 2023

i think it’s just Effect, Hook, and recent new terms where our meaning is overloaded (Client / Server things)

Huxpro pushed a commit that referenced this pull request Nov 7, 2023
Summary of changes:
See <#6417>
gaearon pushed a commit that referenced this pull request Nov 7, 2023
Summary of changes:
See <#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
@sophiebits
Copy link
Member

Hmm I can see the argument for Server Action but I actually am not sure I agree for Client and Server. There the meaning is not any different than the English word alone. The distinction can be a little confusing especially with SSR but I am not sure the capitalization does anything to help.

@gaearon
Copy link
Member

gaearon commented Nov 7, 2023

I feel like it is different in the sense that "Server" can run at the build time while "Client" also runs on the server

@smikitky
Copy link
Member

smikitky commented Nov 9, 2023

Other words that are capitalized in the docs include:

  • Strict Mode
  • Suspense
  • Fragment
  • Canary (though this is often ignored recently)

@sophiebits
Copy link
Member

We should probably have a linter for whatever we decide.

If people never capitalize it in their tweets does that mean we shouldn't capitalize it in the docs?

@Huxpro
Copy link
Member Author

Huxpro commented Nov 9, 2023

We should probably have a linter for whatever we decide.

@sophiebits that would be nice but it's pretty challenging to be complete. We can probably capture syntactic ones like useBlah Hook and "Client Component" but others are tricky

@Huxpro Huxpro mentioned this pull request Nov 9, 2023
Huxpro pushed a commit that referenced this pull request Nov 9, 2023
Summary of changes:
See <#6417>.

There is one exception though. The error message
“Rendered fewer hooks than expected” from React is indeed "hooks"
so I kept as-is. Shall we change the error message from React?
Huxpro pushed a commit that referenced this pull request Nov 9, 2023
Summary of changes:
See <#6417>
Huxpro pushed a commit that referenced this pull request Nov 9, 2023
Summary of changes:
See <#6417>
@Huxpro Huxpro mentioned this pull request Nov 9, 2023
@Huxpro
Copy link
Member Author

Huxpro commented Nov 9, 2023

Other words that are capitalized in the docs include:

  • Strict Mode
  • Suspense
  • Fragment
  • Canary (though this is often ignored recently)

I've just manually updated those but yea I agreed with @sophiebits that we need...something at least. This is not going to scale at all

gaearon pushed a commit that referenced this pull request Nov 10, 2023
Summary of changes:
See <#6417>.

There is one exception though. The error message
“Rendered fewer hooks than expected” from React is indeed "hooks"
so I kept as-is. Shall we change the error message from React?

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
Huxpro added a commit that referenced this pull request Nov 14, 2023
Summary of changes:
See <#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
Huxpro added a commit that referenced this pull request Nov 14, 2023
Summary of changes:
See <#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
neighborhood999 pushed a commit to reactjs/zh-hant.react.dev that referenced this pull request Nov 20, 2023
Summary of changes:
following <reactjs/react.dev#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
neighborhood999 pushed a commit to reactjs/zh-hant.react.dev that referenced this pull request Nov 20, 2023
Summary of changes:
See <reactjs/react.dev#6417>

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
neighborhood999 pushed a commit to reactjs/zh-hant.react.dev that referenced this pull request Nov 20, 2023
Summary of changes:
See <reactjs/react.dev#6417>.

There is one exception though. The error message
“Rendered fewer hooks than expected” from React is indeed "hooks"
so I kept as-is. Shall we change the error message from React?

Co-authored-by: xuan.huang <xuan.huang@bytedance.com>
pro125101 added a commit to pro125101/react-dev that referenced this pull request Mar 12, 2024
Summary of changes:
See <reactjs/react.dev#6417>.

There is one exception though. The error message
“Rendered fewer hooks than expected” from React is indeed "hooks"
so I kept as-is. Shall we change the error message from React?
pro125101 added a commit to pro125101/react-dev that referenced this pull request Mar 12, 2024
pro125101 added a commit to pro125101/react-dev that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants