4 ms·
Eh, my take, Typescript won. Does the same thing as Babel but supports static types and inference in regular JS.
by 0x000000E2 5y ago
Eh, my take, Typescript won. Does the same thing as Babel but supports static types and inference in regular JS.
- WesolyKubeczek 5y agoCan it produce JavaScript runnable on Safari from iOS 9.3.6? Those old iPads and iPhones just won't die... As well as a number of Macbooks that will never go past OS X 10.11.
- 0x000000E2 5y agoYes, it goes back to ES3. Babel does have a neat automatic polyfill system typescript doesn't. But both can target real old JS versions. Most JS packages you'll find on NPM are still ES5. Transpilers are quickly making JS a compiled language where the bytecode format is ES5 :)
- filleduchaos 5y agotsc produces ES3, yes.
- chadlavi 5y agoThe only thing Babel seems to have a moat around is being react's preferred jsx transpiler
- swyx 5y agoon the contrary - tsc is so slow that most people use babel to strip out types in production.
- 0x000000E2 5y agoEverything is transpired to JS before it hits prod. But yeah it's slow
- andrew_ 5y agobingo. tsc for dev. sucrase for prod.
- simlevesque 5y agoWhat does "strip out types in production" means ? I've never heard of that. For what I do, Babel is the slow part. switching babel to esbuild (still with tsc) divided my build times by 10.
- manigandham 5y agoThe types aren't real anyway, what is there to strip out? Do you mean don't type check for production builds?