Re:Babel is used by millions, so why are we running out of m...
by 0x000000E2 on Tuesday May 11, 2021 @04:40AM
(#27115715)
Eh, my take, Typescript won. Does the same thing as Babel but supports static types and inference in regular JS.
[ Parent
| on HN ]
Re:Babel is used by millions, so why are we running out of m...
by chadlavi on Tuesday May 11, 2021 @09:55AM
(#27118161)
The only thing Babel seems to have a moat around is being react's preferred jsx transpiler
Re:Babel is used by millions, so why are we running out of m...
by swyx on Tuesday May 11, 2021 @10:30AM
(#27118516)
on the contrary - tsc is so slow that most people use babel to strip out types in production.
Re:Babel is used by millions, so why are we running out of m...
by simlevesque on Tuesday May 11, 2021 @11:21AM
(#27119171)
What 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.
Re:Babel is used by millions, so why are we running out of m...
by manigandham on Tuesday May 11, 2021 @09:23PM
(#27125636)
The types aren't real anyway, what is there to strip out? Do you mean don't type check for production builds?
Re:Babel is used by millions, so why are we running out of m...
by 0x000000E2 on Tuesday May 11, 2021 @10:57AM
(#27118833)
Everything is transpired to JS before it hits prod.
But yeah it's slow
Re:Babel is used by millions, so why are we running out of m...
by andrew_ on Tuesday May 11, 2021 @11:16AM
(#27119104)
bingo. tsc for dev. sucrase for prod.
Re:Babel is used by millions, so why are we running out of m...
by WesolyKubeczek on Tuesday May 11, 2021 @04:59AM
(#27115844)
Can 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.
Re:Babel is used by millions, so why are we running out of m...
by 0x000000E2 on Tuesday May 11, 2021 @05:07AM
(#27115888)
Yes, 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 :)
Re:Babel is used by millions, so why are we running out of m...
by filleduchaos on Tuesday May 11, 2021 @05:11AM
(#27115912)
tsc produces ES3, yes.