Live data from Hacker News

Replacing JavaScript with Just HTML

htmhell.dev

51–60 of 296 posts

Re: Replacing JavaScript with Just HTML

#54
post #18

Earlier quoted context omitted.

Details works even when it's set display:contents too, for even more flexibility. Can't animate from open›close, yet, though. That's pretty much my last frustration with it.

I think the CSS support for that has finally landed, though it means targetting a pseudo element instead. Its been a year, so support is probably good enough you don't care if just the animation doesn't happen. https://developer.chrome.com/blog/styling-details

Note that the transition to `auto` in that post relies on `interpolate-size` which has yet to land on Firefox or Safari, and neither have movement right now.

Re: Replacing JavaScript with Just HTML

#55
Plain HTML is very cozy to me - I came of age in that era. Marquee tags 4eva.

But as much as I hate to admit it, it is very difficult to build something functional today with plain HTML and no/minimal JS. If you want, say, a model form that manages its children as well, you're basically going to end up with a 2003-era ASP-feeling application with way too many views and forms (as seen on your employer's current HR system). Or you use HTMX... and you still end up with just as many (partial) views, but now with so much implicit state that you're veering into write-only code.

I dislike modern JS to the extent that I opted for Phoenix LiveView, just so I could achieve interactivity without ever having to touch JS, but in truth it's not a comprehensive solution. Still had to write a web worker, a bridge to handle things like notifications, etc. Plus the future direction of Phoenix, all in on AI, is worrying.

Honestly, I should probably just swallow my disdain and learn to appreciate and use modern JS, as painful as that sounds. I want to write and release cool things, not get caught up in navel-gazing language wars.

Re: Replacing JavaScript with Just HTML

#56
post #24

I didn't know about , but how are you supposed to use it with a non-trivial amount of items in the list? I don't see how this can be a replacement for javascript/XHR based autocomplete.

Don't use it, it totally blows. For another oddity to not use, check out the multiple select: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...

Expecting users to press modifiers when clicking on these is so funny.

Re: Replacing JavaScript with Just HTML

#57
post #41

Does it bother anyone else that it links to Codepen instead of just putting them on the page? Like I get this is a blog system but it still feels odd, especially for a "use this plain HTML"-style post...

It doesn’t really bother me.

It seems to link to the authors codepen. If you us code pen you can bookmark the snippets. Codepen colorizes the html/css etc.

Link rot is a thing though, so it’s not always ideal to have dependencies on third party urls staying the same.

Re: Replacing JavaScript with Just HTML

#58
post #55

Plain HTML is very cozy to me - I came of age in that era. Marquee tags 4eva . But as much as I hate to admit it, it is very difficult to build something functional today with plain HTML and no/minimal JS. If you want, say, a model form that manages its children as well, you're basically going to end up with a 2003-era ASP-feeling application with way too many views and forms (as seen on your employer's current HR sy…

I haven't used it in anger myself, but if you know Elixir and Phoenix you might like Gleam, which compiles to Javascript.

Re: Replacing JavaScript with Just HTML

#59
post #47

Earlier quoted context omitted.

Until your client tells you that it doesn't work in Edge and you find out it's because every browser has its own styling and they are impossible to change enough to get the really long options to show up correctly. Then you're stuck with a bugfix's allotment of time to implement an accessible, correctly themed combo box that you should have reached for in the first place, just like what you had to do last week with t…

[deleted]

Have you no sense of craftsmanship?

Re: Replacing JavaScript with Just HTML

#60

When building out a new app or site, start with the simplest solution like the html-only autofilters first, then add complex behavior later. It's good to know these things exist so there are alternatives to reaching for a fat react component as the first step.

Until your client tells you that it doesn't work in Edge and you find out it's because every browser has its own styling and they are impossible to change enough to get the really long options to show up correctly. Then you're stuck with a bugfix's allotment of time to implement an accessible, correctly themed combo box that you should have reached for in the first place, just like what you had to do last week with t…

Right, don't add complexity until you have to.
Post reply on HN