Skip to content

default-solana-adapter should be optional/peer dependency in @orderly.network/hooks #18

@henrypalacios

Description

@henrypalacios

Problem

@orderly.network/hooks declares @orderly.network/default-solana-adapter as a hard dependency. This forces every consumer — including EVM-only integrations — to download and bundle 242+ Solana packages (@solana/web3.js, @coral-xyz/anchor, @layerzerolabs/*, @metaplex-foundation/*, etc.).

Impact on our EVM-only dapp (Polygon):

  • next build OOM at 4GB heap — had to bump to 6GB
  • Build time 22+ minutes before we stubbed packages out
  • ~15MB of dead code in node_modules we never call

Current workaround

We alias 22 Solana/LayerZero packages to false in webpack and add them to serverExternalPackages:

// next.config.mjs
const solanaStubs = {
  '@orderly.network/default-solana-adapter': false,
  '@solana/web3.js': false,
  '@coral-xyz/anchor': false,
  // ... 19 more
}
config.resolve.alias = { ...config.resolve.alias, ...solanaStubs }

Suggested fix

Move default-solana-adapter to peerDependencies (optional) or optionalDependencies in @orderly.network/hooks. EVM consumers install only the EVM adapter; Solana consumers install only the Solana adapter.

This is standard practice for multi-chain SDKs (e.g., wagmi adapters, Thirdweb chain packages).

Versions affected

Every published version: 2.8.14, 2.10.2, 2.11.0, 3.0.0-beta.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions