• brian@programming.dev
    link
    fedilink
    arrow-up
    14
    ·
    1 year ago

    I don’t think it really fractures anything considering you can call a ts package from js without knowing. The other way also works with third party typings in DefinitelyTyped.

    It really just adds a bit of extra type info into js, looks like js, and transpiles into js that looks almost exactly like the input, including comments and spacing and such if you like, so there isn’t any lockin.

    There isn’t any competition, it’s just an extra optional tool for the js ecosystem in my eyes.

    • fidodo@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      The transpilation that typescript does doesn’t really have anything to do with typescript, it’s just there because typescript wants to support the latest ecmascript features, so transpilation is necessary for that, but technically you could simply strip out the type info and have another transpiler like babel handle the backwards compatibility. I think there are a few minor exceptions to that, like enums. There was even a proposal to add some typescript types to native JavaScript that would be ignored by the interpreter and just act as comments.

    • shastaxc@lemm.ee
      link
      fedilink
      arrow-up
      1
      arrow-down
      2
      ·
      1 year ago

      I think too many people ITT are conflating Typescript with Typescript frameworks like Angular.