Parallelize SSR fetches on the home page#2416
Merged
Simek merged 1 commit intoreact-native-community:mainfrom Apr 29, 2026
Merged
Parallelize SSR fetches on the home page#2416Simek merged 1 commit intoreact-native-community:mainfrom
Simek merged 1 commit intoreact-native-community:mainfrom
Conversation
The home page was awaiting five ssrFetch calls sequentially in getServerSideProps, then awaiting each .json() one at a time. Fan them out with Promise.all so the waterfall collapses into a single roundtrip's worth of latency.
Simek
approved these changes
Apr 29, 2026
Member
There was a problem hiding this comment.
Hey @azizbecha, thanks nice catch and improvement! 👌
We already use parallel promises for package pages fetches, but I have missed this on the home page.
Would you be interested in optimizing also the Popular page fetches? Can be done in a separate PR.
3 tasks
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/index.tsxwas awaiting fivessrFetchcalls one after another insidegetServerSideProps, then awaiting each.json()sequentially. The fetches don't depend on each other.Promise.allfor both the requests and the JSON parses, so the waterfall collapses into a single roundtrip's worth of latency on the home page.Test plan
bunx oxlint pages/index.tsx— cleanbunx oxfmt --check pages/index.tsx— cleanbun startand load/locally; dev-server log shows the five/api/libraries...requests issued in the same window (~470ms each, overlapping) instead of stacked sequentially. Warm renders return in ~24-185ms with all five API calls completing in ~5-15ms each, in parallel. No runtime errors.