snaps icon indicating copy to clipboard operation
snaps copied to clipboard

Restructure packages

Open Mrtenz opened this issue 2 years ago • 0 comments

In the current situation snaps-rpc-methods, snaps-controllers, snaps-utils, etc., are heavily coupled together. snaps-controllers exports functionality from snaps-rpc-methods, snaps-types exports from numerous packages, and so on. This results in all of these packages being included in Snap bundles as well.

Some ideas:

  • Move Node.js-specific exports to a /node entrypoint (e.g., @metamask/snaps-utils/node). See @metamask/utils for example.
  • Extract execution services (currently in snaps-controllers) into a separate package, and export the Node.js execution services from a separate entrypoint.
  • Reconsider the snaps-types and snaps-rpc-methods structure, to maybe remove the dependency from snaps-types on snaps-rpc-methods.
  • Separate utils that we expect snaps devs to internal-only utils. Maybe we can introduce a snaps-internals package.

We need to design a new architecture for these packages.

Mrtenz avatar Oct 18 '23 10:10 Mrtenz