Skip to content

Typescript Option #142

Closed
Closed

Description

@mike-ward

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!

Activity

  1. mxstbr commented on Jul 23, 2016

    @mxstbr
    Contributor

    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)

  2. gaearon commented on Jul 24, 2016

    @gaearon
    Contributor

    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.

  3. huiwang commented on Aug 25, 2016

    @huiwang

    Hello guys, any updates to support typescript ?

  4. gaearon commented on Aug 25, 2016

    @gaearon
    Contributor

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

  5. mattiamanzati commented on Sep 4, 2016

    @mattiamanzati

    @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

  6. heyimalex commented on Nov 11, 2016

    @heyimalex
    Contributor

    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 😊

  7. wmonk commented on Dec 27, 2016

    @wmonk

    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.

  8. quantuminformation commented on Jan 3, 2017

    @quantuminformation

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

  9. webeli commented on Feb 2, 2017

    @webeli

    @wmonk great initiative, will definitely try it out!

  10. tarurar commented on Feb 6, 2017

    @tarurar

    @webeli How was it?

  11. spsoto commented on Apr 3, 2017

    @spsoto

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

  12. Timer commented on Apr 3, 2017

    @Timer
    Contributor

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

  13. maxmalov commented on Apr 11, 2017

    @maxmalov

    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.

  14. ianks commented on Apr 23, 2017

    @ianks

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

  15. 2 remaining items

  16. zanettin commented on Apr 28, 2017

    @zanettin

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

  17. EricForgy commented on May 4, 2017

    @EricForgy

    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.

  18. Timer commented on May 4, 2017

    @Timer
    Contributor

    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!

  19. EricForgy commented on May 4, 2017

    @EricForgy

    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.

  20. Timer commented on May 4, 2017

    @Timer
    Contributor

    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.

  21. mindjuice commented on May 4, 2017

    @mindjuice

    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.

  22. sjdweb commented on May 22, 2017

    @sjdweb

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

  23. wmonk commented on May 22, 2017

    @wmonk

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

  24. XVincentX commented on May 22, 2017

    @XVincentX

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

  25. gaearon commented on May 22, 2017

    @gaearon
    Contributor

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

  26. Vaccano commented on May 24, 2017

    @Vaccano

    +1 for Typescript support!

  27. locked and limited conversation to collaborators on May 24, 2017
  28. gaearon commented on May 24, 2017

    @gaearon
    Contributor

    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.

  29. Timer commented on Jul 19, 2017

    @Timer
    Contributor

    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.

  30. Timer commented on Oct 30, 2018

    @Timer
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions