Convert the Review Board extension code to TypeScript.
Review Request #14569 — Created Aug. 21, 2025 and submitted
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 |
---|---|
1532e1517b02d26b8ee85e42326f828a3c7482dd |
Description | From | Last Updated |
---|---|---|
Looks like this was copy/pasted from elsewhere? This is about the file attachment thumbnail. |
|
|
This should be /** |
|
|
While here, could you update this JS example to be a bit more modern (get rid of the function () … |
![]() |
|
This comment was copy/pasted and needs to be fixed too. |
|
|
These need to be removed. |
|
- Change Summary:
-
- Fixed the docs for
FileAttachmentThumbnailHookView
. - Updated one more usage of this hook in
FileAttachmentThumbnailView
.
- Fixed the docs for
- Commits:
-
Summary ID 53b7fe3bb58c1ff1843c91efd5a182c2c432bd7c 919f39059a23e0b5f2e968fc6b2f8baa9ac17e5a - Diff:
-
Revision 2 (+1198 -372)
Checks run (2 succeeded)
- Change Summary:
-
- Modernized example JavaScript docs.
- Fixed some other docs.
- Removed the old JavaScript files from the bundle.
- Commits:
-
Summary ID 919f39059a23e0b5f2e968fc6b2f8baa9ac17e5a 2e860ad3d3c64b1976d2a3c53263344908543af4 - Diff:
-
Revision 3 (+1196 -382)
Checks run (2 succeeded)
- Change Summary:
-
Added an unstaged fix.
- Commits:
-
Summary ID 2e860ad3d3c64b1976d2a3c53263344908543af4 1532e1517b02d26b8ee85e42326f828a3c7482dd - Diff:
-
Revision 4 (+1196 -382)