Skip to content

Remove bluebird and use native Promise#2409

Merged
j0k3r merged 4 commits intomasterfrom
fix/remove-bluebird
Apr 22, 2026
Merged

Remove bluebird and use native Promise#2409
j0k3r merged 4 commits intomasterfrom
fix/remove-bluebird

Conversation

@j0k3r
Copy link
Copy Markdown
Member

@j0k3r j0k3r commented Apr 21, 2026

The code looks more native now.

The code looks more native now.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the Bluebird dependency and migrates the codebase (core plugin + packagers + tests) to native Promise and async/await patterns.

Changes:

  • Dropped bluebird from package.json and replaced BbPromise.* usages across lib/ and tests/.
  • Refactored several modules (notably compilation/packaging paths) to async/await with native concurrency handling.
  • Updated Jest mocks/tests to work with Node-style async APIs (fs.readFile, fs.stat) and native promises.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/wpwatch.test.js Replaced BbPromise.join/reject with Promise.all/native Promise.reject.
tests/validate.test.js Updated mocked config loads and rejection cases to native promises.
tests/runPluginSupport.test.js Replaced BbPromise.join with Promise.all.
tests/run.test.js Updated watch handler stubs from Bluebird to native resolved promises.
tests/prepareStepOfflineInvoke.test.js Updated spawn rejection to native Promise.reject.
tests/prepareOfflineInvoke.test.js Updated spawn rejection to native Promise.reject.
tests/packagers/yarn.test.js Updated spawnProcess stubs to return native promises.
tests/packagers/npm.test.js Updated spawnProcess stubs to return native promises.
tests/packageModules.test.js Replaced Bluebird sequencing helpers with async loops/native promises.
tests/packExternalModules.test.js Updated packager mock returns and assertions to native promises.
tests/index.test.js Updated plugin hook stubs to return native promises.
package.json Removed bluebird dependency.
lib/wpwatch.js Converted Bluebird usage to native promises for watch lifecycle.
lib/validate.js Replaced Bluebird resolves/rejects with native Promise patterns; minor optional chaining cleanup.
lib/utils.js Removed lodash/bluebird usage; native implementations for cache purge + helpers.
lib/runPluginSupport.js Replaced BbPromise.resolve() with Promise.resolve().
lib/run.js Reworked watch flow away from BbPromise.try to try/catch + Promise.resolve(action).
lib/packagers/yarn.js Migrated to async/await and removed Bluebird-specific helpers.
lib/packagers/npm.js Migrated to async/await and removed Bluebird-specific helpers.
lib/packagers/index.js Updated packager interface docs to Promise-based terminology.
lib/packageModules.js Replaced Bluebird promisify/mapSeries with util.promisify + async loops + Promise.all.
lib/packExternalModules.js Converted to async/await; introduced helper for callback/promise interop.
lib/compile.js Replaced Bluebird concurrency with custom async concurrency mapper.
lib/cleanup.js Replaced BbPromise.resolve() with Promise.resolve().
index.js Updated Serverless hook chains from BbPromise.bind/tap to native promise chaining.
biome.jsonc Updated Biome schema URL version.
mocks/fs.js Added callback-based readFile/stat and mode to support promisified fs usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/packExternalModules.js Outdated
Comment thread lib/compile.js Outdated
Comment thread lib/packagers/index.js
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

package.json:41

  • After removing the bluebird dependency, there are still repo artifacts that reference it (e.g. README.md and examples/babel-webpack-5/lib/App.js import/require bluebird). Consumers following the README or running examples will hit a runtime/module-resolution error unless those references are updated (or bluebird is kept as a dependency/devDependency). Consider updating docs/examples (and regenerating package-lock.json if applicable) as part of this change.
  "dependencies": {
    "archiver": "^7.0.1",
    "find-yarn-workspace-root": "^2.0.0",
    "fs-extra": "^11.3.4",
    "glob": "^13.0.6",
    "lodash": "^4.18.1",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/packagers/npm.js Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/utils.js
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@j0k3r j0k3r requested a review from vicary April 22, 2026 09:17
Copy link
Copy Markdown
Member

@vicary vicary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, finally!

Tried exactly this a few years ago, blocked by the support matrix back then. It surely feels weird that this is trivial work now with LLM.

@j0k3r j0k3r merged commit 152d1cf into master Apr 22, 2026
17 checks passed
@j0k3r j0k3r deleted the fix/remove-bluebird branch April 22, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants