TypeScript native compiler

타입스크립트 네이티브 컴파일러

TypeScript 7 moves the compiler to native code and parallelizes parts of project analysis.

···
html
<div class="visual compiler" data-step="0"><div class="visual-head"><strong>NATIVE COMPILER</strong><i></i></div><div class="visual-scene"><div class="compile-row"><b>JS</b><div class="compile-track"><i>A</i><i>B</i><i>C</i></div></div><div class="compile-row"><b>Native</b><div class="compile-track"><i>A</i><i>B</i><i>C</i></div></div><div class="compile-out">same checked result</div></div><div class="visual-caption"></div><div class="visual-dots"><b></b><b></b><b></b></div></div>
css
.visual{width:min(95vw,760px);height:min(91vh,330px);padding:clamp(9px,2.5vmin,18px);display:flex;flex-direction:column;gap:clamp(6px,1.7vmin,11px);border:1px solid var(--line);border-radius:13px;background:var(--surface);font:500 clamp(12px,3.4vmin,16px)/1.25 var(--font-sans,-apple-system),sans-serif}
.visual-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:19px;color:var(--accent)}.visual-head strong{font-size:1em}.visual-head i{display:block;width:8px;height:8px;flex:none;border-radius:50%;background:var(--accent);animation:visual-pulse 1.3s infinite}@keyframes visual-pulse{50%{opacity:.25}}
.visual-scene{position:relative;flex:1;min-height:0;overflow:hidden}.visual-caption{min-height:2.4em;display:grid;place-items:center;text-align:center}.visual-dots{display:flex;justify-content:center;gap:4px}.visual-dots b{display:block;width:15px;height:3px;border-radius:3px;background:var(--line)}.visual-dots b.on{background:var(--accent)}
.visual-scene *{box-sizing:border-box}.visual-scene .mono{font-family:ui-monospace,monospace}.visual-scene .muted{color:var(--muted)}.visual-scene .lit{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 14%,var(--surface))!important;color:var(--fg)!important}
.compiler .visual-scene{display:flex;flex-direction:column;justify-content:center;gap:12px}.compile-row{display:flex;align-items:center;gap:10px}.compile-row b{width:52px;flex:none;color:var(--muted)}.compile-track{display:flex;gap:5px;flex:1}.compile-track i{height:25px;flex:1;display:grid;place-items:center;border:1px solid var(--line);border-radius:5px;background:var(--bg);font:600 12px ui-monospace,monospace;transition:background .35s,transform .35s}.compiler[data-step="0"] .compile-row:first-child i:first-child,.compiler[data-step="1"] .compile-row:first-child i:nth-child(-n+2),.compiler[data-step="1"] .compile-row:nth-child(2) i,.compiler[data-step="2"] .compile-track i{background:var(--accent);color:var(--surface)}.compiler[data-step="1"] .compile-row:nth-child(2) i{transform:translateY(-4px)}.compile-out{text-align:center;color:var(--muted);opacity:.4;transition:opacity .3s}.compiler[data-step="2"] .compile-out{opacity:1;color:var(--accent)}
js
const root=document.querySelector('.visual'),cap=root.querySelector('.visual-caption'),dots=[...root.querySelectorAll('.visual-dots b')],captions=["Sequential file pass","Native workers share files","Checked result is the same"];let step=0;function advance(){root.dataset.step=String(step);cap.textContent=captions[step];dots.forEach((d,i)=>d.classList.toggle('on',i===step));if(root.classList.contains('generic')){root.querySelector('.generic-input').textContent=step===3?'"hi"':'7';root.querySelector('.generic-output').textContent=step===3?'"hi" : string':'7 : number'}if(root.classList.contains('union'))root.querySelector('.set-value').textContent=step%2?'value: "seven"':'value: 7';step=(step+1)%captions.length}advance();let timer=setInterval(advance,1100);root.addEventListener('pointerdown',()=>{clearInterval(timer);advance()})

TypeScript 7 ports its compiler and language service to a native Go implementation. It can distribute work across files during stages such as parsing, checking, and emitting.

The two lanes conceptually compare sequential work with distributed work on the same file set. The blocks are not benchmark data; actual speed depends on the project and machine.

When to use

Consider it for faster editor feedback and checking in large TypeScript projects. Check compiler API compatibility in your tooling.

Open as page ↗