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

perf: replace jsonwebtoken with jose #8217

Open
wants to merge 2 commits into
base: beta
Choose a base branch
from

Conversation

andershermansen
Copy link
Contributor

The jose package has 0 dependencies and is tree shakable ESM.
So we get lower bundle size and get rid of 10 dependencies.

The jose package has 0 dependencies and is tree shakable ESM.
So we get lower actual bundle size and get rid of 10 dependencies.
@andershermansen
Copy link
Contributor Author

@AlessioGr On the quest for lower bundle size this will reduce payload bundle size from 4,008 KB to 3,824 KB (4.6% reduction).

In addition there are some security concerns with the lodash packages included in jsonwebtoken. Ref the comment here: auth0/node-jsonwebtoken#933 (comment)

All in all jose seems more modern, updated and is ESM. I have used it successfully in other projects instead of jsonwebtoken.

I have also checked that the generated token with my change is same as before using the debugger on https://jwt.io/

@AlessioGr AlessioGr self-assigned this Sep 14, 2024
@jmikrut
Copy link
Member

jmikrut commented Sep 15, 2024

Hey @andershermansen good PR! We will review shortly. I think we will be able to merge it.

THANK YOU!!!

@andershermansen
Copy link
Contributor Author

@jmikrut @AlessioGr Any concerns about the change? Or just still waiting for code review?

@AlessioGr
Copy link
Member

No concerns atm, just need to find time to review

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

Successfully merging this pull request may close these issues.

3 participants