Skip to content

Why use babel? #345

Answered by ArnaudBarre
OldStarchy asked this question in Q&A
Discussion options

You must be logged in to vote

To have HMR with React for good DX in dev, we need to integrate https://www.npmjs.com/package/react-refresh
This also requires some code updates which is implemented today only in Babel (via a plugin) and SWC.

TSC doesn't support this transformation natively. And TSC is not used for transpilng anyway because it's too slow (only in 5.5 they added a short path for emmiting without typechecking). TSX transformation is done via esbuild, which sadly doesn't support fast refresh (I did a PR for that without success)

I'm surprised that this two features aren't supported by babel yet. I'll look at it in the week

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by OldStarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants