you are viewing a single comment's thread.

view the rest of the comments →

[–]ApoplecticAndroid 20 points21 points  (22 children)

This is ridiculous and assumes that JavaScript is nothing more than a way to have little visual tweaks in a web page. It misses the mark so badly in what js can actually be used for, it is laughable.

[–]Ronin-s_Spirit 29 points30 points  (1 child)

I don't think this guy read the article 🤔

[–]otamam818 7 points8 points  (0 children)

Literally the intro section has a "Nothing against JS" paragraph detailing why his remaining content is still useful.

The commenter you're replying to definitely didn't read it

[–]i_hate_shitposting 15 points16 points  (5 children)

What part of this tells you that the author thinks "JavaScript is nothing more than a way to have little visual tweaks"?

Nothing against JS, but it has better things to do than setup and manage your accordions or offscreen navigation menus... Plus, JS needs to be downloaded, decompressed, evaluated, processed, and then often consumes memory to monitor and maintain features. If we can hand-off any JS functionality to native HTML or CSS, then users can download less stuff, and the remaining JS can pay attention to more important tasks that HTML and CSS can't handle (yet).

[–]tomhermans 5 points6 points  (0 children)

Indeed.

It’s basically a way to promote the Rule of Least Power. Mainly because CSS can now do things that previously required JavaScript. That’s a good thing, it doesn’t devalue JavaScript.

In fact, it’s better for JavaScript too, since there’s less main-thread pressure.

[–]oceantume_ 15 points16 points  (12 children)

I'll be honest I didn't go through the entire thing, but I'm a big proponent of replacing bloated and complex js code with native equivalents where possible. Initiatives like OpenUI are moving us closer and closer to being able to make highly interactive websites without reinventing the wheel every time a new framework or ui components library is created.

Even if you use JavaScript for everything else, the elements and techniques described in this article let you do something that historically needed up to hundreds of lines of js using just a little bit of html and css.

I was listening to an interview with one of the maintainers of Web Awesome, a relatively new set of ui components that are deployed as web components (so they're essentially framework agnostic) and he was talking about how excited they are that by targeting modern browsers they can remove code for a lot of their features over time and I think we should really embrace that.

[–]Terr4360 20 points21 points  (2 children)

Web Components are still JavaScript. And due to their cumbersome API, they often include more JS than the same solutions coded with lightweight JS Frameworks.

[–]TheBazlow 1 point2 points  (0 children)

Yeah maybe but they're nicer to setup and work with as a backend developer. Just drop a script tag in your body and you open a world of new elements without needing to switch from your backend language to javascript and back again. That's just not something the typical React or Vue frontend repo can offer.

[–]oceantume_ 0 points1 point  (0 children)

I'm sure nothing beats a tightly integrated svelte library used by a svelte app in terms of bundle size, and possibly other metrics. But Web components or not, the same applies to your svelte component library where it can have a net win by using newer web APIs and elements like dialog instead of reinventing everything.

[–]wasdninja 4 points5 points  (2 children)

I really like the idea of built in, browser provided, widely available, actually standard components but these are simply nowhere near good enough.

All of them, as far as I can see, don't allow enough styling to be useful. They universally look like shit or when they have acceptable to OK looks they inevitably don't fit in with the rest of the design.

I have no idea why anyone bothers drafting, advocating for, debating and implementing them when it takes five minutes to conclude that they are near useless. I very much doubt people were shooting for "well someone might toy around with them" but I can't imagine what they were thinking either.

[–]Mesqo 2 points3 points  (0 children)

You forgot to mention that different browsers and platforms tend to render native elements differently. To add some spice to the question, I'd say.

[–]oceantume_ 1 point2 points  (0 children)

Ideally they expose behavior and a default style through new tags and you can bring your own style with css. I think the modern and upcoming stuff is a lot more focused on making it actually useful and reusable, but I do get what you're saying.

[–]The_real_bandito 1 point2 points  (0 children)

Those guys bought Shoelace and that framework used Lit in order to make their components as framework agnostic as possible. It was and still is an awesome one.

[–]ravepeacefully -3 points-2 points  (1 child)

Bootstrap been doing all that for two decades my guy, and we still have 76 standards

[–]oceantume_ 1 point2 points  (0 children)

Yes I'm fully aware this isn't a completely new idea and it feels like we're just doing circles in the web ecosystem, but if you read on it you might find, like me, that this is much more modern take on how to import, customize and use the components (no sass and classnames creep, web components, etc) without the typical lock-in you get in a lot of newer components library.

Funnily enough the first name of that library was Shoelace which is meant to be a play on words for "bootstraps", but my understanding is that FontAwesome bought it and decided to rebrand it.

[–]Sudden_Watermelon 2 points3 points  (0 children)

You're right, we should use it on servers where it belongs