New re-usable component for Blob File Content
Technical discover: #196712 (comment 271152500)
Relevant for at least the following components:
View | Screenshot |
---|---|
Snippet | |
File | |
Diff |
However, the way we present information in Diff, even though might look similar, is technically completely different under the hood. Existing app/assets/javascripts/diffs/components/diff_content.vue
component is much more complex than needed for Snippets and Files. It is very tightly coupled with the functionality of the Diffs to the point of being not-practical and irresponsible to make it work for Snippets and Files. However, since we have at least two places that would benefit from rendering the blob in the same manner, it makes sense to generalize it and abstract it into a new component.
Doesn't make a lot of sense
- New
shared
component in GitLab itself. - Why not to re-use
app/assets/javascripts/diffs/components/diff_content.vue
as suggested by #34822 (closed)? See relevant part of the technical discovery.