Earlier quoted context omitted.
> Side benefit: also no weird $(thing)[0] when you need to use a DOM API, like HTML5 validity or whatever. But looping over querySelectorAll() is painful. I'm not really a frontend dev, so perhaps I'm doing it wrong, but this is the "easier" way I found when I was writing an app a few weeks ago (in TypeScript): // Get Array of HTMLElements from querySelectorAll(). let queryAll = (q: string): HTMLElement[] => { let no…
return Array.from(document.querySelectorAll(q));
Bootstrap 5 will remove jQuery as a dependency
321–330 of 333 posts
Re: Bootstrap 5 will remove jQuery as a dependency
#322Earlier quoted context omitted.
> Side benefit: also no weird $(thing)[0] when you need to use a DOM API, like HTML5 validity or whatever. But looping over querySelectorAll() is painful. I'm not really a frontend dev, so perhaps I'm doing it wrong, but this is the "easier" way I found when I was writing an app a few weeks ago (in TypeScript): // Get Array of HTMLElements from querySelectorAll(). let queryAll = (q: string): HTMLElement[] => { let no…
> But looping over querySelectorAll() is painful. Not any more: let elements = document.querySelectorAll('.some-class') elements.forEach(function(element){ ... }) https://developer.mozilla.org/en-US/docs/Web/API/NodeList/fo... PS. The other two answers here are outdated.
Other people suggested Array.from(), but that won't work in IE, and the polyfill for it is a lot longer/more complex than the for loop I wrote.
Re: Bootstrap 5 will remove jQuery as a dependency
#323Earlier quoted context omitted.
> Every dependency removed from your website is a win. Sorry that this rant is hitting you, it's nothing personal, but this is somewhat a distraction. Deliver the slim version from your own host and with an existing HTTP connection and it's just 70 KB without compressed transfer. That's very little, even on mobile. People are regularly missing to optimize images and will easily transfer 100s of KB in image overhead o…
Its not just the bandwidth spent its the extra complexity of the code base. Every framework you add is an extra thing that devs have to know and in the future there will be less and less people who know jquery.
On the other hand, people are integrating libraries for ANYTHING in their projects and don't care about that either.
Call me old-fashioned, but PHP + MySQL with HTML, CSS and a handful of jQuery has still brought me everywhere in terms of tech stack. Maybe I'm just doing shitty jobs, I don't know, but it works and the client is happy, so it doesn't look like a problem for me.
Re: Bootstrap 5 will remove jQuery as a dependency
#324Earlier quoted context omitted.
I wish I could find it, but I read an article a while ago that showed how CDN-cached stuff usually, well, isn't. At the very least it's not something to rely on when making decisions about payload size.
It's cached at the CDN nodes, which means quick delivery to the device. This is much better than serving that file from your origin server, and even if you use a CDN it's unlikely that it'll match the hit rates of the public CDNs. That can make a measurable improvement, and at worse is no slower than hosting it yourself.
My rule of thumb is that public CDNs aren’t a performance move in the HTTP/2 era (i.e. 2016 or later). They may still be convenient, however.
Re: Bootstrap 5 will remove jQuery as a dependency
#325Earlier quoted context omitted.
Look, I’ve replaced plenty of jQuery with vanilla JS. I’m totally on board for lighter, leaner pages. My point was simply that there’s this tedious cycle where people crap on the older tools and say everything is better across the board with the current hotness without actually measuring anything. There are a lot of cool capabilities we can use now but they’re only going to be better at the things you actually measur…
The "cool new stack", in this case, is native, vanilla javascript that works everywhere without downloading anything and without a need to learn someone else's library.
Re: Bootstrap 5 will remove jQuery as a dependency
#326Earlier quoted context omitted.
That's a pretty obnoxious and unfounded opinion.
You seem to be ignorant in the matter. Go learn modern DOM methods, you will understand why you are so wrong.
Re: Bootstrap 5 will remove jQuery as a dependency
#327Earlier quoted context omitted.
I will swear on my life that I haven't used a style attribute in the last five years. Since I started using BEM for namespacing I have had a very easy time keeping my CSS clean and maintainable. I won't deny others their opinions, though.
BEM is a decent convention for old-school, global document styling, in the absence of scope. But it's also manual, error-prone, and verbose, making it a poor substitute for actual namespacing provided by components. I sympathize with your resistance to css-in-js; I've been doing webdev since 1998 and only really embraced it in the last couple years. I'm reminded of quotes like "The difficulty lies not so much in new…
Re: Bootstrap 5 will remove jQuery as a dependency
#328Earlier quoted context omitted.
A single stable identifier would've solved the whole situation and Apple already had it with Advertising ID. Exposing that to the browser would've been enough so Safari could've been ahead of the curve.
Yeah, all you need to do is include a persistent identifier shared across all sites in the world! In fact, this solution is so great you don’t even need cookies anymore and you never get logged out if you accidentally delete them!
Re: Bootstrap 5 will remove jQuery as a dependency
#329Re: Bootstrap 5 will remove jQuery as a dependency
#330Earlier quoted context omitted.
When the wheel is prone to damage from small bumps, and can't handle off-road, a new stronger reliable wheel that handles all terrain is needed. That's what Jquery offers.
And when the wheel is so bloated the car can barely make it down the road without needing to refill the fuel tank a new more lightweight reliable wheel that can handle modern terrain is needed. That is why people are moving away from Jquery.