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 base64 field as non-null in schema #20822

Closed

Conversation

Kerumen
Copy link
Contributor

@Kerumen Kerumen commented Jan 23, 2020

Description

Follow up of #20314, I added the base64 field because the fragment defines it and it avoids TS errors.

@Kerumen Kerumen requested a review from a team as a code owner January 23, 2020 17:33
@vladar
Copy link
Contributor

vladar commented Jan 27, 2020

Thanks so much for the PR!

But base64 can actually be null:

return {
base64: base64Image && base64Image.src,
aspectRatio: images[0].aspectRatio,

We have a separate option base64 for fluid and fixed methods which controls this (when set to false, base64 output will be null.

And gatsby-image is handling null-case explicitly:

{/* Show the blurry base64 image. */}
{image.base64 && (
<Placeholder
ariaHidden
src={image.base64}
spreadProps={placeholderImageProps}
imageVariants={imageVariants}
generateSources={generateBase64Sources}
/>
)}

So I incline to close this PR unless I am missing something?

@Kerumen
Copy link
Contributor Author

Kerumen commented Jan 27, 2020

Oh yes. And I double checked gatsby-image definition file and base64 is defined as optional.

Sorry for the trouble!

@Kerumen Kerumen closed this Jan 27, 2020
@Kerumen Kerumen deleted the fix/gatsby-image-required-fields branch January 27, 2020 13:08
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

2 participants