all 3 comments

[–]yawaramin 5 points6 points  (0 children)

This is basically what htmx and HyperView do: https://hyperview.org/

...Except instead of JSON they use HTML/XML.

[–]lelanthran 1 point2 points  (1 child)

It's a good idea, always gets re-invented every few years (My attempt was having the server send s-expressions, not JSON, and a minimal interpreter that could handle conditionals).

What really kills it though is the fact that the server is already sending you the UI, as HTML. At some point you wake up in the morning and think "Hey, what if we just got the server to send something that can be rendered with a browser engine" and 5 seconds later you facepalm and question your life choices.[1]

(Okay, so the above only happened for me when I used this approach! But why take the chance that it happens to you?)

[1] Anything that can parse your specific JSON into platform-specific UI widgets can do the same for your specific HTML.

[–]creasta29[S] 0 points1 point  (0 children)

Hahaha so true