Skip to content

Static Constructors (Tree-Shaking) #740

@ScottyPoi

Description

@ScottyPoi

All static constructors in EthereumJS packages were removed as part of tree-shaking optimizations.

Ultralight's portalnetwork package contains several static constructors. PortalNetwork.create is a big one, but also uTP packet constructors Packet.from... and possibly more.

To follow the optimization pattern executed in the EthJS packages, we would replace these static constructors with an exported function. For example, in the PortalNetwork class, public static create = async (...) => {...} would be replaced with export async function createPortalNetwork(...) {...} with the same internal logic, and moved to a new file client/constructor.ts

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