DEV Community

Discussion on: Is babel still relevant for TypeScript projects ?

Collapse
 
alexburner profile image
Alex Burner

One important aspect of babel-preset-env I think you missed: Browser Polyfills. TypeScript can transpile syntax down for older browsers, but it won't add runtime code to support something like String.prototype.replaceAll() in IE11

Collapse
 
mbeaudru profile image
Manuel Beaudru

Indeed, I will update the post this weekend to add this point 👍

I thought that TypeScript added polyfills, but it doesn't and adding them is not trivial either.

Thanks !

Collapse
 
nojan profile image
Nojan

I've noticed in TypeScript playground, when you write code that contains newer features of JS and set the target to something like ES5, the tsc will produce code that seems to be polyfilled. Why do you say that it doesn't do runtime polyfilling?