Passing Behavior Through A Network
You can pass a description through a network. You can’t pass behavior or code through a network. With a strong declarative and semantic language, building the code on both ends of your network to allow a description of the behavior (your declarative language) to inform both sides to make it feel like you’re passing the behavior itself through.
HTML is a great example of this. Add the readonly attribute to an input element in your HTML and now the input behaves differently (you can’t edit the field). Your readonly attribute doesn’t actually make it not-editable but tells the browser engine to render it that way and disallow typing.
On the web, Custom Elements are a great way to extend the html engine. Adding a star-rating component or segmented-control element via JS and customElements.define can then be declaratively invoked by your HTML. It’s never been easier! This is a key conceptual point behind HTMX too, with custom attributes instead of custom elements.
JSON Schema is less semantically rich out of the gate, but has support for attributes on fields that can be used in a very similar way. You need to create the engine that understands those attribute semantics. This gives you more flexibility than HTML provides at the expense of building it yourself.
React Server Components also fit this model. React is the engine deployed via javascript bundle, your components provide the semantics, and some form of json is the component description over the network.
Related Reading: The Server Doesn’t Render Anything, Two Approaches to Decoupling, Web Components Work Great with htmx, Web Development Has Lots of DSLs