{"id":5246,"date":"2026-07-08T07:58:29","date_gmt":"2026-07-08T15:58:29","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/typescript\/?p=5246"},"modified":"2026-07-08T07:58:29","modified_gmt":"2026-07-08T15:58:29","slug":"announcing-typescript-7-0","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-7-0\/","title":{"rendered":"Announcing TypeScript 7.0"},"content":{"rendered":"<p>Today we are proud to announce the availability of TypeScript 7, a 10x faster native port of TypeScript!<\/p>\n<p>Since its early days, TypeScript has promised to deliver on JavaScript that scales.\nBy bringing strong type-checking and rich tooling to the world of JavaScript, TypeScript made it possible to build non-trivial high-quality apps across platforms.<\/p>\n<p>Last year, <a href=\"https:\/\/devblogs.microsoft.com\/typescript\/typescript-native-port\/\">our team unveiled TypeScript&#8217;s next step<\/a> in scaling: making every part of the toolset an order of magnitude faster.\nThe mission was a native port of TypeScript built in Go that could make the most of modern hardware.\nThis port was done as faithfully as possible, writing new code while maintaining the structure and logic of the original codebase to keep results consistent and compatible between the two compilers.\nThe key difference is that with this new codebase, TypeScript 7 brings native code speed, shared memory multithreading, and a number of new optimizations that typically yield speedups between 8x and 12x on full builds.<\/p>\n<p>Just as with any other release, TypeScript 7 is available via npm:<\/p>\n<pre class=\"prettyprint language-sh\" style=\"padding: 10px;border-radius: 10px;\"><code>npm install -D typescript\r\n<\/code><\/pre>\n<p>That will get you the new <code>tsc<\/code> executable in your workspace (which you can run via <code>npx tsc<\/code>).\nOf course, a big part of the TypeScript experience is also about editor support.\nYour favorite code editor should easily support TypeScript 7 with its new support for the language server protocol (LSP), and its new speed and multithreading improvements.\nWhether you&#8217;re using something like VS Code, Visual Studio, WebStorm, or any other modern editor, TypeScript 7 should work great.\nJust check your editor&#8217;s documentation &#8211; for example, <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=TypeScriptTeam.native-preview\">VS Code has a dedicated extension for TypeScript 7 that you can use today<\/a>, and Visual Studio will automatically enable TypeScript 7 based on your workspace.<\/p>\n<h2 id=\"what-does-a-faster-typescript-mean\">What Does A Faster TypeScript Mean?<\/h2>\n<p>A faster TypeScript sounds great on paper, but what does it mean in practice?\nMaybe it helps to think about where TypeScript comes up at every stage of development.<\/p>\n<p>A typical day of development might involve opening your editor, opening a TypeScript file, and running an operation like <em>find-all-references<\/em> across your projects.\nThen as you&#8217;d start to make edits, maybe you&#8217;d expect auto-completions to pop up, and get red squiggles on the fly as you&#8217;d make edits.\nWhen you (and more recently, perhaps an AI agent) were ready to build your project, you&#8217;d run <code>tsc<\/code>, check the output for errors, and then run your generated code somehow.<\/p>\n<p>A faster TypeScript means every part above is streamlined.\nWaiting for your editor to fully load your project will feel instantaneous.\nDelays on <em>find-all-references<\/em>, auto-completion, and diagnostics should take a fraction of the time they used to.\nAnd when you run <code>tsc<\/code>, maybe in <code>--watch<\/code> mode, you&#8217;ll be able to tighten your feedback loop and iterate faster than ever before.<\/p>\n<p>You can see this on real-world projects.\nIn fact, you can try comparing on a few open-source projects yourself.\nHere are the build times of running TypeScript 6 and 7 on some fairly large open source codebases.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Codebase<\/th>\n<th style=\"text-align:right\">TypeScript 6<\/th>\n<th style=\"text-align:right\">TypeScript 7<\/th>\n<th style=\"text-align:right\">Speedup<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">vscode<\/td>\n<td style=\"text-align:right\">125.7s<\/td>\n<td style=\"text-align:right\">10.6s<\/td>\n<td style=\"text-align:right\">11.9x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">sentry<\/td>\n<td style=\"text-align:right\">139.8s<\/td>\n<td style=\"text-align:right\">15.7s<\/td>\n<td style=\"text-align:right\">8.9x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">bluesky<\/td>\n<td style=\"text-align:right\">24.3s<\/td>\n<td style=\"text-align:right\">2.8s<\/td>\n<td style=\"text-align:right\">8.7x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">playwright<\/td>\n<td style=\"text-align:right\">12.8s<\/td>\n<td style=\"text-align:right\">1.47s<\/td>\n<td style=\"text-align:right\">8.7x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">tldraw<\/td>\n<td style=\"text-align:right\">11.2s<\/td>\n<td style=\"text-align:right\">1.46s<\/td>\n<td style=\"text-align:right\">7.7x<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2026\/07\/7-0-speedup-chart-2.png\" alt=\"Compile times of the projects between TypeScript 6 and 7 described the table above, ranging from 7.7x to 11.9x\"><\/p>\n<p>TypeScript 7 also typically does better while asking for <em>less<\/em> aggregate memory over the span of a build.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Codebase<\/th>\n<th style=\"text-align:right\">TypeScript 6<\/th>\n<th style=\"text-align:right\">TypeScript 7<\/th>\n<th style=\"text-align:right\">Memory Delta<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">vscode<\/td>\n<td style=\"text-align:right\">5.2GB<\/td>\n<td style=\"text-align:right\">4.2GB<\/td>\n<td style=\"text-align:right\">-18%<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">sentry<\/td>\n<td style=\"text-align:right\">4.9GB<\/td>\n<td style=\"text-align:right\">4.6GB<\/td>\n<td style=\"text-align:right\">-6%<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">bluesky<\/td>\n<td style=\"text-align:right\">1.8GB<\/td>\n<td style=\"text-align:right\">1.3GB<\/td>\n<td style=\"text-align:right\">-26%<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">playwright<\/td>\n<td style=\"text-align:right\">1.0GB<\/td>\n<td style=\"text-align:right\">0.9GB<\/td>\n<td style=\"text-align:right\">-11%<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">tldraw<\/td>\n<td style=\"text-align:right\">0.6GB<\/td>\n<td style=\"text-align:right\">0.5GB<\/td>\n<td style=\"text-align:right\">-15%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2026\/07\/7-0-mem-chart-2.png\" alt=\"Differences in memory reduction between TypeScript 6 and 7 described in the table above, ranging from -6% to -26%\"><\/p>\n<p>Of course, there&#8217;s more to the experience than the full build.\nOn the same computer, opening a file with an error in the VS Code codebase would previously take about 17.5 seconds from the time you opened the editor to the time you saw the first error.\nWith TypeScript 7, it&#8217;s under 1.3 seconds &#8211; over 13x faster.<\/p>\n<h2 id=\"battle-tested-and-ready-for-production\">Battle-Tested and Ready for Production<\/h2>\n<p>The TypeScript project contains tens of thousands of tests built over more than a decade that run on every commit on our <code>main<\/code> branch.\nThey&#8217;ve ensured every one of our releases is stable and reliable.<\/p>\n<p>But TypeScript 7 is no ordinary release.\nBeyond our test suite, we&#8217;ve leveraged a number of different resources to make sure TypeScript 7 is solid for production use.<\/p>\n<p>Over the last year we&#8217;ve worked with many large teams internally and externally to test TypeScript 7 on real-world codebases.\nThe results have been overwhelmingly positive, with entire companies reporting that TypeScript 7 has been stable, fast, and easy to adopt.\nFor example, the <a href=\"https:\/\/code.visualstudio.com\/blogs\/2026\/06\/26\/iterating-faster-with-ts-7\">VS Code team recently highlighted their experience with TypeScript 7&#8217;s preview releases<\/a> to move faster in their development cycle.\nWe&#8217;ve also worked with Microsoft teams like Loop, Office, PowerBI, Teams, and Xbox to ensure that TypeScript is ready for the largest of codebases.\nLikewise, companies like Bloomberg, Canva, Figma, Google, Lattice, Linear, Miro, Notion, Sentry, Slack, Vanta, Vercel, VoidZero, and more have worked with us to test TypeScript 7 on their codebases and given us feedback to make it better.<\/p>\n<p>Additionally, we&#8217;ve rebuilt much of our broader test infrastructure to run on TypeScript 7.\nTypeScript 6 and earlier had automated and on-demand testing for TypeScript and JavaScript projects on GitHub to detect regressions in the compiler and language service.\nThe same testing is back, and running against TypeScript 7, finding issues in real codebases so we can find gaps in our core test suite and ship a better experience.<\/p>\n<p>The combination of explicit feedback, automated crash reports, and aggressive testing has made a measurable difference in quality.\nIn fact, our data insights have shown us that TypeScript 7.0&#8217;s new language server has actually reduced failing language server commands by over 80%, and reduced server crashes by over 60% compared to that of TypeScript 6.0.<\/p>\n<p>We&#8217;ve also heard some incredible feedback from teams at scale:<\/p>\n<ul>\n<li>Slack engineers have told us that TypeScript 7 eliminated 40% of their merge queue time and <a href=\"https:\/\/bsky.app\/profile\/slack.engineering\/post\/3lry3ml3qok2f\">brought type-checking time in CI from about 7.5 minutes to 1.25 minutes<\/a>. Local development in the editor was previously almost &quot;unusable&quot; due to language server load times and engineers would typically let CI do a full type-check. TypeScript 7 has been able to load the same codebase in a few seconds and made local type-checking feasible again.<\/li>\n<li>Builds at Vanta have dramatically improved, <a href=\"https:\/\/bsky.app\/profile\/chriskrycho.com\/post\/3melxwy2lkycq\">showing a speedup of up to 9x faster on one of their biggest projects<\/a>.<\/li>\n<li>Similarly, the News Services team at Microsoft told us that adopting TypeScript 7 saved them 400 hours a month waiting for CI builds.<\/li>\n<li>Last year, engineers working on PowerBI described TypeScript 7 in the editor as &quot;life-saving&quot; for working on their codebase. They adopted the experience as a default even before TypeScript 7 supported rename functionality in VS Code.<\/li>\n<li>Developers working on Loop&#8217;s monorepo were also ecstatic. The previous editor experience was described as unusable at their scale, whereas the TypeScript 7 experience has been &quot;amazing&quot; to use.<\/li>\n<li>Canva developers have told us that TypeScript 7&#8217;s language service shows dramatic speedups, going from about 58 seconds to seeing the first error in their editors to about 4.8 seconds.<\/li>\n<\/ul>\n<h2 id=\"running-side-by-side-with-typescript-60\">Running Side-by-Side with TypeScript 6.0<\/h2>\n<p>While TypeScript 7.0 is here, it does not ship with an API.\nWe expect TypeScript 7.1 to ship with a new (and different) API, but until then we have made it a priority to ensure TypeScript can be run side-by-side with TypeScript 6.0 for utilities that still need some programmatic access to the compiler (such as typescript-eslint).<\/p>\n<p>As part of the 6.0\/7.0 transition process, we&#8217;ve published a new compatibility package, <code>@typescript\/typescript6<\/code>.\nThis package provides an executable named <code>tsc6<\/code>, so that if needed, you can install TypeScript 7.0 (which ships its own <code>tsc<\/code> binary) side-by-side without naming conflicts.\nThe new package also re-exports the TypeScript 6.0 API, so that you can use <code>tsc<\/code> for TypeScript 7, while other tooling can continue to rely on 6.0.<\/p>\n<p>Because some tools like typescript-eslint expect to import from <code>typescript<\/code> directly via peer dependencies, we recommend achieving this via npm aliases.\nYou should be able to run the following command<\/p>\n<pre class=\"prettyprint language-sh\" style=\"padding: 10px;border-radius: 10px;\"><code>npm install -D typescript@npm:@typescript\/typescript6\r\n<\/code><\/pre>\n<p>or modify your <code>package.json<\/code> as follows:<\/p>\n<pre class=\"prettyprint language-json\" style=\"padding: 10px;border-radius: 10px;\"><code>{\r\n  &quot;devDependencies&quot;: {\r\n    &quot;typescript&quot;: &quot;npm:@typescript\/typescript6@^6.0.2&quot;,\r\n  }\r\n}\r\n<\/code><\/pre>\n<p>Note that doing this will leave you only with a <code>tsc6<\/code> executable.\nTo get 7.0&#8217;s <code>tsc<\/code>, you can add another alias for TypeScript 7 and <code>npx tsc<\/code> will just work with 7.0:<\/p>\n<pre class=\"prettyprint language-json\" style=\"padding: 10px;border-radius: 10px;\"><code>{\r\n  &quot;devDependencies&quot;: {\r\n    &quot;typescript&quot;: &quot;npm:@typescript\/typescript6@^6.0.2&quot;,\r\n    &quot;typescript-7&quot;: &quot;npm:typescript@^7.0.2&quot;,\r\n  }\r\n}\r\n<\/code><\/pre>\n<h3 id=\"nightly-builds-and-typescriptnative-preview\">Nightly Builds and <code>@typescript\/native-preview<\/code><\/h3>\n<p>Until now, most developers have installed TypeScript 7 via the <code>@typescript\/native-preview<\/code> package.\nThis package shipped nightly builds of the new codebase, and has served the community  well with over 8.5 million weekly downloads!<\/p>\n<p>However, going forward, nightly builds will soon resume under the standard <code>typescript<\/code> package with the <code>next<\/code> tag.\nYou can install it with:<\/p>\n<pre class=\"language-text\" style=\"padding: 10px;border-radius: 10px;\"><code>npm installl -D typescript@next\r\n<\/code><\/pre>\n<h2 id=\"custom-scaling-parallelization-and-controls\">Custom Scaling: Parallelization and Controls<\/h2>\n<p>TypeScript 7.0 now performs many steps in parallel, including parsing, type-checking, and emitting.\nSome of these steps, like parsing and emitting can mostly be done independently across files.\nAs such, parallelization automatically scales well with larger codebases with relatively little overhead.\nBut not every step in a TypeScript build is easily parallelizable.<\/p>\n<p>TypeScript 7 introduces the experimental <code>--checkers<\/code> and <code>--builders<\/code> flags to fine-tune the parallelization behavior for less-trivial steps like type-checking and project reference building.\nIt also introduces a <code>--singleThreaded<\/code> flag to disable parallelization entirely, which can be useful for debugging or running in environments with limited resources.<\/p>\n<h3 id=\"type-checker-parallelization\">Type-Checker Parallelization<\/h3>\n<p>Other steps, like type-checking, have more complex dependencies across files.\nMost files end up relying on the same type information from their dependencies and the global scope, and so running type-checkers completely independently would be wasteful &#8211; both in computation and memory.\nOn the other hand, type-checking occasionally relies on the relative ordering of information in a program, and so type-checking from scratch must always check the same files in an identical order to ensure the same results.<\/p>\n<p>To enable parallelization while avoiding these pitfalls, TypeScript 7.0 creates a fixed number of type-checker workers with their own view of the world.\nThese type-checking workers may end up duplicating some common work, but given the same input files, they will always divide them identically and produce the same results.<\/p>\n<p>The default number of type-checking workers is 4, but it can be configured with the new <code>--checkers<\/code> flag.\nYou may find that increasing this number can further speed up builds on larger codebases where typical machines have more CPU cores, but will typically come at the cost of increased memory usage.\nFor example, in the table above, we ran TypeScript 7 with its default of <code>--checkers 4<\/code>.\nHere&#8217;s what the results look like on the same machine with <code>--checkers 8<\/code>.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Codebase<\/th>\n<th style=\"text-align:right\">TypeScript 6<\/th>\n<th style=\"text-align:right\">TypeScript 7 <br \/> (<code>--checkers 8<\/code>)<\/th>\n<th style=\"text-align:right\">Speedup<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">vscode<\/td>\n<td style=\"text-align:right\">125.7s<\/td>\n<td style=\"text-align:right\">7.51s<\/td>\n<td style=\"text-align:right\">16.7x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">sentry<\/td>\n<td style=\"text-align:right\">139.8s<\/td>\n<td style=\"text-align:right\">12.08s<\/td>\n<td style=\"text-align:right\">11.6x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">bluesky<\/td>\n<td style=\"text-align:right\">24.3s<\/td>\n<td style=\"text-align:right\">2.01s<\/td>\n<td style=\"text-align:right\">12.1x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">playwright<\/td>\n<td style=\"text-align:right\">12.8s<\/td>\n<td style=\"text-align:right\">1.16s<\/td>\n<td style=\"text-align:right\">11x<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">tldraw<\/td>\n<td style=\"text-align:right\">11.2s<\/td>\n<td style=\"text-align:right\">1.06s<\/td>\n<td style=\"text-align:right\">10.6x<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As you can see, these codebases get a better speedup from dedicating more cores, but results will differ across projects and underlying machines.<\/p>\n<p>On the other hand, on machines with fewer CPU cores and less memory (e.g. CI runners) you may want to decrease this number to avoid unnecessary or incidental overhead.\nYou can specify a value as low as <code>--checkers 1<\/code>, effectively making type-checking single-threaded and eliminating duplicate work.<\/p>\n<p>In rare cases, varying the number of <code>--checkers<\/code> may surface order-dependent results.\nSpecifying a fixed number of checkers across build environments can help ensure everyone is getting the same results, but is up to the discretion of your team.<\/p>\n<h3 id=\"project-reference-builder-parallelization\">Project Reference Builder Parallelization<\/h3>\n<p>TypeScript 7.0 can parallelize builds within a project, but it can now also build multiple projects at once as well.\nThis behavior can be configured with the new <code>--builders<\/code> flag, which controls the number of parallel project reference builders that can run at once when running under <code>--build<\/code>.\nThis can be particularly helpful for monorepos with many projects.<\/p>\n<p>Like <code>--checkers<\/code>, increasing the number of builders can speed up builds, but may come at the cost of increased memory usage.\nIt also has a multiplicative effect with <code>--checkers<\/code>, so it&#8217;s important to find the right balance for your machine and codebase.\nFor example, building with <code>--checkers 4 --builders 4<\/code> allows up to 16 type-checkers to run at once, which may be excessive.<\/p>\n<p>Unlike <code>--checkers<\/code>, varying the number of builders should not produce different results;\nhowever, building project references is fundamentally bottlenecked by the dependency graph of projects (with the exception of type-checking on codebases that leverage <code>--isolatedDeclarations<\/code> and separate syntactic declaration file emit).<\/p>\n<h3 id=\"single-threaded-mode\">Single-Threaded Mode<\/h3>\n<p>In some cases, it can be helpful to enforce single-threaded operation throughout the compiler.\nThis may be useful for debugging, comparing performance with TypeScript 6 and 7, when orchestrating parallel builds externally, or for running in environments with very limited resources.\nTo enable single-threaded mode, you can use the new <code>--singleThreaded<\/code> flag.\nThis will not only cap the number of type-checking workers to 1, but also ensure parsing and emitting are done in a single thread.<\/p>\n<h2 id=\"improved---watch-mode\">Improved <code>--watch<\/code> Mode<\/h2>\n<p>TypeScript 7 ships with a completely rebuilt <code>--watch<\/code> mode.\n<code>--watch<\/code> is now powered by a new foundation based on <a href=\"https:\/\/github.com\/parcel-bundler\/watcher\">the Parcel bundler&#8217;s file-watcher<\/a> that provides efficient and stable cross-platform file watching capabilities.<\/p>\n<p>When our team set out to port our file watching logic, we encountered a few challenges with cross-platform file watching in Go.\nThe standard library doesn&#8217;t provide a built-in file watching API, and existing third-party libraries we explored had various issues with stability, performance, cross-platform support, or issues with build tooling integration.\nWe were able to build solutions around polling periodically to check for file changes, and this worked broadly across operating systems;\nhowever it was computationally expensive, especially at larger-scale projects with many dependencies in <code>node_modules<\/code>.\nEven with dynamic scheduling strategies, we found that pure-polling solutions were too taxing for general use.<\/p>\n<p>For many years, Visual Studio Code has relied on <a href=\"https:\/\/www.npmjs.com\/package\/@parcel\/watcher\"><code>@parcel\/watcher<\/code><\/a>, and in recent years TypeScript in VS Code has relied on its file watching capabilities indirectly.\nWhile it seemed promising, one of the problems for us with Parcel&#8217;s watcher is that it&#8217;s written in C++, and in turn requires a full C++ toolchain to build.\nGiven our positive experience with Parcel&#8217;s watcher in VS Code, we explored porting it to Go with a few minimal assembly shims to avoid introducing a new toolchain dependency.<\/p>\n<p>The exploration has been a success &#8211; what started as a very direct translation from C++ to Go was further refined into idiomatic Go that still passes the ported test suite.\nThe watcher is a self-contained package that has allowed us to keep a clean separation of concerns between what we care to watch and why.\nWe are now seeing significant resource improvements in <code>--watch<\/code> mode across platforms, and have been hearing positive feedback from earlier users of TypeScript 7.<\/p>\n<p>We&#8217;d like to extend our thanks to Devon Govett whose work on Parcel has provided immense benefits to both the Visual Studio Code and TypeScript projects.\nWe hope this port will provide opportunities and insights for the original Parcel watcher codebase over time.<\/p>\n<h2 id=\"updates-since-5x-and-new-behaviors-from-60\">Updates Since 5.x, and New Behaviors from 6.0<\/h2>\n<p>TypeScript 7.0 is made to be compatible with TypeScript 6.0&#8217;s type-checking and command-line behavior.\nPractically any TypeScript code that compiles cleanly with TypeScript 6.0 (with the <code>stableTypeOrdering<\/code> flag on, and without any <code>ignoreDeprecations<\/code> flag set) should compile identically in TypeScript 7.0.<\/p>\n<p>With that said, TypeScript 7.0 adopts 6.0&#8217;s new defaults, and provides hard errors in the face of any flags and constructs deprecated in TypeScript 6.0.\nThis is notable as 6.0 is still relatively new, and many projects will need to adapt to its new behaviors.\nWe encourage developers to adopt TypeScript 6.0 to make the transition to TypeScript 7.0 easier, and you can also read <a href=\"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-6-0\/\">the TypeScript 6.0 release blog post<\/a> for more details on these deprecations.<\/p>\n<p>At a glance, the notable default changes to configuration are:<\/p>\n<ul>\n<li><code>strict<\/code> is <code>true<\/code> by default.<\/li>\n<li><code>module<\/code> defaults to <code>esnext<\/code>.<\/li>\n<li><code>target<\/code> defaults to the current stable ECMAScript version immediately preceding <code>esnext<\/code>.<\/li>\n<li><code>noUncheckedSideEffectImports<\/code> is <code>true<\/code> by default.<\/li>\n<li><code>libReplacement<\/code> is <code>false<\/code> by default.<\/li>\n<li><code>stableTypeOrdering<\/code> is <code>true<\/code> by default, and cannot be turned off.<\/li>\n<li><code>rootDir<\/code> now defaults to <code>.\/<\/code>, and inner source directories must be explicitly set.<\/li>\n<li><code>types<\/code> now defaults to <code>[]<\/code>, and the old behavior can be restored by setting it to <code>[&quot;*&quot;]<\/code>.<\/li>\n<\/ul>\n<p>We believe the <code>rootDir<\/code> and <code>types<\/code> changes may be the most &quot;surprising&quot; changes, but they can be mitigated easily.\nProjects where the <code>tsconfig.json<\/code> sits outside of a directory like <code>src<\/code> will simply need to include <code>rootDir<\/code> to preserve the same directory structure.<\/p>\n<pre class=\"prettyprint language-diff\" style=\"padding: 10px;border-radius: 10px;\"><code>  {\r\n      &quot;compilerOptions&quot;: {\r\n          \/\/ ...\r\n+         &quot;rootDir&quot;: &quot;.\/src&quot;\r\n      },\r\n      &quot;include&quot;: [&quot;.\/src&quot;]\r\n  }\r\n<\/code><\/pre>\n<p>For the <code>types<\/code> change, projects that depend on specific global declarations will need to list them explicitly. For example,<\/p>\n<pre class=\"prettyprint language-diff\" style=\"padding: 10px;border-radius: 10px;\"><code>  {\r\n      &quot;compilerOptions&quot;: {\r\n          \/\/ Explicitly list the @types packages you need (e.g. bun, mocha, jasmine, etc.)\r\n+         &quot;types&quot;: [&quot;node&quot;, &quot;jest&quot;]\r\n      }\r\n  }\r\n<\/code><\/pre>\n<p>The deprecations that have turned into hard errors with no-op behavior are:<\/p>\n<ul>\n<li><code>target: es5<\/code> is no longer supported.<\/li>\n<li><code>downlevelIteration<\/code> is no longer supported.<\/li>\n<li><code>moduleResolution: node\/node10<\/code> are no longer supported, with <code>nodenext<\/code> and <code>bundler<\/code> being recommended instead.<\/li>\n<li><code>module: amd, umd, systemjs, none<\/code> are no longer supported, with <code>esnext<\/code> or <code>preserve<\/code> being recommended in conjunction with bundlers or browser-based module resolution.<\/li>\n<li><code>baseUrl<\/code> is no longer supported, and <code>paths<\/code> can be updated to be relative to the project root instead of <code>baseUrl<\/code>.<\/li>\n<li><code>moduleResolution: classic<\/code> is no longer supported, and <code>bundler<\/code> or <code>nodenext<\/code> are the recommended replacements.<\/li>\n<li><code>esModuleInterop<\/code> and <code>allowSyntheticDefaultImports<\/code> cannot be set to <code>false<\/code>.<\/li>\n<li><code>alwaysStrict<\/code> is assumed to be <code>true<\/code> and can no longer be set to <code>false<\/code>.<\/li>\n<li>The <code>module<\/code> keyword cannot be used in namespace declarations.<\/li>\n<li>The <code>asserts<\/code> keyword cannot be used on imports, and must use the <code>with<\/code> keyword instead (to align with developments on ECMAScript&#8217;s import attribute syntax).<\/li>\n<li><code>\/\/\/ &lt;reference no-default-lib \/&gt;<\/code> directives are no longer respected under <code>skipDefaultLibCheck<\/code>.<\/li>\n<li>Command line builds cannot take file paths when the current directory contains a <code>tsconfig.json<\/code> file unless passed an explicit <code>--ignoreConfig<\/code> flag.<\/li>\n<\/ul>\n<h3 id=\"template-literal-types-now-preserve-unicode-code-points\">Template Literal Types Now Preserve Unicode Code Points<\/h3>\n<p>TypeScript 7.0 now treats Unicode code points more naturally when inferring from template literal types.\nFor example:<\/p>\n<pre class=\"prettyprint language-typescript\" style=\"padding: 10px;border-radius: 10px;\"><code>type HeadTail&lt;S&gt; = S extends `${infer Head}${infer Tail}` ? [Head, Tail] : never;\r\n\r\ntype Result = HeadTail&lt;&quot;\ud83d\ude00abc&quot;&gt;;\r\n\/\/   ^\r\n\/\/ In 7.0: [&quot;\ud83d\ude00&quot;, &quot;abc&quot;]\r\n\/\/ Previously: [&quot;\\ud83d&quot;, &quot;\\ude00abc&quot;]\r\n<\/code><\/pre>\n<p>Previously, TypeScript followed JavaScript&#8217;s UTF-16 indexing behavior here and split <code>&quot;\ud83d\ude00&quot;<\/code> into two halves of a surrogate pair (<code>\\ud83d<\/code> and <code>\\ude00<\/code>).\nThat was technically consistent with indexing in JavaScript (e.g. the inferred <code>Head<\/code> type was equal to <code>&quot;\ud83d\ude00abc&quot;[0]<\/code>), but it usually wasn&#8217;t what people intended, and could produce string literal types containing unpaired surrogates that aren&#8217;t semantically meaningful.<\/p>\n<p>This is a breaking change for type-level string manipulation that intentionally modeled UTF-16 code units, such as some string <code>Length<\/code> utilities.\nIn practice, we expect the new behavior to be more useful and less surprising: template literal inference now follows the same intuition as iterating a string with <code>for...of<\/code> or spreading it with <code>[...str]<\/code>, where <code>&quot;\ud83d\ude00&quot;<\/code> is treated as one unit.<\/p>\n<h3 id=\"javascript-differences\">JavaScript Differences<\/h3>\n<p>As we ported the existing codebase, we also took the opportunity to revisit how our JavaScript support works.<\/p>\n<p>TypeScript originally supported JavaScript files by using JSDoc comments and recognizing certain code patterns for analysis and type inference.\nLots of the time, this was based on popular coding patterns, but occasionally it was based on whatever people <em>might<\/em> be writing that Closure and the JSDoc doc generating tool might understand.\nWhile this approach was helpful for developers with loosely-written JSDoc codebases, it required a number of compromises and special cases to work well, and diverged in a number of ways from TypeScript&#8217;s analysis in <code>.ts<\/code> files.<\/p>\n<p>In TypeScript 7.0, we have reworked our JavaScript support to be more consistent with how we analyze TypeScript files.\nSome of the differences include:<\/p>\n<ul>\n<li>Values cannot be used where types are expected &#8211; instead, write <code>typeof someValue<\/code><\/li>\n<li><code>@enum<\/code> is not specially recognized anymore &#8211; create a <code>@typedef<\/code> on <code>(typeof YourEnumDeclaration)[keyof typeof YourEnumDeclaration]<\/code>.<\/li>\n<li>A standalone <code>?<\/code> is no longer usable as a type &#8211; use <code>any<\/code> instead.<\/li>\n<li><code>@class<\/code> does not make a function a constructor &#8211; use a <code>class<\/code> declaration instead.<\/li>\n<li>Postfix <code>!<\/code> is not supported &#8211; just use <code>T<\/code>.<\/li>\n<li>Type names must be defined within a <code>@typedef<\/code> tag (i.e. <code>\/** @typedef {T} TypeAliasName *\/<\/code>), not adjacent to an identifier (i.e. <code>\/** @typedef {T} *\/ TypeAliasName;<\/code>).<\/li>\n<li>Closure-style function syntax (e.g. <code>function(string): void<\/code>) is no longer supported &#8211; use TypeScript shorthands instead (e.g. <code>(s: string) =&gt; void<\/code>).<\/li>\n<\/ul>\n<p>Additionally, some JavaScript patterns, like aliasing <code>this<\/code> and reassigning the entirety of a function&#8217;s <code>prototype<\/code> are no longer specially treated.<\/p>\n<p>While some of our JS support is in flux, we have been updating this <a href=\"https:\/\/github.com\/microsoft\/typescript-go\/blob\/main\/CHANGES.md\"><code>CHANGES.md<\/code> file<\/a> to capture the differences between TypeScript 6.0 and 7.0 in more detail.<\/p>\n<h2 id=\"editor-experience\">Editor Experience<\/h2>\n<p>As we mentioned above, TypeScript 7.0&#8217;s performance improvements are not limited to the command line experience &#8211; they also extend to the editor experience too.\nFor VS Code users, we have <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=TypeScriptTeam.native-preview\">a dedicated extension for TypeScript 7<\/a>.\nWhen you install this extension, it will automatically become the default experience.\nYou can disable and re-enable it at any time with the &quot;Disable TypeScript 7 Language Server&quot; and &quot;Enable TypeScript 7 Language Server&quot; commands from the command palette.\nIn the coming weeks support for TypeScript 7 will ship as part of VS Code itself.<\/p>\n<p>For Visual Studio users, the latest version of the IDE will automatically enable TypeScript 7 based on your workspace. You won&#8217;t need to do anything differently.<\/p>\n<p>Of course, TypeScript 7 should work great in any editor of your choosing.\nThe new foundation is built on the Language Server Protocol (LSP) and is able to leverage multiple threads to serve simultaneous requests as quickly as possible.<\/p>\n<p>Since it first debuted, we&#8217;ve added in missing functionality like auto-imports, expandable hovers, inlay hints, code lenses, go-to-source-definition, JSX linked editing and tag completions, and more.\nMissing features from TypeScript 7.0 beta, such as semantic highlighting, &quot;sort imports&quot;, &quot;remove unused imports&quot;, and more are now in.<\/p>\n<p>Additionally, we&#8217;ve continued to drive performance and stability in the past few months.\nWe&#8217;ve rebuilt much of our testing and diagnostics infrastructure to make sure the quality bar is high, in which we are able to fuzz-test the language server against the top TypeScript and JavaScript codebases on GitHub.\nAs we&#8217;ve mentioned above, TypeScript 7&#8217;s new language server is significantly more stable than TypeScript 6&#8217;s.<\/p>\n<h3 id=\"typescript-and-embedded-languages\">TypeScript and Embedded Languages<\/h3>\n<p>It&#8217;s worth calling out that workflows that use Vue, MDX, Astro, Svelte, and others will likely not yet be able to leverage TypeScript 7.\nSimilarly, specialized type-checking within templates like Angular will also likely not use TypeScript 7.\nThis is mainly because TypeScript 7 does not yet expose a stable programmatic API, and so tools (such as Volar) which embed TypeScript into their own compilers and language services can only currently rely on TypeScript 6.0.\nWe expect this to be a point-in-time issue, as we are committed to providing a solution here.\nWe will be actively working with the maintainers of these projects to ensure TypeScript 7 supports these workflows.<\/p>\n<p>Until then, we recommend that teams use TypeScript 7 in scenarios where language server plugins are not required.\nProjects using Angular can use a combination of TypeScript 7 to get fast project-wide error detection at the CLI with <code>tsc<\/code>, and TypeScript 6.0 for editor support.\nProjects using Vue, MDX, Astro, Svelte, and others will need to continue using TypeScript 6.0 for now.\nIn VS Code, users can simply run the &quot;Disable TypeScript 7 Language Server&quot; command to revert to TypeScript 6.0.<\/p>\n<h2 id=\"the-road-forward\">The Road Forward<\/h2>\n<p>TypeScript 7.0 is a major milestone in the TypeScript project.\nThis port has been the primary focus of our team for over a year, and with 7.0 out, we will be returning to new feature work, ergonomic improvements, more performance wins, and implementing a new API for the broader ecosystem.\nWhile that seems major, we expect a fairly similar timeline to releases prior to TypeScript 7.0, with new featureful versions published every 3-4 months.\nWith TypeScript 7.1 on the horizon, we hope to bridge any gaps to help bring the community forward.<\/p>\n<p>We also encourage you to share your experience using TypeScript 7.0 online.\nFeel free to follow and tag <a href=\"https:\/\/bsky.app\/profile\/typescriptlang.org\">@typescriptlang.org on Bluesky<\/a> or <a href=\"https:\/\/fosstodon.org\/@TypeScript\/\">@typescript@fosstodon.org on Mastodon<\/a>, or <a href=\"https:\/\/twitter.com\/typescript\">@typescript on Twitter<\/a>, and let us and others know what you think of TypeScript 7.<\/p>\n<p>We know this new release will be incredibly valuable for the TypeScript ecosystem.\nWe hope that it makes your day-to-day coding experience more fast, fun, productive, and joyful.<\/p>\n<p>Welcome to the native era of the TypeScript toolset.<\/p>\n<p>Happy Hacking!<\/p>\n<p>&#8211; The TypeScript Team<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are proud to announce the availability of TypeScript 7, a 10x faster native port of TypeScript! Since its early days, TypeScript has promised to deliver on JavaScript that scales. By bringing strong type-checking and rich tooling to the world of JavaScript, TypeScript made it possible to build non-trivial high-quality apps across platforms. Last [&hellip;]<\/p>\n","protected":false},"author":381,"featured_media":5244,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript"],"acf":[],"blog_post_summary":"<p>Today we are proud to announce the availability of TypeScript 7, a 10x faster native port of TypeScript! Since its early days, TypeScript has promised to deliver on JavaScript that scales. By bringing strong type-checking and rich tooling to the world of JavaScript, TypeScript made it possible to build non-trivial high-quality apps across platforms. Last [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/5246","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\/381"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/comments?post=5246"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/5246\/revisions"}],"predecessor-version":[{"id":5249,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/5246\/revisions\/5249"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media\/5244"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media?parent=5246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/categories?post=5246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/tags?post=5246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}