xrpl.js icon indicating copy to clipboard operation
xrpl.js copied to clipboard

Make xrpl.js more modular

Open tequdev opened this issue 1 year ago • 2 comments

Currently xrpl.js (xrpl) is a big code, including Client and Wallet.

Even if you use only xrpl utils on the front end, it still contains Client and Wallet code.

The same goes if you want to use only the ledger or transaction models.

For example, how about splitting the code as follows?

@xrpl/wallet @xrpl/client @xrpl/models @xrpl/utils

tequdev avatar May 05 '23 03:05 tequdev

I completely agree. We will try to come up with a proposal for a more modular design and present it to the community.

ckniffen avatar May 08 '23 23:05 ckniffen

In analyzing your request the largest problem seems to be bundle size of xrpl.js. We discovered that we can address this with relatively few breaking changes. That work has culminated in xrpl 3.0 having a 50-65%+ file size reduction in the official bundle.

This was done through cleaning up dependencies and polyfills. If your own code relies on these previously required polyfills you will not see such a drastic reduction but in our tests this is about a reduction of 300kb gzipped.

The focus of 4.0 will be then be to further reduce bundle size by further focusing on tree-shaking and modularization.

ckniffen avatar Aug 14 '23 22:08 ckniffen