[HN Gopher] Etsy's Journey to TypeScript
___________________________________________________________________
Etsy's Journey to TypeScript
Author : elorant
Score : 39 points
Date : 2021-11-16 14:20 UTC (8 hours ago)
(HTM) web link (codeascraft.com)
(TXT) w3m dump (codeascraft.com)
| [deleted]
| christopherbalz wrote:
| Great in-depth write-up!
| Humphrey wrote:
| We've converted most JS projects I work on to TypeScript now, and
| it is game-changing. Interesting to read how a much larger
| company did the transition.
|
| Main takeaways from this article that I have also found are:
|
| - Convert your most imported & core code first - it's much easier
| to convert files which only have TS imports - so start with
| those, and work out.
|
| - Generating types for API response data has removed so many
| runtime errors. We generate types from GraphQL schemas.
|
| While learning TypeScript takes time (but not much really), now I
| am familiar with it, I would code faster in TS than in JS.
| SavantIdiot wrote:
| > All of the above took a week or two
|
| Wow, that's crazy fast. Going from JS to TS is a dose of hard
| reality w.r.t. how many bad patterns JS lets slide. They must
| have had a lot of devs or a few really good ones.
|
| Although I'm surprised they are still using Babel in 2021. I
| dropped support for it in my FE build flow in 2018 and hit a few
| corner cases in Europe and China, but that was it.
| sccxy wrote:
| If Babel is outdated in 2021, what is the best practice for FE
| build flow?
|
| I'm thinking about updating my projects but there too many
| options to choose from..
| SavantIdiot wrote:
| We use the JS outputted by TSC in both webpack and nuxt
| projects. I honestly don't know if that is bad, but I have
| such a small team that no one really knows. We're not Etsy-
| sized. :) This article drove it:
|
| https://blog.logrocket.com/why-you-dont-need-babel/
| Humphrey wrote:
| I think the "week or two" was just referring to updating their
| tool chain to also include support for TypeScript - not
| actually converting any code.
| byhemechi wrote:
| TypeScript is one of those things that doesn't feel like it's
| doing much when you start working with it but then when you try
| to switch back to writing vanilla JS you wonder how you ever
| managed. The editor tooling alone makes it easily worth the setup
| time.
| throwaway894345 wrote:
| This may be the perspective of a JS veteran (who has the types
| of common APIs committed to memory), but I keep a respectful
| distance from JS and only seriously touched TS yesterday and
| already the benefits seem significant.
| peanut_worm wrote:
| Learning Typescript was probably one of the best investments of
| time I have ever made. It took like 3 hours to learn all together
| and saved me at least 20 hours of debugging already.
___________________________________________________________________
(page generated 2021-11-16 23:00 UTC)