Skip to content

Commit 0c45654

Browse files
gatsbybotpieh
andauthored
chore: remove tracedSVG (#37093) (#37137)
* chore: remove tracedSVG (#37093) * init * gri * update shopify snapshot * gatsby-plugin-sharp tests * update gatsby-remark-images/gatsby-node tests * update gatsby-plugin-image tests * update schema print tests * remove traceSVG unit tests as it was removed * legacy gatsby-image fields * update polyfill tests * update cypress assertion * update contentful cypress assertions * drop few more packages from gatsby-plugin-sharp as they are no onger used * correct IMAGE_CDN fallback for TRACE_SVG * update generateImageData * update e2e-prod/assertions * update unit test * update snapshot * update e2e-dev/assertions * drop more unused * sync yarn.lock * a bit more prod warnings * adjust gatsby-remark-images plugin options warning * add link to gatsby-remark-images warning (cherry picked from commit 94c2d73) * gatsby recipe tests * cli tests * babel config tests * update assertion * some reverts? * update assertion * contentful extend node type * fallback in test * fix tracedSVG fields * fix(gatsby-cli): relax error location validation and ignore extra fields (#34559) * package.json removals Co-authored-by: Michal Piechowiak <[email protected]>
1 parent d7edf95 commit 0c45654

File tree

30 files changed

+395
-1171
lines changed

30 files changed

+395
-1171
lines changed

e2e-tests/contentful/cypress/integration/gatsby-image.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ describe(`gatsby-image`, () => {
5252
it(`fluid`, testConfig, () => testGatsbyImage(`fluid`, hasBase64Placeholder))
5353
it(`fixed`, testConfig, () => testGatsbyImage(`fixed`, hasBase64Placeholder))
5454
it(`webp`, testConfig, () => testGatsbyImage(`webp`, hasBase64Placeholder))
55-
it(`traced`, testConfig, () => testGatsbyImage(`traced`, hasSVGPlaceholder))
55+
it(`traced`, testConfig, () =>
56+
testGatsbyImage(`traced`, hasBase64Placeholder)
57+
)
5658
it(`sqip`, testConfig, () => testGatsbyImage(`sqip`, hasSVGPlaceholder))
5759

5860
it(`english`, testConfig, () => {

e2e-tests/contentful/cypress/integration/gatsby-plugin-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe(`gatsby-plugin-image`, () => {
7474
testGatsbyPluginImage(`dominant-color`, hasColorPlaceholder)
7575
)
7676
it(`traced`, testConfig, () =>
77-
testGatsbyPluginImage(`traced`, hasSVGPlaceholder)
77+
testGatsbyPluginImage(`traced`, hasColorPlaceholder)
7878
)
7979
it(`blurred`, testConfig, () =>
8080
testGatsbyPluginImage(`blurred`, hasBase64Placeholder)

e2e-tests/contentful/cypress/integration/tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe(`tags`, () => {
1919
"have.text",
2020
"numberInteger"
2121
)
22-
cy.get('[data-cy-id^="tag-"]').should("have.length", 2)
22+
cy.get('[data-cy-id^="tag-"]').should("have.length", 5)
2323
})
2424
it(`Filtered Entries`, () => {
2525
cy.get('[data-cy-integers] [data-cy-id="number-integer"]').should(

e2e-tests/contentful/src/pages/gatsby-plugin-image.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ const GatsbyPluginImagePage = ({ data }) => {
8585
))}
8686
</Grid>
8787

88-
<h2>gatsby-plugin-image: Traced SVG Placeholder</h2>
88+
<h2>
89+
gatsby-plugin-image: Traced SVG Placeholder (fallback to DOMINANT_COLOR)
90+
</h2>
8991
<Grid data-cy="traced">
9092
{data.default.nodes.map(node => (
9193
<div>

e2e-tests/gatsby-static-image/cypress/integration/traced.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ describe(`fixed`, () => {
55
cy.visit(`/traced`).waitForRouteChange()
66
})
77

8-
it(`renders a traced svg`, () => {
8+
it(`traced svg (falls back to DOMINANT_COLOR)`, () => {
99
cy.getTestElement(tracedTestId)
10-
.find(`.gatsby-image-wrapper > img`)
11-
.should(`have.attr`, `src`)
12-
.and(src => {
13-
;[`data:image/svg+xml`].forEach(part => expect(src).to.include(part))
10+
.find(`.gatsby-image-wrapper > [data-placeholder-image]`)
11+
.first()
12+
.should($el => {
13+
// traced falls
14+
expect($el.prop("tagName")).to.be.equal("DIV")
15+
expect($el).to.be.empty
1416
})
1517
})
1618

examples/using-contentful/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"scripts": {
3131
"develop": "gatsby develop",
3232
"build": "gatsby build",
33+
"clean": "gatsby clean",
3334
"start": "gatsby serve"
3435
}
3536
}

integration-tests/gatsby-cli/__tests__/new.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ describe(`gatsby new`, () => {
2929
})
3030

3131
it(`creates a gatsby site with the default starter`, () => {
32-
const [code, logs] = GatsbyCLI.from(cwd).invoke([`new`, `gatsby-default`])
32+
const [code, logs] = GatsbyCLI.from(cwd).invoke([
33+
`new`,
34+
`gatsby-default`,
35+
`gatsbyjs/gatsby-starter-default#v3`,
36+
])
3337

3438
logs.should.contain(
3539
`info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git`
@@ -48,7 +52,7 @@ describe(`gatsby new`, () => {
4852
const [code, logs] = GatsbyCLI.from(cwd).invoke([
4953
`new`,
5054
`gatsby-blog`,
51-
`gatsbyjs/gatsby-starter-blog`,
55+
`gatsbyjs/gatsby-starter-blog#v3`,
5256
])
5357

5458
logs.should.contain(

packages/gatsby-cli/src/structured-errors/error-schema.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Joi from "joi"
22
import { ILocationPosition, IStructuredError } from "./types"
33

4-
export const Position: Joi.ObjectSchema<ILocationPosition> = Joi.object().keys({
5-
line: Joi.number(),
6-
column: Joi.number(),
7-
})
4+
export const Position: Joi.ObjectSchema<ILocationPosition> = Joi.object()
5+
.keys({
6+
line: Joi.number(),
7+
column: Joi.number(),
8+
})
9+
.unknown()
810

911
export const errorSchema: Joi.ObjectSchema<IStructuredError> =
1012
Joi.object().keys({
@@ -27,7 +29,7 @@ export const errorSchema: Joi.ObjectSchema<IStructuredError> =
2729
location: Joi.object({
2830
start: Position.required(),
2931
end: Position,
30-
}),
32+
}).unknown(),
3133
docsUrl: Joi.string().uri({
3234
allowRelative: false,
3335
relativeOnly: false,

packages/gatsby-plugin-image/src/resolver-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ export function getGatsbyImageFieldConfig<TSource, TContext, TArgs>(
201201
type: ImagePlaceholderType.name,
202202
description: stripIndent`
203203
Format of generated placeholder image, displayed while the main image loads.
204-
BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)
205-
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
206-
TRACED_SVG: a low-resolution traced SVG of the image.
204+
BLURRED: a blurred, low resolution image, encoded as a base64 data URI.
205+
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image (default).
206+
TRACED_SVG: deprecated. Will use DOMINANT_COLOR.
207207
NONE: no placeholder. Set the argument "backgroundColor" to use a fixed background color.`,
208208
},
209209
formats: {

packages/gatsby-plugin-sharp/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
"gatsby-telemetry": "^2.14.0",
1818
"got": "^11.8.2",
1919
"lodash": "^4.17.21",
20-
"mini-svg-data-uri": "^1.3.3",
21-
"potrace": "^2.1.8",
2220
"probe-image-size": "^6.0.0",
2321
"progress": "^2.0.3",
2422
"semver": "^7.3.5",
2523
"sharp": "^0.29.0",
26-
"svgo": "1.3.2",
2724
"uuid": "3.4.0"
2825
},
2926
"devDependencies": {

0 commit comments

Comments
 (0)