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): be less aggressive when marking builtin methods as unsafe #30216

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Mar 12, 2021

Description

This PR looks to make tracking of unsafe builtins a bit more relaxed - few cases that we gathered so far:

  • creatting http(s).Agent itself doesn't have sideeffects, so just preparing it without making request should be safe (relevant when using algoliasearch package as an example)
  • node-gyp-build used to load some binaries should be safe to ignore (relevant when using subscriptions-transport-ws as an example)

[ch26858]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 12, 2021
@pieh pieh added topic: build Related to the Gatsby build process and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 12, 2021
@pieh pieh marked this pull request as ready for review March 12, 2021 12:06
Copy link
Contributor

@vladar vladar 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, thanks 👍 I wonder though if this approach is viable in the long run - will we keep adding all possible exceptions? Maybe we can just allow users to opt-out of those warnings somehow?

Not blocking this PR obviously but something to think about. Left one nit but also not blocking.

@pieh
Copy link
Contributor Author

pieh commented Mar 12, 2021

will we keep adding all possible exceptions? Maybe we can just allow users to opt-out of those warnings somehow?

That is TBD, for me ideally users are covered in a lot of common cases (our defaults), but will think about ignoring those warnings, or ignoring some of them because they should be treated as safe (configurable by users)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build Related to the Gatsby build process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants