{"id":1825,"date":"2014-11-12T07:30:00","date_gmt":"2014-11-12T07:30:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/typescript\/2014\/11\/12\/announcing-typescript-1-3\/"},"modified":"2024-07-02T12:17:15","modified_gmt":"2024-07-02T20:17:15","slug":"announcing-typescript-1-3","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-1-3\/","title":{"rendered":"Announcing TypeScript 1.3"},"content":{"rendered":"<p>We\u2019re happy to announce the availability of TypeScript 1.3. TypeScript 1.3 includes two new features in the language and a new language service for Visual Studio 2015 that is built on the .NET Compiler Platform (\u201cRoslyn\u201d), Visual Studio&#8217;s new language service that provides rich Intellisense.\u00a0Roslyn makes it much easier to provide a premier editing experience for TypeScript in Visual Studio on par with the other\u00a0first-class languages in Visual Studio.<\/p>\n<p>TypeScript 1.3 is available as part of <a title=\"Visual Studio 2015 Preview\" href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=517033\">Visual Studio 2015 Preview<\/a>. You can also install it for <a title=\"Visual Studio 2013 via the power tool install\" href=\"https:\/\/visualstudiogallery.msdn.microsoft.com\/955e0262-0858-40c9-ab5a-1acc680e9bfd\">Visual Studio 2013 via the power tool install<\/a>, <a title=\"NPM\" href=\"https:\/\/www.npmjs.org\/package\/typescript\">NPM<\/a>, and as <a title=\"source\" href=\"https:\/\/github.com\/Microsoft\/TypeScript\/releases\/tag\/v1.3\">source<\/a>.<\/p>\n<h2>New Language Features<span style=\"font-size: 12px;\">\u00a0<\/span><\/h2>\n<p>We\u2019ve added two new language features in TypeScript 1.3: the \u201cprotected\u201d access modifier and tuple types.<\/p>\n<p>The \u201cprotected\u201d access modifier is a\u00a0<a href=\"http:\/\/typescript.codeplex.com\/workitem\/125\">highly requested feature<\/a>\u00a0that allows users the ability to use build even richer objected-oriented patterns in TypeScript. In this example, you can see how the protected keyword allows subclasses to gain visibility into the parent class without exposing this API to other parts of the code.<\/p>\n<p><span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">class<\/span> <span style=\"color: #00ccff;\">List<\/span>&lt;<span style=\"color: #00ccff;\">T<\/span>&gt; {<\/span>\n<span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">\u00a0 \u00a0 private<\/span>\u00a0contents: <span style=\"color: #00ccff;\">T<\/span>[];<\/span>\n<span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">\u00a0 \u00a0 constructor<\/span>() {<\/span>\n<span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0\u00a0this<\/span>.contents = [];<\/span>\n<span style=\"font-family: 'courier new', courier;\">\u00a0 \u00a0 }\n<span style=\"color: #0000ff;\">protected<\/span> setElement(index: <span style=\"color: #0000ff;\">number<\/span>, item: <span style=\"color: #33cccc;\">T<\/span>) {\n<span style=\"color: #0000ff;\">this<\/span>.contents[index] = item;\n}<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier;\">}<\/span><\/p>\n<p><span style=\"color: #0000ff;\">class<\/span> <span style=\"color: #33cccc;\">Stack<\/span>&lt;<span style=\"color: #33cccc;\">T<\/span>&gt; <span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">extends<\/span> <\/span><span style=\"color: #33cccc;\">List<\/span>&lt;<span style=\"color: #33cccc;\">T<\/span>&gt; {\n<span style=\"font-family: 'courier new', courier;\">\u00a0 \u00a0 currentIndex: <span style=\"color: #0000ff;\">number<\/span>;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">constructor<\/span>() {\n<span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 super<\/span>();\n<span style=\"color: #0000ff;\">this<\/span>.currentIndex = 0;\n}<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">\u00a0 \u00a0 public<\/span> push(item: <span style=\"color: #33cccc;\">T<\/span>) {\n<span style=\"color: #0000ff;\">this<\/span>.setElement(<span style=\"color: #0000ff;\">this<\/span>.currentIndex, item);\n<span style=\"color: #0000ff;\">this<\/span>.currentIndex++;\n}\n}<\/span><\/p>\n<p><span style=\"color: #0000ff;\">var<\/span> stack = <span style=\"color: #0000ff;\">new<\/span> <span style=\"color: #33cccc;\">Stack<\/span>&lt;<span style=\"color: #0000ff;\">number<\/span>&gt;();\nstack.setElement(0, 1); <span style=\"color: #339966;\">\/\/ error &#8216;setElement&#8217; is protected and only visible to subclasses\u00a0<\/span><\/p>\n<p>Tuple types allow TypeScript to begin typing the new patterns we will see in the upcoming <a href=\"http:\/\/wiki.ecmascript.org\/doku.php?id=harmony:specification_drafts\">ECMAScript 6 standard<\/a>, where new features like array\u00a0destructuring allow developers to work with arrays in richer ways.\u00a0Tuple types have the advantage that now you can accurately describe the type of an array of mixed types, as in this example:<\/p>\n<p><span style=\"font-family: 'courier new', courier;\"><span style=\"color: #0000ff;\">var<\/span> tuple: [<span style=\"color: #0000ff;\">number<\/span>, <span style=\"color: #0000ff;\">string<\/span>] = [1, <span style=\"color: #ff0000;\">&#8220;bob&#8221;<\/span>];\n<span style=\"color: #0000ff;\">var<\/span> secondElement = tuple[1]; \u00a0<span style=\"color: #339966;\">\/\/ secondElement now has type &#8216;string&#8217;\u00a0<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<h2>New Visual Studio Features<span style=\"font-size: 12px;\">\u00a0<\/span><\/h2>\n<p>With TypeScript 1.3, we\u2019ve built a new Visual Studio 2015 language service on Roslyn, the compiler platform that&#8217;s a part of the <a href=\"http:\/\/www.dotnetfoundation.org\/prjnetcompilerroslyn.aspx\">open source .NET Foundation<\/a>.\u00a0Roslyn allows us to enable a number of new features for editing TypeScript code.<\/p>\n<p>&nbsp;<\/p>\n<h2>Faster and more accurate find all references<\/h2>\n<p>We have made fundamental changes to how compute and report references. Computing references is now significantly faster on the first attempt. Find All References now also reports locations where a contextual type is present, and reports indexed access to properties.<\/p>\n<h2><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5661.FasterAndMoreAccurateFind.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4360\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5661.FasterAndMoreAccurateFind.png\" alt=\"Image 5661 FasterAndMoreAccurateFind\" width=\"555\" height=\"339\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5661.FasterAndMoreAccurateFind.png 555w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5661.FasterAndMoreAccurateFind-300x183.png 300w\" sizes=\"(max-width: 555px) 100vw, 555px\" \/><\/a><\/h2>\n<h2>Enhanced completion list<\/h2>\n<p>TypeScript now supports the same trigger commit characters as C#, so \u201center\u201d or \u201ctab\u201d \u00a0both commit your selection from the completion list. TypeScript also has completion list filtering based on camel casing.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7673.completion_list.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4361\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7673.completion_list.png\" alt=\"Image 7673 completion list\" width=\"410\" height=\"81\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7673.completion_list.png 410w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7673.completion_list-300x59.png 300w\" sizes=\"(max-width: 410px) 100vw, 410px\" \/><\/a><\/p>\n<h2>Enhanced outlining<\/h2>\n<p>With the \u201cRoslyn\u201d language service everything is now collapsible \u2013 \u00a0including functions, object literals, classes, and control flow blocks.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/2161.enhanced_outlining.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4363\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/2161.enhanced_outlining.jpg\" alt=\"Image 2161 enhanced outlining\" width=\"1017\" height=\"459\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/2161.enhanced_outlining.jpg 1017w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/2161.enhanced_outlining-300x135.jpg 300w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/2161.enhanced_outlining-768x347.jpg 768w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" \/><\/a><\/p>\n<h2>Enhanced Colorization<\/h2>\n<p>Classes, Interfaces, modules,\u00a0enums\u00a0are now colored according to their kind. \u00a0Keywords are also now colorized correctly according to their context.<\/p>\n<h2><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5518.EnhancedColorization-1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4364\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5518.EnhancedColorization-1.png\" alt=\"Image 5518 EnhancedColorization 1\" width=\"678\" height=\"384\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5518.EnhancedColorization-1.png 678w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5518.EnhancedColorization-1-300x170.png 300w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><\/a><\/h2>\n<h2>Peek<span style=\"font-size: 12px;\">\u00a0<\/span><\/h2>\n<p>Editor peek is now available, enabling you to quickly see declarations at a glance complete with colorization.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/1134.Peek_.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4365\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/1134.Peek_.png\" alt=\"Image 1134 Peek\" width=\"899\" height=\"341\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/1134.Peek_.png 899w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/1134.Peek_-300x114.png 300w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/1134.Peek_-768x291.png 768w\" sizes=\"(max-width: 899px) 100vw, 899px\" \/><\/a><\/p>\n<h2>Enhanced rename<\/h2>\n<p>TypeScript now supports inline rename with even more accuracy than before. Rename finds all instances the name even if it does not have an explicit type annotation \u2013 \u00a0including strings used in property access.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/8168.rename.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4366\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/8168.rename.png\" alt=\"Image 8168 rename\" width=\"487\" height=\"234\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/8168.rename.png 487w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/8168.rename-300x144.png 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/a><\/p>\n<h2>TODO comments support<\/h2>\n<p>&nbsp;<\/p>\n<p>TODO comments are now populated in the tasks list.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5314.todo_comments.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4367\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5314.todo_comments.jpg\" alt=\"Image 5314 todo comments\" width=\"695\" height=\"310\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5314.todo_comments.jpg 695w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/5314.todo_comments-300x134.jpg 300w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<h2>Better support for functional programming style<\/h2>\n<p>We have made several changes to ensure that our tools work well with different JavaScript coding patterns. Specifically, we&#8217;ve improved support for the functional programming style by improving how the editor works with nested functions. Now &#8220;Navigate To&#8221; shows you nested functions, and the navigation\u00a0bar shows where you are based on your enclosing function scopes.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7144.BetterSupportForFunctional.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4368\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7144.BetterSupportForFunctional.png\" alt=\"Image 7144 BetterSupportForFunctional\" width=\"947\" height=\"601\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7144.BetterSupportForFunctional.png 947w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7144.BetterSupportForFunctional-300x190.png 300w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2014\/11\/7144.BetterSupportForFunctional-768x487.png 768w\" sizes=\"(max-width: 947px) 100vw, 947px\" \/><\/a><\/p>\n<h2>Looking Ahead<\/h2>\n<p>We&#8217;re pleased to enable more coding patterns and improve the Visual Studio experience of working with TypeScript.\u00a0We look\u00a0forward to\u00a0continuing to\u00a0enhance the language and\u00a0tools for working with large-scale JavaScript projects.\u00a0To find out more about what we&#8217;ll be working on next, check out our <a href=\"http:\/\/blogs.msdn.com\/b\/typescript\/archive\/2014\/10\/22\/typescript-and-the-road-to-2-0.aspx\">roadmap<\/a>. We encourage you to try out this release and <a href=\"https:\/\/github.com\/microsoft\/typescript\/issues\">give us your feedback<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re happy to announce the availability of TypeScript 1.3. TypeScript 1.3 includes two new features in the language and a new language service for Visual Studio 2015 that is built on the .NET Compiler Platform (\u201cRoslyn\u201d), Visual Studio&#8217;s new language service that provides rich Intellisense.\u00a0Roslyn makes it much easier to provide a premier editing experience [&hellip;]<\/p>\n","protected":false},"author":377,"featured_media":1797,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1825","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript"],"acf":[],"blog_post_summary":"<p>We\u2019re happy to announce the availability of TypeScript 1.3. TypeScript 1.3 includes two new features in the language and a new language service for Visual Studio 2015 that is built on the .NET Compiler Platform (\u201cRoslyn\u201d), Visual Studio&#8217;s new language service that provides rich Intellisense.\u00a0Roslyn makes it much easier to provide a premier editing experience [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/1825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/users\/377"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/comments?post=1825"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/1825\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media\/1797"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media?parent=1825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/categories?post=1825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/tags?post=1825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}