top | item 37288691

(no title)

uryga | 2 years ago

> Apps (as in, mobile apps) cannot be rendered on the sever

yes and no. sure, you can't do standard SSR like for websites. but i've seen a number of spins[1] on "Server-driven UI", meaning "server defines the app views as a big blob of JSON". usually, it's payload looking something like this:

  [
    { "type": "Heading", "text": "Our cool products" },
    { "type": "List", "children": [
      { "type": "ProductCard", "id": 123, },
      { "type": "ProductCard", "id": 456, }
      ...
    ] }
  ]
the app "interprets" this and displays the corresponding components in the specified arrangement.

the kicker is that, in a sense, RSC is just a less ad-hoc way to do this kind of thing! instead of `type` tags you get "client references", React handles the relevant parsing/serialization, and a lot of other good stuff on top. it's also quite seamless w.r.t writing components -- react does a very good job of abstracting away all the serialization business. and importantly, you can have an actual ecosystem of RSC packages around it, which a bespoke in-house method of doing this won't have.

now, RSC for react native has barely even been teased, but i'll bet good money that they have at least a prototype somewhere. and yeah, of course this would require your app to be in React Native. but that's the selling point -- IF all your stuff is in react, you get a bunch of power and some good DX.

---

[1] some examples off the top of my head:

- Facebook (not public, described by an employee): https://twitter.com/acdlite/status/1632217463772393473

- AirBnb: https://medium.com/airbnb-engineering/a-deep-dive-into-airbn...

- a Polish site called allegro.pl, though I can't find the conf talk about it right now...

discuss

order

No comments yet.