addons-code-manager icon indicating copy to clipboard operation
addons-code-manager copied to clipboard

Allow CodeView to accept a single `file` prop instead of 3 individual props

Open bobsilverberg opened this issue 4 years ago • 1 comments

This is a follow-up to https://github.com/mozilla/addons-code-manager/pull/1498.

CodeView accepts some props which are properties of a VersionFile. #1498 introduced yet another of those, the isMinified prop.

It seems like it might be better to just accept a file prop, and then destructure that inside the component in order to get the content, isMinified, and mimeType props. I investigated this during the development of #1498 but found that it complicated testing because we need to create a VersionFile in the test, and we don't currently have a way to do that. Introducing a way to do that would result in some refactoring of the versions reducer, and it all started to look like more work than would be worthwhile, at least to land #1498.

This is a code quality issue to look into doing that work so that CodeView can simply accept a file prop.

┆Issue is synchronized with this Jira Task

bobsilverberg avatar Mar 25 '20 12:03 bobsilverberg

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

stale[bot] avatar Sep 21 '20 12:09 stale[bot]