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-react-router-scroll): hide sessionStorage warnings in production #12593

Merged
merged 3 commits into from
Mar 15, 2019

Conversation

aengl
Copy link
Contributor

@aengl aengl commented Mar 15, 2019

Hide sessionStorage warnings in production

Description

Concerns the plugin gatsby-react-router-scroll.

If cookies are disabled, the production version of the website would show console warnings when scrolling.

With this change, those warnings will only be visible in the development version.

Related Issues

Fixes #12577

If cookies are disabled, the production version of the website would show console warnings when scrolling.
@pieh
Copy link
Contributor

pieh commented Mar 15, 2019

This generally looks good, but I will change __DEV__ to process.env.NODE_ENV !== production. I realize we do use __DEV__ in other places in this plugin, but we really shouldn't - we don't use this is any other package and can be confusing, as this package have custom babel configuration.

But overall 👍

@aengl
Copy link
Contributor Author

aengl commented Mar 15, 2019

@pieh Agreed, I also prefer process.env.NODE_ENV,__DEV__ is always a bit magical 😄.

@pieh pieh changed the title Hide sessionStorage warnings in production fix(gatsby-react-router-scroll): hide sessionStorage warnings in production Mar 15, 2019
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Thanks @aengl!

@pieh pieh merged commit 365be0a into gatsbyjs:master Mar 15, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 15, 2019

Holy buckets, @aengl — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@aengl
Copy link
Contributor Author

aengl commented Mar 15, 2019

@pieh Thank you for your guidance and effort, very much appreciated!

@aengl aengl deleted the aen/hide-warnings branch March 15, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants