1.0.0-experimental.f9b30bb • Published 5 months ago

@mcintyre94/web3.js-legacy-sham v1.0.0-experimental.f9b30bb

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

npm npm-downloads semantic-release code-style-prettier

@solana/web3.js-legacy-sham

This package is a drop-in replacement for a subset of the version 1.x @solana/web3.js interfaces. Its goal is to satisfy the legacy interfaces with as little code as possible.

If you depend on web3.js directly then you should not use this. Instead, migrate to version >=2 of @solana/web3.js.

On the other hand, if you depend on the legacy library transitively through a dependency that you don't control, you can use this sham to satisfy those libraries' dependency on the legacy web3.js interfaces with fewer bytes of JavaScript code.

Usage

  1. Install the library into your project
    npm install --save @solana/web3.js-legacy-sham
  2. Override your dependencies' dependency on the legacy library in your package.json. As an example, imagine that you wish to override the Metaplex token metadata library's dependency on the legacy web3.js.
    • Using pnpm overrides
      "pnpm": {
        "overrides": {
          "@metaplex-foundation/mpl-token-metadata>@solana/web3.js": "npm:@solana/web3.js-legacy-sham"
        }
      }
    • Using npm overrides
      "overrides": {
        "@metaplex-foundation/mpl-token-metadata": {
          "@solana/web3.js": "npm:@solana/web3.js-legacy-sham"
        }
      }
    • Using yarn resolutions
      "resolutions": {
        "@metaplex-foundation/mpl-token-metadata/@solana/web3.js": "npm:@solana/web3.js-legacy-sham"
      }