Skip to content

Performance: Reduce waterfall fetching by making repo and resolvedRev optional

Warren Gifford requested to merge tr/stop-waterfall-fetching into main

Created by: umpox

Actions before merging this PR:

  • Fix TS errors where repo or resolvedRev are now undefined
  • Remove any more code that blocks rendering if repo or resolvedRev are undefined
  • Use repoName and revision from URL (parseBrowserRepoURL) in components instead of waiting for these queries.
    • E.g., here we do this for the fetchBlob query.
    • Check that this is OK, with code intel. That there are no issues with doing this. The only one I can think is if our backend expects a specific commit ID or something, and we don't have that because the URL only contains a branch, or nothing.

Description

Makes repo and resolvedRev optional.

  • Components should try to render as much as they can to improve perceived perf here
  • Queries such as fetchBlob should use the URL as a source of truth rather than the output of this query for improved perf.

Screenshots

Before

https://user-images.githubusercontent.com/9516420/184105613-fdbce4e4-c94d-452f-99f4-ab8827ea1b3e.mp4

After

https://user-images.githubusercontent.com/9516420/184105651-e879e9a0-e8bd-4de5-b2c7-961bd386779d.mp4

Test plan

Merge request reports

Loading