-
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-sharp): throw error when not added to gatsby-config #21045
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.
Approved with one typo to fix
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.
Looks great Ward
@@ -40,7 +40,7 @@ const getImageSize = file => { | |||
// There is no guarantee that the module resolved is the module executing! | |||
// This can occur in mono repos depending on how dependencies have been hoisted. | |||
// The direct require has been left only to avoid breaking changes. | |||
let { boundActionCreators } = require(`gatsby/dist/redux/actions`) | |||
let boundActionCreators |
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.
This implementation is weird. I know it’s not the scope of this. But can you explain to me why we inject the boundActionCreators? Is this the whole local Gatsby vs global Gatsby stuff?
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.
boundActionCreators
was deprecated in v2. We can continue using it, but it’s recommended that one rename it to actions
. Note that actions
is what is passed in in most lifecycle APIs.
So the name boundActionCreators
is largely a remnant of the past.
Description
With jobs-api we need to make sure that gatsby-plugin-sharp is set inside the gatsby-config array. It should always have been this case, this shows a valid error when it happens.