Convert the Review Board extension code to TypeScript.

Review Request #14569 — Created Aug. 21, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

Djblets's JavaScript extension code is typed, but our Review Board
aliases were all classic code aliasing to the RB namespace directly.
This prevented any extensions from benefiting from any typing
information for classes, attribute interfaces, or anything else.

We now export those out from appropriate modules in order to retain all
the typing.

However, since the rest of the extension hooks depended on those being
set on RB, and were a bit of a pain to use from TypeScript code, this
change also converts those to TypeScript.

The hooks are very basic, so this is pretty straight-forward. We have
our usual attribute interfaces and our classes. The addition to the
existing code is that there's now dedicated *HookView classes for the
hooks that inject views into other views and pass in particular
attributes. The new views type and assign options so that usage is more
clear and types carry forward.

This is all going into a reviewboard/extensions module, rather than
being rolled up into reviewboard/common, in order to more clearly
separate common interfaces from extension-related code. It is, however,
being merged into the same Pipeline bundle, since pages including the
common bundle expect RB.Extension, the hooks, etc. to exist (which
is also needed for extensions not using ESM).

Unit tests passed.

Tested a few extensions, each making use of these classes. They were
still working as expected.

Ported one (rbcommenttype) to TypeScript and tested again. This tested
CommentDialogHook and ReviewDialogCommentHook. They still work.

Summary ID
Convert the Review Board extension code to TypeScript.
Djblets's JavaScript extension code is typed, but our Review Board aliases were all classic code aliasing to the `RB` namespace directly. This prevented any extensions from benefiting from any typing information for classes, attribute interfaces, or anything else. We now export those out from appropriate modules in order to retain all the typing. However, since the rest of the extension hooks depended on those being set on `RB`, and were a bit of a pain to use from TypeScript code, this change also converts those to TypeScript. The hooks are very basic, so this is pretty straight-forward. We have our usual attribute interfaces and our classes. The addition to the existing code is that there's now dedicated `*HookView` classes for the hooks that inject views into other views and pass in particular attributes. The new views type and assign options so that usage is more clear and types carry forward. This is all going into a `reviewboard/extensions` module, rather than being rolled up into `reviewboard/common`, in order to more clearly separate common interfaces from extension-related code. It is, however, being merged into the same Pipeline bundle, since pages including the `common` bundle expect `RB.Extension`, the hooks, etc. to exist (which is also needed for extensions not using ESM).
53b7fe3bb58c1ff1843c91efd5a182c2c432bd7c
Description From Last Updated

Looks like this was copy/pasted from elsewhere? This is about the file attachment thumbnail.

daviddavid
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. 
      
  2. Show all issues

    Looks like this was copy/pasted from elsewhere? This is about the file attachment thumbnail.

  3. 
      
jdjdksoshbwj
  1. Ship It!
    1. This is a production server. If you need to do testing, please use https://demo.reviewboard.org/

  2. 
      
jdjdksoshbwj
  1. 
      
  2.