Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/using-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"author": "Dustin Schau <[email protected]>",
"dependencies": {
"gatsby": "^2.0.19",
"gatsby": "^5.14.0",

Choose a reason for hiding this comment

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

critical

Upgrading gatsby from major version 2 to 5 will break the project. This is a significant update with many breaking changes that require a broader migration effort.

Here are some of the required changes:

  • React Version: Gatsby v5 requires React 18. The react and react-dom dependencies must be upgraded from ^16.5.1 to ^18.0.0.
  • Gatsby Plugins: All gatsby-* plugins are outdated and need to be upgraded to versions compatible with Gatsby v5. For example, gatsby-plugin-sharp is at ^2.0.7 and should be at ^5.13.1 or similar.
  • gatsby-image: The gatsby-image package (^2.0.15) is deprecated and has been replaced by gatsby-plugin-image. This requires not only a dependency change but also code modifications where the Image component is used.
  • StaticQuery component: The StaticQuery component is deprecated and should be replaced with the useStaticQuery hook. This will require refactoring the Layout component.
  • Dev Dependencies: Development dependencies like react-test-renderer (^16.6.0) and babel-preset-gatsby (^0.1.2) are incompatible and must be updated.

Simply changing this one line will lead to build failures. I recommend addressing all these migration steps within this PR or creating a dedicated migration PR.

"gatsby-image": "^2.0.15",
"gatsby-plugin-manifest": "^2.0.5",
"gatsby-plugin-offline": "^2.0.5",
Expand Down