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

Consider outputting ESM #378

Open
4 tasks done
acidoxee opened this issue Oct 5, 2023 · 2 comments
Open
4 tasks done

Consider outputting ESM #378

acidoxee opened this issue Oct 5, 2023 · 2 comments

Comments

@acidoxee
Copy link

acidoxee commented Oct 5, 2023

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

The current package is CJS-only. The package itself isn't that heavy, but it being in CJS has the downside of also pulling all transitive dependencies as CJS, despite some of them providing ESM entrypoints (including the heaviest dependency, jose).

Describe the ideal solution

It would be great if jwks-rsa were a dual CJS/ESM package, with "real" entrypoints for each (not just a thin wrapper of the one around the other). ESM consumers would be able to leverage proper tree-shaking of not only jwks-rsa, but also of its transitive dependencies that provide ESM entrypoints like jose, which are incredibly heavy in CJS and would be way lighter in ESM.

Alternatives and current workarounds

No response

Additional context

No response

@adamjmcgrath
Copy link
Contributor

Hi @acidoxee - thanks for raising this

We don't have any plans to convert this package to dual CJS/ESM, but I'll leave this open as an enhancement in case anyone wants to raise a PR

@acidoxee
Copy link
Author

Hey @adamjmcgrath, I've just submitted #380 which I believe addresses a good portion of the migration towards dual CJS/ESM. There's still some work to do to fix existing (but until then, masked/missed) typing errors, fix examples and update the README and changelog to advertise for the potential breaking change.

I'll let you check the PR itself, and if you have time to review it I'd be happy to try and finish it with you or other maintainers, since it would progress quicker with your inputs and help 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants