It’s not “quickly”, and I’d like to learn about faster ways too.
It’s not “quickly”, and I’d like to learn about faster ways too.
You send a request to a server from frontend, the backend responds with html and places it on the page where specified. Its much more intuitive and lower mental load than something like react or vue.
But the thing gp suggested looks much better, at least here: https://github.com/danawoodman/bun-htmx (see src/components, they use react-dom/server renderer to template-render tsx (also note that “tsx” I’m using is not a file format, but `npm i -d tsx`)). I guess I can try that in node too.
That said, I don’t see the “quicker” part here tbh, imagining my mithril code in htmx templating code doesn’t make a big difference, unless I am missing something. It’s the same parametrized html but on server. Not even a glimpse of RAD-like paradigm shift.
I guess htmx looks better if you’re using react but never allowed yourself a thought that it’s a useless esoteric bullshit everyone agrees to out of fear of being ostracized, which htmx removes silently (and it’s server-side). Mithril is just a vdom-based templater with simple autoredraw and doesn’t implement esoteric bs already.
I somewhat agree with gp’s “unpack json” part, although it’s not a big deal with types shared across ends. I just re-new Date’s after fetch and that’s it.