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-plugin-sharp): throw error when not added to gatsby-config #21045

Merged
merged 2 commits into from
Feb 1, 2020

Conversation

wardpeet
Copy link
Contributor

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.

@wardpeet wardpeet requested a review from a team as a code owner January 30, 2020 13:39
ascorbic
ascorbic previously approved these changes Jan 30, 2020
Copy link
Contributor

@ascorbic ascorbic left a 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

Copy link
Contributor

@blainekasten blainekasten left a 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
Copy link
Contributor

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?

Copy link
Contributor

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.

@sidharthachatterjee sidharthachatterjee changed the title fix(gatsby-plugin-sharp): throw error when not configured correctly fix(gatsby-plugin-sharp): throw error when not added to gatsby-config Feb 1, 2020
@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Feb 1, 2020
@gatsbybot gatsbybot merged commit 3487e48 into gatsbyjs:master Feb 1, 2020
@wardpeet wardpeet deleted the fix/sharp-not-a-plugin branch September 23, 2020 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants