Andrew Branch

3.2K posts

Andrew Branch banner
Andrew Branch

Andrew Branch

@atcb

Working on TypeScript at Microsoft. I appear when someone says “module resolution” three times in the dark. He/him

Marin, CA Katılım Ocak 2013
643 Takip Edilen2.9K Takipçiler
ArkType
ArkType@arktypeio·
We tested TS Go with ArkType's stress tests: 📈5x faster 📉30% less memory ✅99% correct Even the craziest types in our repo were perfect on day one🤯
ArkType tweet media
English
4
6
354
32.4K
Andrew Branch
Andrew Branch@atcb·
@saltyAom Awesome! Tip: try "TypeScript Go: Restart Language Server" instead of "Reload Window" to see the squiggles appear even faster :)
Andrew Branch tweet media
English
0
1
25
2.8K
SaltyAom
SaltyAom@saltyAom·
I test it and it's real Here's what I did 1. Create 1,000 endpoints with body + response validation 2. Infers schema to type and check if return type is correct 3. It happens in order for 1,000 time 4. See how long it takes for 1,001th route 5. Reload IDE ts: 3.35s ts-go: 0.63s
TypeScript@typescript

Today we're thrilled to announce our effort to port the TypeScript compiler and language service to native code, gaining a 10x speed boost in build times and editor responsiveness! devblogs.microsoft.com/typescript/typ…

English
10
37
717
74K
Andrew Branch retweetledi
alistair
alistair@alistaiir·
The new TypeScript is *really* fast
English
9
13
239
30.1K
Andrew Branch retweetledi
TypeScript
TypeScript@typescript·
Today we're thrilled to announce our effort to port the TypeScript compiler and language service to native code, gaining a 10x speed boost in build times and editor responsiveness! devblogs.microsoft.com/typescript/typ…
English
159
1.4K
6.8K
1.2M
Andrew Branch retweetledi
Marco Ippolito
Marco Ippolito@satanacchio·
Node.js v23.6.0 is out! 🥳🎉 This release enables the flag --experimental-strip-types by default. Node.js will execute TypeScript files without additional configuration! ⚠️ This feature is experimental, has limitations and is subject to change. nodejs.org/en/blog/releas…
English
18
167
860
90.1K
Andrew Branch
Andrew Branch@atcb·
@ballingt In those cases, you kind of _want_ to have duplicated and unassignable TS types, because that accurately describes the situation. But for simple functions and values, things that aren't meant to be used nominally, there's no issue.
English
1
0
1
21
Andrew Branch
Andrew Branch@atcb·
@ballingt We do this on DT a lot because it's usually just not worth actually duplicating the .d.ts content. The only caveat is if the ESM/CJS JS actually export things that exhibit bad dual-package behavior, like classes that will be checked with `instanceof` or duplicate Symbol()
English
1
0
1
34
Thomas Ballinger
Thomas Ballinger@ballingt·
@atcb I have the TypeScript version of Dual Package hazard: I have some types that can't be assigned structurally (usually recursive types) so I'd like to ensure only a single set of types is used.
English
1
0
0
337
Andrew Branch
Andrew Branch@atcb·
@ballingt But I mean, for some import that results in TS loading `a/dist/esm-types`, is the same import meaningful at runtime, e.g. will it load a value in Node.js? In other words, do any of the types describe the exports of a JS module, or is it purely a collection of types?
English
1
0
0
46
Thomas Ballinger
Thomas Ballinger@ballingt·
@atcb yeah a/dist/esm-types/ is a types-only directory pointed to from a "types" in package.json, although I can change the structure or do whatever it takes to use the same .d.ts files on disk for ESM and CJS types, hoping that that way those types would be assignable to each other
English
1
0
0
34
Andrew Branch
Andrew Branch@atcb·
@ballingt So this is a package entrypoint that has no corresponding JS? (Or empty stubs for JS?)
English
1
0
1
45
Thomas Ballinger
Thomas Ballinger@ballingt·
Any suggested reading on this? Since it's my library I can guarantee these types are the same, I'm avoiding default exports etc. I know you've usefully crusaded against this and were always contenting with people saying they wanted to do this. Any reading on potential issues?
English
1
0
0
88
Andrew Branch
Andrew Branch@atcb·
@mitschabaude But Node doesn't do type stripping inside node_modules, so if you're writing a library, you're in this situation where you can run TS during development, but you need to publish JS files. That makes it impossible to satisfy our rule of "write the specifier that works at runtime."
English
0
0
2
82
Andrew Branch
Andrew Branch@atcb·
@mitschabaude We already had support for that via --allowImportingTsExtensions, but you were forced into --noEmit with that. That felt good enough for folks targeting Bun and bundlers, because for those scenarios, you never really need to emit .js files at all.
English
1
0
1
117
Bradley Farias
Bradley Farias@bradleymeck·
@devongovett Conditions are the same as TSConfig, flags for daaaaays since people want tool interop but tools don't pin to non-magic stuff so you have to make config options to fit other tools magic
English
2
0
2
252
John Reilly ❤️🌻
John Reilly ❤️🌻@johnny_reilly·
Finding that working with JSDoc is made massively more fun by defining any non trivial type code in an `types.d.ts` TypeScript file which can then be imported into the JSDoc. Your codebase is still 100% JS for running code, but the type syntax in TS is much easier than in JSDoc
John Reilly ❤️🌻@johnny_reilly

Having started working through an untyped codebase, it feels like I've found an unmade jigsaw puzzle. The more information you feed the compiler, the more useful information you get about the code, the more bugs you find and the more pleasant the dev experience becomes!

English
1
0
10
1.9K
Matt Pocock
Matt Pocock@mattpocockuk·
New NPM publishing guide is MASSIVE (hitting publish next week)
English
29
35
739
29.9K
Andrew Branch
Andrew Branch@atcb·
Editing with @britto_gab's work on region-prioritized diagnostics has been so great: > in our testing on TypeScript’s own checker.ts, a full semantic diagnostics response took 3330ms. In contrast, the response for the first region-based diagnostics response took 143ms! 👏
TypeScript@typescript

The release candidate for TypeScript 5.6 is now available for testing! Give it a try today for more new checks, ways to speed-up your builds, new JS features, and more! devblogs.microsoft.com/typescript/ann…

English
1
1
21
3.2K
Thomas Ballinger
Thomas Ballinger@ballingt·
@atcb I'm missing your content on Twitter, I know you probably have a another job besides tweeting but I hope you're having a great summer!
English
1
0
1
36
Andrew Branch retweetledi
John Reilly ❤️🌻
John Reilly ❤️🌻@johnny_reilly·
Dual publishing ESM and CJS is hard. Getting the types incorrect in your package.json is disappointingly easy. If you want something to help you with both, then maybe tsup and Are the Types Wrong can help. Thanks to @atcb for his assistance with this ❤️🌻 johnnyreilly.com/dual-publishin…
English
1
6
41
4.9K