oauth-io / oauth-phonegap

OAuth.io plugin for Apache Cordova/PhoneGap
195 stars 69 forks source link

Dependency on jQuery just for $.ajax #13

Closed Ezku closed 8 years ago

Ezku commented 10 years ago

Hi guys,

I recently had to work around an issue related to this plugin's dependency on jQuery. You're only using the $.ajax portion of it in OAuth.http, so you're mandating that your users take on a pretty heavy dependency for something pretty minimal and non-integral to your use case. Fortunately, this is easily redeemed.

I used xhr-ajax to implement my workaround, and it appears to work perfectly. I'd submit a pull request, but I don't have any idea about your preferred means of bundling dependencies. Hope you can manage to find a solution yourself, but let me know if I can be of assistance.

Cheers, Eevert

bumpmann commented 10 years ago

I agree that it can be a drawback to depend on jQuery, but we wanted to keep the syntax for the requests the closest than $.ajax.

We were thinking about to keep jQuery optional for the main cases, and require it only when using OAuth.http

pre commented 10 years ago

I also vote for not requiring jQuery at all. In my Angular project I have a specific issue with ng-touch: if I include jQuery in my project, ng-touch no longer works as expected.

matti commented 10 years ago

I've managed to keep my apps jQuery free and now this just pollutes my app :/

:+1:

bumpmann commented 10 years ago

Maybe we can only include $.ajax ?

tekmonk commented 10 years ago

You can get away with just using the ajax module from Zepto ( http://zeptojs.com/ ) or another smaller library

bumpmann commented 8 years ago

jquery is included with a lightweighted compilation to include $ ajax in a closure so it's now light and won't pollute the other code.