-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DO NOT MERGE] NFT Grid Performance Changes #13295
base: main
Are you sure you want to change the base?
Conversation
We already use `Image.getSize` to fetching dimensions.
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: d65ad55 Note
Tip
|
…improve-nft-grid-performance
…improve-nft-grid-performance
some SVG images were unbounded allowing them to grow to their full size. This is an issue for android since it can also cause the app to crash if trying to render a massive canvas,
This uses expo image which gives us a nice perf win for collectible media (nfts)
since we are instead replacing this component to use the expo-image version
collectibleIconContainer: { | ||
width: '100%', | ||
aspectRatio: 1, | ||
marginBottom: 10, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some images do not have a size, and collapse to 0. This ensures that we at least give the container a size, so the image can fill it.
flexGrow: 0, | ||
flexShrink: 0, | ||
flexBasis: 97, | ||
aspectRatio: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check this I don't think it is necessary.
import Identicon from '../../UI/Identicon'; | ||
import ComponentErrorBoundary from '../../UI/ComponentErrorBoundary'; | ||
|
||
interface Props { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to keep the interface similar-ish to RemoteImage
.
Honestly that interface is a mess, so I am open to updating this interface to make it a little cleaner and easier to understand.
style, | ||
}); | ||
|
||
const FadeInContainer = useCallback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These containers act similar to the conditionals in RemoteImage
, but just keeps the conditionals contained here.
Gives us a cleaner return JSX output.
Description
We had some issues surrounding the NFT grid on Android.
This fix should help alleviate some of these issues.
useSvgUriViewBox
as this made an expensive call to fetch an SVG. Instead rely on the existingImage.getSize
for dimensions.There are other things we can do (throttling renders, flashlist) but lets see if we can get the list scrolling without crashing first.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist