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

fix(gatsby-transformer-sharp): Add checkSupportedExtensions option #22565

Merged
merged 3 commits into from
Mar 27, 2020

Conversation

LekoArts
Copy link
Contributor

Description

Initially the idea was to traverse the GraphQL AST and check whether publicURL is used alongside childImageSharp or not. However, this task would have been really cumbersome and the end result would be brittle as multiple cases (file, allFile, fragments and more) would need to be handled.
We can revisit this idea once we can return components from GraphQL - I added a TODO for that.

In the meantime we expose an option to turn of the warning. The warning is still valuable but if people are sure that they handle all cases, they can turn it off.

Documentation

The option was documented in the README.

Related Issues

Follow-up of #20782
Fixes #21823

@LekoArts LekoArts requested review from a team as code owners March 25, 2020 09:03
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

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

One quick question but other than that this looks great! Thanks @LekoArts!

packages/gatsby-transformer-sharp/README.md Outdated Show resolved Hide resolved
freiksenet
freiksenet previously approved these changes Mar 25, 2020
@LekoArts LekoArts merged commit 91e7bfb into gatsbyjs:master Mar 27, 2020
@LekoArts LekoArts deleted the conditionally-print-gif-warning branch March 27, 2020 09:40
@LekoArts
Copy link
Contributor Author

Published in gatsby-transformer-sharp@2.4.3

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.

gatsby-transformer-sharp: Don't print .gif warning when publicURL is used in query
4 participants