Convert the Review Board extension code to TypeScript.
Review Request #14569 — Created Aug. 21, 2025 and updated
Djblets's JavaScript extension code is typed, but our Review Board
aliases were all classic code aliasing to theRB
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 onRB
, 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 intoreviewboard/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 expectRB.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
andReviewDialogCommentHook
. They still work.
Summary | ID |
---|---|
53b7fe3bb58c1ff1843c91efd5a182c2c432bd7c |
Description | From | Last Updated |
---|---|---|
Looks like this was copy/pasted from elsewhere? This is about the file attachment thumbnail. |
|