惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
S
SegmentFault 最新的问题
Martin Fowler
Martin Fowler
罗磊的独立博客
T
The Blog of Author Tim Ferriss
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Heimdal Security Blog
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy International News Feed
T
Tailwind CSS Blog
AWS News Blog
AWS News Blog
雷峰网
雷峰网
PCI Perspectives
PCI Perspectives
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
N
News | PayPal Newsroom
C
CERT Recently Published Vulnerability Notes
Microsoft Security Blog
Microsoft Security Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
博客园 - 【当耐特】
Vercel News
Vercel News
GbyAI
GbyAI
博客园 - 司徒正美
量子位
T
Threat Research - Cisco Blogs
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News - Newest:
Hacker News - Newest: "LLM"
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
Y
Y Combinator Blog
P
Proofpoint News Feed
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Mastering the Latest TypeScript: What's New in 6.0 (and a Peek at 7)
Erik Hanchett · 2026-06-05 · via DEV Community

TypeScript 6.0 has been out for a few months now, and it's a bit of an unusual release. It's the last compiler that will be written in TypeScript and JavaScript. Later this year, TypeScript 7 arrives with the compiler rewritten in Go. Microsoft has seen roughly 10x speed improvements on large codebases. That makes 6.0 the bridge release.

The good news is that the features I want to show you aren't going anywhere. Everything here is forward compatible with TypeScript 7. They're also just genuinely nice to use. I'll walk through five additions worth adopting today, show the tsconfig.json changes that add them, and finish with what the Go rewrite means for you.

If you'd rather watch than read, the full video is here.

Prerequisites

  • Node.js 20 or newer
  • TypeScript 6.0 (npm install -D typescript@6)
  • A code editor with TypeScript support (I'm using Kiro)
  • Basic familiarity with tsconfig.json

1. Native Temporal date and time types

The built-in JavaScript Date API isn't that great. Months are zero-indexed, time zone handling is painful, and most of us reach for an API library to help. TypeScript 6 ships type support for Temporal, the TC39 date/time API, so you get a modern API with no extra dependency.

Creating a date is readable now. You pass the year, month, and day as named fields instead of memorizing argument order.

const launch = Temporal.PlainDate.from({ year: 2026, month: 9, day: 1 });

// Arithmetic that reads the way you think about it
const twoWeeksLater = launch.add({ weeks: 2 });
const aMonthEarlier = launch.subtract({ months: 1 });

Enter fullscreen mode Exit fullscreen mode

Time zones are really neat to use. You can format the same instant across several zones without juggling offsets by hand.

const now = Temporal.Now.zonedDateTimeISO("America/Los_Angeles");

const zones = ["America/Los_Angeles", "America/New_York", "Europe/London", "Asia/Tokyo"];
for (const zone of zones) {
  const local = now.withTimeZone(zone);
  console.log(zone, local.toLocaleString());
}

Enter fullscreen mode Exit fullscreen mode

And duration math, the thing that usually sends you to a library, is built in.

const today = Temporal.Now.plainDateISO();
const target = Temporal.PlainDate.from("2026-09-01");
const diff = today.until(target, { largestUnit: "day" });

console.log(`${diff.days} days until launch`);

Enter fullscreen mode Exit fullscreen mode

You get all this without a date library, and you avoid the off-by-one month bugs that Date gives you. This is the feature I expect people to adopt first.

2. Map.getOrInsert() and getOrInsertComputed()

If you work with Map, you know the check-then-set code you have to write. You want to insert a value only if the key isn't already there, so you write something like this.

const cache = new Map<string, number>();

if (!cache.has("a")) {
  cache.set("a", 1);
}
const value = cache.get("a")!; // non-null assertion because get() can return undefined

Enter fullscreen mode Exit fullscreen mode

Two things bother me there. The if guard is boilerplate, and the ! non-null assertion exists only because get() is typed to possibly return undefined. TypeScript 6 adds Map.getOrInsert(), which adds all of that into one call.

const cache = new Map<string, number>();

const value = cache.getOrInsert("a", 1); // returns 1, inserts if missing
cache.getOrInsert("a", 99);              // key exists, so this is ignored
console.log(cache.get("a")); // still 1

Enter fullscreen mode Exit fullscreen mode

It checks for the key, returns the existing value if present, and inserts only when the key is missing. You don't overwrite anything, and the guard and the assertion both go away.

There's a companion method, getOrInsertComputed(), that takes a factory function instead of a value. The function only runs when the key is actually missing.

const cache = new Map<string, number>();

cache.getOrInsertComputed("a", () => {
  console.log("computing a");
  return 1;
}); // logs "computing a", inserts 1

cache.getOrInsertComputed("a", () => {
  console.log("this never runs");
  return 2;
}); // key already exists, so the factory is skipped entirely

Enter fullscreen mode Exit fullscreen mode

That second factory never executes. If your value is expensive to produce, a database call, a heavy calculation, parsing something large, getOrInsertComputed() skips the work entirely when the key already exists. getOrInsert() evaluates its argument no matter what, so reach for the computed version when the value isn't cheap.

3. RegExp.escape() for safe dynamic regex

Building a regular expression from user input is a classic problem that we all run into. Say you take a version string and try to match it.

const userInput = "1.0";
const pattern = new RegExp(userInput, "g");

const text = "version 1.0 and build 1x0 are different";
console.log(text.match(pattern)); // matches BOTH "1.0" and "1x0"

Enter fullscreen mode Exit fullscreen mode

That matches more than you wanted. The . in the input is a regex wildcard, so it matches any character, including the x in 1x0. TypeScript 6 adds RegExp.escape(), which escapes special characters in a string so it's treated literally.

const userInput = "1.0";
const pattern = new RegExp(RegExp.escape(userInput), "g");

const text = "version 1.0 and build 1x0 are different";
console.log(text.match(pattern)); // matches only "1.0"

Enter fullscreen mode Exit fullscreen mode

Now the dot is a literal dot, and you match exactly what you meant. Any time you build a regex from a value you didn't write yourself, wrap it in RegExp.escape().

4. The # subpath imports (and the tsconfig that powers them)

Deep relative imports like ../../../utils/format are hard to read and break when you move files. The common fix is a path alias with @, but that can collide with real npm packages, since plenty of scoped packages start with @. TypeScript 6 leans into Node's subpath imports, which use a # prefix that can't be confused with a package name.

Setup happens in two files. First, tsconfig.json needs a module resolution mode that understands subpath imports.

{
  "compilerOptions": {
    "module": "esnext",
    "moduleResolution": "bundler"
  }
}

Enter fullscreen mode Exit fullscreen mode

If you're not using a bundler, the Node-native equivalent works too.

{
  "compilerOptions": {
    "module": "nodenext",
    "moduleResolution": "nodenext"
  }
}

Enter fullscreen mode Exit fullscreen mode

Then you declare the actual mapping in package.json under imports.

{
  "imports": {
    "#utils/*": "./src/utils/*.js",
    "#components/*": "./src/components/*.js"
  }
}

Enter fullscreen mode Exit fullscreen mode

Now your imports are clean.

import { formatDate } from "#utils/format";
import { Button } from "#components/Button";

Enter fullscreen mode Exit fullscreen mode

Without one of those module resolution settings, the # imports won't resolve, so the tsconfig change is the part that actually unlocks the feature. If you watched my earlier video on tsconfig paths, this is the modern, standardized version of that same idea.

5. Smarter generic inference

This one removes annotations you used to have to write by hand. Take a generic interface like this.

interface CreatePair<T> {
  config: { value: T };
  consume: (value: T) => void;
}

Enter fullscreen mode Exit fullscreen mode

Before TypeScript 6, you usually had to pin the generic explicitly when you used it.

const pair: CreatePair<number> = {
  config: { value: 42 },
  consume: (value) => console.log(value),
};

Enter fullscreen mode Exit fullscreen mode

TypeScript 6 infers T from the value you provide, so the annotation becomes optional.

const pair = {
  config: { value: 42 },        // T inferred as number
  consume: (value: number) => console.log(value),
};

Enter fullscreen mode Exit fullscreen mode

Because the compiler reads 42 and figures out the type, you write less and still get full type safety and autocomplete everywhere. It's a small change you'll feel constantly in real code.

tsconfig.json changes worth making now

Beyond the subpath imports config above, TypeScript 6 shifts a few defaults in a direction that TypeScript 7 will push as well. A few minutes auditing your config today saves friction later.

  • strict now defaults to true. If you've explicitly set strict: false, you're working against where the language is heading. This is a good moment to enable it or write down why you're opting out.
  • verbatimModuleSyntax: true is encouraged and replaces the older importsNotUsedAsValues. It forces explicit import type for type-only imports, which keeps your emitted output predictable.
  • baseUrl is no longer required for paths to work. If you only kept baseUrl around to enable path aliases, you can drop it.
  • moduleResolution: "node" is on its way out. If you're still on the legacy resolver, 6.0 is the time to move to nodenext or bundler.

What's coming in TypeScript 7

TypeScript 7 is the headline behind all of this. The compiler is being rewritten in Go (the project codename is Corsa), and the speed gains look impressive. The Go compiler parallelizes across CPU cores, so the bigger your codebase, the more you benefit.

Wrapping up

TypeScript 6 isn't a flashy release, and that's the point. Temporal, the new Map methods, RegExp.escape(), subpath imports, and smarter inference all make day-to-day code a little cleaner, and none of it gets in your way when you move to 7. The single most valuable thing you can do today is adopt these APIs and audit your tsconfig.json so the Go-compiler upgrade is a non-event.

I also built an experimental skill that helps you upgrade older TypeScript projects to 6.0. If you use Kiro, Claude Code, or another agentic editor, give it a try on a TypeScript 5 project and let me know how it goes. The link is in the video description.

Watch the full walkthrough on YouTube, and drop a comment if you've started using any of these in your own projects.