Remix.run Logo
troad 10 hours ago

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.

bigstrat2003 8 hours ago | parent | next [-]

> 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.

I would certainly agree that using a little JS can get you further than just HTML. But I think that a plain HTML page is far more pleasant to use (and thus, functional) than the JS monstrosities that dominate the Web today. There's a reason people use the NoScript addon: because a whole lot of website designers use JS in ways that make the experience a ton worse for the user.

zarzavat 5 hours ago | parent | next [-]

> There's a reason people use the NoScript addon

To be snarky, do they? The average user doesn't even know what JS is.

Users want websites that are fast and solve their problems, with a good UI. They don't care how it's made.

Make websites that people enjoy using. A good developer can do that with any set of tools, though a no-JS approach is limited in scope.

llmslave2 8 hours ago | parent | prev [-]

It's not an either/or. Modern Javascript is actually really nice to write and use, and you can write it in a tight, minimal way that doesn't bloat the page or slow it down.

trinix912 4 hours ago | parent | next [-]

Of course you can, but most people still opt to pull in a whole framework (React) or heavy library (jQuery) just to achieve what's essentially a few XMLHttpRequests and some DOM changes.

tonyedgecombe 6 hours ago | parent | prev [-]

>you can write it in a tight, minimal way that doesn't bloat the page or slow it down.

Yet most people don't.

There are some problems with the language itself but it's mostly from a users perspective that I find it frustrating.

wild_egg 9 hours ago | parent | prev | next [-]

> 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.

You're overthinking htmx then. I do some fairly complex stuff with no extra partials. Trick is just always rerender and use hx-select and hx-target to slice out the bits you want to update on the current page.

Server always has authoritative state and code is dead simple to reason about.

troad 4 hours ago | parent [-]

> You're overthinking [noun]

Yes, almost certainly!

> I do some fairly complex stuff with no extra partials. Trick is just always rerender and use hx-select and hx-target to slice out the bits you want to update on the current page.

Good trick! My only experience of HTMX in production entailed porting Stimulus code, hence the partials, but your approach is obviously much neater. I'll give it a shot, next time it might be suitable.

nashashmi 3 hours ago | parent | prev | next [-]

OT: marquee tags were a missed opportunity to implement horizontal scrolling often used on shopping websites. Now it uses JS to achieve the same.

I have been trying to find other more commonly known UI patterns that could be done natively. The time has long come for tabular data to be put into HTML tables just by referencing the source. Xslt almost did that. Another one is integrating xml http requests with native html. I think HTMz came close to this.

assimpleaspossi 2 hours ago | parent [-]

There's a usability and design issue with that as you lose what you're reading as it scrolls off the screen. Also, scrolling is a styling issue and not a document description issue which is what HTML is for.

Note: <marquee> has never been part of any HTML standard since the beginning except the current one which only has it for the purpose of marking it obsolete so people will quit using it.

an hour ago | parent [-]
[deleted]
faitswulff 10 hours ago | parent | prev [-]

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

troad 9 hours ago | parent [-]

I appreciate the helpful reply, but I think this is precisely the kind of indirection I need to avoid. I'm a sucker for elegance. If left entirely to my own devices I'd probably design a language / write a transpiler of my own, and wind up with exceedingly elegant tooling for websites, and no websites. :)

llmslave2 8 hours ago | parent [-]

This is why I don't use Typescript or frameworks in my own projects, I just constantly seek the cleanest abstraction and never get anything done. Using a deliberately messy solution is annoying but at least I accomplish stuff.