{"id":153,"date":"2013-08-23T14:32:00","date_gmt":"2013-08-23T14:32:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/typescript\/2013\/08\/23\/new-visual-studio-2013-features-for-typescript\/"},"modified":"2024-07-01T10:08:38","modified_gmt":"2024-07-01T18:08:38","slug":"new-visual-studio-2013-features-for-typescript","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/typescript\/new-visual-studio-2013-features-for-typescript\/","title":{"rendered":"New Visual Studio 2013 Features for TypeScript"},"content":{"rendered":"<p>As users expect more from the web \u2013 more features, more device support, more interactivity \u2013 ASP.NET developers are increasingly building large JavaScript applications. Starting with 0.9.1,\u00a0a key focus for TypeScript&#8217;s capabilities in the\u00a0Visual Studio support\u00a0is enabling TypeScript to\u00a0work better with ASP.NET projects.<\/p>\n<p><strong>Adding TypeScript to a Project<\/strong><\/p>\n<p>To get started with TypeScript in an ASP.NET project, just add a TypeScript file by choosing <em>Add \u2013 TypeScript File<\/em> in the Solution Explorer right click menu, or by using the <em>Add \u2013 New Item<\/em> dialog. Adding a TypeScript file automatically onfigures the project to support compiling TypeScript. You can also rename JavaScript files with the \u201c.ts\u201d extension to convert them into TypeScript files. Since TypeScript is a superset of JavaScript, you can gradually migrate the scripts you already have by adding type annotations and restructuring the code to use classes, interfaces, and modules.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0172.NewTypeScriptFile.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4302\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0172.NewTypeScriptFile.png\" alt=\"Image 0172 NewTypeScriptFile\" width=\"551\" height=\"467\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0172.NewTypeScriptFile.png 551w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0172.NewTypeScriptFile-300x254.png 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/a><\/p>\n<p><strong>Adding Declaration Files<\/strong><\/p>\n<p>One of the best parts of JavaScript development is the wealth of useful, free libraries available online. To use these JavaScript libraries seamlessly in TypeScript apps, TypeScript supports declaration files (with the extension \u201c.d.ts\u201d) that describe the types of objects in JavaScript files. Through the community efforts, many popular JavaScript libraries now have tooling and error detection using these declaration files.\u00a0 Sites like <a href=\"https:\/\/github.com\/borisyankov\/DefinitelyTyped\">DefinitelyTyped<\/a> have become indispensable for developers\u00a0by collecting these declaration files together in one place.\u00a0 Contributions by the community have mirrored these packages as NuGet, making them available to Visual Studio users.<\/p>\n<p>In 0.9.1, with\u00a0a right click you can\u00a0now choose \u201cSearch for TypeScript Typings\u2026\u201d This searches NuGet for TypeScript-related packages matching the name of the JavaScript file. If you install a typing package, it will automatically be referenced by all of the TypeScript files in your project. You no longer need to explicitly add reference tags in your TypeScript code to each of the declaration files.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/6013.SearchNuGetTypings.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4303\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/6013.SearchNuGetTypings.png\" alt=\"Image 6013 SearchNuGetTypings\" width=\"551\" height=\"358\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/6013.SearchNuGetTypings.png 551w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/6013.SearchNuGetTypings-300x195.png 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/4834.SearchNuGetTypings2.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4305\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/4834.SearchNuGetTypings2.png\" alt=\"Image 4834 SearchNuGetTypings2\" width=\"506\" height=\"444\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/4834.SearchNuGetTypings2.png 506w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/4834.SearchNuGetTypings2-300x263.png 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/a><\/p>\n<p><strong>Debugging<\/strong><\/p>\n<p>TypeScript 0.9.1 continues to make it easy\u00a0to debug TypeScript code, letting you focus on the code you&#8217;ve written. Because the TypeScript compiler generates source map files that relate the symbols in your TypeScript code with its JavaScript output, you can set a breakpoint in a TypeScript file, open your app in Internet Explorer, and then step through your code in Visual Studio just like ordinary JavaScript. You can examine the values of objects, add watches, view the call stack, and more. Since TypeScript is compiled to clean, readable JavaScript, it\u2019s also straightforward to debug your code in your browser\u2019s developer tools.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0410.DebugTypeScript.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4306\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0410.DebugTypeScript.png\" alt=\"Image 0410 DebugTypeScript\" width=\"534\" height=\"494\" srcset=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0410.DebugTypeScript.png 534w, https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2013\/08\/0410.DebugTypeScript-300x278.png 300w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/><\/a><\/p>\n<p><strong>Organizing TypeScript and JavaScript in Solutions<\/strong><\/p>\n<p>By default, TypeScript files are automatically compiled when they\u2019re saved and when your solution builds. Generated JavaScript files are placed in the same directory as their TypeScript source files. Think of the generated JavaScript files like DLLs generated from C# or VB code: they\u2019re not included in your project, so they don\u2019t appear in the Solution Explorer. If you want to view the JavaScript files, you can use the \u201cShow All Files\u201d button at the top of the Solution Explorer. The <a href=\"http:\/\/www.typescriptlang.org\/Playground\/\">TypeScript Playground<\/a> is another great tool for quickly seeing how your TypeScript will be compiled.<\/p>\n<p><strong>Other Editors<\/strong><\/p>\n<p>We\u2019ve released the TypeScript compiler and language as <a href=\"http:\/\/typescript.codeplex.com\/sourcecontrol\/latest#README.txt\">open source<\/a>\u00a0to make it easy for the community to build great tools. While we think Visual Studio 2013 provides the best TypeScript development experience, there are a number of other editors with TypeScript support available, including Eclipse, Web Storm, Sublime Text, emacs, and vim.<\/p>\n<p>We hope that these features make it seamless to use TypeScript in ASP.NET projects in Visual Studio 2013. As always, send us feedback on the <a href=\"http:\/\/typescript.codeplex.com\/discussions\">TypeScript CodePlex page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As users expect more from the web \u2013 more features, more device support, more interactivity \u2013 ASP.NET developers are increasingly building large JavaScript applications. Starting with 0.9.1,\u00a0a key focus for TypeScript&#8217;s capabilities in the\u00a0Visual Studio support\u00a0is enabling TypeScript to\u00a0work better with ASP.NET projects. Adding TypeScript to a Project To get started with TypeScript in an [&hellip;]<\/p>\n","protected":false},"author":375,"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-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript"],"acf":[],"blog_post_summary":"<p>As users expect more from the web \u2013 more features, more device support, more interactivity \u2013 ASP.NET developers are increasingly building large JavaScript applications. Starting with 0.9.1,\u00a0a key focus for TypeScript&#8217;s capabilities in the\u00a0Visual Studio support\u00a0is enabling TypeScript to\u00a0work better with ASP.NET projects. Adding TypeScript to a Project To get started with TypeScript in an [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/153","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\/375"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/153\/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=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}