Introducing RSCs
RSCs, despite their name, are not necessarily components that run on a server. Instead, their defining characteristic is that their component functions are never, under any circumstances, executed on the client side!
Consequently, RSCs may be executed on a server, but they may also be called during the build process, hence pre-generating components at build time. They definitely won’t be executed in the browser, though.
Figure 16.1: RSCs can’t be called from the client side
But what’s the purpose of RSCs? How are they created and used?
Making Sense of RSCs
The core idea behind RSCs is that you can build components that render outside of the browser (e.g., on the server). As a result, these components can execute code that wouldn’t work in the browser—for example, because Node.js-specific APIs are used, or code that relies on credentials (e.g., database credentials) that must not be exposed to the client...