piotrwitek / react-redux-typescript-guide

The complete guide to static typing in "React & Redux" apps using TypeScript
https://piotrwitek.github.io/react-redux-typescript-guide/
MIT License
13.35k stars 1.09k forks source link

Use Create react app instead of custom webpack. #151

Closed quantuminformation closed 5 years ago

quantuminformation commented 5 years ago

Now that Create react app has typescript support, I would suggest using that, to make this project fit closer to real-world projects. All of my clients use Create react app for typescript.

piotrwitek commented 5 years ago

Thanks for suggestion @QuantumInformation. I will try to do that as soon as I can find some free time.

chawax commented 5 years ago

I am trying to move my Typescrit project (one I created from React Boilerplate) to Create React App but the problem is CRA uses Babel Typescript transpiler and it has no support for Typescript namespaces !

https://github.com/babel/babel/issues/8244

It's a big problem when you use Swagger Codegen to generate API clients and you use enums in your Swagger file since enums are defined in namespaces. I had the same problem with a React Native project and had to bypass Babel TS transpiler.

One solution may be to eject React Scripts and replace babel-loader in webpack config file with awesome-typescript-loader for example. But I had not tested it yet.

Obviously the best solution would be to change the way Swagger Codegen works with enums. But it looks a bit complex !

chawax commented 5 years ago

I probably found a better solution : using Open API generators to generate my API client from Swagger, since they don't use namespaces. I am giving it a try ! And moreover the generated code is cleaner.

quantuminformation commented 5 years ago

I'm willing to fund this issue.

quantuminformation commented 5 years ago

I think this issue will allow the patterns expressed here to fit in easier to other CRA apps based on my efforts this week.

quantuminformation commented 5 years ago

My card keeps getting declined by stipe(

The credit card form is pretty bad for that stripe widget.

IssueHuntBot commented 5 years ago

@issuehunt has funded $150.00 to this issue.


piotrwitek commented 5 years ago

I'll be working on this today

quantuminformation commented 5 years ago

Top man

On Sat, 13 Apr 2019 at 10:25, Piotrek Witek notifications@github.com wrote:

I'll be working on this today

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/piotrwitek/react-redux-typescript-guide/issues/151#issuecomment-482788785, or mute the thread https://github.com/notifications/unsubscribe-auth/AANN9gWFDzhZcwHIc0ZveM9BkJQe5Km9ks5vgZSRgaJpZM4cLL2Y .

--

Kind regards

Nikos Katsikanis

IssueHuntBot commented 5 years ago

@piotrwitek has rewarded $105.00 to @piotrwitek. See it on IssueHunt

quantuminformation commented 5 years ago

Nice work!