Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

191–200 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#191
post #126

Earlier quoted context omitted.

CSS in JS isn't CSS. It's just SS. It ignores the best part of the language; the cascade.

1) it doesnt ignore it 2) anyone claiming not to have a single `style=""` attribute (which is almost as specific and 1000x less maintainable) in their code is lying

I will swear on my life that I haven't used a style attribute in the last five years. Since I started using BEM for namespacing I have had a very easy time keeping my CSS clean and maintainable. I won't deny others their opinions, though.

Re: Bootstrap 5 will remove jQuery as a dependency

#192

Earlier quoted context omitted.

The standard download of Vue.js is 95k; React is 120k. I have no idea where you got your "500%" from, but it seems wildly off-mark.

https://gist.github.com/Restuta/cda69e50a853aa64912d react is 31kb vue is 20kb preact is 4kb

JQuery Minified and GZipped is also 30KB: https://mathiasbynens.be/demo/jquery-size

When doing comparisons, don't be disingenuous. Compare like numbers.

Re: Bootstrap 5 will remove jQuery as a dependency

#193
post #155

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…

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

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.

Re: Bootstrap 5 will remove jQuery as a dependency

#194
post #126

Earlier quoted context omitted.

CSS in JS isn't CSS. It's just SS. It ignores the best part of the language; the cascade.

Or 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…

> have a compiler enforced link between variables, selectors, and their usages.

That sounds interesting. Can you describe that in more detail?

Re: Bootstrap 5 will remove jQuery as a dependency

#195
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 still does a lot of useful stuff. The best advertisement for jQuery, ironically, is this site: http://youmightnotneedjquery.com/ Look at how simple things are in the left column, and how much more code is needed in the right column.

jQuery has many convenience features such as chaining, for example: item.addClass('selected').siblings().removeClass('selected'); and you don't have to check for nulls after each selection.

Many functions such as closest() and remove() have no equivalents in IE11, and other things such as replaceWith() and before() are not available even in Edge.

For simple sites it is easy enough to remove jQuery, but for more complex javascript applications, especially apps that have a lot of interactivity, removing jQuery will result in more code, or you will end up writing a lot of utility functions thereby creating your own little clone of jQuery.

Re: Bootstrap 5 will remove jQuery as a dependency

#196

Earlier quoted context omitted.

By that logic JQuery users/devs were idiots for recreating the wheel. I smell a jqueery fanboi and it stinks to high heavens.

When the wheel is prone to damage from small bumps, and can't handle off-road, a new stronger reliable wheel that handles all terrain is needed. That's what Jquery offers.

And when the wheel is so bloated the car can barely make it down the road without needing to refill the fuel tank a new more lightweight reliable wheel that can handle modern terrain is needed. That is why people are moving away from Jquery.

Re: Bootstrap 5 will remove jQuery as a dependency

#197

Earlier quoted context omitted.

https://gist.github.com/Restuta/cda69e50a853aa64912d react is 31kb vue is 20kb preact is 4kb

JQuery Minified and GZipped is also 30KB: https://mathiasbynens.be/demo/jquery-size When doing comparisons, don't be disingenuous. Compare like numbers.

Plus Vue.js 2.6.6 is 91K, not the 63K of 2.0.3 in that comparison.

It's easy to "win" internet arguments like this rolls eyes.

Re: Bootstrap 5 will remove jQuery as a dependency

#198
post #184

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…

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.

Reminds me of the very old Joel Spolsky blog post, 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.

Re: Bootstrap 5 will remove jQuery as a dependency

#199
post #29

Earlier quoted context omitted.

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

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 fi…

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

Re: Bootstrap 5 will remove jQuery as a dependency

#200
post #171

Earlier quoted context omitted.

> 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 no…

> But looping over querySelectorAll() is painful. Not any more: let elements = document.querySelectorAll('.some-class') elements.forEach(function(element){ ... }) https://developer.mozilla.org/en-US/docs/Web/API/NodeList/fo... PS. The other two answers here are outdated.

> PS. The other two answers here are outdated.

Sure, the other two answers may be "outdated" but they're still extremely useful if you're looking to calling map/filter/etc against your queried elements.

Post reply on HN