3 ms·
The examples make it appear to be a DSL around JS, without server interactions beyond what you'd accomplished with a `fetch` request. I understand your comparis
by the__alchemist 5y ago
The examples make it appear to be a DSL around JS, without server interactions beyond what you'd accomplished with a `fetch` request. I understand your comparison to a webpack-based JS setup; I'm wondering about comparison to HTML and JS.
How does it interact with Python and Flask?
- sawka 5y agoWith vanilla JS you'd have to gather your parameters, encode them, call fetch, resolve the promise (and handle errors), and decode the result. Then you still need some sort of frontend data model to "set" the fetched data in. Now you need functions to update the DOM. It isn't like it can't be done, but it ends up being 10-15 lines of code, when you can do it in Hibiki in 1-2 (with a UI that looks more declarative). So for Python/Flask, you can just write standard AJAX handlers that return JSON. You can also write special JSON payloads called hibiki "actions" that can set data directly into the data model, update HTML, fire events, or even call other handlers. People knock this approach because it tightly binds your backend to your frontend. But for simple tools, that logic has to exist somewhere -- if you're a Python programmer, it can be simpler to write it in Python than in JavaScript. Whatever gets the job done.
- the__alchemist 5y agoYour explanation makes sense - thanks!