Skip to content

Find strategy to remove libsodium being bundled #1478

@ValarDragon

Description

@ValarDragon

Currently libsodium is brought in for 2 imports:

  • Argon2I
  • Ed25519 key pairs

But neither of these code utilities are used by most apps. I cant even see usage of these within cosmJS. This is causing a large import to appear in our bundles. (190kb gzipped, 500kb after parsing)

I'm new to the JS ecosystem, so these are two options I see right now:

  • Move the libsodium dependency into another package thats not imported everywhere
  • Require libsodium wrappers to be an external dependency, and its up to the caller to include libsodium (https://webpack.js.org/configuration/externals/)

This seems from my (very not robust) testing, to not be handled with tree-shaking in turbo right now, for an app that uses stargate queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions