Skip to content

Commit b2dc6d9

Browse files
authored
Merge pull request #59 from yurist38/migrate-to-gatsby-3
Migration to Gatsby v3
2 parents 7fe33b8 + c84d6d6 commit b2dc6d9

File tree

5 files changed

+3352
-4619
lines changed

5 files changed

+3352
-4619
lines changed

example/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@
55
"version": "0.1.0",
66
"author": "Dmitriy Nevzorov <dmitriy.nevzorov@microapps.com>",
77
"dependencies": {
8-
"gatsby": "^2.32.2",
9-
"gatsby-image": "^2.11.0",
10-
"gatsby-plugin-manifest": "^2.12.0",
11-
"gatsby-plugin-offline": "^3.10.0",
12-
"gatsby-plugin-react-helmet": "^3.10.0",
13-
"gatsby-plugin-react-i18next": "^1.0.1",
14-
"gatsby-plugin-sharp": "^2.14.0",
15-
"gatsby-plugin-sitemap": "^2.12.0",
16-
"gatsby-source-filesystem": "^2.11.0",
17-
"gatsby-transformer-sharp": "^2.12.0",
18-
"i18next": "^19.8.7",
8+
"gatsby": "^3.1.0",
9+
"gatsby-plugin-image": "^1.1.1",
10+
"gatsby-plugin-manifest": "^3.1.0",
11+
"gatsby-plugin-offline": "^4.1.0",
12+
"gatsby-plugin-react-helmet": "^4.1.0",
13+
"gatsby-plugin-react-i18next": "^1.0.4",
14+
"gatsby-plugin-sharp": "^3.1.0",
15+
"gatsby-plugin-sitemap": "^3.1.0",
16+
"gatsby-source-filesystem": "^3.1.0",
17+
"gatsby-transformer-sharp": "^3.1.0",
18+
"i18next": "^19.9.2",
1919
"prop-types": "^15.7.2",
2020
"react": "^17.0.1",
2121
"react-dom": "^17.0.1",
2222
"react-helmet": "^6.1.0",
23-
"react-i18next": "^11.8.5"
23+
"react-i18next": "^11.8.10"
2424
},
2525
"devDependencies": {
26-
"@babel/cli": "^7.12.13",
27-
"@babel/core": "^7.12.13",
28-
"aws-sdk": "^2.838.0",
26+
"@babel/cli": "^7.13.10",
27+
"@babel/core": "^7.13.10",
28+
"aws-sdk": "^2.865.0",
2929
"babel-plugin-i18next-extract": "^0.8.2",
30-
"babel-preset-gatsby": "^0.12.0",
30+
"babel-preset-gatsby": "^1.1.0",
3131
"mkdirp": "^1.0.4",
3232
"prettier": "2.2.1"
3333
},

example/src/components/image.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,19 @@
11
import React from 'react';
22
import {useStaticQuery, graphql} from 'gatsby';
3-
import Img from 'gatsby-image';
4-
5-
/*
6-
* This component is built using `gatsby-image` to automatically serve optimized
7-
* images with lazy loading and reduced file sizes. The image is loaded using a
8-
* `useStaticQuery`, which allows us to load the image from directly within this
9-
* component, rather than having to pass the image data down from pages.
10-
*
11-
* For more information, see the docs:
12-
* - `gatsby-image`: https://gatsby.dev/gatsby-image
13-
* - `useStaticQuery`: https://www.gatsbyjs.org/docs/use-static-query/
14-
*/
3+
import {GatsbyImage} from 'gatsby-plugin-image';
154

165
const Image = () => {
176
const data = useStaticQuery(graphql`
187
query {
198
placeholderImage: file(relativePath: {eq: "gatsby-astronaut.png"}) {
209
childImageSharp {
21-
fluid(maxWidth: 300) {
22-
...GatsbyImageSharpFluid
23-
}
10+
gatsbyImageData(layout: FIXED, width: 300)
2411
}
2512
}
2613
}
2714
`);
2815

29-
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />;
16+
return <GatsbyImage image={data.placeholderImage.childImageSharp.gatsbyImageData} />;
3017
};
3118

3219
export default Image;

0 commit comments

Comments
 (0)