atcb Profile Banner
Andrew Branch Profile
Andrew Branch

@atcb

Followers
3K
Following
6K
Statuses
3K

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

San Rafael, CA
Joined January 2013
Don't wanna be here? Send us removal request.
@atcb
Andrew Branch
1 month
RT @satanacchio: Node.js v23.6.0 is out! 🥳🎉 This release enables the flag --experimental-strip-types by default. Node.js will execute Type…
0
169
0
@atcb
Andrew Branch
4 months
@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.
1
0
1
@atcb
Andrew Branch
4 months
@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?
1
0
0
@atcb
Andrew Branch
4 months
@ballingt So this is a package entrypoint that has no corresponding JS? (Or empty stubs for JS?)
1
0
1
@atcb
Andrew Branch
4 months
@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."
0
0
3
@atcb
Andrew Branch
4 months
@bradleymeck @devongovett This is possibly the thing I most wish people understood about TypeScript
0
0
2
@atcb
Andrew Branch
5 months
@wooorm @robpalmer2 @remcohaszing @ssalbdivad @johnny_reilly Yeah. Put another way: compile .ts and/or .js files, publish .js and .d.ts files. If you’re skipping the compilation step, you’re authoring .js and .d.ts.
0
0
2
@atcb
Andrew Branch
6 months
0
0
1
@atcb
Andrew Branch
6 months
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
6 months
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!
1
1
21
@atcb
Andrew Branch
6 months
@ballingt That’s so kind, hope you’re having a good summer too!
1
0
1
@atcb
Andrew Branch
8 months
RT @johnny_reilly: Dual publishing ESM and CJS is hard. Getting the types incorrect in your package.json is disappointingly easy. If you wa…
0
6
0
@atcb
Andrew Branch
9 months
@craciun_07 @mattpocockuk The output is indeed wrong, though it’s not always super meaningful to discuss tsc emit when errors are present. But the whole idea of `verbatimModuleSyntax` is that anything not marked with `type` gets preserved.
1
0
2
@atcb
Andrew Branch
9 months
@meoyawn This seems totally believable; I would love to know the details and see perf numbers. I would be shocked if it was a significant difference but I could be wrong!
0
0
1
@atcb
Andrew Branch
9 months
I personally tend to use type-only imports via auto-imports (with `verbatimModuleSyntax`) in new projects, but maybe I just like using stuff I made 😄Do what makes you happy, and go deeper into understanding how your tools work if you can. It might be more complex than you think.
0
1
47