Image
user avatar
Andrew Branch
@atcb
Working on TypeScript at Microsoft. I appear when someone says “module resolution” three times in the dark. He/him
Marin, CA
Joined January 2013
  • user avatar
    Let’s look at each piece of this to go over what it does, why it is (or more often *isn’t*) needed, and why I can tell this package.json is misconfigured just from this small snippet. 🧵
    It is *crazy* how ALL of this is needed to just publish a package in today's JS ecosystem...
    A screenshot of a lot of options being used in package.json
  • user avatar
    Want a view of what the TypeScript compiler sees in your project? ⏱ tsc --extendedDiagnostics How long stuff took and how big/complex it is. 📜 tsc --listFiles List of every file included in the compilation. 🧠 tsc --explainFiles List of every file and *why* it’s included.
  • user avatar
    Since February, I’ve been spending part of my time rewriting TypeScript’s modules documentation, replacing years-outdated content and adding some that’s never been written down. There’s always more to write, but I’m publishing it officially today. 1/5 typescriptlang.org/docs/handbook/…
  • user avatar
    One small quality of life improvement for frontend devs in TypeScript 4.3: you can now jump into imported files TypeScript doesn’t understand, like CSS.
    Image
    GIF
  • user avatar
    Of the TypeScript features I’ve worked on, this may be the one I’m personally most excited to use: better support for `require` in auto-imports for plain JS.
    Image
    GIF
  • user avatar
    New things: I’m joining the #TypeScript team starting next week! Incredibly excited and grateful for the opportunity to work full-time on a product I love and use daily. So much to learn! 😍
  • user avatar
    What if TypeScript libraries published just .ts sources to npm instead of .js and .d.ts files? This might already be tempting for Bun-only libraries, but how will that impact users? This is easy to answer by experimenting on existing libraries that ship .js, .d.ts, *and* .ts. 🧵
    What if Node supported TypeScript?
  • user avatar
    Holy smokes, @Netlify’s onboarding experience for an existing @gatsbyjs site is *incredible.* I... think I just migrated my blog in like... 5 minutes (plus waiting for DNS propagation)? 🤯👏🏼
  • user avatar
    📢 Feedback wanted! TypeScript 4.4’s auto-imports will show you the proper import specifier, respecting path mappings and node_modules, instead of the direct path to the exporting file. You can try it out now with VS Code Insiders and TS nightly. marketplace.visualstudio.com/items?itemName…
    Image
  • user avatar
    This is now shipped in TypeScript 4.3 beta and VS Code Insiders! Help me out by giving it a try and reporting any issues you find on GitHub 😄
    Folks are going to love this (hopefully 4.3) TypeScript import change from @atcb github.com/microsoft/Type…
    Image
    GIF
  • user avatar
    Hey @github you probably know this by now, but it seems like ⌘-enter is now closing issues instead of just posting comments, and chaos is reigning supreme
    Image
  • user avatar
    There seems to be a common misconception that this will work. TypeScript will not read JS files inside node_modules by default. Writing JSDoc is great, but you still need to generate declaration files before shipping to npm.
    If you write a library in .ts files, when you publish at a minimum you’ll have 2 files for every source file: a .js file with your implementation and a .d.ts file with all your declarations. If you publish source maps (sourceMaps: true) you will also have a .js.map file. If you
  • user avatar
    When #Xamarin joined Microsoft, I knew there would be some changes, but I wasn’t expecting this:
    Image
  • user avatar
    If you’re writing TS code and running the output in Node—no bundler, esbuild-kit/tsx—and you don’t have "module": "nodenext", "moduleResolution": "nodenext" things are going to be very broken for you. Node will fight you every step of the way and TS won’t help. Let TS help.