TypeScript 7 Native Preview: 10x Faster Web Builds
Visual Studio Codego watch the original →
the gist
Install TypeScript 7's Go-based native compiler via VS Code extension for 10x faster type checking and builds—proven on VS Code's own massive codebase and large-scale apps like Figma.
Harness Native Go Port for 10x TypeScript Speed
TypeScript 7 introduces a groundbreaking port of its compiler and language service from TypeScript/JavaScript to Go, enabling native execution speeds and true multi-threading. This addresses core pain points in large codebases: slow type checking on every keystroke, completions lagging behind complex types, and build times ballooning to minutes.
Why it works: JavaScript's single-threaded nature limits parallelism; Go's native compilation allows shared memory across threads, ripping through type computations 10x faster. For most projects, expect dramatic gains—VS Code's full build dropped from 60s to 30s (2x), Copilot extension from 22s to 4s (5x). On beefy machines, allocate more threads via compiler flags for even better scaling (uses more RAM but crushes compiles).
Trade-offs: Native preview aligns behaviors with TS 6.0 (an "alignment release" prepping for TS 7 breaks/deprecations). Test on TS 6.0 first—if it compiles cleanly, upgrade seamlessly. Nightly previews catch issues early.
Daniel Rosenwasser (TypeScript PM) shares hands-on validation: Internal Microsoft teams, plus Slack, Vanta, Notion, Figma report 4-5x gains on million-line codebases, even with existing parallel stacks.
"For most projects it's going to actually be 10x faster." — Daniel Rosenwasser
Zero-Friction Setup in VS Code
Target skill level: Intermediate TypeScript/JS developers comfortable with VS Code Insiders. Prerequisites: Modern TS/JS project; no Go install needed—it's bundled.
- Extension Install: Search "TypeScript Native Preview" in VS Code Extensions view (building blocks icon). Install—activates on next TS/JS file open. Low-risk: Toggle off anytime.
- CLI Compiler:
npm i @typescript/native-preview. Runtsgoinstead oftscfor 10x builds. Matches TS 6.0 API/behaviors. - Verify: Open TS file—completions, Go to Definition instant. Check VS Code status bar for native mode.
Common mistake: Skipping TS 6.0 alignment. Fix: Update tsconfig.json to "6.0", resolve deprecations.
Quality criteria: Keystroke completions <100ms; full project type-check <10% original time. Benchmark your repo pre/post.
"All you have to do is just hit install... it's just a better faster experience." — Daniel Rosenwasser
Live Workflows: VS Code Updates Supercharge TS7 Dev
James Montemagno demos Insiders (v1.89+) integrations amplifying TS7:
- Browser-in-VS Code: Exclusive browser mode for clean screen shares. Attach tabs to Agent Chat for page analysis/actions (e.g., "overview this page"—auto-processes DOM).
- OpenTelemetry Traces: VS Code Copilot sessions export traces/logs/metrics to any provider (e.g., Aspire dashboard). See agent tool timings, GitHub MCP latencies, errors. Setup:
@opentelemetry/api + @opentelemetry/sdk-node; auto-exports console/HTTP/gRPC. - Markdown Preview Toggle: Switch to full-screen preview (no side-by-side). Right-click → Open Preview.
- Agents Hub: code.visualstudio.com/agents—local/cloud/CLI/third-party models (Ollama, Foundry). Courses on skills/hooks/prompts.
These fit mid-workflow: Type-check fast → Agent-debug UI → Telemetry-trace perf → Preview docs.
"VS Code now is being type checked and built with the new compiler... everything can be built in about 30 seconds." — Daniel Rosenwasser
Prototype Websites: Stream Timer from Scratch
James kickstarts live coding: Recreate his "Stream Timer" site (countdown/up for OBS streamers, e.g., Halo speedruns). Originally pandemic-built for personal use, now scales via TS7 speed.
Process (reconstructed):
- New workspace:
code .in empty folder. npm init -y; npm i typescript @typescript/native-preview.npx tsgo --initfor tsconfig.- Build UI: HTML/TS for timer logic (up/down counters, video embed).
- Native preview auto-types: Instant refactoring, completions as complexity grows.
Before/After: Pre-TS7: Keystroke lag on nested types. Post: Fluid, like editing JS but with TS safety.
Exercise: Clone timer—add persistence (localStorage), styles (CSS vars). Time type-check; compare to stable TS.
Plans for 7 sites: Leverage LSP tricks, real-time workflows. Expect: RAG-like agent integration, optimized pipelines.
Common pitfall: Overlooking multi-threading flags. Pro tip: tsgo --threads 8 on 16-core CPU.
Key Takeaways
- Install TypeScript Native Preview extension immediately—10x gains with zero config risk.
- Align to TS 6.0 first: Fix deprecations for seamless TS 7 jump.
- Benchmark builds:
time tsgovstsc; scale threads for max perf. - Trace Copilot/agents via OpenTelemetry—visualize latencies in Aspire/others.
- Use VS Code as browser + agent context for UI dev loops.
- Prototype fast: TS7 enables complex types without slowdown—ideal for web apps.
- Validate on large repos: Figma/Slack prove 4-5x on monorepos.
- Toggle Markdown full preview for doc-heavy workflows.
- Explore code.visualstudio.com/agents for TS7 + model swapping.
- Run Insiders: Catch weekly releases (e.g., network-enabled sandboxes).