Skip to content
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

Closed
mike-ward opened this issue Jul 23, 2016 · 30 comments
Closed

Typescript Option #142

mike-ward opened this issue Jul 23, 2016 · 30 comments

Comments

@mike-ward
Copy link

mike-ward commented Jul 23, 2016

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!

@mxstbr
Copy link
Contributor

mxstbr commented Jul 23, 2016

We don't intend to provide Webpack specific overrides because it will be very fragile. People will start depending on specific loaders and plugins and we won't be able to improve the overall experience.

If we make everything configurable, this tool will become another webpack. If you’re comfortable doing this, you can use eject and tweak the options at any time.

Source: #99 (comment)

@mxstbr mxstbr closed this as completed Jul 23, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2016

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.

@huiwang
Copy link

huiwang commented Aug 25, 2016

Hello guys, any updates to support typescript ?

@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

If there are any updates, they will be in this thread. 😉
No, we are not currently considering it.

@mattiamanzati
Copy link

mattiamanzati commented Sep 4, 2016

@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!
Atm it's a bit unstable, that's why feedback is welcome, so please report any problem with it!

Install and try it
create-react-app my-awesome-typescript-app-folder --scripts-version=git://github.com/mattiamanzati/create-react-app.git#typescript-support

Pull Request: #509

@heyimalex
Copy link
Contributor

heyimalex commented Nov 11, 2016

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 😊

@wmonk
Copy link

wmonk commented Dec 27, 2016

Hopefully this will be useful, but i'm now maintaining a fork of react-scripts called react-scripts-ts, that is (an should stay) up-to-date with react-scripts.

@quantuminformation
Copy link

Definitely a win-win to support ts. More and more questions about react and ts workflow these days.

@webeli
Copy link

webeli commented Feb 2, 2017

@wmonk great initiative, will definitely try it out!

@tarurar
Copy link

tarurar commented Feb 6, 2017

@webeli How was it?

@spsoto
Copy link

spsoto commented Apr 3, 2017

Really interested in this feature too, since TypeScript suits fine for really large projects.

@Timer
Copy link
Contributor

Timer commented Apr 3, 2017

We're going to be exploring tight integration with Flow in an upcoming release which will enable first class support for typing.

@maxmalov
Copy link

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.

@ianks
Copy link

ianks commented Apr 23, 2017

@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.

@vincaslt
Copy link

vincaslt commented Apr 23, 2017

@ianks I agree. Typescript just has much better support and better tooling

@Timer
Copy link
Contributor

Timer commented Apr 23, 2017

Please see #1998 (comment) for a more detailed response.

@zanettin
Copy link

+1 for ts support - hope you'll consider to add an option 👍

@EricForgy
Copy link

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.

@Timer
Copy link
Contributor

Timer commented May 4, 2017

Hi Eric!
Unfortunately we're not exploring typescript in the immediate future. We realize this may be painful for some people.

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!

@EricForgy
Copy link

EricForgy commented May 4, 2017

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.

@Timer
Copy link
Contributor

Timer commented May 4, 2017

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.
The main problem is that parts of our tooling are incompatible with typescript and the ecosystem isn't there yet. Thus, we can't support typescript without degrading the experience.

@mindjuice
Copy link

I've been trying out create-react-app-typescript with some success. It uses create-react-app with some modified react-scripts.

Not sure what incompatibilities might exist, but it's been fine so far.

@sjdweb
Copy link

sjdweb commented May 22, 2017

I found this starter template helpful to get going with @wmonk 's react-scripts-ts.

@wmonk
Copy link

wmonk commented May 22, 2017

We also just upgraded to match create-react-app@1.0.x 🎉 at react-scripts-ts

@XVincentX
Copy link

I really think the cra cli should show something to make sure the ts fork is more discoverable.

@gaearon
Copy link
Contributor

gaearon commented May 22, 2017

Happy to consider PRs like this! But it would probably be odd to have logs pointing to forks in ejected apps.

@Vaccano
Copy link

Vaccano commented May 24, 2017

+1 for Typescript support!

@facebook facebook locked and limited conversation to collaborators May 24, 2017
@gaearon
Copy link
Contributor

gaearon commented May 24, 2017

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.

@Timer
Copy link
Contributor

Timer commented Jul 19, 2017

Hi all!

I'd love to hear some of your feedback and criticism on my proposed plugin system (#2784).
And since this thread is about TypeScript, here is the corresponding TypeScript plugin: #2815.

@Timer
Copy link
Contributor

Timer commented Oct 30, 2018

TypeScript is now officially supported as of Create React App 2.1. Read the release notes to get started!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests