Live data from Hacker News

jQuery 3.0 Released

jquery.com

71–80 of 164 posts

Re: jQuery 3.0 Released

#71
post #44
post #30

Whenever a new version of jQuery (or Zepto) comes along, I wonder what would have happened if web development borrowed a page from other ecosystems and browser runtimes had subsumed the jQuery API, shipping it natively. It's a controversial notion, I'll grant, but what if the DOM APIs had been replaced by "native" jQuery support? Would we have been better off? Worse? Considering the intricacies of standards bodies an…

What version of jQuery exactly? They've made backwards incompatible changes; browsers can't do that.

Right, that is the advantage of having an API layer that the developer (not the web platform) controls. The more we dump into the web platform the bigger it gets because it's nearly impossible to remove anything. The idea of the Extensible Web Manifesto is to provide primitives in the web platform and let people build more powerful abstractions over them in JavaScript.

You could view jQuery as that type of abstraction. If you decide to use some other abstraction (e.g. React) you can switch your web page/app and you aren't paying the cost of having jQuery embedded into the web platform.

Re: jQuery 3.0 Released

#73

Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?

Yup.

> If yes, why not use "vanilla" js?

I can't answer that, but I can answer "Why not use $Framework?"

My current project (a large admin system) is crying out for the more complex parts of the admin UI to be built in React, Angular etc. The problem is it's an all-or-nothing situation.

When picking up a new technology I want to add a little bit to the current project, a bit more to the next, and so on. Progressive Enhancement for the developer. jQuery lets me do that; the frameworks don't.

I have used KnockoutJS in 2 locations in this project; both for a single component on a page which needed to be very dynamic. I have been impressed that it doesn't try and take over, and lets me think of enhancing the experience (and my skills) one component at a time.

Re: jQuery 3.0 Released

#74
post #32

Earlier quoted context omitted.

Well it's 2016 and we still don't have nodeList.forEach() so it can't be much worse.

well we do have for..of that will iterate over a nodeList natively (and now that i'm using let/const i've found myself using for..of a lot more)

jQuery 3.0 lets you do for..of for a jQuery collection even.

Re: jQuery 3.0 Released

#75
post #12

Earlier quoted context omitted.

Yes of course, for new projects now and for the foreseeable. Its terse expressive fluent syntax alone is reason enough to use it for me. Nothing else comes close for ad-hoc dom work, and your user almost certainly has it cached already anyway.

Unfortunately when you score a page for speed things like jq and bs are counted against you when they are likely to be cached. Why don't any scoring systems (that I know of) able to take can asset popularity into account for things like this?

Just as interesting - I'd like to see stats on which CDNs offer the best chance of a warm cache for my visitors - and which versions of various libraries have the best chance of being cached.

Re: jQuery 3.0 Released

#76
post #3

http://youmightnotneedjquery.com/

That page does an excellent job of convincing me to carry on using jQuery.

  if (el.classList)
    el.classList.contains(className);
  else
    new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
vs

  $(el).hasClass(className);

Re: jQuery 3.0 Released

#78
post #73

Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?

Yup. > If yes, why not use "vanilla" js? I can't answer that, but I can answer "Why not use $Framework?" My current project (a large admin system) is crying out for the more complex parts of the admin UI to be built in React, Angular etc. The problem is it's an all-or-nothing situation. When picking up a new technology I want to add a little bit to the current project, a bit more to the next, and so on. Progressive E…

Vue.js is a really great way to add progressive enhancement. Can add it to a single page or even a single element on a page and not effect the rest of the page.

Re: jQuery 3.0 Released

#79

Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?

If it works and you know it, why not? They're still working on it, it's not going away any time soon, and just about everyone who knows JS knows jQuery. This is particularly true is JS is not the core of your application.

Should you write a SaaS SPA in nothing but HTML and jQuery? Probably not.

Should you write the entire application in React just because you want to have a nice fade out effect on alerts and notifications? Definitely not.

Re: jQuery 3.0 Released

#80
post #30

Whenever a new version of jQuery (or Zepto) comes along, I wonder what would have happened if web development borrowed a page from other ecosystems and browser runtimes had subsumed the jQuery API, shipping it natively. It's a controversial notion, I'll grant, but what if the DOM APIs had been replaced by "native" jQuery support? Would we have been better off? Worse? Considering the intricacies of standards bodies an…

querySelector and querySelectorAll exist in browsers only because of jQuery
Post reply on HN