-
Notifications
You must be signed in to change notification settings - Fork 128
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
optimize: SDK bundle size by ~100kb #478
optimize: SDK bundle size by ~100kb #478
Conversation
🦋 Changeset detectedLatest commit: cdc7c61 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
Hey, could you please revert all changes to the package.json and add a changeset instead? There's a comment above from the changeset bot that contains the instructions :) |
7db6ff1
to
5a24667
Compare
Appreciate the fast reply @mmv08. Changeset has been added. |
Hey all, just wondering what the latest was on this PR? |
@hammeiam PR waiting review. Feel free to subscribe to PR to get updates as we progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
when can we expect this to ship? it seems like it's been approved 2 weeks ago |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
We use Safe Wallet SDK in our commercial Web3 application.
The main problem thus far has been huge bundle size.
After deeper investigation, I found out that inside SDK whole
ethers
package was imported.Moreover,
ethers
itself isn't architected in the way so it can be tree shaken.Given that SDK only uses
ethers
in a few places (message hashing and function data encoding), I've decided to migrate to alternativeviem
which comes with much better TypeScript support and most importantly, the whole package is 3x smaller and optimized for tree shaking.After testing these changes in our production, we experienced a significant drop from 504kb to 359kb in bundle size.
I expect other apps to have similar result. (100 - 150kb drop depending on bundler configuration)