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

chore(gatsby, gatsby-transformer-remark, gatsby-plugin-sharp): Cleanup v4 compile flag conditions #36486

Merged
merged 6 commits into from Aug 30, 2022

Conversation

marvinjude
Copy link
Contributor

@marvinjude marvinjude commented Aug 29, 2022

Description

In preparation for v5 canaries, This PR makes codepaths behind _CFLAGS_.GATSBY_MAJOR === 4 conditions the default and also removes non _CFLAGS_.GATSBY_MAJOR === 4 codepaths.

[sc-54975]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 29, 2022
@marvinjude marvinjude changed the title chore(gatsby, gatsby-transformer-remark, gatsby-plugin-sharp): Cleanup compile flag conditions chore(gatsby, gatsby-transformer-remark, gatsby-plugin-sharp): Cleanup v4 compile flag conditions Aug 29, 2022
@marvinjude marvinjude added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 29, 2022
@marvinjude marvinjude marked this pull request as ready for review August 29, 2022 11:39
}
exports.onPluginInit = async ({ actions }, pluginOptions) => {
setActions(actions)
setPluginOptions(pluginOptions)
}
}
Copy link
Contributor

@wardpeet wardpeet Aug 29, 2022

Choose a reason for hiding this comment

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

This can be used instead of the whole try catch

exports.onPluginInit = async ({ actions }, pluginOptions) => {
    setActions(actions)
    setPluginOptions(pluginOptions)
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean removing the if (coreSupportsOnPluginInit) { check ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

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

Looks good, small remarks.

@wardpeet wardpeet merged commit 9dcc773 into master Aug 30, 2022
@wardpeet wardpeet deleted the cleanup-v4-c-flags branch August 30, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants