-
Notifications
You must be signed in to change notification settings - Fork 49
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
Migrate gatsby from v1 to v2 #75
Conversation
@kairstenfay -- upgrade node & npm and this will work*. I resolved this by upgrading to versions 13.6.0 & 6.13.6 respectively, removing *There are other build errors, but these look like they are covered in the gatsby upgrade guide. |
Thanks, James. Upgrading to node v13 plus removing |
Update: The site now builds using gatsby v2 Bugs to fix
Misc
|
Begin the process of migrating from gatsby v1 to v2. I'm following the [steps documented here](https://www.gatsbyjs.org/docs/migrating-from-v1-to-v2/).
`react` and `react-dom` are `peerDependencies` in v2.
Part of migrating gatsby v1 to v2, per [the gatsby documentation](https://www.gatsbyjs.org/docs/migrating-from-v1-to-v2/#change-modifybabelrc-to-oncreatebabelconfig).
`Link` is now imported from "gatsby"
As per the upgrading guide
This allows `gatsby develop` to work (previously we were getting an error during bundle generation). Note that the site is still not working, but does build without errors.
as per v1-v2 upgrade guide
We had a number of issues with upgrading gatsby that were fixed by using the latest node and npm versions
Followed the migration path outlined in https://www.gatsbyjs.org/docs/migrating-from-v1-to-v2/#remove-or-refactor-layout-components
`div` cannot be a child of `p`
reverts some of 2c5915a
b55fed7
to
571f2a1
Compare
This was catching relative links which should got to auspice (e.g. the zika tile on the splash page) but modifying the link to go to a gatsby 404 (the server never saw the get request and so couldn't send to auspice). This plugin is generally problematic for us & needs attention.
571f2a1
to
6818b81
Compare
We want certain relative links to go to the server (e.g. /login shouldn't be interpreted as a gatsby page, but go to the server which redirects as appropriate). This fixes the nav-bar to achieve the desired behavior with the new gatsby version. x
We want to create the users "page" via a `createPage` call so that we can use it /users/:username URLs. When this was located within the `/pages` directory gatsby automatically created a page at `/users` which loaded fine, but the `createPage` functionality was lost (i.e. /users/userName wouldn't load). By moving this file gatsby no longer automatically creates a URL for it and we get back our desired behaviour via `createPage`.
512326e
to
431b191
Compare
Awesome! I poked around the site for a little while and the only bug I was able to find was the 404 bug noted above. |
I believe that Python 2.7 is no longer required for this Gatsby installation. Or that was my experience installing now on a system that lacks Generally, my install experience on this branch is much improved. Various Gatsby plugins had been giving me trouble before. The only bug I've found is the 404 issue. |
I decided to merge this to ease development. I believe the only issue that needs resolving is the 404 not behaving as intended. |
Documentation
I'm following this guide for upgrading gatsby from v1 to v2.
Steps taken
Steps taken (all within
static-site
directory)Upgrade gatsby version with
npm i gatsby@latest
Upgrade gatsby-related packages
Install react with
npm i react react-dom
Install plugins' peer dependencies
edit (james 2020-01-15): see below for current status