Lazy fetching of diff view lines
diffs.json returns lines data for both inline and parallel diff view at the same time.
This makes the JSON bigger, therefore, it takes more time to fetch the data. Also, it doubles the data we store in Vuex store and it's not efficient in terms of performance and memory usage.
diffs.json endpoint to support
view parameter which could be
parallel and it will only return the respective diff lines by the given parameter.
With this approach, we will need to make another request when we switch the diff view type, but that's something we should do to increase the performance of the MR page. Also, switching diff view mode is not a very common action. Previous implementation before the MR diffs refactor was reloading the page but this new approach will show a spinner while fetching the data. So in the end, it will have better UX compared to old version.