Skip to content

Commit

Permalink
chore(gatsby): revert #26636; and pin uuid to v3.4.0 (#26824)
Browse files Browse the repository at this point in the history
The bump to v8 as applied in #26636 gave us no benefits and are giving problems with imports in certain cases. Maintainers have made it clear they won't offer any support for node 13, which we will want to support for a while as well.

In due time we'll replace this library with something simpler as the maintenance burden will be too high. For now we revert and pin to 3.4.0, the last stable version that does what we want.

Fixes #26812
  • Loading branch information
pvdz authored Sep 8, 2020
1 parent df9014d commit 25b73ad
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"stack-trace": "^0.0.10",
"strip-ansi": "^5.2.0",
"update-notifier": "^4.1.0",
"uuid": "^8.3.0",
"uuid": "3.4.0",
"yargs": "^15.3.1",
"yurnalist": "^1.1.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-cli/src/reporter/redux/internal-actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/camelcase */

import { v4 as uuidv4 } from "uuid"
import uuidv4 from "uuid"
import { trackCli } from "gatsby-telemetry"
import signalExit from "signal-exit"
import { Dispatch } from "redux"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-benchmark-reporting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"fast-glob": "^3.2.4",
"node-fetch": "^2.6.0",
"uuid": "^8.3.0"
"uuid": "3.4.0"
},
"scripts": {
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { performance } = require(`perf_hooks`)

const { sync: glob } = require(`fast-glob`)
const nodeFetch = require(`node-fetch`)
const { v4: uuidv4 } = require(`uuid`)
const uuidv4 = require(`uuid/v4`)
const { execSync } = require(`child_process`)
const fs = require(`fs`)

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"semver": "^7.3.2",
"sharp": "^0.25.4",
"svgo": "1.3.2",
"uuid": "^8.3.0"
"uuid": "3.4.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/src/scheduler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { v4: uuidv4 } = require(`uuid`)
const uuidv4 = require(`uuid/v4`)
const path = require(`path`)
const fs = require(`fs-extra`)
const got = require(`got`)
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-recipes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"unist-util-remove": "^2.0.0",
"unist-util-visit": "^2.0.2",
"urql": "^1.9.7",
"uuid": "^8.3.0",
"uuid": "3.4.0",
"ws": "^7.3.0",
"xstate": "^4.9.1",
"yoga-layout-prebuilt": "^1.9.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-source-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"graphql": "^14.6.0",
"invariant": "^2.2.4",
"node-fetch": "^1.7.3",
"uuid": "^8.3.0"
"uuid": "3.4.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-source-graphql/src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { v4: uuidv4 } = require(`uuid`)
const uuidv4 = require(`uuid/v4`)
const { buildSchema, printSchema } = require(`gatsby/graphql`)
const {
wrapSchema,
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"is-docker": "^2.1.1",
"lodash": "^4.17.20",
"node-fetch": "^2.6.0",
"uuid": "^8.3.0"
"uuid": "3.4.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-telemetry/src/in-memory-store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from "uuid"
import uuidv4 from "uuid"
import os from "os"
import { join } from "path"

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-telemetry/src/telemetry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from "uuid"
import uuidv4 from "uuid/v4"
import os from "os"
import { isCI, getCIName } from "gatsby-core-utils"
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"type-of": "^2.0.1",
"url-loader": "^1.1.2",
"util.promisify": "^1.0.1",
"uuid": "^8.3.0",
"uuid": "3.4.0",
"v8-compile-cache": "^1.1.2",
"webpack": "^4.44.1",
"webpack-dev-middleware": "^3.7.2",
Expand Down
6 changes: 1 addition & 5 deletions packages/gatsby/src/redux/__tests__/jobsv2.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const jobsManager = require(`../../utils/jobs-manager`)
jest.spyOn(jobsManager, `enqueueJob`)
jest.spyOn(jobsManager, `removeInProgressJob`)
jest.mock(`uuid`, () => {
return {
v4: () => `1234`,
}
})
jest.mock(`uuid/v4`, () => () => `1234`)

import { jobsV2Reducer as jobsReducer } from "../reducers/jobsv2"

Expand Down
10 changes: 4 additions & 6 deletions packages/gatsby/src/utils/__tests__/jobs-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ jest.mock(
{ virtual: true }
)

jest.mock(`uuid`, () => {
return {
v4: jest.fn().mockImplementation(jest.requireActual(`uuid`).v4),
}
})
jest.mock(`uuid/v4`, () =>
jest.fn().mockImplementation(jest.requireActual(`uuid/v4`))
)

const worker = require(`/node_modules/gatsby-plugin-test/gatsby-worker.js`)
const reporter = require(`gatsby-cli/lib/reporter`)
const hasha = require(`hasha`)
const fs = require(`fs-extra`)
const pDefer = require(`p-defer`)
const { v4: uuidv4 } = require(`uuid`)
const uuidv4 = require(`uuid/v4`)

fs.ensureDir = jest.fn().mockResolvedValue(true)

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/utils/create-node-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v5 as uuidv5 } from "uuid"
import uuidv5 from "uuid/v5"
import report from "gatsby-cli/lib/reporter"

const seedConstant = `638f7a53-c567-4eca-8fc1-b23efb1cfb2b`
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/utils/jobs-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from "uuid"
import uuidv4 from "uuid/v4"
import path from "path"
import hasha from "hasha"
import fs from "fs-extra"
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24746,7 +24746,7 @@ utils-merge@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"

uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2, uuid@^3.3.3, uuid@^3.4.0:
uuid@3.4.0, uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2, uuid@^3.3.3, uuid@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
Expand All @@ -24756,11 +24756,6 @@ uuid@^7.0.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b"
integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==

uuid@^8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea"
integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==

v8-compile-cache@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz#8d32e4f16974654657e676e0e467a348e89b0dc4"
Expand Down

0 comments on commit 25b73ad

Please sign in to comment.