Re:Ask HN: What happened to vanilla HTML/CSS/JS development?
by keb_ on Tuesday September 13, 2022 @08:20PM
(#32831801)
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.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development?
by nisegami on Monday September 12, 2022 @07:56AM
(#32808819)
When 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
Re:Ask HN: What happened to vanilla HTML/CSS/JS development?
by keb_ on Tuesday September 13, 2022 @08:19PM
(#32831797)
I believe you are talking about this hyperscript: https://hyperscript.org/
Whereas the parent post is talking about: https://github.com/hyperhype/hyperscript
Unfortunately, the creator of 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.).
This looks like pug/slim and other templating to remove xml from pages but instead of just something like
you get something like: 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.