Skip to content

chore(jest-util): replace p-limit with inline implementation#15972

Open
roli-lpci wants to merge 2 commits intojestjs:mainfrom
roli-lpci:chore/remove-p-limit
Open

chore(jest-util): replace p-limit with inline implementation#15972
roli-lpci wants to merge 2 commits intojestjs:mainfrom
roli-lpci:chore/remove-p-limit

Conversation

@roli-lpci
Copy link

Summary

Replace the p-limit package (and its transitive yocto-queue dependency) with a ~30-line inline concurrency limiter in jest-util. The implementation covers the exact API surface Jest uses: pLimit(n) returning a function that queues async work with bounded concurrency.

Packages updated:

  • jest-changed-files — process-spawning mutex (concurrency 5)
  • jest-circus — concurrent test limiter
  • jest-jasmine2 — concurrent test limiter
  • jest-runner — in-band and parallel test run limiters

The e2e test fixture (e2e/transform/transform-runner/runner.ts) still uses p-limit directly from the root devDependencies, which is appropriate for a test fixture.

Test plan

  • yarn build:js compiles cleanly
  • ESLint clean on all changed files
  • Prettier clean on all changed files
  • yarn constraints passes
  • yarn dedupe --check passes

Move the concurrency-limiting logic from the p-limit package into
jest-util as a ~30-line inline implementation covering the exact API
surface Jest uses. This removes p-limit (and its transitive yocto-queue
dependency) from jest-changed-files, jest-circus, jest-jasmine2, and
jest-runner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Feb 27, 2026

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 76df202
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/69a12ba24533160008d5385c
😎 Deploy Preview https://deploy-preview-15972--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 27, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15972

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15972

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15972

create-jest

npm i https://pkg.pr.new/create-jest@15972

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15972

expect

npm i https://pkg.pr.new/expect@15972

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15972

jest

npm i https://pkg.pr.new/jest@15972

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15972

jest-circus

npm i https://pkg.pr.new/jest-circus@15972

jest-cli

npm i https://pkg.pr.new/jest-cli@15972

jest-config

npm i https://pkg.pr.new/jest-config@15972

@jest/console

npm i https://pkg.pr.new/@jest/console@15972

@jest/core

npm i https://pkg.pr.new/@jest/core@15972

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15972

jest-diff

npm i https://pkg.pr.new/jest-diff@15972

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15972

jest-each

npm i https://pkg.pr.new/jest-each@15972

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15972

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15972

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15972

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15972

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15972

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15972

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15972

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15972

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15972

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15972

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15972

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15972

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15972

jest-mock

npm i https://pkg.pr.new/jest-mock@15972

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15972

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15972

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15972

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15972

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15972

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15972

jest-runner

npm i https://pkg.pr.new/jest-runner@15972

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15972

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15972

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15972

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15972

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15972

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15972

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15972

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15972

@jest/types

npm i https://pkg.pr.new/@jest/types@15972

jest-util

npm i https://pkg.pr.new/jest-util@15972

jest-validate

npm i https://pkg.pr.new/jest-validate@15972

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15972

jest-worker

npm i https://pkg.pr.new/jest-worker@15972

pretty-format

npm i https://pkg.pr.new/pretty-format@15972

commit: cbc8927

The p-limit removal in jasmineAsyncInstall.ts collapsed two import lines
into one, shifting all subsequent line numbers in the built index.js by -1.
This updates the snapshot references from line 311 to 310.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant