Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

131–140 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#131

Earlier quoted context omitted.

For one, fetch() doesn’t support progress reporting.

It does. The fetch response object exposes a `ReadableStream` through the `body` property, which you can loop through with a `for await ... of` loop. On each iteration, simply update your progress.

Yep, that’s a cute hack. Now what would be the equivalent of that for file upload? There’s no such API for fetch() because there’s no writeable body stream for requests. QED

Re: Bootstrap 5 will remove jQuery as a dependency

#132
post #48
post #39

This PR is massive and represents a year and a half of work. If you look at the comments you see there are loads of browser-specific issues being fixed. IE support was dropped as they didn't feel making stuff compatible (jQuery did that for them before). The API is also incompatible; in the words of one dev: "we broke everything". As one of the commenters pointed out, a lot of stuff was copied from jQuery to make it…

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.

Re: Bootstrap 5 will remove jQuery as a dependency

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

Minor nitpick but TLS support is separate from IE and is handled by the OS.

Re: Bootstrap 5 will remove jQuery as a dependency

#135
post #10

Earlier quoted context omitted.

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

I've always liked to use axios which provides a jQuery-ish AJAX library. Works in the browser and server-side with NodeJS. https://github.com/axios/axios Much nicer to use than fetch IMHO

[deleted]

Re: Bootstrap 5 will remove jQuery as a dependency

#136
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 is still maintained. The last pull request was 2 weeks ago. Remember that this is a _mature_ project and as such doesn't need the plethora of pull requests everyday. Personally if you are spending all that time and energy recreating the wheel just to say "you don't use JQuery ", you're being an idiot and might as well just use JQuery. Seriously I wonder how much they actually spent in dollar hours on this pull…

> Personally if you are spending all that time and energy recreating the wheel just to say "you don't use JQuery ", you're being an idiot

I prefer the term "Magpie Developer" https://blog.codinghorror.com/the-magpie-developer/

Personally, I'm currently working on projects that still use Bootstrap 3. It still works, just a jQuery still works.

Re: Bootstrap 5 will remove jQuery as a dependency

#137
post #6

> Bootstrap 5 will remove jQuery as a dependency ... by copying over/rebuilding big chunks of it. - $(element).closest(`.${ClassName.ALERT}`)[0] + SelectorEngine.closest(element, `.${ClassName.ALERT}`) - $.Event(Event.CLOSE) + EventHandler.trigger(element, Event.CLOSE) - $(element).one( ... ) + EventHandler.one( ... ) - $(this).data(DATA_KEY) + Data.getData(this, DATA_KEY) And so on and so forth. DOM APIs are just as…

Is SelectorEngine sizzle directly? I'm not sure how practical replacing jQuery is, and not going to look that deep. But jQuery isn't nearly as big today since most browsers (even IE11) are pretty modern.

A good replacement selector engine:

`const selectorEngine = selector => Array.from(document.querySelector(selector));`

:)

Re: Bootstrap 5 will remove jQuery as a dependency

#138
post #39

This PR is massive and represents a year and a half of work. If you look at the comments you see there are loads of browser-specific issues being fixed. IE support was dropped as they didn't feel making stuff compatible (jQuery did that for them before). The API is also incompatible; in the words of one dev: "we broke everything". As one of the commenters pointed out, a lot of stuff was copied from jQuery to make it…

A thing I always didn't like of Bootstrap is that it requires you to load a full version of jQuery just to use it. Maybe I don't need the whole jQuery, because I use another framework, or because I have a very simple site that doesn't require any JavaScript at all.

The thing is that when Bootstrap first launched everyone was using jQuery, so it was a de facto standard, everyone already had it, so requiring it as a dependency was not an issue at all, now we are moving towards different web technologies and practically nobody is using jQuery, and having to load it just a dependency to Bootstrap is not good, considering that it will slow down the loading of the page and consume traffic for mobile users.

Re: Bootstrap 5 will remove jQuery as a dependency

#139
post #17

Do you use Bootstrap? If yes, what version? If not, why not? Which alternative do you use?

I like Bootstrap but I tend to use Milligram for most stuff these days. It's an excellent starting point and easy to extend. https://milligram.io

I was looking at the milligram site and it looked oddly familiar. Seems http://getskeleton.com/ uses the same layout for their main page demoing the framework.

Re: Bootstrap 5 will remove jQuery as a dependency

#140

Can someone explain why if you like jquery and you're used to it why is it a bad idea or it's not but just personal preference at this point?

If you ever need a new job, basically recruiters will laugh at you for not using React / Angular.
Post reply on HN