Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

171–180 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#171
post #70

Earlier quoted context omitted.

> As one of the commenters pointed out, a lot of stuff was copied from jQuery to make it work. > In other words, this entire effort seems of dubious benefit to me. You made other points, but I wanted to focus on this one. Yes, there's a few remaining bits that don't have standards. But you can do so much with querySelector, classlist.toggle(), lastElementChild, scrollIntoView, insertAdjacentHTML - literally every Jav…

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

Re: Bootstrap 5 will remove jQuery as a dependency

#172
post #14
post #10

Earlier quoted context omitted.

I am still more fond of jQuery's ajax functionality than anything that followed, including the fetch API.

Why? fetch returns a native promise, which are _much much much_ nicer to work with than XHR ever was or desired to be. Good riddance.

jquery also returns a promise

Re: Bootstrap 5 will remove jQuery as a dependency

#173

This is funny. I was thinking that Bootstrap should be suffering the same fate as jquery. That is, it’s relevance should be decreasing as web technology catches on. I see no reason for using a third party layout system now that CSS has `display: flex;` and `display: grid;`. As for modals and menus, HTML has ` ` and ` `. And for reusable components, we have custom elements, that you can either implement your self (not…

Designing design systems is hard.

Re: Bootstrap 5 will remove jQuery as a dependency

#174
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…

jQuery may be outdated from a JS point of view, but nothing beats its syntax. Nothing is as simple and straightforward.

Most of its syntax is now part of JS/DOM natively now. I think that's because of how intuitive it was.

It's not cool anymore but there's little compelling reason to tear it out of existing projects other than a refactor. It still works.

Re: Bootstrap 5 will remove jQuery as a dependency

#175
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 own choice but trying to force it on others.

Fortunately for those who do not have hours and weeks of time navigating NPM dependency wildlands, jQuery represents a quick and efficient escape. If Vue or React offer better efficiency or simpler use, users will migrate swiftly but given the current state of affairs that seems unlikely, so they can coexist serving different use cases.

The idea that React or Vue can or should replace jQuery is more wishful than real given 90% of jQuery use cases are for websites and ajax calls that would not benefit from the massive overhead of a shadow dom and NPM workflow.

Re: Bootstrap 5 will remove jQuery as a dependency

#176

Earlier quoted context omitted.

in the world of web performance and SEO 85kb is very significant. i wouldnt think twice to remove it if i had the opportunity. compared to modern frameworks, jquery is ~500% larger. you could definitely debate the usage and needs but thats a separate topic than efficiency.

The standard download of Vue.js is 95k; React is 120k. I have no idea where you got your "500%" from, but it seems wildly off-mark.

https://gist.github.com/Restuta/cda69e50a853aa64912d

react is 31kb vue is 20kb preact is 4kb

Re: Bootstrap 5 will remove jQuery as a dependency

#177
post #72

Earlier quoted context omitted.

You seem to be misinformed. IE11 hasn't been dropped, is supported, and is still the only browser shipping with some versions of Windows as of right now. Older versions of IE have been dropped. And Edge is still their recommending browsing experience and the only one likely to receive enhancements (both will continue to receive security fixes). Key Dates: - Internet Explorer 9: EOL January 12, 2016 - Internet Explore…

IE will go EOL for the majority of users well before 2025, simply because they're not adding features and the web _will_ break (and is already breaking) as a result. Imagine TLS 1.4, or some other change that will occur that will completely break IE11. Instead, Microsoft will ship Edge with Chromium (even on Windows 7) and say "use that instead" and will eventually remove IE altogether.

And enterprise users will block the update and continue demanding that all of their vendors support IE11 and I will continue smashing my head on the desk finding 10 year old bugs.

Re: Bootstrap 5 will remove jQuery as a dependency

#178

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.

Re: Bootstrap 5 will remove jQuery as a dependency

#179
post #156

Earlier quoted context omitted.

in the world of web performance and SEO 85kb is very significant. i wouldnt think twice to remove it if i had the opportunity. compared to modern frameworks, jquery is ~500% larger. you could definitely debate the usage and needs but thats a separate topic than efficiency.

Uh, at least in terms of react a bit of quick googling saw people who were putting effort into optimizing react's client side size getting it down to ~40 - 90 kB, so it seems pretty comparable. Some of these folks had a 1.2 MB script bundle they were sending to the client to begin with. I'm not in the trenches with this stuff though so my numbers may be wrong but... the ~500% number seems pretty off.

https://gist.github.com/Restuta/cda69e50a853aa64912d react is 31kb vue is 20kb preact is 4kb. depends on the framework but 500% isnt far off

Re: Bootstrap 5 will remove jQuery as a dependency

#180
post #171

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…

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

Or if you prefer:

    for (const element of document.querySelectorAll('.some-class')) {
      // ...
    }
Post reply on HN