HMPL – template language for displaying UI from server to client
github.com
github.com
Afaict nowhere is it being presented as a new or genius idea, or is it suggesting it will replace SPA frameworks. These all seem to be things you've projected on to the submission.
> The HMPL template language extends the capabilities of regular HTML by adding query objects to the markup to reduce the code on the client. When writing SPA, a large amount of javascript code is generated, which is loaded when the user visits the site, so the loading speed can be quite slow. All this can be avoided by generating the markup on the server and then loading it on the client:
< some code >
Let's say that the same code on popular frameworks such as Vue and others takes up much more code, which, in fact, can be moved to the server.
Maybe I’m misinterpreting but this seems to say that this approach is an improvement over SPAs. My point is that this is basically what everyone else has done all the time before SPAs were even a thing.
In the end, it bends back to HTML5, CSS, JS with Jquery, and PHP + MySQL :D
I might just be dense :D
*looks inside, it's JavaScript*
My flow is that focusing on the data structure and methods allows the UI to be completely abstract. Not in a magic way but in a “maybe we should use cross compile this into C++ and use OpenGL if the UI becomes too complex. This is how you get AutoCad or film editing software running essentially as a Proton/video game runs.
When your app gets beyond a certain level of complexity (window composition, etc) yeah there’s ways to make it happen.
From my understanding, modern frameworks(React) use both. Why would you limit yourself to just server-side? Isn’t there a trade off between server-side and client-side rendering?
When state lives on the server, usually in a database, leave your templating engine there and ship HTML.
When state only lives in the client, think temporary UI state or animations, that rendering needs to happen in the client.
At least for the kinda of sites and apps I build, that almost always means most of the rendering is done on the server and client rendering is so small in scope that I don't need more than plain old JS or a web component.