my blog https://overreacted.io
53
fork

Configure Feed

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

nit

+1 -1
+1 -1
public/what-does-use-client-do/index.md
··· 584 584 585 585 **Together, they let you "weave" the two sides of your program by creating and composing [reusable abstractions with logic from both sides.](/impossible-components/)** But I think the pattern extends beyond React and even beyond JavaScript. Really, this is just RPC at the module system level with a mirror twin for sending more code to the client. 586 586 587 - The server and the client are two sides of a single program. They're separated by time and space so they can't share the execution context and directly `import` each other. The directives "open the doors" across time and space: the server can *render* the client as a `<script>`; the client can *talk back* to the server via `fetch()`. But `import` is the most direct way to express that, so directives make it happen. 587 + The server and the client are two sides of a single program. They're separated by time and space so they can't share the execution context and directly `import` each other. The directives "open the doors" across time and space: the server can *render* the client as a `<script>`; the client can *talk back* to the server via `fetch()`. But `import` is the most direct way to express that, so the directives let you use it. 588 588 589 589 Makes sense, doesn't it? 590 590