Live data from Hacker News

Bootstrap 5 will remove jQuery as a dependency

github.com

301–310 of 333 posts

Re: Bootstrap 5 will remove jQuery as a dependency

#301

Earlier quoted context omitted.

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

What does jQuery do to play poorly with React that this reimplementation doesn't?

React lifecycle - the virtual dom breaks down when you are manipulating the dom directly. It can still be done, but it's a bit weird.

Incidentally one of the most interesting react apps that plays super nice with jQuery is the new WordPress editor. I have nothing but respect at how they made it work with the tons of bad js code out there.

Re: Bootstrap 5 will remove jQuery as a dependency

#302

Earlier quoted context omitted.

There's no such thing as "done" software. Your view is incompatible with reality, I'm afraid. Yes, I did check whether ls was still actively being developed, saw that it wasn't doing anything new, and switched to exa, which is a fantastic little project, with sane defaults, less cruft, and greater speed. You can always improve software, some people just get bored of doing so, and then declare it "done". But it isn't,…

Is whatever benefit you see worth the hassle when sharing scripts or setting up servers?

If you mean for exa specifically, then yes. It’s mostly compatible with ls. Never caused problems in years now.

Re: Bootstrap 5 will remove jQuery as a dependency

#303

Earlier quoted context omitted.

That's one of the post Apple Computer decisions that bugs me. I'm a relic and like my headphones with wires attached. My wired cans have this unique feature of not needing to be recharged.

Now you know how everyone else felt when Apple killed the floppy.

I don't follow your logic. When the floppy was killed, there were better replacements available. There were devices just as portable, larger capacity, and faster access. It just plugged into a different port, and came in a different form factor.

Switching from wired to wireless giving up performance capabilities (ex: over ear headphones vs ear buds) forcing one to recharge batteries etc is not even in the same ballpark as the loss of the floppy.

Re: Bootstrap 5 will remove jQuery as a dependency

#304
post #111

Earlier quoted context omitted.

This is a great opportunity to learn! 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.

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

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.

Re: Bootstrap 5 will remove jQuery as a dependency

#306
post #264

Earlier quoted context omitted.

Advertising ID is Apple's own standard and already in use. It's what mobile apps use but it's the most privacy conscious method since it has no personal details and can be reset at anytime. Making that available for apps and websites would've eliminated 99% of cookies and user syncing pixels since the industry could use a short-term stable ID to track engagement and conversions.

> since it has no personal details Unfortunately the industry doesn't work like that, the name of the game is "collect everything and anything at any cost". It is so bad that there is barely any difference between the behavior of "legal/legit" players (established advertisement businesses like Google) and scammers, Google for example bypassed 3rd party cookie restrictions on Safari, just like sophisticated scammers u…

That's exactly how the industry works. I've spent more than a decade in it. We're talking about IDs, not tracking other information.

IDs are needed for 2 primary reasons: controlling ad frequency and attributing clicks and conversions to an ad impression.

Cookies worked for a long time but they were always considered loose short-term and anonymous identifiers. Apple had a opportunity to offer a better device-level option that had the same privacy but much better efficiency, and yet decided to break APIs and user experience instead, while also entrenching the big companies at the detriment of everyone else.

Re: Bootstrap 5 will remove jQuery as a dependency

#307
post #191

Earlier quoted context omitted.

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.

I think BEM was the point where I decided to give up and accept CSS in my JS.

Re: Bootstrap 5 will remove jQuery as a dependency

#308
post #70

Earlier quoted context omitted.

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

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

[...document.querySelectorAll(el)]

Re: Bootstrap 5 will remove jQuery as a dependency

#309
post #163

Earlier quoted context omitted.

Jquery will fallback to native functions where available and it's feature complete. It doesn't need to have constant commits to still be immensely useful. Its primary purpose was smoothing over browser inconsistencies and it's cached by every major CDN already so using it is likely faster than trying to rebuild and maintain the individual parts separately.

> it's cached by every major CDN already I’ve never found this to be true any time I’ve measured, especially for mobile clients. Small caches with lots of versions and CDNs really cut into the theoretical benefits.

I wish I could find it, but I read an article a while ago that showed how CDN-cached stuff usually, well, isn't. At the very least it's not something to rely on when making decisions about payload size.

Re: Bootstrap 5 will remove jQuery as a dependency

#310
post #82

Earlier quoted context omitted.

Only part of the world is moving to css-in-js. I won't be on the boat leaving for that destination.

Is CSS Modules considered to be "CSS-in-JS"? It does require JavaScript to import the class names, but the stylesheet itself is static. I personally find it to be a great solution to the scoping problem, and combined with Sass it's very flexible. Even theming is a cinch with a single shared Sass file with theming variables, or CSS custom properties. Every CSS-in-JS library I've tried makes everything way too cumberso…

I can't answer your question, but after a lot of experimenting and reading I ended up with styled-components as my preferred solution if I were to go the SPA way.

It allows you to write your CSS inside the backtick js strings (template literals?) and then inserts/removes the relevant CSS as components are loaded/unloaded.

Personally I've gone in an entirely different direction (server-side everything, and simply diffing the HTML on the client when necessary), but if I were to build a proper front-end app, I'd probably go for styled-components.

The main downside is that the stuff needed to parse the css-in-js-string is yet another thing that increases payload size, but for an app it's not too bad.

Post reply on HN