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

Version 9.0.0 Increased bundle size, probably due to lodash import #878

Closed
ahedenholm-bonn opened this issue Jan 12, 2023 · 7 comments
Closed

Comments

@ahedenholm-bonn
Copy link

Description

When trying to update to 9.0.0 we noticed that the bundle size of jsonwebtoken had increased quite a lot, making a small app of ours exceed a max size limit at a cloud platform.

It seems to us at least that it might be due to importing the whole lodash package in package.json instead of just the functions used, introduced in this commit: ecdf6cc

I realise this doesn't necessarily fit all that well under "bug", sorry in that case.

Reproduction

Here's two screenshots from bundlephobia comparing 8.5.1 vs 9.0.0

8.5.1:
image
image

9.0.0:
image
image

Environment

  • Version of this library used: 9.0.0
@mulfyx
Copy link

mulfyx commented Jan 12, 2023

const {includes, isBoolean, isInteger, isNumber, isPlainObject, isString, once} = require('lodash')

the guys really need lodash for Array#includes and typeof 💀💀💀

@Uzlopak Uzlopak mentioned this issue Jan 12, 2023
4 tasks
@Uzlopak
Copy link

Uzlopak commented Jan 12, 2023

Created a PR #879 which removes lodash with equivalent.

@Uzlopak
Copy link

Uzlopak commented Jan 12, 2023

Also created a PR for removing semver

So I guesstimate, that when those two PRs get merged the bundle size shrinks t 20kb?

@BeenaCelin
Copy link

When can we expect this fix? As our app is impacted in bundled size due to this new version (9.0.0)[our app(edgelambda) is associated with cloudfront viewe request , and the viewer request quota limit is 1 MB for cloudfront. Kindly let us know the ETC for this fix and release

@Uzlopak
Copy link

Uzlopak commented Jan 24, 2023

@BeenaCelin
When I see when the last release before v9 was, I assume that this project is basically unmaintained. Maybe it is worth to switch to fast-jwt?

@rajeev5rhyme
Copy link

@Uzlopak :Are going to release new version of jsonwebtoken with shrinked loadash size? Is jsonwebtoken and fast-jwt has same feature?

@Uzlopak
Copy link

Uzlopak commented Feb 14, 2023

I am not a maintainer of jsonwebtoke and i dont want to fork and release a patched version.

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