3 ms·
Here's an idea – instead of passing the "visual page structure" to the client as JSON, use a markup language specifically designed for that purpose – HTML. Wha
by paxys 5y ago
Here's an idea – instead of passing the "visual page structure" to the client as JSON, use a markup language specifically designed for that purpose – HTML.
What ends up happening though is that you have to build that general purpose API for mobile apps regardless, and right after that developers start using it to render their web app components. Rinse and repeat.
- lucasyvas 5y agoIf you are into server-driven UI, you can deliver structural data in JSON format and only have the client know how to render components. This is easier said than done, however, as you basically need to reinvent parts of HTML but worse (ex. attaching event handlers to UI elements, etc.) Or, use GraphQL. Or a BFF for each client.
- square_usual 5y ago> Here's an idea – instead of passing the "visual page structure" to the client as JSON, use a markup language specifically designed for that purpose – HTML. Why didn't you just come out and say "Use Hotwire!" or "Use LiveView!" ;)
- davidatbu 5y agoWait, are you saying that "html-over-the-wire" is preferable even for mobile apps, or that having mobile clients makes using "html-over-the-wire" undesirable?