r/angularjs • • Jan 31 '14

You might need jquery.

https://gist.github.com/rwaldron/8720084#file-reasons-md
19 Upvotes

9 comments sorted by

8

u/thisisafullsentence Jan 31 '14

Ok so jQuery takes into account some pretty incredible cross-browser idiosyncrasies.

But take into account some people who might not need jQuery:

  • AngularJS: ships with jqLite, which already covers most of the basic DOM traversal, etc. of jQuery.

  • Mobile HTML5 developers: the footprint just might not be necessary, especially considering modern mobile browsers have support for beautiful CSS3, hardware-accelerated animations.

  • No need for graceful degration: some may make functional websites using CSS3 animations without the use of JS.

I'll have full disclosure. After developing probably around 100 websites, ranging from brand awareness to social applications, I've only used 1 website without jQuery! (See first point)

But I can imagine that as I develop more Angular applications, using the full jQuery library is just not necessary.

1

u/ehutch79 Feb 01 '14

Isn't there a stripped down jQuery inside angular? It should cover the most of the common stuff jQuery does.

1

u/the_good_time_mouse Feb 02 '14

In other words you might not need jquery if you use angular, because it contains jquery.

Well, a version of it.

2

u/thisisafullsentence Feb 01 '14

Absolutely. It's called jqLite and it covers most of the basic things. Angular has deep integration with directive binding, element repeating, etc.

From the docs:

jqLite is a tiny, API-compatible subset of jQuery that allows Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most commonly needed functionality with the goal of having a very small footprint.

1

u/ivjames Feb 01 '14

One of the main reasons Angular uses jqLite is the cross-browser aspect.

jqLite chases jQuery, so you still need jQuery even if you're not using the full install.

2

u/thisisafullsentence Feb 01 '14

The reason jqLite ships with Angular is so that you do not need jQuery. You are absolutely welcome to "upgrade" jqLite to jQuery, but using Angular's methods of directive binding, element repeating, etc., is more deeply ingrained into the Angular ecosystem than jQuery will be. They are 2 separate libraries.

2

u/ivjames Feb 02 '14

They are, but jqLite strives to maintain compatibility with jQuery, not the other way around. You may not need to use jQuery, but it drives the feature set of jqLite. That's what I meant, but failed to say.

1

u/[deleted] Feb 01 '14

Exactly. For me, I just don't want to think that hard. I want to get shit done.

1

u/thisisafullsentence Feb 01 '14

I agree with you - I don't think that I should need to learn every single cross-browser obscurity. That's why jQuery makes it so easy to just develop once, and not think about every browser.