From e691342e5f62dc4156b4e501edf260c773203c8b Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 10 Feb 2021 11:55:24 +0000 Subject: [PATCH] chore(gatsby-source-contentful): Remove deprecated image resolvers (#29425) --- .../src/extend-node-type.js | 10 -- .../gatsby-source-contentful/src/fragments.js | 105 ------------------ 2 files changed, 115 deletions(-) diff --git a/packages/gatsby-source-contentful/src/extend-node-type.js b/packages/gatsby-source-contentful/src/extend-node-type.js index 04cbd59057d70..bc04be42e9643 100644 --- a/packages/gatsby-source-contentful/src/extend-node-type.js +++ b/packages/gatsby-source-contentful/src/extend-node-type.js @@ -738,17 +738,9 @@ exports.extendNodeType = ({ type, store, reporter }) => { return imageProps } - // TODO: Remove resolutionsNode and sizesNode for Gatsby v3 const fixedNode = fixedNodeType({ name: `ContentfulFixed`, getTracedSVG }) - const resolutionsNode = fixedNodeType({ - name: `ContentfulResolutions`, - getTracedSVG, - }) - resolutionsNode.deprecationReason = `Resolutions was deprecated in Gatsby v2. It's been renamed to "fixed" https://example.com/write-docs-and-fix-this-example-link` const fluidNode = fluidNodeType({ name: `ContentfulFluid`, getTracedSVG }) - const sizesNode = fluidNodeType({ name: `ContentfulSizes`, getTracedSVG }) - sizesNode.deprecationReason = `Sizes was deprecated in Gatsby v2. It's been renamed to "fluid" https://example.com/write-docs-and-fix-this-example-link` // gatsby-plugin-image const getGatsbyImageData = () => { @@ -783,9 +775,7 @@ exports.extendNodeType = ({ type, store, reporter }) => { return { fixed: fixedNode, - resolutions: resolutionsNode, fluid: fluidNode, - sizes: sizesNode, gatsbyImageData: getGatsbyImageData(), resize: { type: new GraphQLObjectType({ diff --git a/packages/gatsby-source-contentful/src/fragments.js b/packages/gatsby-source-contentful/src/fragments.js index d943cf51952bc..8ac3da7d7c240 100644 --- a/packages/gatsby-source-contentful/src/fragments.js +++ b/packages/gatsby-source-contentful/src/fragments.js @@ -155,108 +155,3 @@ export const contentfulAssetFluidPreferWebpNoBase64 = graphql` sizes } ` - -// TODO: in v3 remove these legacy fragments -export const GatsbyContentfulResolutions = graphql` - fragment GatsbyContentfulResolutions on ContentfulResolutions { - base64 - width - height - src - srcSet - } -` - -export const GatsbyContentfulResolutions_tracedSVG = graphql` - fragment GatsbyContentfulResolutions_tracedSVG on ContentfulResolutions { - tracedSVG - width - height - src - srcSet - } -` - -export const GatsbyContentfulResolutions_noBase64 = graphql` - fragment GatsbyContentfulResolutions_noBase64 on ContentfulResolutions { - width - height - src - srcSet - } -` - -export const GatsbyContentfulResolutions_withWebp = graphql` - fragment GatsbyContentfulResolutions_withWebp on ContentfulResolutions { - base64 - width - height - src - srcSet - srcWebp - srcSetWebp - } -` - -export const GatsbyContentfulResolutions_withWebp_noBase64 = graphql` - fragment GatsbyContentfulResolutions_withWebp_noBase64 on ContentfulResolutions { - width - height - src - srcSet - srcWebp - srcSetWebp - } -` - -export const GatsbyContentfulSizes = graphql` - fragment GatsbyContentfulSizes on ContentfulSizes { - base64 - aspectRatio - src - srcSet - sizes - } -` - -export const GatsbyContentfulSizes_tracedSVG = graphql` - fragment GatsbyContentfulSizes_tracedSVG on ContentfulSizes { - tracedSVG - aspectRatio - src - srcSet - sizes - } -` - -export const GatsbyContentfulSizes_noBase64 = graphql` - fragment GatsbyContentfulSizes_noBase64 on ContentfulSizes { - aspectRatio - src - srcSet - sizes - } -` - -export const GatsbyContentfulSizes_withWebp = graphql` - fragment GatsbyContentfulSizes_withWebp on ContentfulSizes { - base64 - aspectRatio - src - srcSet - srcWebp - srcSetWebp - sizes - } -` - -export const GatsbyContentfulSizes_withWebp_noBase64 = graphql` - fragment GatsbyContentfulSizes_withWebp_noBase64 on ContentfulSizes { - aspectRatio - src - srcSet - srcWebp - srcSetWebp - sizes - } -`