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

feat(hub): update loading times of tokens for swaps and pools #266

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

BrownBrownBear
Copy link
Contributor

This is what we were talking about on friday with a new avatar component that could load base64 items. Tokens with a base64 parameter should load instantly and our token list should be loaded faster on the swaps page.

I can make the time to load remote tokens quicker that are PNGs or other formats since we are sending in the list via the server page by removing a loading prop in the component. HOWEVER, if images have incorrect URLs or there's not a good internet connection, this can cause a broken image to show up and we won't be able to show a fallback. Server Components in Next.js run entirely on the server and are not tied to browser-side lifecycle events like onLoad or onError. Such callbacks are inherently client-side concepts because they rely on events occurring in the browser.

I thought this was a happy medium. I can also see us running into an issue in the future of this default list getting too big.
The performance impact of string serialization can be problematic and we're sending a huge list down from a server component to a clientside component.

We can always try

  • Reducing the size of the token list file so we get base64 data only.
  • Loading the token list data dynamically on the client side like we're currrently doing

Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:54pm
v2-honey ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:54pm
v2-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:54pm
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
bartio-dex ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm
bartio-honey ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm
bartio-lend ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm
bartio-perps ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm
bartio-station ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm
berajs-docs ⬜️ Ignored (Inspect) Dec 16, 2024 10:54pm
v2-bend ⬜️ Ignored (Inspect) Dec 16, 2024 10:54pm
v2-berps ⬜️ Ignored (Inspect) Dec 16, 2024 10:54pm
v2-dex ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:54pm

.scripts/vercel-local-install.sh Show resolved Hide resolved
apps/hub/src/app/layout.tsx Show resolved Hide resolved
.scripts/set-local-install.js Show resolved Hide resolved
packages/shared-ui/src/token-icon.tsx Show resolved Hide resolved
packages/berajs/src/hooks/useTokens.ts Show resolved Hide resolved
packages/ui/src/custom-avatar.tsx Show resolved Hide resolved
packages/shared-ui/src/token-icon.tsx Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants