Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Constructors (Tree-Shaking) #740

Open
ScottyPoi opened this issue Feb 24, 2025 · 0 comments
Open

Static Constructors (Tree-Shaking) #740

ScottyPoi opened this issue Feb 24, 2025 · 0 comments

Comments

@ScottyPoi
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant