News for hackers. Stuff that matters.
Re:TypeScript support added to Create React App by solidr53 on Monday October 22, 2018 @06:45PM (#18279243)
Pretty much just file extension support and docs. The support mainly comes from Babel 7.
Re:TypeScript support added to Create React App by cix_pkez on Monday October 22, 2018 @07:19PM (#18279429)
I'd call that a good thing, really. Not needing ever more dependencies.

I think this is a solid direction to go.

Let's just say I give the React devs... props.

Re:TypeScript support added to Create React App by mikewhy on Monday October 22, 2018 @09:32PM (#18280103)
Funny, cause just using typescript to compile means you get to drop a lot of Babel dependencies / eslint dependencies.
Re:TypeScript support added to Create React App by WorldMaker on Tuesday October 23, 2018 @03:03PM (#18286385)
There's still react-scripts-ts [1] which drops the majority of Babel in the CRA pipeline for solely Typescript. Presumably, it will remain active as it is still a useful alternative if you know you are going to want Typescript from day one. (This Babel-based support is perfect for those unsure and looking to experiment, which is great.)

[1] https://github.com/wmonk/create-react-app-typescript

Re:TypeScript support added to Create React App by mikewhy on Tuesday October 30, 2018 @08:35AM (#18335907)
I use react-scripts-ts. There's an open issue discussing the future of it now that CRA does it on its own.

https://github.com/wmonk/create-react-app-typescript/issues/...

Re:TypeScript support added to Create React App by benatkin on Monday October 22, 2018 @10:56PM (#18280407)
create-react-app is built on Webpack, for hot module replacement (HMR), and that requires a webpack loader. There's babel-loader and ts-loader. The stats in the projects are similar, but babel-loader is part of the babel project while ts-loader comes from an independent project, so it may be better integrated. Also ts-loader suggests using it with babel-loader. I'm not sure why, but if you install ts-loader and babel-loader you'll wind up with more dependencies than if you just install babel-loader. https://github.com/babel/babel-loader https://github.com/TypeStrong/ts-loader
Re:TypeScript support added to Create React App by baddox on Tuesday October 23, 2018 @03:06AM (#18281340)
The last I checked (a month or so ago, but before the recent 2.0 release) create-react-app didn’t have hit module replacement. It just watched files and completely reloaded the browser when anything changed.
Re:TypeScript support added to Create React App by jasonkillian on Monday October 22, 2018 @08:47PM (#18279916)
How well does Babel transpile TS? My initial instinct is that I'd trust the real TS compiler over Babel, but I've never tried compiling TS with Babel.

I assume the real TypeScript compiler still does the type-checking and that would be unaffected by Babel.

Re:TypeScript support added to Create React App by wwwigham on Monday October 22, 2018 @09:23PM (#18280070)
The TS team implemented the TS parsing support in Babel. You are correct that the TS compiler is still needed for the typechecker, however.
Re:TypeScript support added to Create React App by jasonkillian on Monday October 22, 2018 @10:44PM (#18280364)
Ah, I didn't realize this, very cool collaboration! For those who are reading this and might find it helpful, here's a link to the official blog post on the work: https://blogs.msdn.microsoft.com/typescript/2018/08/27/types...
Re:TypeScript support added to Create React App by brunolemos on Wednesday October 24, 2018 @09:21AM (#18292129)
We added more changes on master, now it creates tsconfig automatically, checks if the required dependencies are installed and other nice ux improvements.