Modernize RB.DiffFragmentQueue and RB.DataUtils.

Review Request #14098 — Created Aug. 9, 2024 and updated — Latest diff uploaded

Information

Review Board
master

Reviewers

This change converts the old RB.DiffFragmentQueueView to TypeScript,
along with the DataUtils methods which it uses. This involves several
pieces:

  • Changed the queue to not inherit from a Backbone view. This doesn't
    actually do any view things, it's purely an orchestration class.
  • Renamed it to DiffFragmentQueue and moved into a utils/ directory.
  • Updated the DataUtils methods to return promises for their results,
    and marked the callback function parameters as deprecated.
  • Rewrote the fragment loading to use promises and async/await instead
    of $.funcQueue, and fetch instead of $.ajax.
  • Ran js-tests.
  • Opened a review request with a bunch of diff comments and saw all the
    diff comment fragments load correctly.
  • Opened the review dialog with a bunch of pending diff comments and saw
    all the diff comment fragments load correctly.
  • Expanded sections of the diff for the reviews and review dialogs.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Modernize RB.DiffFragmentQueue and RB.DataUtils.
This change converts the old `RB.DiffFragmentQueueView` to TypeScript, along with the DataUtils methods which it uses. This involves several pieces: - Changed the queue to not inherit from a Backbone view. This doesn't actually do any view things, it's purely an orchestration class. - Renamed it to `DiffFragmentQueue` and moved into a utils/ directory. - Updated the `DataUtils` methods to return promises for their results, and marked the callback function parameters as deprecated. - Rewrote the fragment loading to use promises and async/await instead of `$.funcQueue`, and `fetch` instead of `$.ajax`. Testing Done: - Ran js-tests. - Opened a review request with a bunch of diff comments and saw all the diff comment fragments load correctly. - Opened the review dialog with a bunch of pending diff comments and saw all the diff comment fragments load correctly. - Expanded sections of the diff for the reviews and review dialogs.
654e7c8a9b1c9d46baa150b74c3c921f28f98912 David Trowbridge
reviewboard/staticbundles.py
reviewboard/static/rb/js/common/index.ts
reviewboard/static/rb/js/common/utils/dataUtils.ts
reviewboard/static/rb/js/common/utils/index.ts
reviewboard/static/rb/js/utils/tests/dataUtilsTests.es6.js
reviewboard/static/rb/js/common/utils/tests/index.ts
reviewboard/static/rb/js/reviewRequestPage/views/reviewRequestPageView.es6.js
reviewboard/static/rb/js/reviewRequestPage/views/tests/baseStatusUpdatesEntryViewTests.es6.js
reviewboard/static/rb/js/reviews/index.ts
reviewboard/static/rb/js/reviews/utils/diffFragmentQueue.ts
reviewboard/static/rb/js/reviews/utils/index.ts
reviewboard/static/rb/js/views/tests/diffFragmentQueueViewTests.es6.js
reviewboard/static/rb/js/reviews/utils/tests/index.ts
reviewboard/static/rb/js/reviews/views/reviewDialogView.ts
reviewboard/static/rb/js/reviews/views/tests/reviewDialogViewTests.ts
reviewboard/static/rb/js/tests/index.ts
reviewboard/static/rb/js/utils/dataUtils.es6.js
reviewboard/static/rb/js/views/diffFragmentQueueView.es6.js
Loading...