Skip to content

Commit

Permalink
Upgrade jest-worker (#23077)
Browse files Browse the repository at this point in the history
This PR upgrades `jest-worker` and `jest-cli` to the latest pre-release version, also removed `jest-circus` which is included in Jest by default. `jest-worker@next` includes a fix for memory leak that we need (jestjs/jest#11187). 

Fixes #22925. This will also improve the OOM issue for `next dev` #15855.
  • Loading branch information
shuding committed Mar 16, 2021
1 parent 091d56a commit 1bf4cf3
Show file tree
Hide file tree
Showing 21 changed files with 61,139 additions and 61,518 deletions.
2 changes: 0 additions & 2 deletions jest.config.js
@@ -1,6 +1,4 @@
module.exports = {
// this will become default in jest 27:
testRunner: 'jest-circus/runner',
testMatch: ['**/*.test.js'],
verbose: true,
rootDir: 'test',
Expand Down
5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -59,7 +59,7 @@
"async-sema": "3.0.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
"babel-jest": "27.0.0-next.5",
"browserslist": "^4.14.7",
"browserstack-local": "1.4.0",
"cheerio": "0.22.0",
Expand Down Expand Up @@ -87,8 +87,7 @@
"image-size": "0.9.3",
"is-animated": "2.0.0",
"isomorphic-unfetch": "3.0.0",
"jest-circus": "26.0.1",
"jest-cli": "24.9.0",
"jest-cli": "27.0.0-next.5",
"ky": "0.19.1",
"ky-universal": "0.6.0",
"lerna": "4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Expand Up @@ -2,7 +2,7 @@ import { loadEnvConfig } from '@next/env'
import chalk from 'chalk'
import crypto from 'crypto'
import { promises, writeFileSync } from 'fs'
import Worker from 'jest-worker'
import { Worker } from 'jest-worker'
import devalue from 'next/dist/compiled/devalue'
import escapeStringRegexp from 'next/dist/compiled/escape-string-regexp'
import findUp from 'next/dist/compiled/find-up'
Expand Down
Expand Up @@ -7,7 +7,7 @@ import {
sources,
} from 'next/dist/compiled/webpack/webpack'
import pLimit from 'p-limit'
import jestWorker from 'jest-worker'
import { Worker } from 'jest-worker'
import crypto from 'crypto'
import cacache from 'next/dist/compiled/cacache'
import { spans } from '../../profiling-plugin'
Expand Down Expand Up @@ -192,13 +192,10 @@ class TerserPlugin {
return initializedWorker
}

initializedWorker = new jestWorker(
path.join(__dirname, './minify.js'),
{
numWorkers: numberOfWorkers,
enableWorkerThreads: true,
}
)
initializedWorker = new Worker(path.join(__dirname, './minify.js'), {
numWorkers: numberOfWorkers,
enableWorkerThreads: true,
})

initializedWorker.getStdout().pipe(process.stdout)
initializedWorker.getStderr().pipe(process.stderr)
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/conf/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/css-loader/cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/debug/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/find-cache-dir/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/next/compiled/postcss-flexbugs-fixes/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/postcss-preset-env/index.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 1bf4cf3

Please sign in to comment.