4 ms·
Yes — @humphrey is correct here. Literally being able to add type annotations (and validate that nothing fishy happened in production) took a very short period
by bichiliad 5y ago
Yes — @humphrey is correct here. Literally being able to add type annotations (and validate that nothing fishy happened in production) took a very short period of time, but everything else was the hard part.
Also, I'd love to hear what a common replacement to Babel looks like. Although we've seen a few faster alternatives, Babel's been working really well since we adopted it, and we haven't had a ton of incentive to try something less battle-tested in the time since.
- SavantIdiot 5y agoNo alternative, just the output of TSC with eslint both set to ES2019[0]. But if that's not a good idea, I'd really like to know why. I don't like extra tooling that I don't fully understand just for the heck of it. @WorldMaker has a good point below. [0] and I just discovered our default boilerplate is using ts set to ES6 and eslint set to ES2019. Facepalm.
- bichiliad 5y agoWe still typecheck and build in different steps due to speed; we can build our JS much faster than TS can with Babel + Webpack. We also have a bunch of old custom features that our build system needs to support, so bolting them onto tsc was a non-starter. Plus, we have to support some fairly old browsers (we only recently dropped support for IE11), so Babel is certainly doing a lot of transforms on the bundles we ship to older browsers. Separately, do you mean Terser instead of ESLint? ESLint isn’t really part of our build process.
- SavantIdiot 5y agoTerser? Sigh... Add that to the list of 200+ tooling options that my team doesn't have time to investigate.
- bichiliad 5y agoIt’s a minifier. I am not sure if tsc minifies your code for you or not, but if it doesn’t, you’d definitely want that in your build step. It’ll shrink your built files considerably, and it’s a pretty standard, uncomplicated tool.