4 ms·
Working on a project right now with htmx, hyperscript, tailwindcss (all new to me) and it's impressive how low the cognitive load is in a lot of cases.
by nisegami 4y ago
Working on a project right now with htmx, hyperscript, tailwindcss (all new to me) and it's impressive how low the cognitive load is in a lot of cases.
- gremlinsinc 4y agohtmx and tailwindcss are great but hyperscript looks crazy evil. I hate mixing html and js though, even jsx rubs me wrong. This looks like pug/slim and other templating to remove xml from pages but instead of just something like body p | This is a test of the text block. you get something like: var h = require('hyperscript') h('p', "This is a test of the text block") and I want to know why would you want the entire page in JS objects? personally I like the way htmx, vue, alpinejs do things with basically embedding actions/events on the existing xml structures. It's more an abstraction over existing html, than totally redoing or replacing html. That seems like a case of 'we knew we could do it, but never stopped to ask ourselves if we should' ... Turbolinks + stimulusjs is also another great stack for mini-frontend frameworks. Also super fast.. turbolinks can go well w/ anything though including htmx or alpinejs, but there's a lot of tutorials on stimulus+turbolinks.
- nisegami 4y agoWhen I first saw hyperscript in the HTMX docs (they're made by the same person), it also struck me as an unholy abomination. But in practice, it's been pretty nifty. It provides a concise way to perform common actions that adheres to the idea of locality of behavior that HTMX and Tailwind both offer as well. I still think I might come to regret it, but it doesn't seem like it would be hard to rip it out and replace it with plain JS. For example, I'm mostly using it to do stuff like: on click toggle .hidden on .modal
- toastercat 4y agoI believe you are talking about this hyperscript: https://hyperscript.org/ https://hyperscript.org/ Whereas the parent post is talking about: https://github.com/hyperhype/hyperscript https://github.com/hyperhype/hyperscript Unfortunately, the creator of https://hyperscript.org/ https://hyperscript.org/ hijacked the name even when the term "hyperscript" is still used to refer to dominictarr's project and the `h('p', 'hello world') API of declaring templates in JavaScript (as seen in React, Preact, Mithril, etc.).
- toastercat 4y agoHyperscript (https://github.com/hyperhype/hyperscript https://github.com/hyperhype/hyperscript) is actually quite nice when you get used to it, and I actually prefer it over JSX. Pair it with something like microh[0], and it gets even better. [0] https://github.com/fuzetsu/microh https://github.com/fuzetsu/microh