13 ms·
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 supp
by arp242 8y ago
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.
- miohtama 8y agoIE itself is being "dropped" as well, so long term support commitment for new products does not make sense.
- Someone1234 8y agoYou 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 Explorer 10: EOL January 31, 2020 - Internet Explorer 11: EOL Unknown/Unannounced IE11's EOL date is currently unknown. It would be at minimum 2025 based on Windows 10's current extended support date (but each Windows 10 feature release with IE11 pushes that date back).
- tcd 8y agoIE 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.
- therealx 8y agoMinor nitpick but TLS support is separate from IE and is handled by the OS.
- ronsor 8y agoWindows 7 will be unsupported next year.
- tcd 8y agoYes. MS still intends to ship their new browser on Windows 7 since it'll be like any other browser you can install...
- baroffoos 8y agoAnd 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.
- redler 8y agoWorse still: they’ll force your site into the bizarro world of ersatz IE9 or even IE8 “compatibility” through the auspices of “enterprise mode”. There’s nothing like the unique experience of trying to resolve a problem in your modern app, reported by a user who thinks they’re running IE11, but is actually running a never-was IE8 — because the last known developer of some indecipherable ActiveX-festooned internal budgeting app passed away 12 years ago.
- Wowfunhappy 8y agoI'm not sure security patches to ensure a program is not dangerous to use is quite the same thing as "supported". I mean, yes, it technically is in a sense of the word, but it's not meaningful. Microsoft is telling everyone to not use IE11. They are not adding features to IE11, or fixing (non-security) bugs. While it is the only browser shipped with LTSB, Microsoft's position is that no one should be using LTSB on general-purpose machines anyway. (Mind you, LTSB works and is wonderful, but Microsoft would prefer you don't know that.)
- mythz 8y ago> You seem to be misinformed. The PR specifically says "* Remove IE (but not Edge)" and to update docs containing IE references.
- Someone1234 8y agoYou misread the post I was responding to. They remarked that because IE itself was "dropped" that new products, including Bootstrap 5 need not support it. > IE itself is being "dropped" as well, so long term support commitment for new products does not make sense.
- franciscop 8y agoI did read that as "Support for IE is being dropped from Bootstrap", not the way you interpreted it.
- skinnymuch 8y agoThe OP was def saying IE itself is being dropped. Unless we are talking about a different comment.
- dstroot 8y agoIE 11 is not a browser. It is a compatibility solution.
- dwd 8y agoWhich makes jQuery a compatibility solution for a compatibility solution. Also if you need to support IE you're probably not in the position of converting your application to BootStrap v5.
- TylerH 8y agoWell, IE has not been receiving feature updates for over a year. It only receives security patches, and these days only critical ones. It is a dead browser; do not use it unless your job forces you to.
- simook 8y agoI tend to agree.
- tcd 8y agojQuery _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 vanilla and written in ES6 (it was already but transpiled) you can use modules/tree shaking, even better for performance.
- Carpetsmoker 8y agoBut this isn't replaced with a new framework that uses the shadow DOM, it uses the same techniques as jQuery, except without jQuery. jQuery already uses many native features when supported, while also working around browser quirks and such. It's less of an issue than in the past, but it hasn't gone away completely; see all the comments/fixes for specific browsers. > One less dependency, network request and more efficient code is always worth the effort. Of course not. It's a return-of-investment calculation. The 85k of jQuery isn't all that large, especially considering that websites like Medium and NYC load 2MB of JS, and the overhead of jQuery compared to standard JavaScript is minor.
- alejandromaka 8y agoin 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.
- munk-a 8y agoUh, 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.
- writepub 8y agoLegacy 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
- mythrwy 8y agoOnly part of the world is moving to css-in-js. I won't be on the boat leaving for that destination.
- GordonS 8y agoCompletely agree - I find the current trend (and that's what I see it as) of css-in-js to be most disagreeable. CSS works fine without JS, or even better with SASS/LESS.
- JustSomeNobody 8y agoI both love it and hate it. I love it because a lot of the supporters, on the inside, hate it too. They've spent the last decade saying, ya gotta keep 'em separated. Now they have to say no, it is fine to mix 'em. And it's killing them to say it, but they need jobs, so they follow the herd. But, yeah, other than that, it's a stupid idea.
- pault 8y agoCSS in JS isn't CSS. It's just SS. It ignores the best part of the language; the cascade.
- deleted 8y ago[deleted]
- charrondev 8y agoOr the worst from my point of view. CSS rots more than any other code in a front end codebase and the methods for static analysis are incredibly limited. Refactoring and static analysis tools are incredibly limited or nonexistent for plain CSS or SCSS (when talking about the barriers between HTML and the stylesheet). We do all of our new views and stylesheets using React, TypeScript, and Typestyle. As a result we can expose much controlled methods of theming and have a compiler enforced link between variables, selectors, and their usages. We can refactor easily. We can catch simple typos at compile time instead of runtime, and validate them more easily in CI.
- viraptor 8y agoThere are some nice benefits possible. I don't know if bootstrap actually gets rid of this already, but if you want to enable CSP headers on your website, you have to allow eval for jQuery. Enabling a stricter policy would be great.
- nailer 8y ago> 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 JavaScript answer on SO is now "2016: all current browsers now support X". Yeah, I'm sure they had to patch in a lot, but I'm also sure they didn't have to recreate everything. Side benefit: also no weird $(thing)[0] when you need to use a DOM API, like HTML5 validity or whatever.
- Carpetsmoker 8y ago> 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 nodes = document.querySelectorAll(q); let arr: HTMLElement[] = []; arr.length = nodes.length; for (let i = 0; i < nodes.length; i++) { if (!(nodes[i] instanceof HTMLElement)) { arr.length--; continue; } arr[i] = nodes[i] as HTMLElement; } return arr; };
- rmrfrmrf 8y agoreturn Array.from(document.querySelectorAll(q));
- Carpetsmoker 8y agoThis won't filter SVG elements, and unfortunately Array.from isn't available in IE (and perhaps some other browsers that are still in use).
- nicoburns 8y agolet queryAll = (q: string): HTMLElement[] => { let nodes = document.querySelectorAll(q); return Array.from(nodes).filter(node => (node instanceof HTMLElement)) as HTMLElement[]; } Will do the same. Note that `Array.from()` is a relatively new method, that you will need to polyfill if you wish to support internet explorer, but `Array.prototype.slice.call()` serves the same purpose and can be used in older browsers.
- untog 8y ago> As one of the commenters pointed out, a lot of stuff was copied from jQuery to make it work. "a lot" is an important clarification there, though. If they copied 99% of jQuery over then yes, it's a total waste of time. But 5%? 10%? That's a meaningful reduction in download size.
- alerighi 8y agoA 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.
- colejohnson66 8y agoWell, technically, it uses jQuery’s “slim” build which omits some features such as AJAX, but yes. You do have to pull in all of jQuery’s slim build to run it
- Carpetsmoker 8y ago> 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. You can just use the CSS and ignore the JavaScript parts, or write your own JS to build the CSS, which is what I did (twice, at the different jobs). I never liked the Bootstrap JavaScript for a host of reasons. Unfortunately this incompatible rewrite fixes exactly nothing of that.
- martin_a 8y ago> practically nobody is using jQuery Well, yeah, no: https://trends.builtwith.com/javascript/jQuery https://trends.builtwith.com/javascript/jQuery
- baybal2 8y ago> 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 In Bootstrap, it really does very few things. It was an error to begin with to bring the whole jQuery just to do few floating menus.
- rco8786 8y agoJquery is dead (RIP). Moving away from it is a necessary act to keep a project alive, even if they copied 50% of it into Bootstrap (I’m guessing the real number is much lower) to do so. Over time the remnants will decay away as well. Your argument is like saying Chevy never should have abandoned the carburetor because the effort was not worth the efficiency gain of first generation fuel injectors.
- ksec 8y ago220 Comments, I still don't see any one with good enough rational reason for removing jQuery. If you are reimplementing more than a few jQuery stuff to make it work then it shouldn't have been removed in the first place. At least not now. And now they are dropping IE support, jQuery, which defeat the purpose of these framework in the first place, making it work across multiple browsers.
- black-tea 8y ago> Whereas before it was "jQuery for EVERYTHING", now it seems to be the reverse: "remove jQuery from EVERYTHING", Reminds me of "replace ALL tables with divs" in the mid 2000s. I actually saw developers spending inordinate amounts of time using divs and css to display tabular data across browsers (which back then meant the one you used: Firefox, and the one everyone else used: IE6). I'm not sure what causes this black and white thinking. I guess it's laziness. It's easy to spot the word jquery and say "bad". It's more difficult to consider each case independently.
- JustSomeNobody 8y agoHerd thinking. Magpie developer-ing. But, really just mediocrity.
- sandGorgon 8y agoso the big reason here is actually React. Whether you like it or not, the developer momentum behind React/Vue is massive. And jquery works in weird ways with React/Vue. You can still make it work, but people are choosing to go with other frameworks. so the removal is not really a "remove jquery" thing - but more of "make sure the framework javascript doesnt screw up react". For example, look at some of the earliest comments there - https://github.com/twbs/bootstrap/pull/23586 https://github.com/twbs/bootstrap/pull/23586 >If you are interested in Vanilla JS versions of tooltip, popover, and scrollspy, We have versions that we use in [Bootstrap-Vue v1.0.0.beta.7](https://github.com/bootstrap-vue/bootstrap-vue https://github.com/bootstrap-vue/bootstrap-vue) (see in action at [docs](https://bootstrap-vue.js.org/))* https://bootstrap-vue.js.org/))* > Boostrap-Vue is quite interested in the jQuery free version of some of the plugins, as we might be able to direclty import some of these modues (or the classes), to replace some of our code.* > Any chance this can be implemented as custom elements, this way everything would be nicely compatible with all component frameworks.
- paulddraper 8y agoWhat does jQuery do to play poorly with React that this reimplementation doesn't?
- petilon 8y agoI have used jQuery in a React app without issues. It is no worse than making direct DOM calls. React is great for rendering, but you can’t implement direct-manipulation on top of virtual DOM. Direct-manipulation means interactively resizing, drag & drop and so on. To implement this you need to know the position and size of real DOM elements. There is no "React way" to query the position and size of elements, so interactivity has to be implemented the old-school way, by interacting with real DOM. You can call native DOM methods to do this, but jQuery makes it easy. There are lots of shortcuts in jQuery. You can certainly do it without jQuery too, but unless reducing download size by around 85KB is very important to you, there is no reason you shouldn’t take advantage of the ease-of-use of jQuery. Keep in mind that once you manipulate DOM directly (using jQuery or not) React can’t update those elements. For more on this look up "Integrating with Other Libraries" in React documentation.
- sureaboutthis 8y agoA lot of things jQuery did can now be done with vanilla javascript so including a non-standard (in a way) code for things that already work in "standard" javascript is what doesn't make sense anymore.