Replies: 3 comments 2 replies
-
I should add, if folks are generally supportive of this idea I'm happy to make the needed changes to aes-js and ethers (if any are needed there). |
Beta Was this translation helpful? Give feedback.
-
I think the I am planning to refactor aes-js into TypeScript and use modules (and remove the encoding libs; there are better libraries in ethers for people who need that ;)) so a thinner subset of features can be pulled in. :) |
Beta Was this translation helpful? Give feedback.
-
I also think they are only available in a secure context? Which would break them entirely for people using local tools and in development environments. But I’m not sure about that, and would require some experimentation to see where they do and don’t work… |
Beta Was this translation helpful? Give feedback.
-
Summary
The json-wallet package uses aes-js, which adds ~40Kb to ethers projects bundle size. Adding a browser-specific target to aes-js could reduce that to near 0 for browser bundles.
Details
This may be more relevant to the aes-js lib but I think discussion here highlights the value of the change. And also @ricmoo created both libs anyway 😉
The aes-js lib could be split based on the target environment in order to significantly reduce the size for browser targets, where size matters most. This can be done by creating a new
browser
target to the package.jsonwhich points to a small shim instead of the main lib. The shim would wrap the browser-native
crypto.subtle
api. Note, theexports
package.json field would work too, either way.Beta Was this translation helpful? Give feedback.
All reactions