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

GlobeIcon SVG is largest gzipped file in distributed library #6142

Open
alecananian opened this issue Feb 2, 2025 · 2 comments
Open

GlobeIcon SVG is largest gzipped file in distributed library #6142

alecananian opened this issue Feb 2, 2025 · 2 comments
Labels
Enhancement An improvement on existing functionality with no modifications to the public API.

Comments

@alecananian
Copy link
Contributor

When importing just the basics of the Thirdweb SDK into a Next.js app

<ThirdwebProvider>
  <ConnectButton ... />
</ThirdwebProvider>

and analyzing the bundle via @next/bundle-analyzer, it shows that the single largest file in the gzipped distributed library is GlobalIcon.js (44Kb).

Image

It contains the GlobeIcon component, an SVG used only in the start screen of the connect wallet flow:

I suggest considering dynamically importing it, hosting it remotely, or if it's not an official brand asset, changing to a less complex icon. Heroicons example is less than 1Kb:

Copy link

linear bot commented Feb 2, 2025

@MananTank
Copy link
Member

Hey @alecananian Thanks for reporting this!

The GlobalIcon is rendered in the first screen shown to the user in ConnectButton's Modal component - so its important for that icon is available immediately.

Using a dynamic import it or fetching it from CDN introduces additional delay so we can not go with those approaches - however we can definitely replace it with a much smaller SVG

@MananTank MananTank added the Enhancement An improvement on existing functionality with no modifications to the public API. label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An improvement on existing functionality with no modifications to the public API.
Projects
None yet
Development

No branches or pull requests

2 participants