feat(hub): update loading times of tokens for swaps and pools #266
+319
−85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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