Convert reviewable models to TypeScript/spina.

Review Request #13530 — Created Feb. 7, 2024 and submitted

Information

Review Board
master

Reviewers

This change converts the *Reviewable models to TypeScript. While I was
in here I also removed some deprecated callbacks-style invocation inside
of the DiffReviewable.

  • Ran js-tests.
  • Smoke tested reviewing file attachments and diffs.
Summary ID
Convert reviewable models to TypeScript/spina.
This change converts the *Reviewable models to TypeScript. While I was in here I also removed some deprecated callbacks-style invocation inside of the DiffReviewable. Testing Done: - Ran js-tests. - Smoke tested reviewing file attachments and diffs. Reviewed at https://reviews.reviewboard.org/r/13530/
c7a3bf9643eb23324ba35e369d6cf71709403b4f
Description From Last Updated

These should all be removed.

chipx86chipx86

Missing docs.

chipx86chipx86

I think we can infer this type by doing: class AbstractReviewable< TAttributes extends AbstractReviewableAttrs = AbstractReviewableAttrs, TCommentBlockType extends AbstractCommentBlock<TCommentBlockAttrs>, TCommentBlockAttrs …

chipx86chipx86

Two blank lines.

chipx86chipx86
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. reviewboard/static/rb/js/reviews/models/diffReviewableModel.ts (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    These should all be removed.

  3. Show all issues

    Missing docs.

  4. Show all issues

    I think we can infer this type by doing:

    class AbstractReviewable<
        TAttributes extends AbstractReviewableAttrs = AbstractReviewableAttrs,
        TCommentBlockType extends AbstractCommentBlock<TCommentBlockAttrs>,
        TCommentBlockAttrs
    > extends ... {
        createCommentBlock(attrs: TCommentBlockAttrs) { ... }
    }
    
    1. That doesn't work. I've been banging my head against this for a while. It's on my radar to circle back and try to improve it.

    2. Yeah it doesn't. I tried to bring this into Spina and it didn't work. But there's some stuff in TypeScript 5+ that may make some of this possible. On my to-do list to play with.

  5. Show all issues

    Two blank lines.

  6. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (cdc4055)