Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

81–90 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

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

Windows 7 will be unsupported next year.

Re: Bootstrap 5 will remove jQuery as a dependency

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

Legacy bootstrap did ship with considerably fat set of dependencies - jQuery, popper, etc. Compare that to Bulma or something more modern, it ships without these dependencies. When the world is moving towards css-in-js and other aggressive ways of trimming unwanted code, removing dependencies is a good move by Bootstrap

Only part of the world is moving to css-in-js.

I won't be on the boat leaving for that destination.

Re: Bootstrap 5 will remove jQuery as a dependency

#83

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…

Bootstrap provides an easily customizable (through SASS/LESS variables) base for a web project and the components are very useful. You can even pick/choose components now to keep it more barebones if you wish. It's also very easy to learn.

All the utility classes are useful too.

Why waste time creating all those components manually?

Also as you say it's still great for prototyping and internal applications that don't need bespoke styles.

Re: Bootstrap 5 will remove jQuery as a dependency

#84
post #14

Earlier quoted context omitted.

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.

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.

Re: Bootstrap 5 will remove jQuery as a dependency

#85

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?

Not a total expert, but as a fan of JQuery I've read the arguments. JQuery modifies the DOM at runtime, this means lots of node traversals and redrawings on the fly, which make it nearly impossible for the Javascript engine to optimize anything. More modern frameworks in general use the concept of a Shadow DOM: they keep their own representation of the DOM internally and only send the full frame to the engine for ren…

shadowdom is actually the opposite - inflexible and a memory hog. It just allows people to be lazy

Re: Bootstrap 5 will remove jQuery as a dependency

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

A tremendous number of sites still use Bootstrap.

Re: Bootstrap 5 will remove jQuery as a dependency

#87
post #10

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)

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

Re: Bootstrap 5 will remove jQuery as a dependency

#88
post #75

Earlier quoted context omitted.

I think jQuery is a good option if you're making "rich applications"; that is, normal HTML pages with some JavaScript for better UX. For many applications this is still a good approach. If you're making an SPA, then jQuery is a bad choice for many reasons. jQuery is just a DOM wrapper, and doesn't give you any application structure, which tends to lead to pretty messy applications.

I believe Vue.js is much better option for this use case (just enhancing UX on an existing HTML page), and is similar in size while giving you much more flexibility.

I only looked at VueJS for about an hour, but it's my impression that Vue.js is much more of an application framework for SPAs than "rich HTML"? Quickly looking at the "getting started" guide doesn't give me the impression that it will work well if JavaScript is disabled?

What I want is just intercept some (but not all) form submissions and load the results via AJAX, and such.

Re: Bootstrap 5 will remove jQuery as a dependency

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

Re: Bootstrap 5 will remove jQuery as a dependency

#90
post #55

Earlier quoted context omitted.

fetch is very bleh, so that's not a high bar. What I'd love to see is more Observable-based offerings in that space... RxJS has some rudimentary client, but seeing that pushed further would be great.

You should look at `for await ... of`[1]. You can get a streaming reader from a `fetch` response and loop if through an async iterator. If you prefer the functional syntax observables, I'm sure you can find a library that wraps async iterators as observables. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

It's not to get a stream so much as it is to get automatic aborts in mergeMaps and such. Amazing for things like auto-complete from an API as you type.
Post reply on HN