4 ms·
It does have polyfills, but precisely to avoid relying on those I tend to stick to using the same in and out language. Babel is a better translator, and typescr
by nothrabannosir 8y ago
It does have polyfills, but precisely to avoid relying on those I tend to stick to using the same in and out language. Babel is a better translator, and typescript is good at doing types. Add sorcery.js to chain the source maps and you’re cooking with gas.
- sbjs 8y agoIn what way have you found Babel to be a better translator?
- nothrabannosir 8y agoSupport of features, maturity, etc. “Do one thing and do it well” applies. Have a look at the Babel website. There are tons of plugins and features: generators, symbols, async generators , object spread (long before TS had it), ......... Then there is automatic tracking of what is supported by your runtime , e.g. you can say “use polyfills for anything not supported by the current version of node”. .babelrc is a complex beast, because polyfilling is complex. Let Babel solve that, and focus your TS energy on typechecking.
- sbjs 8y agoYou're actually arguing against your own point. "Do one thing and do it well" is a great philosophy, and TypeScript actually does that more than Babel does. Babel does translation and polyfill, TypeScript only does translation. Type checking is only done during the translation phase for both tools (using Flow for Babel). So I would say TypeScript is cleaner and simpler in that regard.
- sebazzz 8y agoIt sounds only to me that you create an much more complex and harder to debug build pipeline with little added benefit. Please explain what Babel makes a better translator.