Prefetch data for file when onscreen
What does this MR do?
Relates to: #26693 (closed)
This MR quietly prefetches data for a diff file once it is visible onscreen. The idea is to make expanding diffs more responsive. Since some larger files can take several seconds to be fetched the user will be stuck waiting for a loading screen until the data is available.
Screenshots
Before with loading icon:
Screen_Recording_2020-03-01_at_11.37.53_PM
After no loading icon:
Screen_Recording_2020-03-01_at_11.40.27_PM
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
One concern I have is the potential increased load on gitlab.com from extra "unnecessary" requests. This MR optimistically fetches data for files that may not be clicked on, therefore the data request is unnecessary. I lack the tools to determine how impactful this might be.