Parallelize SSR fetches on the Popular page#2418
Merged
Simek merged 1 commit intoreact-native-community:mainfrom Apr 29, 2026
Merged
Parallelize SSR fetches on the Popular page#2418Simek merged 1 commit intoreact-native-community:mainfrom
Simek merged 1 commit intoreact-native-community:mainfrom
Conversation
Same pattern as react-native-community#2416, applied to pages/popular.tsx which was awaiting twelve ssrFetch calls sequentially in getInitialProps, then awaiting each .json() one at a time. Fan them out with Promise.all so the requests collapse into a single roundtrip's worth of latency.
Simek
approved these changes
Apr 29, 2026
Member
Simek
left a comment
There was a problem hiding this comment.
Thanks for the follow up, LGTM! 🚀
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.
Summary
pages/popular.tsxwas awaiting twelvessrFetchcalls sequentially ingetInitialProps(one per platform), then awaiting each.json()one at a time. The fetches don't depend on each other.Promise.allfor both the requests and the JSON parses.Test plan
bunx oxlint pages/popular.tsx— cleanbunx oxfmt --check pages/popular.tsx— cleanbun startand load/popularlocally; dev-server log shows all twelve/api/libraries?...requests issued in the same window instead of stacked sequentially. Warm renders return in ~26ms with all twelve API calls completing in ~15ms each, in parallel. No runtime errors.