frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

TypeScript 6.0 RC

https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-rc/
81•johnz•5h ago

Comments

culi•4h ago
For anyone who isn't aware, TypeScript does not use semantic versioning.

Though TypeScript 7.0 will be significant in that it will use the new Go compiler

tshaddox•1h ago
Semantic versioning seems slightly weird to even apply to something like TypeScript. You could have patch releases that fix actual compiler crashes, sure, but what is a minor release?

Surely any new feature that causes code to fail to type check when it previously would pass (or vice versa) would have to be considered a breaking change.

A similar thing applies to code formatting tools like Prettier, or any linter.

spankalee•1h ago
Semantic versions would at least be playing nice with how npm manages version ranges. If every release of TypeScript is breaking, then you should use major versions so that `npm update` doesn't break your project.

Yes, typescript would be at version 60 now. No, that's not a problem at all. Numbers are free.

ukuina•17m ago
> Numbers are free.

Someone please tell the LLM naming committee.

joshkel•1h ago
Appreciate the reminder (the lack of SemVer has thrown me in the past). In this case, 6.0 is a bigger change than normal:

> TypeScript 6.0 arrives as a significant transition release, designed to prepare developers for TypeScript 7.0, the upcoming native port of the TypeScript compiler. While TypeScript 6.0 maintains full compatibility with your existing TypeScript knowledge and continues to be API compatible with TypeScript 5.9, this release introduces a number of breaking changes and deprecations that reflect the evolving JavaScript ecosystem and set the stage for TypeScript 7.0.

pscanf•4h ago
As a user, I'm of course very excited about v7. As a developer of an app that _integrates_ TypeScript, however, I feel a bit uneasy seeing the API feature still marked as "not ready" on the roadmap.

On the other hand, I can understand leaving it as the last thing to do, after the foundation has set. Also, the TypeScript team has really done an amazing job all these years with backward compatibility, so that is extremely reassuring.

Maybe my uneasiness is just impatience to get to use the sped-up version in my app as well! :)

tanepiper•3h ago
FWIW I tried it with the VSCode preview in two monorepos we have - one frontend and one backend GraphQL servers with complex types - absolutely no issues (except one breaking change in tsconfig with baseUrl being removed) and fast compile times.
silverstream•3h ago
Same experience here with a pnpm workspace monorepo. The baseUrl removal was the only real friction — we were using it as a path alias root, had to move everything to subpath imports.

  The moduleResolution: node deprecation is the one I'd flag for anyone not paying attention yet. Switching to nodenext forced us to add .js extensions to all      
  relative imports, which was a bigger migration than expected.

  Compilation speed improvement is real though. Noticeably faster on incremental builds.
spankalee•1h ago
As a developer that integrates typescript into client-side web pages and writes lots of custom plugins, I'm extremely nervous about the port to Go.

I think the last estimate I saw was the the Go port compiled to WASM was going to be about triple the size of the minified JS bundle.

tmaly•4h ago
I had no idea they were using Go to write a compiler.
alembic_fumes•4h ago
> strict is now true by default

I would still have a full head of hair if this had been the case since the beginning. Nonetheless I am glad that we got here in the end.

steve_adams_86•3h ago
I came to point that out too. What an awesome development. I think this will have a meaningful impact on the general quality of TS projects over the coming years.
369548684892826•3h ago
Just use deno
Analemma_•2h ago
TypeScript never would’ve taken off if it had been strict from the beginning, it would’ve been just another forgotten gravestone next to Dart and CoffeeScript. I’m not saying those are bad languages, they’re not, but anything other than a very slow and gradual opt-in transition was just a non-starter. It was painful, but TypeScript played the long game.
chrysoprace•1h ago
If it had been, maybe I wouldn't have had to spend years getting buy in for turning on that setting in my team's codebase.
mdtrooper•2h ago
What has always bothered me about TypeScript are union types. If you have a function that receives a parameter such as ‘Dog | Cat’, you cannot separate it. For example:

type Dog = { bark: () => void }

type Cat = { meow: () => void }

function speak(animal: Dog | Cat) {

    if (‘bark’ in animal) {

        animal.bark();

    } else {
        animal.meow();
    }
}

Okay, okay, I know you can filter using ‘in’ to see if it has methods, but in real life, in a company where you have a colleague (who is a golden boy) who writes over-engineered code with hundreds of interfaces of interfaces, you don’t want to spend time searching through the files to find every element that is in the union type.

Whereas in Rust it does:

struct Dog { name: String, }

struct Cat { name: String, }

enum Animal {

    Dog(Dog),

    Cat(Cat),
}

fn process_animal(animal: Animal) {

    match animal {

        Animal::Dog(dog) => {

            println!(‘It is a dog named {}’, dog.name);

        }

        Animal::Cat(cat) => {

            println!(‘It is a cat named {}’, cat.name);

        }
    }
}

I think TypeScript should add a couple of lines of code to the generated JavaScript to do something like:

type Dog = { bark: () => void }

type Cat = { meow: () => void }

function speak(animal: Dog | Cat) {

    if (animal is Dog) {

        animal.bark();

    } else {

        animal.meow();

    }
}
tshaddox•1h ago
The idiomatic way to do this in TypeScript is with discriminated unions. You’re basically just giving the type system an extra property that makes it trivial to infer a type guard (while also making the runtime check in the compiled JavaScript foolproof).
culi•1h ago
This does act exactly as a discriminated union. The code works exactly as written.
zem•1h ago
this post on union types versus sum types is worth a read (the tl;dr is that they both have their uses and one is not strictly better) https://viralinstruction.com/posts/uniontypes/
epolanski•1h ago
You need a tagged union for this in typescript.
spankalee•1h ago
You're talking about adding a runtime feature. TypeScript doesn't do that anymore. It can't control what properties are on objects or add new ones - you do that yourself in the standard JavaScript portion of the language. TypeScript only lets you describe what's there.

As a sibling said, discriminated unions are they way to go here. You can also add custom type guard functions if you can't control the objects but you want to centralize the detection of the types, but it's better to let TypeScript do it itself so that you don't mess something up with a cast.

littlecranky67•1h ago
Typeguard is what you are looking for: function isDog(animal: Dog | Cat): animal is Dog { return "bark" in Dog }

Then: isDog(animal) ? animal.bark() : animal.meow() You get full type narrowing inside conditionals using typeguards.

culi•1h ago
You don't even need that. The code exactly as presented acts as a discriminator. TypeScript is smart enough to handle that logic in the if block and know whether animal has been validated as Dog vs Cat. GP is complaining about a feature that already exists in TypeScript
littlecranky67•1h ago
It depends how you construct Dog and Cat. With Javascripts dynamic prototype chain, you could never know for sure.
culi•1h ago
Try it

https://www.typescriptlang.org/play/?#code/C4TwDgpgBAIg9gcyg...

reitzensteinm•19m ago
type Mutt = Dog & Cat

const imposter: Mutt = { bark: () => console.log("woof"), meow: () => console.log("meow"), }

You're both misunderstanding parent's point as well as the original point. Nobody ever claimed your link wouldn't compile.

castral•1h ago
You can literally do what your generated example does using a type guard. You can also use method overloaded signatures if you dont want to expose your API consumers to union types.
culi•1h ago
Your first code block works exactly as you would expect and has been working like that for many years

https://www.typescriptlang.org/play/?#code/C4TwDgpgBAIg9gcyg...

paulddraper•1h ago
You're looking for a discriminated union [1], which idiomatically:

  type Dog = { bark(): void; type: 'dog' }

  type Cat = { meow(): void; type: 'cat' }

  function speak(animal: Dog | Cat) {
    if (animal.type === 'dog') {
      animal.bark()
    } else {
      animal.meow()
    }
  }
Generally speaking, TypeScript does not add runtime features.

TypeScript checks your use of JavaScript runtime features.

[1] https://www.convex.dev/typescript/advanced/type-operators-ma...

jauntywundrkind•2h ago
My deepest thanks to one @AlCalzone for stepping up to Opus port Decorators to tsgo. https://github.com/microsoft/typescript-go/pull/2926

It would have been an affront to have a 6.0 that shipped without the means to work for so so many javascript frameworks/libraries. AlCalzone utterly saving the day.

I also am so so so thankful that maybe perhaps after what felt like a never ending dolldrums, we may finally be getting decorator support in some browsers. What a colossal relief it will be to see the progress of the language become manifest.

ukuina•14m ago
> Disclaimer: This is an entire day worth of Claude Opus tokens. I don't claim I understand how it works, but I did my best to direct Claude to minimize the baseline diffs, of which it removed quite a few.

TypeScript allows entirely LLM-coded PRs?

CuriousRose•1h ago
I am hoping that eventually there will be some agnosticism with the language server. Currently they all seem to rely on Node which in my opinion is rapidly being outclassed by Bun in terms of resource usage. It would be great to eventually be able to pick what runtime they use in VS Code/Cursor to reduce energy drain on my laptop when working on the go.
djrenren•1h ago
The typescript language server (along with the rest of the compiler) is being rewritten in go for Typescript 7. This work has been going on in parallel with the work on 6.0. The go port has most features of 6.0 already and you can follow its progress and read more about it here:

https://github.com/microsoft/typescript-go

CuriousRose•57m ago
Sure, but instead of waiting another year for this to be launched - with a beta version precaution and inevitable bugs - why not remove the limited hard-coded Node paths and references now and ship something 80:20?
djrenren•49m ago
If it’s a simple change, they might accept a PR. If it isn’t, well that’s your answer. Not worth allocating engineers for it.
ianberdin•9m ago
No way I turn it on. Not a joke.

Cancellation of Army exercise fuels speculation about Mideast troop deployments

https://www.washingtonpost.com/national-security/2026/03/06/army-82nd-airborne-iran/
1•ParentiSoundSys•1m ago•0 comments

ClawMarket agent skill – gives agents wallets and ability to sign onchain txns

https://clawmarket.tech
1•semanticlayer•1m ago•1 comments

Teams have a context-sharing problem; TeamContext is our attempt

https://github.com/hzhou9/TeamContext
1•hzhou9•2m ago•1 comments

AIs are not conscious, but most critics can't adequately explain why

https://plus.flux.community/p/its-like-this-why-your-perception
1•Novapebble•4m ago•0 comments

Show HN: Wez, modern terminal web browser with Vim bindings

https://github.com/keyle/wez
1•keyle•5m ago•0 comments

Feds take notice of iOS vulnerabilities exploited under mysterious circumstances

https://arstechnica.com/security/2026/03/cisa-adds-3-ios-flaws-to-its-catalog-of-known-exploited-...
1•givinguflac•6m ago•0 comments

Show HN: Skylos – A Python dead code finder benchmarked against 9 libraries

https://skylos.dev/blog/we-scanned-9-popular-python-libraries
1•duriantaco•7m ago•1 comments

Netflix acquires Ben Affleck's AI company

https://www.npr.org/2026/03/06/nx-s1-5739370/netflix-ben-affleck-ai-interpositive-deal
1•larubbio•8m ago•0 comments

Show HN: I built an autonomous AI company that runs itself (22 cycles, $36)

https://runautoco.com
1•Ndmtrieff•9m ago•2 comments

Intelligence Beyond Knowledge

https://philpapers.org/rec/HANIBK
1•huiwenhan•10m ago•1 comments

Some Words on WigglyPaint

https://beyondloom.com/blog/onwigglypaint.html
1•RebelPotato•11m ago•0 comments

I've built a better Lovable clone alone

https://playcode.io/
1•ianberdin•11m ago•0 comments

LLM Doesn't Write Correct Code. It Writes Plausible Code

https://blog.katanaquant.com/p/your-llm-doesnt-write-correct-code
1•dnw•15m ago•0 comments

Fast starting Clojure runtime built with GraalVM native-image and Crema

https://github.com/borkdude/cream
1•PaulHoule•15m ago•0 comments

Show HN: MarketplaceKit – Ship a rental marketplace in days instead of months

https://kit.creativewin.net
1•markoristicc•16m ago•0 comments

Tree Rings Reveal Origins of Some of the World's Best Violins

https://www.nytimes.com/2026/03/04/science/stradaviri-violin-forest-tree-rings.html
1•bookofjoe•17m ago•1 comments

Show HN: Reflectt-node – tell Claude to install it, AI team in 5 min

https://github.com/reflectt/reflectt-node
1•reflectt•18m ago•1 comments

Useful queries to analyze PostgreSQL lock trees (a.k.a. lock queues)

https://postgres.ai/blog/20211018-postgresql-lock-trees
1•tanelpoder•18m ago•0 comments

Many scientists now use AI but fail to disclose it, study finds

https://phys.org/news/2026-03-scientists-ai-disclose.html
2•g-b-r•20m ago•0 comments

Data reveal a significant acceleration of global warming since 2015

https://phys.org/news/2026-03-reveal-significant-global.html
2•g-b-r•22m ago•0 comments

A novel about a frustrated IT analyst who gets pulled into organized crime

https://www.amazon.com/dp/B0GRC31MCS
2•smafarin•23m ago•0 comments

Amazon says Anthropic's Claude still OK for AWS customers to use

https://www.cnbc.com/2026/03/06/amazon-aws-anthropic-claude-pentagon-blacklist.html
2•johnbarron•24m ago•0 comments

Show HN: Git for your AI workflow - Version control for what Claude remembers

https://dullnote.com/
1•thedizzyhub•25m ago•0 comments

New plan would tax the rich, eliminate taxes for half of U.S. workforce

https://www.oregonlive.com/politics/2026/03/a-surcharge-for-millionaires-this-plan-would-tax-the-...
3•MilnerRoute•25m ago•0 comments

Savage Care

https://aeon.co/essays/why-bioethics-cannot-help-doctors-in-actual-medical-practice
1•tomodachi94•36m ago•0 comments

Fully functional hair follicle organ regen using potential stem cells in vitro

https://www.sciencedirect.com/science/article/pii/S0006291X26002238
2•bookofjoe•37m ago•0 comments

Burdened by Tech, Gen Z Is Flocking to DVDs and VHS [video]

https://www.youtube.com/watch?v=4UqoTO9kO6c
4•hackerbeat•41m ago•0 comments

Opus 4.6 solved one of Donald Knuth's conjectures [pdf]

https://www-cs-faculty.stanford.edu/%7Eknuth/papers/claude-cycles.pdf
3•peterjliu•41m ago•0 comments

I'm not consulting an LLM

https://lr0.org/blog/p/gpt/
5•lr0•42m ago•0 comments

Tim Sweeney signed away his right to criticize Google's app store until 2032

https://www.theverge.com/news/889595/tim-sweeney-signed-away-his-right-to-criticize-google-until-...
3•CharlesW•43m ago•0 comments