Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

31–40 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#31

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?

I think it's generally considered good when you can eliminate a dependency's reliance on another dependency to function. There's nothing inherently wrong with jQuery. If the functionality and size match your needs, there shouldn't be any problem.

Re: Bootstrap 5 will remove jQuery as a dependency

#32

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?

I think the reason is that many of the problems JQuery was designed to solve (DOM manipulation, cross-browser compatibility issues, AJAX, cool effects) have now been implemented as standards, either in Javascript or CSS and many developers consider the 55k minified download not worth it.

http://vanilla-js.com/

Re: Bootstrap 5 will remove jQuery as a dependency

#33

This is great! This will make bootstrap more attractive and competitive as a framework. JQuery was one of the most important frameworks in Javascript history. It has enabled us to built real webapps. However since then differences between browsers shrunk significantly and we learned how to build maintainable and scalable apps in a more declarative fashion (hello React, Angular and friends)

Whoosh!

Bootstrap is going the way of table layouts. Table layouts were great too but times change. Right now we have CSS Grid and it works in all browsers. I am sure they will bring this goodness to Bootstrap 5 but there is no need for the new layout engine that works great in all useful browsers to have a framework wrapper.

Similarly with the jQuery, it was once useful in a table layout kind of way but nowadays you might as well just write ES6 javascript rather than learn how to do things the special jQuery way. Frameworks are dead in a similar way to how the internal combustion engine is.

Using the intrinsic properties of the browser is where it is at in the same way that electric is where it is at in the automotive world. The fact that everyone is stuck with their excuses for frameworks (and ICE engines) does not change matters. Hence I read this news with all the enthusiasm of a Tesla owner reading about Peugeot developing a more efficient diesel engine.

Re: Bootstrap 5 will remove jQuery as a dependency

#34
post #9

Earlier quoted context omitted.

I know you're sarcastic but Bootstrap has been picking up steam recently. The jQuery removal has been in the work since 2017. If you want faster releases then feel free to submit PRs :)

Really? I'd have guessed bootstrap will be phased out completely by CSS grid, which does essentially what bootstrap does...

I've used bootstrap many many times in my line of work: internal tools and systems for corporate use. I'm not a web designer, neither a full time web developer, so it's really really nice to have a drop-in barebones decent looking and well though interface to work with.

Re: Bootstrap 5 will remove jQuery as a dependency

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

Well, the snippet you posted is a sensible immediate step before any dependency replacement.

You replace direct usage with indirection (adapter) that still calls jQuery, ensure everything still works, then swap out the indirection's implementation (e.g. with native DOM functions), and ensure everything still works.

The pattern specifically just decouples the callsite from implementation.

Re: Bootstrap 5 will remove jQuery as a dependency

#37
post #9

Earlier quoted context omitted.

I know you're sarcastic but Bootstrap has been picking up steam recently. The jQuery removal has been in the work since 2017. If you want faster releases then feel free to submit PRs :)

Really? I'd have guessed bootstrap will be phased out completely by CSS grid, which does essentially what bootstrap does...

I’ve had a lot of issues with grid and all versions of IE/Edge...and Safari.

Re: Bootstrap 5 will remove jQuery as a dependency

#38

This is great! This will make bootstrap more attractive and competitive as a framework. JQuery was one of the most important frameworks in Javascript history. It has enabled us to built real webapps. However since then differences between browsers shrunk significantly and we learned how to build maintainable and scalable apps in a more declarative fashion (hello React, Angular and friends)

Whoosh! Bootstrap is going the way of table layouts. Table layouts were great too but times change. Right now we have CSS Grid and it works in all browsers. I am sure they will bring this goodness to Bootstrap 5 but there is no need for the new layout engine that works great in all useful browsers to have a framework wrapper. Similarly with the jQuery, it was once useful in a table layout kind of way but nowadays you…

>Bootstrap is going the way of table layouts. Table layouts were great too but times change. Right now we have CSS Grid and it works in all browsers.

Which is irrelevant, as Bootstrap is much more than a grid system.

Not to mention it's not meant for the types to mess with their own custom grid layout anyway.

Re: Bootstrap 5 will remove jQuery as a dependency

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

In other words, this entire effort seems of dubious benefit to me. Whereas before it was "jQuery for EVERYTHING", now it seems to be the reverse: "remove jQuery from EVERYTHING", which is equally silly. jQuery does a lot of useful stuff, and al things considered remains a pretty neat project. It shouldn't be used for everything, but spending loads of time in removing it just because it's no longer the kwel fr4m3wr0k of teh week just seems like a waste of effort.

Re: Bootstrap 5 will remove jQuery as a dependency

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

Missing .abort() on safari is one reason. https://caniuse.com/#feat=abortcontroller
Post reply on HN