10 ms·
Announcing TypeScript 1.8 Beta
- DanRosenwasser 11y agoAlso check out our "What's New in TypeScript" page[1] for a little more detail. [1] https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript https://github.com/Microsoft/TypeScript/wiki/What's-new-in-T...
- cpeterso 11y agoDoes Microsoft use TypeScript for any of its other products or web services? How strongly are Microsoft web teams encouraged to dogfood TypeScript? :)
- AdamTReineke 11y agoVS Code, IE11/Edge's F12 developer tools, and Sway (Office) use it to name only a few. VS Code's source: https://github.com/Microsoft/vscode https://github.com/Microsoft/vscode
- altano 11y agoTypeScript is looked upon very highly by everyone at MS and I haven't seen any new projects started with vanilla JS in the last few years. No one needs to encourage anyone to use it. It's just the obvious choice for large projects (and every project at MS is large). Some other products using it off the top of my head: Azure Machine Learning, Xbox Music, Visual Studio Team Services. EVERYTHING new.
- lenkite 11y agoSadly, Microsoft's main JS library for UI development - WinJS 4.x is _not_ TypeScript enabled.
- judah 11y agoWhile WinJS is not built in TypeScript, there are TypeScript bindings for it[0] bundled in the WinJS repo, so it's easy to use from TypeScript. [0]: https://github.com/winjs/winjs/tree/master/typings https://github.com/winjs/winjs/tree/master/typings
- theatraine 11y agoThe new Azure portal uses TypeScript heavily.
- awa 11y agohttps://www.onenote.com/clipper https://www.onenote.com/clipper is written in typescript
- jonesb6 11y agoMy dream is to have enough free time to rewrite a large open source project from es5/6 to typescript. One day.. Edit: I meant refactoring as a way to improve the project, learn typescript, and learn the project itself inside and out.
- nothrabannosir 11y agoI don't know if you're setting me up for a joke here, but you're putting the ball an inch away from an open goal: Javascript is Typescript. Typescript ⊇ Javascript. Especially if you already use Babel (or any other JS preprocessor, like uglify or concat) and have a build pipeline ready, you can start using Typescript today. Don't miss out! PS: It will throw a lot of errors on a conventional codebase, but compile despite them. That's the point; install the compiler today, slowly start fixing the errors as you go. It's all about gradual improvement and optional typing.
- seivan 11y agoThere are still issues with type definitions for third party libraries. I love TypeScript and would love to work on it full time, but it's painful when you need to use a dozen third party code. Unless this has been solved recently, I remembered tds files weren't updated regularly.
- nothrabannosir 11y agoThis myth really needs to die. Sorry for the harsh language, it's the TS team's fault for not taking this ongoing PR blunder seriously. You can (and always could) use almost any 3rd party lib with literally one line of code: var somelib: any; Done. No need to ever touch a .d.ts file. Sure, no type safety on the lib. But isn't that where we started, anyway? This should be put on a giant banner on the TS homepage.
- seivan 11y agoI'm not bothered by silly things like tone or harsh language, especially for such amazing news. I've actually written my fair share during the summer and I never knew about this. Thank you! How well would this work with an editor and typescript plugins? Say the amazing typescript-atom, I would guess the editor would crap its pants, no?
- bunkerbewohner 11y agoThis is brilliant! The first three features, i.e. --allowJs, --reactNamespace, and stateless functional componentshave been precisely the things that I have been missing recently. This makes integrating 3rd party JS libs much easier and I can streamline my components a little since I'm almost exclusively using stateless components anyway. That already made me quite happy. But as I'm reading on I almost can't believe all the other great additions, such as module augmentations, string literal types, AMD module concatenation, let/const in loops. It's like they've been reading my mind. These were all things on my wishlist. Great work!
- nikolay 11y agoI am really puzzling what is Microsoft trying to accomplish here? Eventually a C# that compiles to JavaScript? TypeScript is a great language, and surprisingly (or not) it's more successful than Dart. Now, of course, I want TypeScript to compile to CLR as well. :)
- Analemma_ 11y agoI think people read into TypeScript too much. It's just a "right-now minimal-hassle" way to make front-end dev's lives easier, nothing more. Maybe Microsoft disagrees, but I see TypeScript as something intended to make itself obsolete: eventually, when all browsers are running ES9 (or whichever version we decid has fixed "all" of JavaScript's problems) or WebAssembly (and we're all writing front-end code in C#/C++/Ruby/whatever), then TypeScript will just fade away, by design. For now, it's kinda like JQuery in motivation if not literally architecture: it shields you from browser inconsistencies (in this case, where you don't know what ES version the target is running) and helps you avoid JavaScript's headaches. Just as JQuery became less necessary as time went on-- not because it got worse but because browsers got better-- so too will TypeScript.
- qaq 11y agoby the time all the browsers will run ES(x) ES(y) will be out and everyone will be transpiling ES(y) to ES(x). Given the developer base it's very unlikely to go away.
- wx196 11y agoIn what way it is more successful? Both TIOBE and Redmonk don't confirm your thoughts. http://sogrady-media.redmonk.com/sogrady/files/2015/07/lang-rank-615-wm.png http://sogrady-media.redmonk.com/sogrady/files/2015/07/lang-... http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
- nikolay 11y agoI meant as a mindshare. Given Dart is older, it's just a matter of months for TypeScript to catch up and beat it in these indirect charts as well.
- VeilEm 11y ago> While React has paved the way, JSX syntax is not only tied to React. Does TypeScript manage the lifecycles of elements you create through their version of JSX? React creates an in memory version of the DOM and reconciles changes to the DOM against this. Is TypeScript doing this too or is this simply template syntax inside JavaScript? What React does is not simply template syntax. HTML and JSX are totally different things! JSX renders to HTML eventually, but there's way more going on.
- saidajigumi 11y agoAccording to https://github.com/Microsoft/TypeScript/wiki/JSX https://github.com/Microsoft/TypeScript/wiki/JSX, there are two JSX processing options. The first is a JSX passthru ("preserve" mode) and the second ("react" mode) will generate React.createElement, etc. See that page for the technical details. As such, preserve mode is intended for use with other backends, e.g. those listed under Transpilers at https://facebook.github.io/jsx/ https://facebook.github.io/jsx/. Whichever non-React backend you choose therefore defines the JSX runtime handling rather than having that baked into TypeScript.
- orf 11y agoI think you're misunderstanding the feature, see here for more info: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#custom-jsx-factories-using---reactnamespace https://github.com/Microsoft/TypeScript/wiki/What's-new-in-T...
- Guillaume86 11y agoYou're mixing up React and JSX. Typescript do not replace React, it just allows JSX syntax and transforms it to javascript for you if you want.
- deleted 11y ago[deleted]
- WorldMaker 11y agoAlso, Typescript type checks the JSX. This was the big thing that convinced me to start using TSX was typed views. (I've not been using React, so I've been using preserve behavior and Babel to feed the Virtual DOM library I am using.)
- breck 11y ago"For example, for a quick ES6 to ES5 downlevel conversion using the TypeScript compiler, you just need the following command: > tsc --allowJs --outDir out target_file.js" Is the intent here to allow tsc to be used as a replacement for babel?
- scott_o 11y agoI don't think so. Last time I checked they don't do any polyfills, instead relying on commonJS for that.
- crudbug 11y agoWhen can we see CoreCLR backend for TypeScript ?
- chinhodado 11y agoWhat do you mean by that?
- crudbug 11y agoCurrent TS is targeting JS backend. CoreCLR backend would mean you will have a unified codebase both on browser and server (CLR VM).
- dham 11y agoNot sure I follow. You can use Typescript on the server already with Node.js. The CLR isn't available in the browser.
- girvo 11y agoI'm guessing parent means compiling TypeScript down to CoreCLR bytecode instead of to Javascript and running through Node for execution. Pretty big job, that one.
- rekoros 11y agoTypeScript is amazing. We decided on TS to build https://sameroom.io https://sameroom.io and never looked back!
- meowface 11y agoCool application. It's something I've wanted for a while, and I'd probably use it. But linking it here apropos of almost nothing seems a little like shilling.
- rekoros 11y agoHey - thanks! Proper TypeScript usage is still pretty rare, so this felt OK. As a startup founder, if you have a choice between telling people about your startup and not telling: tell. This is incredibly hard for engineers, but you just have do it. Sometimes I wonder, how many amazing technologies have died because the founders simply couldn't ever figure out how to tell the world about what they built.
- untog 11y agoProper TypeScript usage is still pretty rare, so this felt OK. And if you were pointing to a repo of the code that powers your startup, I'd agree with you.
- rekoros 11y agoBad word choice on my part. Didn't mean "proper" as in "correct", but as in all-in, no-looking-back.
- voltagex_ 11y agoCan you elaborate on how you got started on TypeScript? What IDEs and editors are you using? What build process? How did you handle integration with non-TS libraries? Are there any problems you faced that you wouldn't have, had you stuck with JS? (I'd read a blog post about this, by the way)
- pippy 11y agoI love TypeScript - it's my favorite precompiled language and I use it for a few personal projects of mine. But I can't help but feel it's an evolutionary dead end. asm.js / web assembly is what you want transcompiled languages to target
- ybx 11y agoSomeone in Mozilla came up with a language called LLJS, that took full advantage of and compiled down to asm.js. It looked like it had some promise, since it wasn't nearly as heavy as emscripten, but I don't think much has happened with it since it was created.
- pippy 11y agoInteresting, I've only ever known about Emscripten based asm.js compilers. TypeScript + LLVM have the benefit of being actively developed with a strong community backing.
- moonchrome 11y agoAsmjs/webasm are orhogonal to TS - they even have to manually manage memory
- peteretep 11y agoI don't really understand your comment. What about Typescript precludes it from targetting web assembly or asm.js in the future?
- igl 11y agoI recently learned that the TS type-checker is unsound on purpose and i am a bit disappointed. http://tryflow.org/#2944d91c10fc5d76faeebbb20cac466a http://tryflow.org/#2944d91c10fc5d76faeebbb20cac466a Try this snippet in TS.
- recursive 11y agoUndeclared parameters are implicitly "any". You don't need nearly this much code to break. This is equivalently broken: var x: any = {}; x.foo(); Here's the typesafe way: http://tryflow.org/#b5f826e03045f64084cfc74398270e85 http://tryflow.org/#b5f826e03045f64084cfc74398270e85
- altano 11y agoWhy is this line an error?: > var cats : Cat[] = [ new Cat() ]
- deleted 11y ago[deleted]
- DCoder 11y agoIt would not be an error if not for `addToList(cats, new Dog())`. Based on that call, Flow infers that `cats` has to be a `Dog[]`, not `Cat[]`.
- altano 11y agoRegarding the unsoundness-by-default, I wish "--no-implicit-any" was the default but it's really no big thing to just add this flag to any project.
- igl 11y agoStill... why have type inference in the first place if you can not safely utilize it. The argument for having things unsound is "to strike a balance between correctness and productivity". Having to declare types on everything even if it's just generics beats the productivity argument.
- slantview 11y agohttps://xkcd.com/927/ https://xkcd.com/927/
- jbrantly 11y agoI don't think this applies. I don't believe anybody else was doing what TypeScript does when it was released, that is JavaScript + Type Safety. Even today the only other real contender is Flow.
- deleted 11y ago[deleted]
- johnny_reilly 11y agoWhat jbrantly said. I love JavaScript and I love optional static typing. That's exactly what TypeScript provides.
- scotty79 11y agoStill no love for typing of `this` or `call()` and such
- Ycros 11y agoCan you elaborate on what you mean by that? 1.7 added 'this' typing improvements, and it looks like 1.8 is adding 'this'-based type guards.
- scotty79 11y agoI mean, when specifying function type, you can't specify type of `this` that the function expects to be run with. And `call()` expects thisArg:any, ...args:any[] for all functions regardless of their declared parameter types and expected type of `this`. I'm talking about the usual js `this`, the covertly passed parameter, not typescript `this`, type of own class. Funny they focused so much on classes that they reached 1.8 without so much as touching js most unique feature, flexible `this`.
- _pmf_ 11y agoIt would be refreshing if the ES evolution would take some hints from TypeScript instead of satisfying the perceived need for syntactic sugar and cutesey poor man's FP.
- z3t4 11y agoI think type-script is great. But what's true for every bug that ever existed!? It passed the type checker!