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

Add getSrcset method #106

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Add getSrcset method #106

merged 1 commit into from
Jul 9, 2019

Conversation

bookernath
Copy link
Contributor

@bookernath bookernath commented Jul 7, 2019

Intended to be the FE version of this helper:

bigcommerce/paper-handlebars#42

When we get stencil image URLs from FE calls, this utils function can generate a srcset string from them.

Added tests for both the new imageSrcset.getSrcset and legacy image.getSrc methods.

@bigbot
Copy link

bigbot commented Jul 7, 2019

Autotagging @bigcommerce/storefront-team

@bookernath bookernath changed the title Add new getSrcset function Add getSrcset method Jul 7, 2019
@bookernath bookernath force-pushed the getSrcset branch 11 times, most recently from 55db99d to 99bdcf9 Compare July 7, 2019 23:56
@bc-williamkwon
Copy link
Contributor

bc-williamkwon commented Jul 8, 2019

Everything looks good to me. Just a small optimization but https://benediktmeurer.de/2017/04/03/v8-behind-the-scenes-march-edition/ says that writing JavaScript declaratively can make programs run faster.

@bookernath bookernath force-pushed the getSrcset branch 2 times, most recently from 40956c0 to 5203a66 Compare July 8, 2019 21:17
src/tools/imageSrcset.js Outdated Show resolved Hide resolved
src/tools/imageSrcset.js Outdated Show resolved Hide resolved
@junedkazi junedkazi merged commit c867c96 into bigcommerce:master Jul 9, 2019
@bookernath bookernath deleted the getSrcset branch July 9, 2019 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants