Convert BaseCollection.fetch to return a promise.

Review Request #11629 — Created May 27, 2021 and updated

david
Review Board
master
reviewboard

This is the first of what is likely to be many steps to move our
codebase towards a more modern feel of using promises (and eventually
async) for asynchronous operations. In this change,
BaseCollection.fetch has been changed, along with everything that
actually uses that including similar methods inside
ResourceCollection. The old callback usage is still available through
a helper which will wrap the returned promise, but causes a warning to
be logged to the console.

This also makes a slight tweak to our browserslist config in order to
ensure that async won't get polyfilled out due to older chrome on
android.

  • Ran js-tests.
  • Manually tested data population on the review dialog and post commit
    views.
Summary
Convert BaseCollection.fetch to return a promise.
Description From Last Updated

Col: 11 Expected ':' and instead saw '_loadBranches'.

reviewbotreviewbot

Col: 27 Expected '}' to match '{' from line 9 and instead saw '{'.

reviewbotreviewbot

Col: 13 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 18 Missing semicolon.

reviewbotreviewbot

Col: 9 Unrecoverable syntax error. (49% scanned).

reviewbotreviewbot

Col: 30 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 40 Missing semicolon.

reviewbotreviewbot

Col: 17 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 22 Missing semicolon.

reviewbotreviewbot

Col: 30 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 40 Missing semicolon.

reviewbotreviewbot

Col: 17 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 22 Missing semicolon.

reviewbotreviewbot

Col: 46 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 56 Missing semicolon.

reviewbotreviewbot

Col: 17 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 22 Missing semicolon.

reviewbotreviewbot

Col: 37 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 47 Missing semicolon.

reviewbotreviewbot

Col: 17 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 22 Missing semicolon.

reviewbotreviewbot

Col: 56 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 66 Missing semicolon.

reviewbotreviewbot

Col: 21 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 26 Missing semicolon.

reviewbotreviewbot

Col: 40 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 50 Missing semicolon.

reviewbotreviewbot

Col: 17 Expected an assignment or function call and instead saw an expression.

reviewbotreviewbot

Col: 22 Missing semicolon.

reviewbotreviewbot

Col: 47 Expected ')' and instead saw 'function'.

reviewbotreviewbot

Col: 10 'promiseToCallbacks' is defined but never used.

reviewbotreviewbot

Col: 29 Missing semicolon.

reviewbotreviewbot

Col: 65 Missing semicolon.

reviewbotreviewbot

Col: 50 Missing semicolon.

reviewbotreviewbot

Col: 50 Missing semicolon.

reviewbotreviewbot

Col: 2 Unnecessary semicolon.

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

david
Review request changed

Description:

   

This is the first of what is likely to be many steps to move our

    codebase towards a more modern feel of using promises (and eventually
    async) for asynchronous operations. In this change,
    BaseCollection.fetch has been changed, along with everything that
    actually uses that including similar methods inside
~   ResourceCollection.

  ~ ResourceCollection. The old callback usage is still available through
  + a helper which will wrap the returned promise, but causes a warning to
  + be logged to the console.

   
   

This also makes a slight tweak to our browserslist config in order to

    ensure that async won't get polyfilled out due to older chrome on
    android.

Commits:

Summary
-
Convert BaseCollection.fetch to return a promise.
+
Convert BaseCollection.fetch to return a promise.

Diff:

Revision 2 (+1550 -760)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 passed.
JSHint failed.

JSHint

david
Review request changed
david
Review request changed
david
Review request changed
Loading...