-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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-plugin-image): Handle breakpoints and auto-format in plugin utils #29187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand the goal of EVERY_BREAKPOINTS.
@@ -4,7 +4,21 @@ import { IGatsbyImageData } from "." | |||
import type sharp from "gatsby-plugin-sharp/safe-sharp" | |||
|
|||
const DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2] | |||
const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920] | |||
export const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920] | |||
export const EVERY_BREAKPOINT = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is our default for hooks really going to be all of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for plugins that don't do any actual resizing, so passing more breakpoints just makes it more likely that there will be one that is the size of the screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense.
…n utils (#29187) (#29197) (cherry picked from commit 25912f0) Co-authored-by: Matt Kane <[email protected]>
Published in |
These fixes are mainly for image providers that generate images on the fly. It correctly handles auto fileformats, for image hosts that use content negotiation instead (like Cloudinary), where prviously it was failing to generate the img tag. It also adds a large number of breakpoints by default, as they're effectively free.