Update us to the latest Backbone.js

Review Request #9694 — Created Feb. 23, 2018 and submitted

Information

Review Board
master
a665c88...

Reviewers

This change moves us over to Backbone 1.3.3. There are three changes
to the API that required updates:

  • this.options is no longer set when initializing views, and has to be
    done manually if desired. We only had about 10 views that actually
    used this.options, so this isn't too invasive. I've updated
    documentation where our docs were already in the new style, and
    otherwise left it the same for old code (which will be updated for our
    new doc standards in due time).
  • Callbacks from Model.destroy() are now asynchronous. This doesn't
    actually affect the UI at all, but did affect some unit tests which were
    written with the assumption that it was synchronous.
  • Events.listenTo no longer calls Events.on, instead delegating to
    an internal function. I've updated the test that checked this to instead
    check the internal listener state (which is probably about as fragile).
  • Ran js-tests.
  • Smoke tested the UI.
Description From Last Updated

Col: 29 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 30 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'Class'.

reviewbotreviewbot

Col: 7 'cb' was used before it was defined.

reviewbotreviewbot

Col: 33 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 63 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 31 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 7 'modelMatcher' was used before it was defined.

reviewbotreviewbot

Col: 80 Expected '{' and instead saw 'opts'.

reviewbotreviewbot

Col: 7 'internalOn' was used before it was defined.

reviewbotreviewbot

Col: 15 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 7 'onApi' was used before it was defined.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'listening'.

reviewbotreviewbot

Col: 24 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 23 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 23 Expected '{' and instead saw 'break'.

reviewbotreviewbot

Col: 7 'offApi' was used before it was defined.

reviewbotreviewbot

Col: 18 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'break'.

reviewbotreviewbot

Col: 47 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 54 Expected '{' and instead saw 'callback'.

reviewbotreviewbot

Col: 7 'onceMap' was used before it was defined.

reviewbotreviewbot

Col: 38 Expected '{' and instead saw 'args'.

reviewbotreviewbot

Col: 7 'triggerApi' was used before it was defined.

reviewbotreviewbot

Col: 32 Expected '{' and instead saw 'allEvents'.

reviewbotreviewbot

Col: 19 Expected '{' and instead saw 'triggerEvents'.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'triggerEvents'.

reviewbotreviewbot

Col: 32 Expected '{' and instead saw '('.

reviewbotreviewbot

Col: 29 Expected '{' and instead saw 'this'.

reviewbotreviewbot

Col: 38 Expected '{' and instead saw 'this'.

reviewbotreviewbot

Col: 29 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 30 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'Class'.

reviewbotreviewbot

Col: 7 'cb' was used before it was defined.

reviewbotreviewbot

Col: 33 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 63 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 31 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 7 'modelMatcher' was used before it was defined.

reviewbotreviewbot

Col: 80 Expected '{' and instead saw 'opts'.

reviewbotreviewbot

Col: 7 'internalOn' was used before it was defined.

reviewbotreviewbot

Col: 15 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 7 'onApi' was used before it was defined.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'listening'.

reviewbotreviewbot

Col: 24 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 23 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 23 Expected '{' and instead saw 'break'.

reviewbotreviewbot

Col: 7 'offApi' was used before it was defined.

reviewbotreviewbot

Col: 18 Expected '{' and instead saw 'return'.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'break'.

reviewbotreviewbot

Col: 47 Expected '===' and instead saw '=='.

reviewbotreviewbot

Col: 54 Expected '{' and instead saw 'callback'.

reviewbotreviewbot

Col: 7 'onceMap' was used before it was defined.

reviewbotreviewbot

Col: 38 Expected '{' and instead saw 'args'.

reviewbotreviewbot

Col: 7 'triggerApi' was used before it was defined.

reviewbotreviewbot

Col: 32 Expected '{' and instead saw 'allEvents'.

reviewbotreviewbot

Col: 19 Expected '{' and instead saw 'triggerEvents'.

reviewbotreviewbot

Col: 22 Expected '{' and instead saw 'triggerEvents'.

reviewbotreviewbot

Col: 32 Expected '{' and instead saw '('.

reviewbotreviewbot

Col: 29 Expected '{' and instead saw 'this'.

reviewbotreviewbot

Col: 38 Expected '{' and instead saw 'this'.

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

JSHint

chipx86
  1. Thanks for doing this :) So glad we're finally getting out of the dark ages on Backbone.

  2. We can't just spy on listenTo itself?

  3. 
      
david
Review request changed
Branch:
release-4.0.x
master
Commit:
7451ab4bd72a11976731e0bc3fadb268aa84b037
a665c889b4c776d7f9691d1b0db533b671b9b779

Checks run (1 failed, 1 succeeded)

flake8 passed.
JSHint failed.

JSHint

chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (5327c29)