News for hackers. Stuff that matters.
Re:Ask HN: Why does front-end development change so often? by furi on Sunday January 20, 2019 @03:21AM (#18951896)
Maybe I missed something, but my experience was that Typescript was capable of making useful conclusions (i.e. MyLibrary.MyType.width exists, but MyLibrary.MyType.dog does not) about other libraries, delivered to it via NPM, that were also written in Typescript. If your libraries were written in JavaScript to be run in the browser you were stuck doing `declare var mylibrary: any;` and writing "unsafe" code. This is also true of any global variables/functions/etc. that exist in <script> tags in your HTML.

To be clear I don't expect it to be able to do this, reading JavaScript that was written without types and deciding what the types are sounds more or less impossible, it's just a demonstration of how you tend to end up with an imperfect solution as a result of the decisions made early on in the web's development.

Re:Ask HN: Why does front-end development change so often? by jelgt2011 on Sunday January 20, 2019 @03:44AM (#18951978)
Typescript allows you to essentially write a typed API interface for your library (instead of rewriting your entire library in typescript), but support is fairly spotty.