Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Add documentation detailing differences between CRA 2.0 and CRA-TS #438

Open
@hassankhan

Description

@hassankhan

It would be nice to list the main differences between the two projects, since there is quite a lot of overlapping functionality and can be somewhat confusing to developers who need to make a decision.

Here's what I have so far:

CRA-TS CRA 2.1.1
Namespaces
baseUrl/paths
Casting with <Type>expression
Type-Checking Same process Separate process
Transpilation TypeScript Babel

Activity

ghost

ghost commented on Oct 31, 2018

@ghost

I believe the correct CRA version is 2.1. Also one more difference to add could be that in CRA 2.1 you can't use <Type>expression to cast, only expression as Type. Which is a super minor thing as you can't use it in TSX anyway so it only applies to TS files which I believe are usually in a minority in React based TS projects.

hassankhan

hassankhan commented on Oct 31, 2018

@hassankhan
Author

Thanks @tomashubelbauermicrosoft, I've updated the table above. Do you think its worth mentioning the differences from here too?

ghost

ghost commented on Oct 31, 2018

@ghost

Decorators won' bet supported until CRA 2.1.1: facebook/create-react-app#5642

EDIT: Now fixed and released as CRA 2.1.1.

doxxx

doxxx commented on Nov 1, 2018

@doxxx

What are the implications of using Babel vs tsc for transpilation?

dkozickis

dkozickis commented on Nov 2, 2018

@dkozickis

@doxxx Namespaces and casting

danielkcz

danielkcz commented on Nov 2, 2018

@danielkcz

I think we should include babel-loader for typescript files as well because of the super handy babel-plugin-macros. Or perhaps do it opt-in somehow.

doxxx

doxxx commented on Nov 4, 2018

@doxxx

@dkozickis After doing some reading, it would seem that one of the other implications is that Babel 7 doesn't actually do any type-checking of Typescript code, it just transpiles it down to Javascript. If you want type-checking, you still have to run tsc.

added a commit that references this issue on Nov 4, 2018
c74f2c6
shobhitg

shobhitg commented on Nov 4, 2018

@shobhitg

Just tried out CRA 2.1.0.
Looks like linting is based on eslint. And there is too much mismatch between vscode dev environment and linting errors. There is no eslint config file created to customize anything. And I felt documentation was lacking wrt linting in general.

CRA-TS does it perfectly for me. If the console shows an error, vscode shows it too.

hassankhan

hassankhan commented on Nov 4, 2018

@hassankhan
Author

@doxxx I thought I'd read that somewhere too, but can't seem to find any links 😕. If you could post one, that would be awesome 👍

doxxx

doxxx commented on Nov 4, 2018

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shobhitg@doxxx@dkozickis@danielkcz@hassankhan

        Issue actions

          Add documentation detailing differences between CRA 2.0 and CRA-TS · Issue #438 · wmonk/create-react-app-typescript