Hasty Treat - TypeScript Compilers and Build Tools

Published: Feb. 15, 2021, 2 p.m.

In this Hasty Treat, Scott and Wes talk about the differences between compilers and build tools in TypeScript.

Sanity - Sponsor

Sanity.io\xa0is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at\xa0sanity.io/create. Get an awesome supercharged free developer plan on\xa0sanity.io/syntax.

Sentry - Sponsor

If you want to know what\u2019s happening with your code, track errors and monitor performance with Sentry. Sentry\u2019s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.

Show Notes

03:38 - What is a TypeScript compiler?

07:49 -\xa0Babel

  • Transpiler
  • It doesn\u2019t do typechecking
  • New JS features that aren\u2019t in TypeScript yet

10:22 -\xa0SWC

13:03 -\xa0Deno

13:36 -\xa0Surcase

14:46 -\xa0ESBuild

  • Compiles, but doesn\u2019t do any type checking
  • Fastest

17:39 - What about bundlers?

  • Parcel
  • Snowpack
  • Webpack
  • ESBuild
  • When might you still need a bundler?
    • To handle different types of files that are non-standard
      • Like importing CSS and images
  • Treeshaking
  • Smaller bundle files
    • Typescript can concatenate to a single file, or all .js files, but smaller / smarter bundles still need a tool for that
  • Polyfills
    • Typescript does convert to syntax, but will not polyfill features
    • Something like Promise
      • Syntax can be transpiled to old code
      • Methods like allSettled aren\u2019t
Links Tweet us your tasty treats!