Performance: Reduce waterfall fetching by making repo and resolvedRev optional
Created by: valerybugakov
Status
WIP: going through Typescript errors and testing affected pages.
WIP: testing affected pages and simplifying Typescript types. Ready for functional review and early feedback.
The main-dry-run
CI build is here.
Context
Main ideas behind this PR:
- Make
repo
andresolvedRev
optional for components like theBlobPage
. Render these components earlier to start their network requests like thefetchBlob
query earlier and, as a result, render the blob view faster. - Merge
fetchRepository
andresolveRevision
GraphQL queries into one query to improve the network waterfall. Let me know if you know why it's a bad idea! We discussed this question with @mrnugget and didn't find any obvious blockers. See the relevant Slack thread.
Based on @umpox's draft PR https://github.com/sourcegraph/sourcegraph/pull/40244
Test plan
- Open web application locally.
- Navigate between all possible repo pages (e.g., blob view, commits, tags, settings, etc.)
- Test history API navigation for these pages (clicking links) along with full page refreshes.
- Try adding a new repo that takes time to clone, and try opening the repo page.
App preview:
Check out the client app preview documentation to learn more.