• 
      

    Remove the @spina decorator on abstract classes.

    Review Request #13738 — Created April 16, 2024 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.x

    Reviewers

    BaseVisibilityActionView was decorated with @spina, which isn't
    technically allowed.

    @spina should only be applied to classes that can be instantiated. For
    abstract classes, we either want to use the parent class's Spina
    information or use spinaBaseClassExtends to define a new top-level
    class.

    It seems that, by and large, decorators can't be used with abstract
    classes. When compiling, we get basically:

    const foo = abstract class Foo {}
    

    This is a syntax error in JavaScript.

    The reason we didn't encounter this problem before is that Babel was
    stripping out the abstract when it processed the TypeScript and
    compiled to JavaScript. The TypeScript compiler leaves it in, in order
    to try to wrap it in a decorator.

    Going forward, we'll need to be careful not to decorate these classes.

    Unit tests pass.

    Verified that this no longer broke the build when compiled via
    ESBuild and Storybook.

    Commits

    Files