Jake Bailey Profile Banner
Jake Bailey Profile
Jake Bailey

@andhaveaniceday

2,147
Followers
155
Following
80
Media
1,639
Statuses

Senior Software Engineer at Microsoft working on @typescript

Redmond, WA
Joined May 2021
Don't wanna be here? Send us removal request.
Pinned Tweet
@andhaveaniceday
Jake Bailey
28 days
TypeScript 5.7 will load 2.5x faster than TypeScript 5.6 when run in Node 22+, thanks to @JoyeeCheung 's work to provide an offical API for V8 compile caching. That's 60% less time waiting for tsc/tsserver to actually start doing work. PR:
Tweet media one
16
229
2K
@andhaveaniceday
Jake Bailey
7 months
TypeScript 5.5 will be 30%+ smaller than TS 5.4!
Tweet media one
11
78
721
@andhaveaniceday
Jake Bailey
1 year
TS 5.3 will be 20% smaller than TS 5.2
Tweet media one
13
33
506
@andhaveaniceday
Jake Bailey
2 years
The PR has been merged! We are modules!!!
@andhaveaniceday
Jake Bailey
2 years
After months of work (and years before me!), I've just sent the PR that converts TypeScript itself to modules. The compiler is 10-25% faster, the package is 43% smaller, and more.
34
225
2K
6
29
380
@andhaveaniceday
Jake Bailey
8 months
Don't mind me, just saving the ecosystem nearly a petabyte in data transfer a month
Tweet media one
5
12
255
@andhaveaniceday
Jake Bailey
2 years
More fun perf stuff; I'm working on converting DefinitelyTyped to a true monorepo and found a couple of perf wins in pnpm that makes `pnpm install` all of DT go from from 1 minute to 13 seconds! (I have more to send but this is a great start!)
8
16
169
@andhaveaniceday
Jake Bailey
2 years
Has anyone looked into optimizing Node's semver library? It turns out that 30%+ of pnpm's install time is spent comparing versions 😅
Tweet media one
13
8
145
@andhaveaniceday
Jake Bailey
2 years
TypeScript package maintainers, please, please, please, do not ship your TypeScript source and tsconfig in your package, I'm begging you. Please. Don't do it.
22
12
139
@andhaveaniceday
Jake Bailey
2 years
@RReverser JS doesn't have named parameters either, so in the TypeScript compiler repo we stick a comment on calls like these. Last week I submitted an upgade to our lint rule which lets you auto fix them; so much saved time and brainpower.
11
7
142
@andhaveaniceday
Jake Bailey
6 months
After many import rewrites and a couple of tweaks, it looks like it may be possible for TypeScript to go ESM, including the public API, without breaking CJS once --experimental-require-module is unflagged (assuming makes progress). Very very very cool.
Tweet media one
7
14
130
@andhaveaniceday
Jake Bailey
1 year
Now that the nightly is out, I get to pull the numbers from packagephobia and yay! In 4.9, I deleted some files that had accidentally been included in the package since 3.7 (!) In 5.0,✨modules✨ In 5.3, tsserverlibrary.js replaces typescript.js. I hope there's more, somehow...
Tweet media one
@andhaveaniceday
Jake Bailey
1 year
TS 5.3 will be 20% smaller than TS 5.2
Tweet media one
13
33
506
3
6
113
@andhaveaniceday
Jake Bailey
7 months
TS 5.5 is poised to be one of the best of all time
8
5
94
@andhaveaniceday
Jake Bailey
1 year
It hasn't happened yet (merging today!!!), but I wrote a big ol blog post on the giant migration of DefinitelyTyped to a @pnpmjs monorepo! I am super excited for this. Again thank you @atcb @sanders_n @ZoltanKochan and everyone else.
6
17
91
@andhaveaniceday
Jake Bailey
11 months
@jarredsumner You could read node_version.h, which contains info like: #define NODE_MAJOR_VERSION 20 #define NODE_MINOR_VERSION 9 #define NODE_PATCH_VERSION 0
2
0
87
@andhaveaniceday
Jake Bailey
1 year
Oh baby it happened
Tweet media one
5
2
81
@andhaveaniceday
Jake Bailey
3 years
Today was my last day (officially) working on Python; it's sad to go, but after a two week break, I'll be working on the TypeScript compiler team! 🥳 I truly appreciate everything that's brought me where I am today.
3
2
79
@andhaveaniceday
Jake Bailey
7 months
Okay everyone's asking what I'm so excited about, and it's because I had just gotten the final perf numbers for a PR, which applies @rbuckton 's monomorphization work to the public API and tsserver.
@andhaveaniceday
Jake Bailey
7 months
TS 5.5 is poised to be one of the best of all time
8
5
94
2
5
68
@andhaveaniceday
Jake Bailey
1 year
Been working on a little project and I've just published it; "every-ts" is a utility that can build any version/commit of TypeScript, ever. It wraps git so you can bisect problems down to when they actually changed, without knowing how to build TypeScript.
4
10
66
@andhaveaniceday
Jake Bailey
6 months
I feel the need to revise my last tweet TS 5.5 may very well be _the greatest of all time_
2
6
66
@andhaveaniceday
Jake Bailey
2 years
More late-night-ish perf fun; this time, a 700MB (~30%) reduction in pnpm's max memory usage on the DT monorepo by ensuring that a bunch of limiters (which serialize concurrent accesses to files) get GC'd. Yay profiling!, Rather, snapshotting!
0
3
66
@andhaveaniceday
Jake Bailey
11 months
finally, the graph is real, no mspaint needed
Tweet media one
3
1
62
@andhaveaniceday
Jake Bailey
1 year
0
1
52
@andhaveaniceday
Jake Bailey
1 year
The esbuild playground is now fully powered by WASI 🎉 Everything should work, including --outdir, stdout, even using package.json or tsconfigs. Here's a fun one showing ESM splitting:
Tweet media one
1
4
52
@andhaveaniceday
Jake Bailey
7 months
This continues the downward trend, and I'm really happy about it.
Tweet media one
1
1
50
@andhaveaniceday
Jake Bailey
2 years
Big thanks to everyone who brought us here, especially @WesleyWigham @elibarzilay @evanwallace @DavidSherret !
0
1
47
@andhaveaniceday
Jake Bailey
2 years
Daniel and me: here's 6000 word article on one of the biggest refactors in the TS project's history. 50% of commenters: HAVE YA HEARD OF TABS???
3
3
48
@andhaveaniceday
Jake Bailey
2 years
I need to clarify, this for TS 5.0, not TS 4.9; we're abusing (using?) the semver major bump for these sorts of big changes.
4
2
42
@andhaveaniceday
Jake Bailey
2 years
31% faster pnpm install on the DT monorepo thanks to @vinii_joga10 ! This PR speeds up the "weird helper" I mentioned in my previous thread; now replaced with something less allocate-y by reusing identical options objects. Yes, allocations matter in JS!
1
3
43
@andhaveaniceday
Jake Bailey
1 year
It's a bit unceremonious, but yesterday marked my 5 years at Microsoft! I've had the pleasure to work with so many wonderful and supportive people on projects that always manage to give me joy. Thank you all for making me who I am today! <3
3
0
42
@andhaveaniceday
Jake Bailey
2 years
So, for now, I've sent a PR which adds a little bit of caching of semver objects to the hot part of pnpm; this gets most of the speedup (~3min -> ~2min, +/- variance). But, I think it'd be definitely cool to try and optimize semver or rethink its API to help everyone out.
@andhaveaniceday
Jake Bailey
2 years
Has anyone looked into optimizing Node's semver library? It turns out that 30%+ of pnpm's install time is spent comparing versions 😅
Tweet media one
13
8
145
4
3
41
@andhaveaniceday
Jake Bailey
8 months
Now that's what I call a PR
Tweet media one
6
2
40
@andhaveaniceday
Jake Bailey
1 year
Big shoutout to @z_bodya for all of their recent @pnpmjs perf PRs which feature nice pprof profile screenshots; glad pprof-it is still working out 🎉
Tweet media one
2
3
39
@andhaveaniceday
Jake Bailey
6 months
Thanks to @JoyeeCheung , there's now a PR which provides a way to sync/conditionally grab Node's builtins from ESM. Polyfilling that into Node 22 got me far enough to get our CLI, API, and test suite passing!!! So, here's a draft PR to make TS ESM-only.
@andhaveaniceday
Jake Bailey
6 months
After many import rewrites and a couple of tweaks, it looks like it may be possible for TypeScript to go ESM, including the public API, without breaking CJS once --experimental-require-module is unflagged (assuming makes progress). Very very very cool.
Tweet media one
7
14
130
1
1
39
@andhaveaniceday
Jake Bailey
6 months
This is a big one!!!!
@typescript
TypeScript
6 months
Announcing TypeScript 5.5 Beta! 📣 Now with type predicate inference, more type narrowing, an @‍import tag for JSDoc, the --isolatedDeclarations flag, performance & reliability improvements, and much more!
12
197
916
0
2
38
@andhaveaniceday
Jake Bailey
2 years
Alright, making good on my promise to write some sort of blog post about this. Hope you enjoy!
@andhaveaniceday
Jake Bailey
2 years
More fun perf stuff; I'm working on converting DefinitelyTyped to a true monorepo and found a couple of perf wins in pnpm that makes `pnpm install` all of DT go from from 1 minute to 13 seconds! (I have more to send but this is a great start!)
8
16
169
3
8
37
@andhaveaniceday
Jake Bailey
1 year
oh my god people stop specifing a maximum node version in your package.json's engines field, it's like 99% likely that your package is going to work fine in the next verison of node, you're just spamming everyone who wants to use a faster, more secure version
3
2
34
@andhaveaniceday
Jake Bailey
2 years
Boom! Got it! No more graph sequencer 😃 Yes, it was just another instance of "accidenally quadradic".
Tweet media one
3
3
33
@andhaveaniceday
Jake Bailey
2 years
So, TypeScript has had a small epidemic of crashes (both my fault 😅), both were very annoying to find and minimize. I added a fast-check unittest to fuzz the parser and in seconds it found the same bug. @ndubien
Tweet media one
2
1
32
@andhaveaniceday
Jake Bailey
2 years
Ever wanted way too much info about how we converted TypeScript to modules?
@typescript
TypeScript
2 years
Want to hear about our refactoring adventures? We put together a nice short write-up (just 6,000 words) about our journey in modernizing the TypeScript codebase, and our migration to modules!
1
73
399
0
1
30
@andhaveaniceday
Jake Bailey
6 months
isolatedDeclarations, transpileDeclaration, skipping typecheck in transpileModule (faster bundling in webpack, rollup, etc), much improved AST reuse in dts emit, syntax checked regex (hopefully), more??? This is on top of the stuff I already listed a couple weeks ago.
3
2
27
@andhaveaniceday
Jake Bailey
1 year
fun fact, complaining that your favorite bug (1 of 6,000) isn't fixed yet, that you'll die before you see it fixed, etc, is not going to make the bug get fixed any faster, it's just going to make maintainers sad or, maybe that was your goal, in which case 👎
3
1
27
@andhaveaniceday
Jake Bailey
2 years
Did I waste a bunch of time adding a spinner to a script I should hopefully only need to run once? Yes. Yes I did.
2
0
26
@andhaveaniceday
Jake Bailey
1 year
Next week is gonna be a fun week Soon the scourge of baseUrl, paths, and typesRoot will be purged, replaced with "how about we actually use node_modules like everyone else" (thank you @atcb and Nathan for your efforts, and of course @ZoltanKochan and contributors for pnpm)
Tweet media one
3
4
25
@andhaveaniceday
Jake Bailey
11 months
@ahsan_js @jarredsumner If reading a 4KB file somehow takes longer than 20ms, I'm going to quit coding
1
0
22
@andhaveaniceday
Jake Bailey
2 years
@RReverser Someone's inevitably going to ask "why not an options bag?" This turns out to be faster, and the order of the parameters is also the order of the AST traversal and the guaranteed order of the properties in the object (which actually turns out to matter for perf/stability).
5
0
20
@andhaveaniceday
Jake Bailey
7 months
@mattpocockuk - Perf - Package size - Type predicate inference - Removing everything deprecated in 5.0 - More???
4
0
21
@andhaveaniceday
Jake Bailey
7 months
Many months later and I'm seeing so many people filing issues and including a bisect that points to specific PRs. So cool.
@andhaveaniceday
Jake Bailey
1 year
Been working on a little project and I've just published it; "every-ts" is a utility that can build any version/commit of TypeScript, ever. It wraps git so you can bisect problems down to when they actually changed, without knowing how to build TypeScript.
4
10
66
1
0
22
@andhaveaniceday
Jake Bailey
2 years
What's a few hundred thousand lines between friends?
Tweet media one
5
1
21
@andhaveaniceday
Jake Bailey
2 years
My weekend perf project is a new semver library, or at least something that can be adapted into the current npm semver API. I only have the "easy" stuff done, so version parsing and comparison, but it's looking promising! Parsing is ~1.5-2.5x faster, comparison 1.5-6.5x faster.
4
0
21
@andhaveaniceday
Jake Bailey
2 years
Okay this statement was maybe too strong. I'm not gonna pay Elon to edit it so I'll just say: - At least put your TS source into a different dir - Don't ship a tsconfig that
2
0
19
@andhaveaniceday
Jake Bailey
7 months
@AndaristRake @danvdk To think that this was Dan's second PR to TypeScript, and first that touched the checker. S tier
2
0
18
@andhaveaniceday
Jake Bailey
2 years
@DavidSherret Some of those gains are from targeting ES2018, but most of them are from scope lifting. The API surface is unchanged; internals are still exported as they are now (and my d.ts bundler produces a file for that, similar to the old build by disabling stripInternal).
6
1
19
@andhaveaniceday
Jake Bailey
2 years
I think my tone may have been unclear; I'm genuinely curious and interested in how to make things faster, and if anyone's tried! This is totally not a dig at the library. I just like when code go brr
1
0
18
@andhaveaniceday
Jake Bailey
2 years
@srsholmes It looks better if you look at individual commits, or just skip the "unindent" step. That's what we get for having all of our code nested in namespaces...
1
0
18
@andhaveaniceday
Jake Bailey
2 years
Making further progress on the monorepo'd DT... Now with properly configured devDeps and such and... All new slowness 😥 @vinii_joga10 How bored are you? 😅
Tweet media one
2
0
17
@andhaveaniceday
Jake Bailey
8 months
corepack good end tweet
0
1
16
@andhaveaniceday
Jake Bailey
7 months
This improvement comes from changing some of our entrypoints to use the public API rather than duplicating code. Now TS only contains 1.7 copies of the compiler, where the 0.7 is tsc.js, which is still intentionally a smaller, faster bundle.
2
0
18
@andhaveaniceday
Jake Bailey
6 months
1
0
16
@andhaveaniceday
Jake Bailey
1 year
This is super WIP, but, I just pushed up my weekend work getting esbuild to run via WASI in the browser. No more hacking up a VFS via plugins (forcing me to reimplement module resolution); now it's actually a VFS!
1
2
16
@andhaveaniceday
Jake Bailey
2 years
Ever accidentally throw an exception in the JS debug console and then get 1000 lines of stack trace because you're debugging a really deep stack frame? Well, soon, it won't do that. Sweet relief.
Tweet media one
1
2
16
@andhaveaniceday
Jake Bailey
8 months
@izs @jarredsumner IIRC you can determine it by reading the environment; there should be an entry like: `=C:=C:\some\path` Which is usually just misparsed or ignored by many standard libs. There's a Raymond Chen post for everything:
2
1
14
@andhaveaniceday
Jake Bailey
7 months
@youyuxi Every day I think that we'll eventually be free of tsconfig paths, and every day I'm disappointed
5
0
17
@andhaveaniceday
Jake Bailey
2 years
I have no idea where the word "that" came from. I've already forgotten if I had a whole sentence prepared. Great brain
0
0
14
@andhaveaniceday
Jake Bailey
6 months
@colinhacks This should be a lot better in 5.5, but if you still have this problem in nightly, setting "typescript.tsserver.log": "verbose", changing branches and then sending us the tsserver log would be very helpful.
3
0
14
@andhaveaniceday
Jake Bailey
7 months
For tsserver, this helps pretty much universally.
Tweet media one
1
0
14
@andhaveaniceday
Jake Bailey
2 years
Naively throwing a cache on semver.satisfies reduces a fresh pnpm install of DT from 3 minutes to 2 minutes, at the cost of 200MB peak memory. Worth it? Maybe...
4
0
13
@andhaveaniceday
Jake Bailey
2 years
Sweet sweet savings
Tweet media one
1
1
14
@andhaveaniceday
Jake Bailey
7 months
@OlvisGil This paper claims there's a 5x difference TypeScript and JavaScript, which indicates that its methology is fundamentally flawed and that its results cannot be trusted. TS is just JS with erasable type syntax. It's very frustrating to see this paper continue to make the rounds.
1
0
13
@andhaveaniceday
Jake Bailey
3 years
My cool move of the day is wanting my charging port on the other side of my laptop, then remembering it's a @FrameworkPuter , so I move it.
0
2
13
@andhaveaniceday
Jake Bailey
7 months
@fabiospampinato Many projects source patch TS, users and automation report crashes with stack traces, and a few helpful parties debug TS directly from their deps. That'd all stop working or be a lot harder if minified. Bun caches big JS files, and I'm hoping for in Node
1
0
13
@andhaveaniceday
Jake Bailey
7 months
And if you're using the public API to do something like tsc, i.e. check or emit, you'll get the speedup tsc got in TS 5.0. Hopefully faster ts-node, ts-loader, ts-eslint, nx, apiextractor, the works. A comparable benchmark is to force tsc to use the public API:
Tweet media one
1
0
13
@andhaveaniceday
Jake Bailey
2 years
Loving vitest and its built-in benchmarking for my weekend perf obsession. It's something I sorely miss when I'm not writing Go (though I think Deno brought first-class benchmarking to JS first?). Now all I need is fuzz testing!
2
0
13
@andhaveaniceday
Jake Bailey
1 year
fetching the packument of 9000 packages: no problem have fun👍 asking for the cached download count for 9000 packages: woah woah woah🙅🙅🙅🙅🙅🙅 stop that
Tweet media one
3
0
12
@andhaveaniceday
Jake Bailey
2 years
@43081j Performance; many people (including me) have asked "why isn't this a class", or "why is it so big", and it all comes down to performance. See also: TypeScript isn't the checker with this "huge closure" pattern; pyright has the same thing (though less so).
1
0
12
@andhaveaniceday
Jake Bailey
1 year
@atcb @sindresorhus My money is on but it's a different "username that starts with s".
1
0
12
@andhaveaniceday
Jake Bailey
2 years
@RReverser Just to really clarify, positional params can be faster, and at TS scale it can matter. But there's plenty of places that it doesn't and so we use option bags too. Option bags are definitely the better option for many reasons; don't prematurely optimize based on my commentary!
1
0
10
@andhaveaniceday
Jake Bailey
7 months
To be clear this is not the _only_ reason I think 5.5 is going to be one of the best yet, loads of great stuff, including other people's perf stuff, type predicate stuff, DTS file improvements... maybe isolatedDeclarations too?
1
0
11
@andhaveaniceday
Jake Bailey
1 year
@thorstenball I remember when I was at Google, I had Ian Lance Taylor approve some Go I wrote for readability without any notes. That made me feel very happy, enough to take a picture of my watch (which really dates the photo)
Tweet media one
0
0
11
@andhaveaniceday
Jake Bailey
5 months
oh great this stupid site redirects to x dot com now
2
1
11
@andhaveaniceday
Jake Bailey
2 years
GOOS=wasip1 just landed in Go, and holy moly, esbuild just works. Next step, update esbuild-playground to use this instead so I can emulate the full filesystem instead of using plugins! (Probably with ?)
Tweet media one
1
1
10
@andhaveaniceday
Jake Bailey
2 years
Tweet media one
1
0
10
@andhaveaniceday
Jake Bailey
1 year
I've spent days trying to figure out why some code I wrote wasn't working. Rewriting, rewriting, print debugging, new test cases. Never worked in the "real world". I figured out the problem. My new code wasn't running. I'm not sure if I'm more mad or disappointed. Both. Both.
2
0
10
@andhaveaniceday
Jake Bailey
7 months
@ahejlsberg also has a PR like this one to monomorphize our CFA flow nodes, which also incremenetally improves performance.
1
0
10
@andhaveaniceday
Jake Bailey
8 months
@danvdk @DavidSherret The playground technically had this as a plugin (see screenshot), but the real visual graph and ts-ast-viewer integration is awesome (I use that site so much). Great work!!
Tweet media one
0
0
10
@andhaveaniceday
Jake Bailey
5 months
@jarredsumner If my DNS isn't updated all around in like 15 minutes I'm pretty sad I often send manual cache purge requests to Google and CloudFlare and so on, continually digging the major nameservers until they're all done, so I can continue a deployment
1
0
8
@andhaveaniceday
Jake Bailey
2 years
@bradzacher @tseslint I'm preparing a bunch of notes / opinions for future esbuild changes, and reading the opener to is just painful. Then I go move on to removing a DT package, only to find that the very first one in my list ships their entire repo unfiltered. aaaaaaaaaaaaaa
1
0
10
@andhaveaniceday
Jake Bailey
6 months
Also, I did not do _any_ of the things listed above, most of that is @WesleyWigham and @TitianCernicova My cool stuff is old news
2
0
9
@andhaveaniceday
Jake Bailey
6 months
@mattpocockuk I prefer spaces
0
0
9