-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
✨New amp-cld-img extension to display assets from Cloudinary. #22149
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
This pull request introduces 2 alerts when merging d5c6c2a into b814e5d - view on LGTM.com new alerts:
Comment posted by LGTM.com |
adding @sparhami as well to help out with the review. Thanks! |
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.
Added some comments, will take another look once those are addressed.
const fetchFormat = optionConsume(options, 'fetchFormat', null); | ||
const quality = optionConsume(options, 'quality', null); | ||
|
||
const transformation = { |
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.
Since these keys are combined with those of responsive
, it is a bit misleading to have them as separate objects. For example, just reading the code at a quick glance, there doesn't seem to be any problem if there are keys that are repeated between the two, when in fact, this is a problem.
It could make things more clear to have comments to separate out the sections:
const fields = {
// transformations
b: background,
// responsive
dpr: dprValue,
}
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.
I agree it's a bit confusing, however the separation is there because each segment of the is processed separately - [raw_transformation/transformations fields/responsive fields].
It ends up looking like so (assuming no raw transformation, for simplicity):
b_red,e_sepia/w_100,c_crop
If all the fields are in the same object I can't really separate which fields come before the slash and which ones after, it can change the meaning completely.
Add comments Improve readability Improve types usage
This pull request introduces 2 alerts when merging 1b6e0cc into e38e621 - view on LGTM.com new alerts:
Comment posted by LGTM.com |
Is this PR still active? |
I'm closing this PR since it no longer seems active. Please reopen if needed. |
Add a new extension named
amp-cld-img
, used to display images from Cloudinary.This is a completely new extension based on
<img>
, useful for Cloudinary customers authoring amp pages.The extension allows developers to declare transformations and effects using attributes, and then sets the underlying
src
attribute automatically.More info:
Intent to implement
Cloudinary home page