Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

261–270 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#261
post #111

Earlier quoted context omitted.

This is a great opportunity to learn! http://youmightnotneedjquery.com/ is a great resource: Type in what you want to do (for example, `next` or `AJAX`) and it shows the jQuery code you might have used along with a vanilla JavaScript way to accomplish it.

Is me or the website shows that the in general jQuery codes are much smaller? Like the $.getJSON jQuery code seems much compact compare to IE8+ to IE10+.

Didn't knew that site before, but had a look at it and now I'm pretty sure I will stick to jQuery and not the shiny new things. It's still very solid and gets things done.

Re: Bootstrap 5 will remove jQuery as a dependency

#262

Its only a matter of time before people realise their time is valuable and there is pushback against the frenzied cult of complexity driven by resume builders, framework builders and job seekers always looking for an opportunity to promote their latest projects and run everything else down. jQuery remains as useful as ever and the constant sniping here is a dead giveaway of a faddish mindset of not just making one's…

>90% of Jquery use cases are for websites and ajax calls 90% of what people used jquery for now is built in to browsers by default. Every dependency removed from your website is a win.

> 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 on their sites, but they cry out for jQuery?

Or throw in a bunch of analytics stuff which gets you set back a significant amount of time and connections...

Really: Using jQuery is one of the smallest problems of modern web development.

Re: Bootstrap 5 will remove jQuery as a dependency

#263
post #200
post #171

Earlier quoted context omitted.

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

> PS. The other two answers here are outdated. Sure, the other two answers may be "outdated" but they're still extremely useful if you're looking to calling map/filter/etc against your queried elements.

They asked about looping, not mapping or filtering.

Re: Bootstrap 5 will remove jQuery as a dependency

#264
post #248

Earlier quoted context omitted.

"Solved the whole situation"? From what perpective? Completely killing privacy is not a solution, quite the opposite.

Advertising ID is Apple's own standard and already in use. It's what mobile apps use but it's the most privacy conscious method since it has no personal details and can be reset at anytime. Making that available for apps and websites would've eliminated 99% of cookies and user syncing pixels since the industry could use a short-term stable ID to track engagement and conversions.

> since it has no personal details

Unfortunately the industry doesn't work like that, the name of the game is "collect everything and anything at any cost".

It is so bad that there is barely any difference between the behavior of "legal/legit" players (established advertisement businesses like Google) and scammers, Google for example bypassed 3rd party cookie restrictions on Safari, just like sophisticated scammers use any means to collection information on their targets for social engineering.

What this means is that not only there is no reason to believe that advertisers will be happy with a short-term stable ID akin to Apple's Advertising ID, they have time and time proven to go above and beyond to track users by any and every mean possible.

So what introducing something like Apple's Advertising ID to web will do is merely add yet another identifier to endless bucket of targeting methods already in use, sadly, it won't make advertisers stop abusing other things like cache so we can have nice things.

Re: Bootstrap 5 will remove jQuery as a dependency

#265

Earlier quoted context omitted.

I am going to root for bloated jQuery to save my life! $('.tpm_sensors').forEach(function(sensor) { if (sensor.pressure vs: var tpm_sensors = document.getElementsByClassName('tpm_sensors'); for (var i = 0, len = tpm_sensors.length; i < len; i++) { var sensor = tpm_sensors[i]; if (sensor.pressure < threshold) fixBeforeIDie(); }

document.querySelectorAll('.tpm_sensors').forEach((sensor) => {if (sensor.pressure < threshold) { fixBeforeIDie(); }});

and you usually define $ and $$ as querySelector and querySelectorAll at the beginning of the file if you don't like writing them all out, so they're exactly the same length

Re: Bootstrap 5 will remove jQuery as a dependency

#267

Earlier quoted context omitted.

I would not call Jquery bloated, relative to what is typically found on a website. Some of us still like using it, as the syntax is convenient and functionality reliable. There's an elegance and readability about it that appeals to me more than vanilla JS.

It is bloated compared to using modern DOM methods. jqueery is not needed, its for the lazy and stupid, my opinion.

Homophobia? Really? 'jqueery' isn't a typo.

Re: Bootstrap 5 will remove jQuery as a dependency

#268
post #145
post #48

Earlier quoted context omitted.

jQuery _did_ lots of useful stuff. It's unmaintained, has no interest/support (look at their github), doesn't adapt to modern features, is 'slow' compared to other frameworks that now use the Shadow Dom, and can be replaced with features that are native to JS - what's there not to like about that? One less dependency, network request and more efficient code is always worth the effort. Oh, and since the new code is va…

GitHub is a terrible metric. You probably use tools like grep and ls many times a day... you do not check if ls is up to modern standards and has a constant stream of issues and fixes. You don’t do it for grep, or git...you depend on git. You cannot apply instant gratification to software library dev. If the work for a library was done and satisfied in 2015, then it’s fucking done. It’s tried and tested. It gets secu…

It would only be 'done' or 'mature' enough if there would be (almost) no bugs being listed in the Github issues, right?

Re: Bootstrap 5 will remove jQuery as a dependency

#269

Earlier quoted context omitted.

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.

I am going to root for bloated jQuery to save my life! $('.tpm_sensors').forEach(function(sensor) { if (sensor.pressure vs: var tpm_sensors = document.getElementsByClassName('tpm_sensors'); for (var i = 0, len = tpm_sensors.length; i < len; i++) { var sensor = tpm_sensors[i]; if (sensor.pressure < threshold) fixBeforeIDie(); }

> TypeError: $(...).forEach is not a function

And so it starts. jQuery uses .each, not .forEach. So you fix that. But stuff still doesn't work.

Right, because jQuery's .each passes the index as first parameter and the element as second (or this).

jQuery trips me every single time.

Post reply on HN