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
feat(common): Allow ngSrc to be changed post-init #50683
Conversation
Just a quick comment: the code around |
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
58a0ddb
to
855761e
Compare
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
a445197
to
9638b5a
Compare
packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts
Outdated
Show resolved
Hide resolved
c136729
to
93ef797
Compare
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.
@atcastle looks great, just a couple minor nits.
packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts
Outdated
Show resolved
Hide resolved
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.
reviewed-for: public-api
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.
Reviewed-for: public-api
Remove thrown error when ngSrc is modified after an NgOptimizedImage image is initialized
93ef797
to
1ef004f
Compare
Caretaker note: the presubmit is "green", this PR is ready for merge. |
This PR was merged into the repository by commit 1837efb. |
Remove thrown error when ngSrc is modified after an NgOptimizedImage image is initialized PR Close angular#50683
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Remove thrown error when ngSrc is modified after an NgOptimizedImage image is initialized PR Close angular#50683
Remove thrown error when ngSrc is modified after an NgOptimizedImage image is initialized PR Close angular#50683
This PR modifies the
NgOptimizedImage
behavior whenngSrc
is modified after component initialization. Previously this would throw an error, but we've received feedback (#47813) that this is impeding people's ability to use the directive for some use cases. This PR starts with just allowingngSrc
to be modified, but could be expanded to allow modifying other inputs as well.I'm concerned that modifying certain inputs, such as
height
,width
andfill
would be very likely to cause layout shift, which NgOptimizedImage is specifically designed to prevent.I reviewed the docs and error messages related to this change in functionality, and I don't believe any changes are required.
CC: @AndrewKushnir @kara