my blog https://overreacted.io
53
fork

Configure Feed

Select the types of activity you want to include in your feed.

twk

+1 -1
+1 -1
public/rsc-for-lisp-developers/index.md
··· 58 58 59 59 It marks a piece of code to be treated as data (to be sent to the client). 60 60 61 - This means that whoever imports `onClick` from the backend code won't get an actual `onClick` function--instead, they'll get `'/js/chunk123.js#onClick'` or something like that identifying *how to load* this module. It gives you code-as-data. Eventually this code will make it to the client (as a `<script>`) and be evaluated there. Then, the `onClick` function will actually exist (and maybe even be called). Unlike with LISP quoting, this is [implemented at the compile time](/why-does-rsc-integrate-with-a-bundler/#serializing-modules) using a bundler. 61 + This means that whoever imports `onClick` from the backend code won't get an actual `onClick` function--instead, they'll get `'/js/chunk123.js#onClick'` or something like that identifying *how to load* this module. It gives you code-as-data. Eventually this code will make it to the client (as a `<script>`) and be evaluated there. Then, the `onClick` function will actually exist (and maybe even be called). Unlike with LISP quoting, this is [implemented at the compile time](/why-does-rsc-integrate-with-a-bundler/#rsc-bundler-bindings) using a bundler. 62 62 63 63 What this gives us is an ability to write a program that composes behaviors that execute at different stages (on the server and the client) in a very modular way. [See here for example.](/impossible-components/#final-code) The parts outside the "quote" deal with server-only resources, while the parts inside the "quote" are stateful and exist on the client--but they are composed. The server stuff can wrap the client stuff, the client stuff can wrap the server stuff, as long as you're doing all composition from the server. And what doing composition on the server enables is a guarantee that all the server stuff runs [within a single request/response roundtrip](/one-roundtrip-per-navigation/). It's also [progressively streamed](/progressive-json/). 64 64