Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer Single Exports Over oauth #49

Open
harlan-zw opened this issue Feb 7, 2024 · 1 comment
Open

Prefer Single Exports Over oauth #49

harlan-zw opened this issue Feb 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@harlan-zw
Copy link
Contributor

harlan-zw commented Feb 7, 2024

Currently, users will set up their endpoints by accessing one of the oauth.*.

export const oauth = {
  githubEventHandler,
  spotifyEventHandler,
  googleEventHandler,
  twitchEventHandler,
  auth0EventHandler,
  microsoftEventHandler,
  discordEventHandler,
  battledotnetEventHandler,
  keycloakEventHandler,
  linkedinEventHandler,
  cognitoEventHandler
};

This works and the auto-completion is nice but I think it can be improved:

  • treeshaking afaik won't work as all providers are within the same const, meaning we will bundle all providers (which will grow)
  • oauth seems likely for collisions in global import namespace

Exporting each provider as its own function should fix tree shaking and namespace problems, i.e authGoogleEventHandler where autocompletion should be good.

@Atinux Atinux added the enhancement New feature or request label Feb 17, 2024
@Atinux
Copy link
Owner

Atinux commented Feb 17, 2024

Agree with you, I though about it as well at first and forgot about treeshaking.

Will be a breaking chance then, adding it for next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants