[WIP] [DRAFT] RFC: React Module Conventions RFC v3 #243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[WIP] [DRAFT]
Originally posted by me; under related RFC v2 PR.
Abstract:
In this RFC I propose minor yet effective changes to the React Module Conventions RFC v2. The term "client" is too generic both in Software/Web Development as well as in general. This type of extra generalism may lead to devastating effects on DX in various aspects. I propose; we should use
"use csr"
instead of"use client"
to avoid confusion and generalism, by being explicit and not too generic.Concerns:
"use client"
: both experienced and newbie React Developer would be confused with the word "client", it's too generic, and on top of that, it sounds like we're using hooks. (feeling sorry for classes; no one mentions them these days 😎)I get it, it's not that hard to get used to this but 👇 also, (see proposal after reading both of these concerns)
use strict
, in their free time :).Since
"use strict"
is supported by the language itself out-of-the-box. Imitating the same syntax will confuse some JS devs and newbies that;"use client"
is something that's also part of official JS 1 (which could be devastating).(I get that some of us may be thinking only ɗŭmb devs will have this problem, but, hey, wasn't you also a newbie at some time?).
Don't have hard suggestions on this but this confusion can be reduced by being explicit.
Proposal:
"use csr"
: here we're being explicit. As almost every frontend/backend dev is familiar w/ what is CSR /csr
, it's not that much confusing as compared toclient
Let's not use too generic term and confuse everyone instead let's use specific terms like SSR (ssr) and CSR (csr), that way we're trying to be explicit and the literal meaning is conveyed, leading to improved DX and flexibility.
Reserving
"use ssr"
for future use in SSR functionalities i.e. in the context of SSR.Reserving
"use ssg"
for future use in SSG functionalities i.e. in the context of SSG.Reserving
"use isr"
for future use in the context of ISR.Glossary
csr
: Client Side Renderingssr
: Server Side Renderingssg
: Static Site Generationisr
: Incremental Static RegenerationReferences
Footnotes