• 
      

    Convert the Review Board extension code to TypeScript.

    Review Request #14569 — Created Aug. 22, 2025 and submitted — Latest diff uploaded

    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.

    Commits

    Files