Ghost
Ghost copied to clipboard
feat: replace Promise.join with promise.all()
Got some code for us? Awesome π!
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
andyarn lint
)
We appreciate your contribution!
Also, if you'd be interested in writing code like this for us more regularly, we're hiring: https://careers.ghost.org/product-engineer-node-js
Codecov Report
Merging #14972 (47f5758) into main (3231863) will increase coverage by
8.50%
. The diff coverage is60.00%
.
:exclamation: Current head 47f5758 differs from pull request most recent head b76ffc8. Consider uploading reports for the commit b76ffc8 to get more accurate results
@@ Coverage Diff @@
## main #14972 +/- ##
==========================================
+ Coverage 52.60% 61.10% +8.50%
==========================================
Files 1392 596 -796
Lines 89130 47668 -41462
Branches 10131 4293 -5838
==========================================
- Hits 46884 29127 -17757
+ Misses 42194 18493 -23701
+ Partials 52 48 -4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Why is this change considered an improvement? The docs for Promise.join say "While .all is good for handling a dynamically sized list of uniform promises, Promise.join is much easier (and more performant) to use when you have a fixed amount of discrete promises that you want to coordinate concurrently."
Did you check to see which method performed better?
If the the goal was to use a native Promise method instead of a Bluebird method, Bluebird is still required after this change is made, so there's not much benefit there.
@markstos see #14882 π