News for hackers. Stuff that matters.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by samwillis on Friday September 09, 2022 @12:41PM (#32781537)
> keep the UI in sync with state

This is absolutely true, however there are some newer tools that are appearing that make this much easer with vanilla html - htmx, hyperscript, alpine.js for example (links below).

These newer tools are all made possible due to the “new”(ish) MutationObserver api, it allows you to intercept new dom elements being placed into the document. These libraries let you simple decorate your “real” html with extra attributes enabling easer client side state management. No build step required.

My hope is that a combination of these type of tools, js modules and web components will result in dropping all js build tools. With http2/3 we don’t really need bundling. In many ways it the bundling and transpiling process that has contributed the most to the friction with JS development.

My other observation would be that as js frameworks have evolved they have become more “enterprise” ready, adding tooling (complex central state management, strict typing) to make working in large teams on very large codebases easer. Much of this isn’t really necessary for the majority of we development.

https://htmx.org/

https://hyperscript.org/

https://alpinejs.dev/

Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by shafyy on Friday September 09, 2022 @12:58PM (#32781830)
To that list I'd add Hotwire (especially Stimulus: https://stimulus.hotwired.dev). I use with Rails, but it's framework/backend agnostic.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by xmonkee on Friday September 09, 2022 @12:52PM (#32781704)
It's crazy that we posted almost the exact same thing at the same time: https://news.ycombinator.com/item?id=32781674
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by 9935c101ab17a66 on Friday September 09, 2022 @09:17PM (#32786731)
Both your comments are very helpful, so I’m glad you did :)
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by symlinkk on Friday September 09, 2022 @02:08PM (#32782836)
But if you’re going to use a framework like HTMX and the others you mentioned, why not just use React? Vanilla JS is great because it’s universally available, if you’re choosing to drop that advantage I would just go with React.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by yCombLinks on Friday September 09, 2022 @03:59PM (#32784139)
With react you need a build / transpile stage and have to handle webpack / babel / whatever. You can just use plain tags in html to use htmx and alpine, you just have to include them
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by Existenceblinks on Friday September 09, 2022 @03:58PM (#32784131)
because `react-dom` is bloat [minified]

- [email protected] [3.7 kB]

- [email protected] [36.5 kB]

- [email protected] [38.1 kB]

- [email protected] [130.5 kB]

Right now my whole (everything js) really complex application is 150 kB minified. Imagine adding React .. urghh unreasonable.

Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by vi2837 on Friday September 09, 2022 @04:38PM (#32784618)
Just try Preact
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by Existenceblinks on Friday September 09, 2022 @07:40PM (#32786187)
Preact is good except it tries to be in React league. The author has greater knowledge, enough to left React behind.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by potatoz2 on Friday September 09, 2022 @04:11PM (#32784278)
I hope these succeed, but we still need transpilation/bundling:

- TypeScript needs transpilation and it’s very popular

- Bundling is still beneficial with H2/H3, if only so that compression can work well

Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by lenkite on Saturday September 10, 2022 @01:58AM (#32788217)
Please add https://unpoly.com/ to your list.
Re:Ask HN: What happened to vanilla HTML/CSS/JS development? by alwillis on Friday September 09, 2022 @02:51PM (#32783352)
Thanks for these links! They look like the next logical step for HTML/CSS developers instead of React (or similar) which are overkill.