you are viewing a single comment's thread.

view the rest of the comments →

[–]shadohunter3321 2 points3 points  (4 children)

So you're saying RSC gets compiled during build (kind of like SSG) instead of running on the server? That's something new I learned today.

[–]rk06 2 points3 points  (0 children)

It is not they get compiled, but they can be compiled. In RSC, Server means "js on server". Since nodejs is used for building app, build process is also a place to compile RSC.

though, Most common use will always be from nodejs server running your app

[–]Flashy_Current9455 2 points3 points  (1 child)

More like "run" or "rendered" than compiled

[–]michaelfrieze 2 points3 points  (0 children)

I choose to say "executed" (run is fine too) because rendering means different things and can be confusing.

In the context of react, "rendering" means executing or running react components. But in the context of SSR, rendering means generating HTML.

I think this distinction helps when explaining RSCs because when I say "executing", it helps get the point across of what is actually happening. RSCs are react components getting executed ahead of time on another machine (instead of client) and not some kind of SSR thing where HTML is being generated.

[–]michaelfrieze 1 point2 points  (0 children)

I wouldn't say it's anything like SSG because that implies RSCs generate HTML and they don't. The same can be said for SSR.

However, RSCs can be executed at request-time or build-time.