-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow developers to select which image format to use for images in the content #230
Allow developers to select which image format to use for images in the content #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about the code.
Would be great to introduce some tests to test cases like:
- Default behavior
- Reverse behavior
- Empty value
- Unsupported mime types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eugene-manuilov Looks great, just one comment.
Overall looks good although I still prefer to have the filter operate in the opposite order. Also, it would be good to add some tests verifying that the filter works as expected. |
The benefit of how it currently behaves is that the order of how items have to be sorted in the filter itself is arguably more aligned with the other filter, with the "foundational" format coming first (typically JPEG for our purposes currently). The reason we then iterate through the array backwards here is because the "priority order" of the formats would be actually the opposite, which especially makes sense when thinking about it in the context of future
+1 to that, @eugene-manuilov could you add a few tests for the filter usage? |
It actually makes less sense in the picture context where the The way we have it now, we will need to reverse the order before building the picture element. The fact that we have to reverse the array every time we use it is surely a sign we have the data in the wrong order? The image formats should be listed in the order in which you prefer to use the formats, not the reverse!
I see these as two separate filters - one is a map of arrays and one is an array. Since we can't seem to agree on this point, can we put it to a vote? I'll accept the majority view. |
@adamsilverstein I see your point around reversing the array, I agree that is not optimal. At the same time, my personal take is that it makes sense to have the orders for the two filters behave similarly so that it's easier to remember for developers (if we get rid of the
Definitely, that may make sense, maybe even with some further discussion. I'm also happy to be outvoted. :) However, I'd suggest we do this in a follow-up issue to not block this PR which would be crucial to get into the next beta release. Would it be okay with you to for now go with the current approach, and open an issue to follow up on the discussion here? We would then put that into the next beta milestone, which would give us some time to discuss and have a vote. |
Let's follow up on the filter order discussion in #187 (comment), it's easier to follow on the issue than on this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny recommendation, but nothing blocking.
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
…ess/performance into feature/187-content-images-format
@adamsilverstein @felixarntz an additional test is added. Not sure if we need more tests because the majority of cases are already covered by existing tests. |
…images-format
@eugene-manuilov Updated this PR to be against the |
Summary
Fixes #187
Relevant technical choices
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.