Live data from Hacker News

jQuery 3.0 Released

jquery.com

31–40 of 164 posts

Re: jQuery 3.0 Released

#31
post #8

Earlier quoted context omitted.

So far every new project in the last few years ended up using jQuery because there is always this one ui widget that does what we need and the other libraries just aren't there yet and its not worth the hassle of reimplementing or extending a different library just to not use jQuery.

True. Although whenever I see a jQuery plugin like that I try to replace it with some combination of "components" [1]. There is a lot of progress in that area. There are stuff like : File picker [2], dropdown [3], tip [4] for tooltips and many more. 1 : https://github.com/component 2 : https://github.com/component/file-picker 3 : https://github.com/component/dropdown 4 : http://component.github.io/tip/

The dropdown and tooltips look useful, but FYI it's really simple to make a file picker. Just put a hidden input type="file" on the page, then:

    document.getElementById("that-element").addEventListener("change", function(e) {
        // e.target.files
    });
    document.getElementById("that-element").click();

Re: jQuery 3.0 Released

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

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

Re: jQuery 3.0 Released

#33
post #26

Earlier quoted context omitted.

True. Although whenever I see a jQuery plugin like that I try to replace it with some combination of "components" [1]. There is a lot of progress in that area. There are stuff like : File picker [2], dropdown [3], tip [4] for tooltips and many more. 1 : https://github.com/component 2 : https://github.com/component/file-picker 3 : https://github.com/component/dropdown 4 : http://component.github.io/tip/

What is this "components"? I can't find anywhere that explains what it is. Is it just a random collection of javascript utilities?

It's an isolated collection of HTML, js, and scss to achieve a thing. Like a credit card payment form.

They're mainly for react, though other platforms have them (eg, I use 'ractive', from the guardian, which has its own component model).

Go check out npm, there are a while bunch of react components you can just pick up and use.

Re: jQuery 3.0 Released

#34
post #32
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…

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)

Re: jQuery 3.0 Released

#37

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

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

Isn't that like asking why jQuery exists?

Personally I still believe that JavaScript and HTML should be separate, like HTML and CSS. I know that might make sound old, but I really dislike having a template language embedded in my JavaScript library, and as a result I end up disliking most of the newer frameworks.

I know jQuery, the documentation is good, it's easy to get help, and it makes sense to me in a way React, Angular and others frameworks do not.

Yeah, I could use plain JavaScript, I could also just use Python and not have a Django or Flask dependency. It's just easier and more productive to take the dependency.

Re: jQuery 3.0 Released

#38
post #12

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

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?
Post reply on HN