
Bootstrap 5 will remove jQuery as a dependency - bdcravens
https://github.com/twbs/bootstrap/pull/23586
======
Carpetsmoker
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.

~~~
tcd
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 vanilla and written in ES6 (it was already but
transpiled) you can use modules/tree shaking, even better for performance.

~~~
thrownaway954
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 request.

~~~
cabalamat
> 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/](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.

------
runarberg
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
`<dialog>` and `<details>`. And for reusable components, we have custom
elements, that you can either implement your self (not that hard) or pull from
a library (using javascript modules).

Really the only reason I see anyone using CSS frameworks like bootstrap is for
quick prototyping or because that is what they know and don’t bother picking
up the new standards (which is ironically where jquery was a few years ago).

~~~
fooey
So long as native web controls are look so awful, we need something like
bootstrap

The layout support in Bootstrap is nice, but the baseline design language is
more important

~~~
zanny
Are there any good frameworks of just stylized components? In my experience
building Bootstrap / Bulma without their not-grid grids and layout systems
breaks all the component styles or makes them act really wonky. Like trying to
grid-align or flex-basis a Bulma or Bootstrap btn can get all kinds of weird
stuff going on.

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

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

~~~
martin_a
> Every dependency removed from your website is a win.

Sorry that this rant is hitting you, it's nothing personal, but this is
somewhat a distraction.

Deliver the slim version from your own host and with an existing HTTP
connection and it's just 70 KB without compressed transfer. That's very
little, even on mobile.

People are regularly missing to optimize images and will easily transfer 100s
of KB in image overhead on their sites, but they cry out for jQuery?

Or throw in a bunch of analytics stuff which gets you set back a significant
amount of time and connections...

Really: Using jQuery is one of the smallest problems of modern web
development.

~~~
baroffoos
Its not just the bandwidth spent its the extra complexity of the code base.
Every framework you add is an extra thing that devs have to know and in the
future there will be less and less people who know jquery.

~~~
martin_a
This assumes that nobody will learn "the old stuff" and only focus on the new
stuff. I don't think that's how it works, otherwise we wouldn't see PHP in the
wild anymore. Or anything else that's more than five years old.

On the other hand, people are integrating libraries for ANYTHING in their
projects and don't care about that either.

Call me old-fashioned, but PHP + MySQL with HTML, CSS and a handful of jQuery
has still brought me everywhere in terms of tech stack. Maybe I'm just doing
shitty jobs, I don't know, but it works and the client is happy, so it doesn't
look like a problem for me.

------
dmitriid
> 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 pain in all of parts of a dev's body as they were 10, 15,
and 25 years ago. Even if you "replace" jQuery, you end up just reimplementing
easily a half of it just because it's so brilliant in it's ease of use and
convenience.

~~~
tcd
Yes...What were you expecting then to do? Usually you replace code if you're
dropping a dependency. It's one less network request, saves bandwidth and
removes obsolete and pretty much unmaintained code (at this point, the jQuery
github is as good as dead, unlikely to see major releases any time soon).

Seems to be a sensible approach to me. It's like using native code rather than
electron, even if you add more lines, I'm pretty sure the performance gains
would be worth while.

~~~
mschuster91
> It's one less network request, saves bandwidth

Given that most stuff these days is packed together with Webpack or at least
concat'd together, you don't really save much, plus jQuery in gzip'd form is
clocking in at <30 kB anyway ([https://mathiasbynens.be/demo/jquery-
size](https://mathiasbynens.be/demo/jquery-size)).

> and pretty much unmaintained code (at this point, the jQuery github is as
> good as dead, unlikely to see major releases any time soon)

So what? Software can very well be "done", there is no need to always evolve
and evolve. As long as there is no security issue left unsolved, though.

In addition, if you're rebuilding half of it on your own anyway, chances are
high you'll miss some weird corner case that jQuery solved years, or decades,
ago.

~~~
tcd
I don't agree, software needs to evolve as its dependencies does. In this case
we have fetch, async/await, promises and loads more native features that
jQuery hasn't adapted to (XHR is obsolete now for example).

Why include a dependency that the browser provides for free? jQuery was good
before ES6/next came along, these days it's extra cruft.

And if what you're saying is true about weird corner cases, people will fix
that up in PR's anyway, that's not a reason to stop innovating and just say
"meh, jQuery is good enough".

Thank god most software doesn't work your way, we'd probably be stuck in the
stone ages still.

~~~
exodust
> _...promises and loads more native features that jQuery hasn 't adapted to_

Promises work great in Jquery. I've had much success chaining combinations of
AJAX and interface events together using Jquery deferred promises.

Jquery is stable and reliable. Use it or don't use it.

A lot of devs tend to think the whole world has an updated web browser like
they do. Forgetting that millions of hand-me-down older devices that can't be
updated (eg an iPad 3) will NOT load a page properly with ES6 javascript.

Example: the Steam website... this site is now useless to browse on an "old"
device like an iPad 3 which Apple considers "vintage" so doesn't give updates.
So do we throw the iPad in the trash? We're talking an iPad 3 with retina
screen and pretty good performance, but no updates to OS or web browser. In
the real world, people are not throwing their iPad3's and older devices in the
trash, they're keeping them around house, giving to kids or selling them on
ebay, which means people are buying them on ebay and still using them for
years and years.

------
entelechy
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)

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

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

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

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

~~~
tcd
See [1] for a demo

[1]:[https://tejasq.github.io/basically-
streams/examples/fetch/](https://tejasq.github.io/basically-
streams/examples/fetch/)

------
lichenwarp
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?

~~~
guhcampos
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 rendering. It seems to be extremely more efficient and
flexible.

~~~
barbecue_sauce
I think you may be confusing Shadow DOM with Virtual DOM. Shadow DOM is more
about encapsulation and isolation of independent DOMs, while Virtual DOM is
about keeping an in memory representation of the DOM to allow for more
efficient rendering. Shadow DOM is a browser API whereas Virtual DOM is
implemented in frameworks.

------
STRiDEX
Its also worth reading the 4.3.0 blog post which mentions the removal
[https://blog.getbootstrap.com/2019/02/11/bootstrap-4-3-0/](https://blog.getbootstrap.com/2019/02/11/bootstrap-4-3-0/)

------
sneakernets
People who say jQuery is slow, _never_ used YUI in its heyday. That
abomination deserves nothing but a shallow grave.

~~~
samgranieri
I had to use ext-js. Ugh.

~~~
vinimk
i'm migrating a project away from extjs right now, feel your pain

------
petetnt
Long-ish time ago I tried to modularize and modernize Bootstrap [0] to be
easier to use with the (still) current way of development and needless to say
it was hard, very hard. In the meantime challengers like Bulma, Semantic UI
and Material and Material UI have risen to challenge, with the added benefit
of being written at least partly from scratch (again).

I still think that Bootstrap has it's uses, but incremental updates at this
point seem to be harder than rebooting the whole thing writing everything from
scratch, maybe even using things like CSS Grid and friends in the background.
All the best to the current maintainers in their pretty hard task!

[0]
[https://github.com/twbs/bootstrap/issues/19017](https://github.com/twbs/bootstrap/issues/19017)

~~~
rckclmbr
material-ui is hands-down the most fantastic UI library I have used (both in
company and out). They provide a solid base set of features, balance
convention over configuration well, docs are excellent, and the styling/themes
are a nice thing to build on. I do wish the third-party themes would grow as
large as bootstrap did though.

------
jmkni
Awesome!

I love bootstrap. I know it's not as cool these days, but it still lets me put
together a passable (albeit generic) UI quickly, to present whatever it is I'm
actually trying to do to the user in a way they will recognise.

I don't want to spend my time building all of that myself, of learning a UI
framework, I want to spend it building functionality, and then using Bootstrap
(which I know like the back of my hand at this point) to present the
functionality.

~~~
chiefalchemist
And that's why it's called Bootstrap. If only more people understood why that
matters. You're moving forward with the application while they're wasting time
trying to reinvent a wheel, a wheel that has little to do with getting an MVP
in front of your audience.

~~~
jmkni
Reminds me of the very old Joel Spolsky blog post, _Fire and Motion_ \-
[https://www.joelonsoftware.com/2002/01/06/fire-and-
motion/](https://www.joelonsoftware.com/2002/01/06/fire-and-motion/)

> I noticed how almost every kind of military strategy, from air force
> dogfights to large scale naval maneuvers, is based on the idea of Fire and
> Motion. It took me another fifteen years to realize that the principle of
> Fire and Motion is how you get things done in life. You have to move forward
> a little bit, every day. It doesn’t matter if your code is lame and buggy
> and nobody wants it. If you are moving forward, writing code and fixing bugs
> constantly, time is on your side. Watch out when your competition fires at
> you. Do they just want to force you to keep busy reacting to their volleys,
> so you can’t move forward?

Still as relevant as ever.

------
diafygi
We've had great success with the bootstrap-native fork (same css, different
vanilla javascript). It's super lightweight, fast and the css is just as
customizable (since it's unchanged from normal bootstrap). I look forward to
getting something similar in the mainline :)

[https://github.com/thednp/bootstrap.native](https://github.com/thednp/bootstrap.native)

------
k__
Do you use Bootstrap?

If yes, what version?

If not, why not? Which alternative do you use?

~~~
petepete
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](https://milligram.io)

~~~
radicalriddler
I guess the main difference being that Bootstrap is actively maintained while
Milligram hasn't been updated in 2 years.

~~~
GordonS
Looking at the GitHub page[0], the last commit was 2 _weeks_ ago, not 2 years
ago.

[0]
[https://github.com/milligram/milligram](https://github.com/milligram/milligram)

------
nkg
Good news! I hope it won't be replaced with a 2.0 MB bootstrap.min.js

~~~
k__
Probably not, they remove it because they drop IE support, so they have much
less edge-cases to worry about.

~~~
ptspts
Do they have some remaining Edge cases?

~~~
nikeee
That will become Chrome, so don't worry.

~~~
SmellyGeekBoy
Anyone who lived through the IE6 days has every right to be worried about a
diminishing number of browsers / rendering engines.

------
rc_kas
I have no idea how to do anything without jquery.

~~~
cmg
This is a great opportunity to learn!
[http://youmightnotneedjquery.com/](http://youmightnotneedjquery.com/) is a
great resource: Type in what you want to do (for example, `next` or `AJAX`)
and it shows the jQuery code you might have used along with a vanilla
JavaScript way to accomplish it.

~~~
anthony_doan
Is me or the website shows that the in general jQuery codes are much smaller?

Like the $.getJSON jQuery code seems much compact compare to IE8+ to IE10+.

~~~
h1d
I thought the site's name was a sarcasm until I read their intro paragraph
which makes me laugh that they're actually encouraging the use of jQuery with
those examples.

------
galaxyLogic
This is absolutely good. If they don't need JQuery why should they package it
together with Bootstrap. The only reason to use JQuery would be if you need it
:-)

------
AndyKelley
Wait, Bootstrap has JavaScript now? I've been feeling guilty for not removing
Bootstrap 2.3.2 as a dependency from my personal site
([https://andrewkelley.me/](https://andrewkelley.me/)) for a while now, and as
far as I can recall, it was only CSS. Boy am I out of the web dev loop.

I'm quite happy with my newest site
([https://ziglang.org/](https://ziglang.org/)), which has a dependency on...
nothing! With cache off, 54.36 KB / 50.08 KB transferred. Cache on: 54.36 KB /
0 B transferred. No JavaScript.

~~~
btian
It's possible to get CSS only Bootstrap.

------
IloveHN84
Sad about this. Would do still 100% jQuery projects instead of React ones

jQuery is mature and API are solid compared to other frameworks, where you
cannot build projects again after just 1 week

------
dagoat
I always wondered, back when zepto got some traction, if we'd see it become
fully compatible with Bootstrap.

Then there's always:
[https://github.com/thednp/bootstrap.native/](https://github.com/thednp/bootstrap.native/)

(which I've not used), but appears to remove jQuery as a dependency

------
thatgerhard
Do people still use bootstrap? I found it way too much bloat for something
that doesn't add that much value. I don't think it has a place since flexbox
became a thing. Coding something from scratch is just so much quicker now.

------
dstroot
I’ve been using Bootstrap styles with React and rebuilding the “active” stuff
like modals, navbar, etc. as needed. It’s been pretty painless. I looked at
reactstrap, etc. but I’d rather stay clear of unnecessary dependencies.

~~~
kojackst
Reactstrap is cool, but you basically need to re-learn bootstrap. For every
component you are using, you need to check their documentation to see if they
came up with an attribute for that or if you can use bootstrap classes. It
does improves readability, but doesn't pay off IMHO.

------
aussieguy1234
I use JQuery on the backend
[https://www.npmjs.com/package/cheerio](https://www.npmjs.com/package/cheerio)

------
simonhamp
Why do so many web developers hate jQuery?
[https://link.medium.com/ehNSiPGNgU](https://link.medium.com/ehNSiPGNgU)

~~~
h1d
Just like 'everyone' that hates PHP. Trying to look like they're ahead of the
average by thinking the good old stable tools are obsolete.

------
skizm
I assume I can still use jQuery in conjunction with v5 of Bootstrap, right? I
just don't _need_ it now?

------
stayman
Which will be ready for February 2022

~~~
tcd
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 :)

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

~~~
bendotero
I'm not a big fan of bootstrap but it does a heck of a lot more than just grid
layouts. You can't just easily replace the components (modals, accordions,
buttons, etc) with CSS grid.

~~~
runarberg
It is not just `display: grid` that is replacing the layout. Now we also have
interactive elements in the HTML spec[1] like `<dialog>` and `<details>`. We
also have custom elements making an all in solution like bootstrap less
desirable for everything except quick prototyping.

[1]: [https://html.spec.whatwg.org/multipage/interactive-
elements....](https://html.spec.whatwg.org/multipage/interactive-
elements.html)

~~~
radicalriddler
Dialog is nice if you only support Chrome and Firefox. Maybe when Edge turns
to Chromium it won't be as bad, but the truth is that Bootstrap is accessible
in most if not all modern browsers, but the new HTML5 elements are not.

~~~
runarberg
You can always drop in a polyfill[1], and when browser support picks up, you
can remove it from your dependencies. That is what people used to do when they
decided to omit jquery in favor of native web APIs a few years back.

[1]: [https://github.com/GoogleChrome/dialog-
polyfill](https://github.com/GoogleChrome/dialog-polyfill)

------
z3t4
Isnt IE still the default browser in windows 7,8 and 10 !?

~~~
ezequiel-garzon
In Windows 10 at least it's Edge.

------
brian_herman__
What do they replace it with?

~~~
k__
Seems they replace it vanilla-JS that calls browser APIs directly.

------
trumped
nice to see... most javascript libraries are not really that useful
nowadays... not sure if bootstrap is still useful either though...

------
ethagnawl
This headline stopped being noteworthy ~4 years ago.

