Earlier quoted context omitted.
Right you are. But jQuery is around the same size as Vue, and that's the lean alternative to React. So the “jQuery is bloat” argument still doesn't make much sense. A single retina hero banner is larger than most JavaScript libraries/frameworks.
A lean alternative to React would be preact.
jQuery 3.6.0
231–240 of 292 posts
Re: jQuery 3.6.0
#232Earlier quoted context omitted.
I'm exactly arguing against this Webpack, Typescript, React, etc approach to web development. I'm more productive in PHP + jQuery, a lot due to familiarity, of course, but I'm also a huge believer in a simple stack. If you've 20+ mutually dependent inputs, maybe you need a better UI, not a complex state management framework. If your browser is ultimately executing an untyped crazy dynamic language, is it worth trying…
> It all seems so crazy to me, but this ship has long sailed. Nope. And it's why Svelte is something that I've been hard adopting because it looks the closest to old-school JS/CSS/HTML while still bringing some of the same capabilities over that I love from React and VueJS. It also runs without a VDOM or a constantly running event loop - both things are incredibly attractive to me. Although it's not a perfect solutio…
I can't think of a single framework that does this, (its neigh impossible, actually, it'll just lock up your browser)
Svelte is cool, but this statement needs some serious proof
Re: jQuery 3.6.0
#233Earlier quoted context omitted.
That argument stands true for most frameworks on most platforms. I prefer the dollar sign; it's pervasive and concise.
I disagree. There's nothing about React, Vue or any other framework that I'm aware of that does anything similar to jQuery's dollar sign. The only magically-looking abstraction I can think of is JSX, and that's not only not mandatory but very obviously something that's off the curve. Unlike the dollar sign, which just looks like a special construct of the language.
Re: jQuery 3.6.0
#234Earlier quoted context omitted.
>most likely already cached from CDN. I don't believe any major browser allows sites to share 3rd party caches anymore. Previous HN discussion: https://news.ycombinator.com/item?id=24894135
True, there is still a perf win however since CDNs are located geographically closer to a global consumer than keeping the libs on your own box.
Re: jQuery 3.6.0
#235Earlier quoted context omitted.
I'm trying to wean off of jQuery to reduce dependencies, but it makes me appreciate jQuery all the more. The native JS API is quite a bit more verbose and cumbersome to use, and my absolute biggest gripe with it is that it doesn't even build on modern JS features. It's not compatible with for...of, map, filter, find, etc, which seems really strange for a relatively recent vanilla JS API. Ironically, http://youmightno…
You can easily extend NodeList.prototype with Array.prototype functions you like, and then just use them: ['map', 'find'].forEach(f => NodeList.prototype[f] = Array.prototype[f]); document.querySelectorAll('bla').map(el => whatever) That's what prototypes are for, anyway.
['map', 'find', 'filter', 'reduce'].forEach(f => NodeList.prototype[f] = Array.prototype[f])
// this is for for..of, cannot be above 'map', 'filter' etc.
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]
document.querySelectorAll('span').map(el => console.log(el))
document.querySelectorAll('span').filter(el => el.className === 'fc-black-500').reduce((acc, el) => (acc += el.className, acc), '')
for(let p of document.querySelectorAll('p')) { console.log(p) }
- https://stackoverflow.com/questions/30836289/for-of-loop-que...Re: jQuery 3.6.0
#236Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…
Re: jQuery 3.6.0
#237Earlier quoted context omitted.
You don't have to use all of it though, right? You can choose to only only use the applicable parts: eg: ``` $('.container-element') .addClass('active'); // vs document.querySelectorAll('.my-class-selector') .classList.add('active') ``` I use the native APIs all the time, they are not that complicated or overly verbose. Easily memorized with practice IMHO. Also they are all extremely well documented on MDN.
Technically that breaks, you want: document.querySelectorAll('.my-class-selector').forEach(el => el.classList.add('active')) Personally I use the native APIs because they aren't that hard to use (most of them, anyways) and I tend to be OCD about bundle sizes, but to each their own, I suppose.
So you need to be careful about writing code like that if you want to avoid jQuery.
Re: jQuery 3.6.0
#238Earlier quoted context omitted.
I disagree. There's nothing about React, Vue or any other framework that I'm aware of that does anything similar to jQuery's dollar sign. The only magically-looking abstraction I can think of is JSX, and that's not only not mandatory but very obviously something that's off the curve. Unlike the dollar sign, which just looks like a special construct of the language.
Svelte uses the dollar sign. https://svelte.dev/tutorial/reactive-declarations
Re: jQuery 3.6.0
#239Earlier quoted context omitted.
Right you are. But jQuery is around the same size as Vue, and that's the lean alternative to React. So the “jQuery is bloat” argument still doesn't make much sense. A single retina hero banner is larger than most JavaScript libraries/frameworks.
> and that's the lean alternative to React. Ahem https://preactjs.com/
Re: jQuery 3.6.0
#240I'm a happy jQuery/Bootstrap user @ https://forwardemail.net . The site scores ~100% on Lighthouse and PageSpeed Insights and is ranked #1. Open-startup @ https://forwardemail.net/open-startup ! Completely open-source too @ https://github.com/forwardemail
From your FAQ > No. Prices will never increase. Unlike other companies, we will never shutdown our service either. How can you guarantee this?
Their price completely covers every user signed up at any scale. If they lose all but 1 customer, that customer can keep the lights with just their subscription.
The other is that company has such a large warchest it'd be impossible to run out of money.