-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript Option #142
Comments
Source: #99 (comment) |
TypeScript is a good option for many people. I think it's worth revisiting this in several months, but this is not on the plate right now. |
Hello guys, any updates to support typescript ? |
If there are any updates, they will be in this thread. 😉 |
@huiwang @mike-ward I've been working a bit and reasoning about this; i've started a PR discussion, feel free to test it and give your feedback. I'll do my best to keep the PR up to date with the master branch until most of create-react-app features will be settled and TypeScript support will be considered! Install and try it Pull Request: #509 |
IMO, an independently maintained fork of create-react-app tailored for typescript would be a nice way forward. A lot of what this package provides wrt babel is obviated by typescript, and many things in the ts world that require custom config today, eg setting up jest, could be handled by the package as well. Someone should pitch it to the typescript team: create-react-app has made react accessible to a lot of new developers, and it'd be a smart move to provide an equally nice experience with typescript as the base language. From experience, setting up a fork of react-scripts to compile ts took very little time and effort, and tracking changes from upstream wouldn't be terrible since I imagine most things could be merged without conflict. Low hanging fruit! Hahaha wait I see that's already what you did 😊 |
Hopefully this will be useful, but i'm now maintaining a fork of |
Definitely a win-win to support ts. More and more questions about react and ts workflow these days. |
@wmonk great initiative, will definitely try it out! |
@webeli How was it? |
Really interested in this feature too, since TypeScript suits fine for really large projects. |
We're going to be exploring tight integration with Flow in an upcoming release which will enable first class support for typing. |
Probably someone interested in typescript will find this useful: https://github.com/maxmalov/create-react-app-typescript-example This is an example how you can split application code across different local packages where most of them are written in typescript, more info you can find in the readme. I was using this approach not for a long time, but it's working for me well so far. |
@Timer Although that is nice, Typescript and Flow are equivalent and I would argue the ecosystem surrounding TS is more mature and more compatible with the majority of editors, operating systems, and external JS libraries. Therefore I would argue adding support for Flow does not fully cover the use case for TS. |
@ianks I agree. Typescript just has much better support and better tooling |
Please see #1998 (comment) for a more detailed response. |
+1 for ts support - hope you'll consider to add an option 👍 |
Hello, Newbie here. I spent some time setting up a project with create-react-app and I was happy. Then we hired a developer who convinced me we should use Typescript. What can I do now? Stop using CRA so I can use TS? I am not excited about using a unsupported fork, but I really like CRA. |
Hi Eric! Has your new developer evaluated flow? It can be used without ejecting. Additionally, our next release will treat it as a first class integration. If you would like to use typescript, you must eject and configure it yourself. Sorry about this! |
Thanks @Timer for the quick response. We've been researching Flow vs Typescript just this morning (in Bangkok) and so far still leaning to TS based on what we're reading. My developer has extensive experience with TS, but not with Flow, but we will check it out for sure. Best regards. Edit: We are also on Windows/Azure. |
Flow has support for Windows, and I believe it's gotten much better since the initial release (in terms of performance). The two are syntactically pretty similar. Let us know if you have any questions. :) If you end up choosing TS you may consider using the fork, though we don't officially endorse it. |
I've been trying out create-react-app-typescript with some success. It uses Not sure what incompatibilities might exist, but it's been fine so far. |
I found this starter template helpful to get going with @wmonk 's |
We also just upgraded to match |
I really think the |
Happy to consider PRs like this! But it would probably be odd to have logs pointing to forks in ejected apps. |
+1 for Typescript support! |
Thanks for your comments. I wanted to keep the discussion open but it seems like people can't refrain from posting “+1”s so I’ll lock the issue for now. @Timer has done some exploration into what it would take to support TS, so maybe he can share his findings in another thread. |
TypeScript is now officially supported as of Create React App 2.1. Read the release notes to get started! |
Generate an app that supports Typescript instead of ES6 or provide a simple migration path through documentation.
Another option is to simply add the Typescript loaders to the webpack.config.*.js configurations. Then the user can rename the files and clean up the minor syntax differences
Love this tool. I avoided React because of the tooling. Not anymore. Thanks!
The text was updated successfully, but these errors were encountered: