feat: Add lazy loading for token list requests#823
Open
C0mberry wants to merge 9 commits intosolana-foundation:masterfrom
Open
feat: Add lazy loading for token list requests#823C0mberry wants to merge 9 commits intosolana-foundation:masterfrom
C0mberry wants to merge 9 commits intosolana-foundation:masterfrom
Conversation
|
@C0mberry is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile OverviewGreptile SummaryThis PR improves performance by batching token info requests instead of fetching them individually, and adds lazy loading via Suspense for the AccountsCard component. Key Changes:
Critical Issues Found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant PageClient as page-client.tsx
participant TokenBatch as TokenBatchProvider
participant TokenAPI as Token List API
participant AccountsCard
participant AddressComp as Address Component
User->>PageClient: View transaction page
PageClient->>PageClient: Extract accountAddresses from message
PageClient->>TokenBatch: Initialize provider with cluster and addresses
activate TokenBatch
TokenBatch->>TokenBatch: useEffect triggered on mount
TokenBatch->>TokenAPI: POST batch request for all token addresses
TokenAPI-->>TokenBatch: Return token info array
TokenBatch->>TokenBatch: Build tokenMap from results
deactivate TokenBatch
PageClient->>AccountsCard: Render with Suspense wrapper
activate AccountsCard
AccountsCard->>AddressComp: Render address with fetchTokenLabelInfo
activate AddressComp
AddressComp->>AddressComp: Call useTokenInfo hook
AddressComp->>TokenBatch: Call useTokenBatch via try-catch
TokenBatch-->>AddressComp: Return context with getTokenInfo method
AddressComp->>TokenBatch: Call getTokenInfo with pubkey
TokenBatch-->>AddressComp: Return cached token from tokenMap
AddressComp->>User: Display token label
deactivate AddressComp
deactivate AccountsCard
|
rogaldh
reviewed
Jan 26, 2026
Contributor
|
Another thing about batching is that it may fail in the future. With
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
36a0a05 to
1f13c89
Compare
a71bf07 to
9e7d6c6
Compare
rogaldh
reviewed
Feb 3, 2026
rogaldh
reviewed
Feb 3, 2026
61973bc to
6a6a25e
Compare
askov
reviewed
Feb 12, 2026
* add lazy laoding and batch requests * codestyle fix * removed useless comment
4ddb9e9 to
2aef8a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Type of change
Screenshots
Testing
Related Issues
HOO-214
Checklist
build:infoscript to update build information