utils icon indicating copy to clipboard operation
utils copied to clipboard

Consider adding exports for individual files

Open mcmire opened this issue 1 year ago • 0 comments

As time has grown, this package has grown to include a lot of different types of utilities. That's great, but at the same time, the size of this package has grown as well:

Some projects may only need one or two utilities and may not wish to import this entire package to get them. If we get to a point where both extension and mobile support tree-shaking, then we don't have to worry about unnecessarily bloat, but in the meantime, we might consider creating an export for each file in the src/ directory (minus node.ts, which we've already done).

Before we go down this path, however, we should verify that this indeed would be a viable solution — i.e., that if we create a file-specific export, a project which uses this import would add far less to that project than it would in importing all of @metamask/utils.

mcmire avatar Jan 23 '24 21:01 mcmire