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(gatsby-remark-images-contentful): enable webp sources #11273

Conversation

AlbericTrancart
Copy link
Contributor

Description

Add a withWebp option to include a webp source in parsed images from contentful.

Related Issues

Addresses #11268.

@KyleAMathews
Copy link
Contributor

Is there any reason to not just make this the default? Seems like everyone should have webp enabled :-)

@wardpeet
Copy link
Contributor

we should enable it by default 👍

@AlbericTrancart
Copy link
Contributor Author

@KyleAMathews I didn't enabled it by default because it isn't in gatsby-remark-images so I thought there should be a good reason, but I will make it the default then 👍

@wardpeet what kind of structure are you thinking of? Something like this? (I will implement this TODO rightaway if possible 😉 )

srcSet: {
  original: ...,
  webp: ...
}

@wardpeet
Copy link
Contributor

wardpeet commented Jan 25, 2019

hey @AlbericTrancart it's super cool that you want to take this on right away but it would be a breaking change so we have to wait for gatsby v3. Also I haven't thought about it yet 😄.

The current behaviour is perfect for now. So good job! 💪

@AlbericTrancart AlbericTrancart force-pushed the topics/add-webp-support-to-remark-images-contentful branch 2 times, most recently from 726b058 to 0715ea7 Compare January 25, 2019 16:41
@AlbericTrancart
Copy link
Contributor Author

Updated!

@KyleAMathews
Copy link
Contributor

@wardpeet this wouldn't be a breaking change actually because it's hidden from the user — nobody's code would break — their sites would just get faster :-)

@KyleAMathews
Copy link
Contributor

@AlbericTrancart the only reason we don't include it by default in gatsby-remark-images is that generating webp thumbnails is a lot more expensive than jpg. So we want people to opt into webp so they realize the cost they're taking on (as not everyone wants to tradeoff longer build times for smaller images).

But with a hosted service like Contentful where webp images are generated on demand, it makes a lot more sense to default to webp.

@AlbericTrancart
Copy link
Contributor Author

@KyleAMathews @wardpeet any news on merging this PR? :)

@AlbericTrancart AlbericTrancart force-pushed the topics/add-webp-support-to-remark-images-contentful branch from 0715ea7 to 2618b0a Compare February 16, 2019 17:40
@AlbericTrancart
Copy link
Contributor Author

@wardpeet PR rebased to fix a merge conflict on the README.

@ryanwiemer
Copy link
Contributor

Any update on this? I would love to see the gatsby-remark-images-contentful plugin get some improvements.

@AlbericTrancart
Copy link
Contributor Author

@wardpeet @KyleAMathews ping to merge this PR :)

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your patience. It looks great, I've added the small TODO.

@wardpeet wardpeet changed the title Add webp support to gatsby-remark-images-contentful feat(gatsby-remark-images-contentful): enable webp sources Mar 11, 2019
@wardpeet wardpeet merged commit 6866e76 into gatsbyjs:master Mar 11, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 11, 2019

Holy buckets, @AlbericTrancart — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@sidharthachatterjee
Copy link
Contributor

Published in gatsby-remark-images-contentful@2.0.9

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.

None yet

5 participants