r/reactjs • u/kensaadi I ❤️ hooks! 😈 • Aug 06 '26
Discussion Anyone here shipped Server-Driven UI in a React production app?
Anyone shipped Server-Driven UI in a React production app? Looking for war stories, not blog posts
I've read the usual Server-Driven UI case studies from large product teams, and I'm currently evaluating the architecture for a project.
The theory is clear. What I'm looking for now is feedback from people who actually shipped SDUI in production and discovered where the model starts to break.
You definitely don't need to answer everything. Even one painful lesson, failed approach, or unexpected trade-off would be useful.
1. Contracts and versioning
What did your server actually send?
- A fixed JSON schema?
- A typed contract with generated client types?
- Something more flexible or ad-hoc?
How did you handle backward compatibility when the server contract or client component registry changed?
Did you validate payloads at runtime with Zod, JSON Schema, or something similar?
2. Component registry and extensibility
How did you map definitions such as:
{
"type": "TextInput",
"props": {
"label": "Email"
}
}to actual React components?
Was the registry closed and centrally controlled, or could product teams register their own components?
What happened when a payload referenced a component or prop that an older client did not support?
3. Layout and responsive behavior
Did layout live inside the server payload, or did the client retain control over composition?
For example:
- flex/grid definitions in the payload;
- semantic layout primitives;
- fixed client-side templates;
- a hybrid approach.
Who controlled responsive behavior and breakpoints?
Did mobile and desktop receive different payloads, or did the same definition adapt entirely on the client?
4. Logic, state, and forms
This is the area I'm most interested in.
How much behavior did you allow into the contract before it started becoming a programming language of its own?
In particular, how did you model:
- conditional visibility;
- RBAC and component-level access;
- cascading form fields;
- dependent validation;
- multi-step workflows;
- save-and-resume;
- role-based branching;
- asynchronous data loading;
- domain events and analytics?
Which logic stayed on the server, which was represented declaratively in the payload, and which remained inside the client?
Where did the state live for complex forms and long-running workflows?
5. Development experience and testing
How did developers preview and debug server-driven screens?
Did you build an internal visual editor, use fixtures and Storybook, or rely on editing payloads and refreshing the application?
What gave you the most confidence?
- Payload snapshots
- Contract tests between server and client
- Runtime validation
- Generated types
- End-to-end tests
- Something else
Most importantly: what architectural decision looked good initially but became painful in production?
I've read the theory. I'm interested in the pragmatism of people who shipped this, maintained it, migrated it, or eventually removed parts of it.
Success stories are useful, but failures and traps are probably even more valuable.
16
u/ForestG18 Aug 06 '26
As a consultant, nearly every company I have worked for, wanted - at some point - to create their own "UI generator" application. I saw it in Java (with Vaadin), with .NET and Angular, with Django...
The key was, there are no jack-of-all-trades. Complexity makes the underlying framework so complex that the added value of a generated UI goes away. Abandoned projects, multi-tenant requirements spagetthifying the code, newcomers not understanding the custom logic and making shortucts, very, VERY long implementation for simple tasks makes this a very bad idea on an enterprise level.
For smaller, dedicated, very narrow specialized softwares (e.g. form generators, CRMs, education websites etc.) it can work. For smaller, very efficient teams, without much scope drift, and a limited set of frontend requirements it is a viable option. Still needs an experienced frontend dev though. Most projects are not ready for the limitations this architecture brings and it won't save you much on the long run. A dedicated, decoupled FE is always more flexible and can be refactored to be gradually backend-driven on specialized, often duplicated software parts, where for example the "microarchitecture-frontend shell" can be still standalone above.
7
u/FalconGood4891 Aug 06 '26
I have seen this pattern in enterprise saas where the backend architect wanted to control everything from BE, it may seem very straightforward at first but gets too convoluted later. The motivation behind this often given as BE will completely drive UI and source of truth would be BE and very less FE changes will be there. But it becomes messy, always avoid it if possible. REST is made for a reason.
2
u/Flat_Bee7112 Aug 06 '26
That registry mapping you’ve got there is exactly where things get messy once you step past toy examples. We used a fixed JSON schema with generated types on both ends, and it worked fine until a payload referenced a component version the client didn’t know about yet. The fallback was a generic error card, which product hated, so we layered on a best-effort render that stripped unknown props. It kept things from crashing but introduced silent UI regressions that were a nightmare to debug.
For layout, we kept the client in control of composition using predefined templates, server just declared what slots to fill. Letting the server dictate flex/grid properties directly turned into a maintenance headache the second designers wanted a slightly different card padding on iOS. Mobile and desktop got separate payloads because trying to make one definition adapt across both led to bloated props and too many conditional branches.
Forms were the part that almost broke us. We modeled conditional visibility and dependent validation declaratively in the payload, but once we hit multi-step workflows with save-and-resume, the state management on the client became its own beast. Ended up storing a serialized snapshot of the whole form state on the server between steps and sending it back down, which worked but felt like we were building a half-assed state machine inside JSON. The biggest trap was letting the payload express simple logic like "if field A equals X, show field B." That one decision kept growing until we had a mini expression language nobody wanted to maintain. If I did it again I'd keep logic as dumb as possible in the payload and lean harder on client-side hooks with strict boundaries.
1
u/TheRealSeeThruHead Aug 06 '26 edited Oct 14 '26
Minim veniam culpa exercitation ea nostrud voluptate consequat sint minim esse amet ipsum minim. Sunt incididunt fugiat duis pariatur duis amet eu occaecat pariatur est. Reprehenderit eiusmod dolor exercitation deserunt deserunt consectetur laborum quis occaecat nulla sint do et sunt labore.
1
u/denexapp Aug 06 '26
technically RSCs are SDUI - you push a tree of components and props, and the client renders client components with the passed props
1
u/thowaway183829292828 Aug 08 '26
My team did before i joined. It was hell. I'm now leading the team in getting rid of that mess and going client driven. Ymmv
3
u/Hairy_Garbage_6941 Aug 06 '26
Explore a2ui and extending it rather than rolling your own schema.
1
u/mrdivyansh Aug 06 '26
Explore Vercel’s json render.
1
u/_jgusta_ Aug 06 '26
Wait is this another type of regression back into monolithic PHP-style apps? Im half joking but decoupling was supposed to be a done deal that everyone could get behind. You can always go back to the wide open surface area of self-posting PHP files that were the backend, frontend and business logic all in one!