Diff of the pull request: https://github.com/facebook/create-react-app/pull/4837/commi...
Interesting that the first line of that pull request removed the Oxford comma.
TypeScript support added to Create React App
61–70 of 90 posts
Re: TypeScript support added to Create React App
#62offtopic, but I'm in the middle of trying to convince my small team to pick up typescript for a new significant node backend for our company. It seems like a no-brainer from my perspective. Compilation is fast, we would use `strict` but would allow devs to default to `any` if the types got too hard. There are no downsides but so many upsides - better refactoring, intellisense, documentation, communication of interfac…
Re: TypeScript support added to Create React App
#63Earlier quoted context omitted.
> There are no downsides but so many upsides I've not used TS, but from what I've read the types from TS are not js compatible, so once you go into TS you have code that just isnt js. (As opposed to flow, where you can just have it not be used) While transpiling is normal, I'm as hesitant to tie myself to TS as I am to, say, a non-standard decorators syntax. Anyone coming to me with "there are no downsides" in such a…
You're wrong. Once you transpile the TS, you have standardized ECMAScript. Want to stop using TS? No problem. Just delete your TS files and work from your JS files. And, beyond that, TS is intended to be a superset -- never incompatible, just "extra". Finally, you can use TypeScript the same way Flow is used, through comments. Tying yourself to TS isn't really something you can do, and there's zero risk in using it.…
You do not want to work on that. It readable to an extent, but it's definitely not pleasant.
I don't think you could just go back.
Re: TypeScript support added to Create React App
#64Re: TypeScript support added to Create React App
#65Earlier quoted context omitted.
My favorite is [1]. The downstream errors that type generates are "fun." "Slightly obtuse" is an understatement when dealing with `Pick` and the errors the complimenting mapped types generate. Once you throw in React and higher order components, you can get errors that are literally several console pages long - although that's usually just tsc "tracing" the error through the complex types. [1] https://github.com/piot…
Yes, your experience mirrors mine completely. It's quite difficult to get complex higher-order components working correctly, especially if you're throwing in things like defaultProps and propTypes. For example, some issues I've hit recently: [0][1]. I think this is likely an artifact though of how powerful TS's type system is. I'm sure there're error-readability improvements possible, but with such complex type const…
The great thing about types is that the make you think more about keeping you APIs nice and clean on a semantic level, not just about if the syntax in your examples look pretty. I really hope more library authors use them early on so they avoid such mistakes in the future. There's only so much the Flow and TypeScript devs can do to make up for those existing problems.
Re: TypeScript support added to Create React App
#66This is awesome. I recently moved from Typescript to plain Javascript for a project and it is quite frustrating. You don't realise what you had till it's gone!
Re: TypeScript support added to Create React App
#67Earlier quoted context omitted.
Typescript looks interesting and increasingly appealing -- it is high on my list of tech to explore. However, absolutist statements are not very useful... It shouldn't even need saying, but clearly large javascript projects do succeed from time to time.
"Time to time" is reductive even. Large Javascript projects succeed all the time, and have done for decades. This whole thread needs a bit of perspective, no matter what you think of Typescript, the web wasn't invented in 2015...
Re: TypeScript support added to Create React App
#68Earlier quoted context omitted.
You're wrong. Once you transpile the TS, you have standardized ECMAScript. Want to stop using TS? No problem. Just delete your TS files and work from your JS files. And, beyond that, TS is intended to be a superset -- never incompatible, just "extra". Finally, you can use TypeScript the same way Flow is used, through comments. Tying yourself to TS isn't really something you can do, and there's zero risk in using it.…
Have you seen the code the TS compiler spits out? You do not want to work on that. It readable to an extent, but it's definitely not pleasant. I don't think you could just go back.
Otherwise you can just prettify it and be on your way.
Sure you don't want to go back, but that's the whole reason TS exists: writing JS with good organization and discipline is impossible at worst, full of boilerplate at best.
Re: TypeScript support added to Create React App
#69This is awesome. I recently moved from Typescript to plain Javascript for a project and it is quite frustrating. You don't realise what you had till it's gone!
For someone stubborn that refuse to use TS, what are you missing ? Is it the IDE tools or the compiler error messages, or writing type annotations ?
Re: TypeScript support added to Create React App
#70offtopic, but I'm in the middle of trying to convince my small team to pick up typescript for a new significant node backend for our company. It seems like a no-brainer from my perspective. Compilation is fast, we would use `strict` but would allow devs to default to `any` if the types got too hard. There are no downsides but so many upsides - better refactoring, intellisense, documentation, communication of interfac…
I've only used TS as a single dev but with multiple editors and they could have different version of TS from the other, I wonder what's the best way. Do you just help a guy with vim/vs code/IntelliJ/sublime/etc to set up to use auto TS compile and ask everyone to stick with a specific TS version? Or is it better to use something like Prepros to handle all the builds?