cmd-johnson / deno-oauth2-client

Minimalistic OAuth 2.0 client for Deno.
MIT License
45 stars 9 forks source link

suggestion: Move OAuth2ClientConfig interface into src/types.ts #38

Open jollytoad opened 11 months ago

jollytoad commented 11 months ago

To allow a consuming project to utilitize the config type without pulling in the full dependency of the OAuth2Client.

This could be completely backwards compatible by re-exporting the type from the oauth2_client.ts

Happy to submit PR if you are open to this.

iuioiua commented 11 months ago

This is a server-side module. A server downloading the whole module of 33 KB is negligible. This would be a different story if this were a client-side module where dependency sizes have a tangible effect. While this would be nice to have, this is not something to be concerned about.

jollytoad commented 11 months ago

They all add up, and it's not so much about the size but the complexity of dependencies. Deno provides a very simple way to keep a dependency tree as clean as possible, by importing only exactly what you absolutely require, we should embrace it, it's the main advantage over the npm dependency hell.

If want to write functions that reference the OAuth2ClientConfig type, then I want just that, and not the whole implementation, and there is no reason I shouldn't be able to do that if types are just exported separated, it's a pretty easy thing for a library to do, and doesn't break compatibility.

cmd-johnson commented 11 months ago

Sounds reasonable

I'll add this change to the PR with the OIDC implementation (#39), since it already includes a refactoring of the OAuth2Client class.