r/Clojure • u/roman01la • Jun 04 '25
Towards React Server Components in Clojure, Part 3
https://romanliutikov.com/blog/towards-react-server-components-in-clojure-part-3
21
Upvotes
r/Clojure • u/roman01la • Jun 04 '25
4
u/roman01la Jun 04 '25
Sharing my progress on react server components implementation in UIx
4
u/slashkehrin Jun 04 '25
Very cool update again. I never knew that React doesn't support error boundary on the server. Maybe because the it has to be a class component? Though them not even shipping an error boundary might be an admission of low priority.
Excited to hear more about this. My initial reaction is that providers aren't worth losing the simplicity of the RSC mental model, but I also had a lot of pain in the past with drop drilling on the server (e.g dictionaries for i18n RSC on the server), so looking forward to seeing more.
1
u/zerg000000 Jun 04 '25 edited Jun 04 '25
very cool feature indeed. But normally, I seldom use this kind of feature. The problem with this approach is not only about the n + 1. The real issue is that
* The data fetching logic becomes implicitly hidden in the UI tree. From the renderer/fetcher point of view, it is completely dynamic, which means hard to optimize and debug.
* many useful information is only available at render time, compared to fetching at the root
* Similar to GraphQL, circular fetching is possible
2. must run multiple times to just know about the whole fetching plan
3. Unlike client-side, server-side is seldom overfetch since we also have better querying tools and larger permissions compared to REST API.
4. render / fetch is much slower when they interleave
5. Since the complexity it introduces, it becomes harder to cache effectively.
6. Smart component ( a component knowing too much ) also damages the reusability
It did make developers feel better, but the maintenance cost is too huge to ignore.