hikerpig / gatsby-project-kb

Developing gatsby-theme-kb, a Gatsby theme for publishing Knowledge Base.
https://gatsby-project-kb.vercel.app/
MIT License
62 stars 15 forks source link

refactor: Upgrade to Gatsby v3 and React 17 #7

Closed AndrewNatoli closed 3 years ago

AndrewNatoli commented 3 years ago

I got a little excited about Gatsby 3 while also looking at your project and decided to try upgrading it. ¯_(ツ)_/¯

Gatsby 3 uses Webpack 5 which no longer includes Node polyfills by default. I had to import browserify-path (see gatsby-node) so AnchorTag would still work. Otherwise everything else seems fine.

Also looks like Prettier formatted a few extra lines in gatsby-node... I can get those reverted if needed.

hikerpig commented 3 years ago

Thank you sooooooooo much! 👏👏👏 I am excited about Gatsby v3, too. And I am in the middle of migration (just got to the path-browserify part, but I think I shall remove the path import eventually). I will check this PR locally ASAP.

hikerpig commented 3 years ago

Aha nerver mind, I resolve the path-browserify issues I mentioned in the next commit.

As for prettier, I find it pretty strange that when I ran it to format gatsby-node.js, I got different outcome than yours. I ran yarn prettier packages/gatsby-theme-kb/gatsby-node.js -w from the project dir. Could this be that you use a global prettier executable?