develwoutacause’s avatardevelwoutacause’s Twitter Archive—№ 1,755

  1. So I decided to build this browser extension as an alternative to the #TC39 type annotations proposals to prototype the approach. It mostly works though I've come to the conclusion that this is not as workable as I initially thought. github.com/dgp1130/ts-transformer-extension/ @develwoutacause/1569883800263610369
    1. …in reply to @develwoutacause
      The core issue is that there's no clear mechanism for determining which scripts on a page are #TypeScript which needs to be transformed by the browser, and which scripts are real #JavaScript. The obvious approaches (file extensions, Content-Type, attributes) have major flaws.
      1. …in reply to @develwoutacause
        Instead, I came to the conclusion that browsers don't have the necessary context to strip types effectively and this is better done in an ESM dev server like #Vite. Such a server actually has all the same tooling usability benefits as the TC39 proposal.
        1. …in reply to @develwoutacause
          So while I think this is ultimately a failed experiment, I figured I'd still share it to keep the conversation going and give another perspective on this particular problem space.