Skip to content

Removed Bluebird dependency#17831

Merged
daniellockyer merged 5 commits into
TryGhost:mainfrom
chairulakmal:14882-remove-bluebird-from-bookshelf-raw-knex
Aug 29, 2023
Merged

Removed Bluebird dependency#17831
daniellockyer merged 5 commits into
TryGhost:mainfrom
chairulakmal:14882-remove-bluebird-from-bookshelf-raw-knex

Conversation

@chairulakmal
Copy link
Copy Markdown
Contributor

@chairulakmal chairulakmal commented Aug 26, 2023

refs #14882

👋 Hi there! I'm a new contributor and I've made minimum changes to the last file requiring Bluebird and then remove it from ghost/core. I tried to refactor the code to operate with async/await but after realizing how raw-knex is used, I opted to instead do a one line change where Bluebird Promise.props is used. Subsequently I updated the core package.json by removing Bluebird, since it's now unnecessary for any file in ghost/core. Your feedback is much appreciated!

Thanks,
kai

Please include a description of your change & check your PR against this list, thanks!

  • There's a clear use-case for this code change, explained below
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test:all in core and yarn lint)

We appreciate your contribution!


🤖 Generated by Copilot at e625a9f

This pull request removes the bluebird library and updates the raw_knex plugin to use native promises methods. This simplifies the code and reduces the number of dependencies in the project.

refs TryGhost#14882
with this the Bluebird is no longer required in ghost/core
@chairulakmal chairulakmal changed the title 14882 remove bluebird from ghost/core Removed bluebird from ghost/core Aug 26, 2023
@chairulakmal
Copy link
Copy Markdown
Contributor Author

chairulakmal commented Aug 27, 2023

Hi @daniellockyer, thanks for running the CI tests! I didn't realize there's a distinct test suite for the core, and how it doesn't automatically execute when running yarn test from the monorepo root. Will fix it today or tomorrow.

refs TryGhost#14882
with this the Bluebird is no longer required in ghost/core
@chairulakmal
Copy link
Copy Markdown
Contributor Author

Instead of transforming raw_knex into an asynchronous function, I chose to make one minor change to eliminate the need for Bluebird's Promise.props. This approach successfully achives the goal of eliminating Bluebird from the core. Furthermore, I verified that executing yarn test:all yielded comparable results to those of the existing main branch.

Comment thread ghost/core/core/server/models/base/plugins/raw-knex.js
@daniellockyer daniellockyer changed the title Removed bluebird from ghost/core Removed Bluebird dependency Aug 29, 2023
@daniellockyer daniellockyer merged commit 687cf5a into TryGhost:main Aug 29, 2023
@daniellockyer
Copy link
Copy Markdown
Contributor

Thanks @chairulakmal! 😀

@chairulakmal chairulakmal deleted the 14882-remove-bluebird-from-bookshelf-raw-knex branch September 5, 2023 11:32
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.

2 participants