The Types as Comments proposal means that browsers could run TypeScript-checked code directly, (even though they wouldn't do any type-checking). That means faster iteration with all the type-checking and editing experience you know and love today.


We're excited to hear what you think of this idea! We're hoping that this proposal can make coding easier for TypeScript and JavaScript users at every scale.


seems really similar to the type checking in Closure compiler which was my favorite way to write js! ++ for this


I am clairvoyant 🔮 (CRA-ZY)

dawntraoz's tweet image. I am clairvoyant 🔮 (CRA-ZY)

I have had a chance to chew on this a bit and my take is more nuanced now. As with a lot of decisions in tech, this proposal is a matter of tradeoffs and the weight different people will attribute to various factors will fluctuate My thoughts: 🧵 (buckle up, it's a long one)



This proposal looks like an amazing opportunity to effectively deprecate runtime constructs that should never have been in TypeScript in the first place, such as Enums and class visibility modifiers. No breaking changes needed since this is opt-in!


JSDoc typings already cover this use case 🤦🏼‍♂️ Including type checking, typings (ie .d.ts) generation And in VSCode: inline type checking, intellisense, and inline documentation I've been using build-less TS typed JS for years


Hmmm don’t really like this. The JavaScript parser still has to understand the types in some form in order to know what to ignore? What will you see in the Developer tools, will the types be shown there? Any minifier is going to strip these types anyway for a good reason.


Would specing that browsers read `application/typescript` files in a type-ignoring manner solve the same issues, and be simpler by leaving the JS language untouched/avoiding TC39?


Except that's not what this proposal is. Why then are you marketing it as "TS with no build step"?


Leave JavaScript alone. It’s fine the way it is.


Getting the actual typescript runtime in the browser, running typescript truly as-is with no transpilation step, would be ideal. And it would be feasible, given how eager browsers are to update. Your very own colleagues manage one of those browsers already!


Good god just use JavaScript and a better linter.


I admire everyone's efforts here, but it's very troubling to be throwing away JS's ability to ever use type information at runtime, because the syntax space was taken up by everyone's pet type checker and we Don't Break The Web. It's going to be a fun ride...


This seems nice, but IMHO should get rid of some legacy syntax before 🙂


How about a fast compiler that’s not written in JavaScript first? How would the type checking be faster if it still uses tsc under the hood. Tools like @vite_js already give us instant updates and type checks running concurrently. I would also love a TypeScript package registry!


Why does this have to be an ECMAScript proposal and not just a proposal as a second JavaScript syntax? ie why are we not pushing Chromium or FireFox to add a TypeScript parser? Then you only have to compile for release.


This is a great idea. I've been hoping for something like this for a long time. It reminds me of the transition from ActionScript2 to ActionScript3 (also based on the ECMAScript standard). In AS3, types were optional but the code was interpreted at runtime (no transpilation).


Wouldn't it be much better to instead allow for using other languages in the browser and defining sdk's for them? Something like wasm but more practical. This is more like copying typescript features into javascript


Please please please let this proposal reach Stage 1!


apropos of nothing (except positive possibilities for the language), how about support for tail call recursion in browsers?


This is a wonderful stop gap proposal to real types, but ultimately I want full static typing in js for performance and to eliminate the need for using a separate language to do #webassembly


I really like the idea of : as a "smart" comment syntax that's aware of commas and braces. 🔥 Not a big fan of adding `type` and `as` as new (contextual) keywords that also act like comments, though. That feels redundant, and I'd rather have TS adopt Flow cast syntax in JS mode


Instead of complaining here just read the proposal on GitHub properly. There are so many claims that are not true and those who have not used TS and never will have nothing to say here. Sorry if I have to express it so hard.


For a type system, but comments are for humans. Have another iteration for a proper extension of the ECMAScript syntax, take inspiration from other modern languages such as Rust, Dart, Swift, as well TypeScript. I really think it could be great, but not with comment hacks! :)


A type system for JS must be properly implemented in the core syntax, not as comments (they are for humans, not application code). :) TypeScript super popular currently, jQuery, CoffeScript huge before. JS is not just a compile target for them. Take inspir. from Rust as well!


It feels wrong. You make a dynamic language static. The whole Idea feels stupid. Microsoft wants this, why? To push the backend stuff to the client?


in my opinion, Typescript does great, but looks ugly sometimes and almost unreadable, but over all, it is great


Aren't we going backwards? How can it be better?

onhate's tweet image. Aren't we going backwards? How can it be better?

I use jsDoc for optional typing in js since quite a while, see for example webengineering-fhnw.github.io/Kolibri/


United States トレンド
Loading...

Something went wrong.


Something went wrong.