openid / AppAuth-JS

JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
Apache License 2.0
977 stars 162 forks source link

[QUESTION] Can we remove the dependencies on hapi, jquery, etc? #49

Closed markphillips100 closed 6 years ago

markphillips100 commented 6 years ago

I've noticed the package.json pulls in libraries that support the nodejs sample app but these dependencies leak into the npm package whether someone is using the library in a situation requiring them or not.

In addition, the xhr.ts file's Requestor class creates a dependency on some JQuery types; JQueryAjaxSettings and $.ajax. I intend to eventually use the library in Angular 5/Ionic 3 so was hoping to not require a JQuery dependency.

Is it possible the JQueryRequestor is not used as a fallback Requestor, at least not in the core code? I'd prefer an error that a Requestor has not been specified rather than couple to a default if possible.

markphillips100 commented 6 years ago

Sorry, I see there's already pull requests about this very question.

tikurahul commented 6 years ago

We only pull types corresponding to the libraries you mentioned. These parts are completely swappable / replaceable depending on what you need.

The final bundle (JS) only contains the actual parts you use. So use a bundler like rollup or babel. If you want more guidance on the how - I can add more documentation.

markphillips100 commented 6 years ago

That's fine. I'm using Ionic which implements its own bundling. I think it uses tree-shaking so should be good.

tikurahul commented 6 years ago

Marking this fixed.