Skip to content
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): Add automatic srcset generation to ngOptimizedImage (second PR) #47695

Closed

Conversation

atcastle
Copy link
Contributor

@atcastle atcastle commented Oct 7, 2022

Note: This PR is a duplicate of (#47547) to work around a CI issue.

This PR adds a feature for automatic srcset generation to the NgOptimizedImage directive. Srcsets are generated as density selectors (eg "1x", "2x") if there is no sizes prop provided, or with responsive srcsets with a range of pixel values if a sizes prop exists. These responsive breakpoints are user-configurable using a new provider called ImageConfig.

The automatic srcset can be disabled with a new unoptimized attribute.

Note: This PR only contains unit testing of this feature. End-to-end tests will be added shortly. Opening this now to begin discussion with @pkozlowski-opensource and @AndrewKushnir.

// CC: @kara

@pullapprove pullapprove bot requested a review from alxhub October 7, 2022 17:43
@angular-robot angular-robot bot added the feature Issue that requests a new feature label Oct 7, 2022
@kara kara added the target: major This PR is targeted for the next major release label Oct 7, 2022
@atcastle atcastle force-pushed the image-directive-auto-srcset-2 branch from 653ed7f to 1618289 Compare October 7, 2022 17:51
Add a feature to automatically generate the srcset attribute for images using the NgOptimizedImage directive. Uses the 'sizes' attribute to determine the appropriate srcset to generate.
@atcastle atcastle force-pushed the image-directive-auto-srcset-2 branch from 1618289 to f5de4f9 Compare October 7, 2022 18:01
@atcastle
Copy link
Contributor Author

atcastle commented Oct 7, 2022

The problem with the original PR (#47547) seems to have been fixed, so I'm closing this PR.

@atcastle atcastle closed this Oct 7, 2022
@jessicajaniuk jessicajaniuk added the area: common Issues related to APIs in the @angular/common package label Oct 7, 2022
@ngbot ngbot bot added this to the Backlog milestone Oct 7, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: common Issues related to APIs in the @angular/common package feature Issue that requests a new feature target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants