사용자
Explains this post to me so that even Java developer could understand:
Now let me try to explain RSC:
Every app (web or otherwise) fundamentally has a couple of ways to store the state:
- ephemeral state on device (think hover state of a button)
- local state on device (think saved draft of a tweet)
- local cache of server state (think your profile avatar)
- ephemeral server state (think request IP address)
- server state specific to the instance (think of new uploaded avatar saved in memory or on volatile disk)
- persistent server state (think user name stored in DB)
- server cache of DB state (think a list of top10 trending topics)
- server queues (think waiting for seconds or days to get email/sms verification code)
And every app fundamentally limited by how it can talk to those state stores:
- some of the interactions have to be instant and never fail (think rendering a new frame in the game)
- some should be very fast and reliable (think writing into text input)
- some are expected to be fast on the fast Internet and slower on the slow one (think position of the enemy in Counter Strike)
- some can be slightly slower and tolerate slight inconsistencies (think auto saving drafts in Gmail)
- some can be even slower as long as it "feels deliberate" (think pressing "calculate my taxes" button)
- some are expected to start some real life process with different expectations for "I see that it started" and "I see that it's finished" (think of the "search for new game lobby" button)
Now let's make this way more complicated, what about the time when you want to upload your new avatar. How many of those places do you want to store that avatar in? How many of those places will get out of sync? What kind of feedback do users expect for each? What are the failure modes?
Keep in mind that users get accustomed to good things and what was considered good interaction today, would be considered slow and clunky tomorrow.
I'll leave it as an exercise for the reader to figure out where terms like "client side navigation", "full page navigation", "local first", "progressive enchantment", "optimistic updates", etc. are falling onto those two lists and how different frameworks are trying to lie to you that you only need a couple of those points figured out to deliver either passable or great experience 🙃