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

[1.0] Fix gatsby-link for undefined nextState #907

Merged
merged 2 commits into from
May 3, 2017
Merged

[1.0] Fix gatsby-link for undefined nextState #907

merged 2 commits into from
May 3, 2017

Conversation

0x80
Copy link
Contributor

@0x80 0x80 commented May 3, 2017

  • Solves errors in production when /route/child/ is available but /route/ is not.

@KyleAMathews I thought fetching routes like this is actually a good example of where you'd want to be have a debug statement in place to just switch on. I think the size of the debug library is negligible, but if you disagree I can take it out of course.

* Solves an error if `/route/child/` is available but `/route/` is not.
@gatsbybot
Copy link
Collaborator

gatsbybot commented May 3, 2017

Deploy preview ready!

Built with commit 985ecef

https://deploy-preview-907--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented May 3, 2017

Deploy preview ready!

Built with commit 985ecef

https://deploy-preview-907--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

KyleAMathews commented May 3, 2017

Deploy preview ready!

Built with commit 985ecef

https://deploy-preview-907--gatsbyjs.netlify.com

@0x80 0x80 changed the title Fix gatsby-link for undefined nextState [1.0] Fix gatsby-link for undefined nextState May 3, 2017
@KyleAMathews
Copy link
Contributor

Yeah... don't think shipping code that 99.999% of page loads won't use makes sense.

If we won't browser logging, why don't we just add a build flag or something equivalent? So gatsby build --debug-logging or whatever. Then that sets a environment variable in webpack and in the code we have if (process.env.DEBUG) { console.log('something') }. This code would be removed for normal builds and be left in when you want to debug something.

Also the debug code would always run during development.

We could use console.group to make things fairly tidy.

@0x80
Copy link
Contributor Author

0x80 commented May 3, 2017

@KyleAMathews ok fair enough. I'll give it some more thought later and strip the debugging for now

@KyleAMathews KyleAMathews merged commit 25dc2f2 into gatsbyjs:1.0 May 3, 2017
@KyleAMathews
Copy link
Contributor

Awesome, thanks!

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.

3 participants