<story><title>TC39 Proposal: Type Annotations</title><url>https://github.com/tc39/proposal-type-annotations</url></story><parent_chain><item><author>klodolph</author><text>I love this.&lt;p&gt;Maybe it means that I don’t have to preprocess &amp;#x2F; compile TypeScript before running it. This is a genuine win for me. The TypeScript compiler can continue doing what it does best—type checking—and then I can just run the code. Running the TypeScript compiler from a cold start takes a surprisingly long amount of time.&lt;p&gt;Currently, I have to figure out how to get a build system that compiles TypeScript once for bundling to the browser and once for running in Node, and the user experience around setting this up is just incredibly bad. It sucks. I make some change to how I build for browser and it turns out to be incompatible with whatever system I am using for Node. This solves part of that problem, and reduces friction. Type annotations can be just part of the JS and stripped out by minification.</text></item></parent_chain><comment><author>runarberg</author><text>I’ve been writing Vanilla JavaScript with JSDoc annotations and using TypeScript as a type checker (as opposed to a compiler) for some of my hobby-projects, and it is amazing breath of fresh air from the bundler tool chains of the past.&lt;p&gt;As pointed out by this proposal the JSDoc annotations are—to put it mildly—a bit cumbersome. The more complicated types are close to impossible to figure out how to write, if they are possible to write at all. And on Q&amp;amp;A forums I constantly have to translate between the two syntaxes in my head, since most of the audience will probably not understand the JSDoc syntax.&lt;p&gt;Having a unified type annotation syntax which the runtime ignores will definitely make my life easier.</text></comment>
<story><title>TC39 Proposal: Type Annotations</title><url>https://github.com/tc39/proposal-type-annotations</url></story><parent_chain><item><author>klodolph</author><text>I love this.&lt;p&gt;Maybe it means that I don’t have to preprocess &amp;#x2F; compile TypeScript before running it. This is a genuine win for me. The TypeScript compiler can continue doing what it does best—type checking—and then I can just run the code. Running the TypeScript compiler from a cold start takes a surprisingly long amount of time.&lt;p&gt;Currently, I have to figure out how to get a build system that compiles TypeScript once for bundling to the browser and once for running in Node, and the user experience around setting this up is just incredibly bad. It sucks. I make some change to how I build for browser and it turns out to be incompatible with whatever system I am using for Node. This solves part of that problem, and reduces friction. Type annotations can be just part of the JS and stripped out by minification.</text></item></parent_chain><comment><author>redox99</author><text>I don&amp;#x27;t see what the issue is.&lt;p&gt;For backend node, you simply edit a couple of lines in the package.json to use ts-node during dev, and run tsc for shipping builds (a bit more performant than ts-node).&lt;p&gt;For frontend usually you literally don&amp;#x27;t configure anything, Next.JS, CRA, or whatever already comes with typescript preconfigured if you select it. And if you do everything manually, considering you still need to setup babel, webpack etc, it makes almost no difference.&lt;p&gt;It seems quite extreme modifying javascript for this considering you still would want to remove types in order to reduce bundle size, and you would still need the actual compiler because you have things such as enums, annotations and more that JS doesn&amp;#x27;t support either.</text></comment>