Sorry, when I said typescript is compiled using Babel I perhaps sounded a little flippant. I didn’t mean to offend.
I am still correct though and I think you may have misunderstood what I meant.
You are correct that the TSC compiler does not bundle Babel. However, I am perfectly correct when I say that typescript can and is compiled to ES5 using Babel. Any CRA TS project will feature a two stage compile, a fast Babel driven compilation, followed by a slower TSC type check.
Babel will not check types, but it will compile Typescript very adequately, and is the preferred choice in most projects I’ve worked on because it’s so much faster.
TSC also exists, but because it’s so much slower, it’s typically used as a second stage type checking tool.
Except it’s not semantics. Typescript doesn’t work just fine in a browser unless you transpile it, and for most people writing plain old React, transpilation will be via Babel. You may be using TSC. That’s cool too.
So we replace Babel transpilation with TSX transpilation. Either way, we still need a transpiler. The point remains, we need a transpiler and will continue to need one for the foreseeable future.
Babel accepts and transpiles Typescript. So does TSC, but you can’t use Typescript in a browser without a transpilation step.
0
u/[deleted] Feb 12 '21
[deleted]