red-gold / react-social-network

Simple React Social Network
https://medium.com/@qolzam/create-social-network-by-react-js-fe60010a32e6
MIT License
489 stars 484 forks source link

[Idea] what about create react app instead of custom webpack #17

Closed quantuminformation closed 6 years ago

quantuminformation commented 7 years ago

FYI

https://github.com/wmonk/create-react-app-typescript

Qolzam commented 7 years ago

Thanks! good idea.Could you please assist me with some tips to figure out how it would be necessary to replace webpack with react-scripts-ts?

quantuminformation commented 7 years ago

I'll get your project running and see if I can convert it if you like?

quantuminformation commented 7 years ago

I installed it by following these instructions:

npm install -g create-react-app
create-react-app my-app --scripts-version=react-scripts-ts

and you will get

image

You should be able to copy over the dependencies for the scripts (and other files like tslint, tsconfig) and run your project without using your custom webpack.

image

Your custom webpack works fine, but by using CRA, you might make your app appeal to a wider react audience.

Qolzam commented 7 years ago

Perfect 👍 you are awesome . I like that.

quantuminformation commented 7 years ago

I had a bash at this

https://github.com/QuantumInformation/react-social-network/tree/CRA but got this image

Qolzam commented 7 years ago

I built your tree but I didn't get that error. On the whole this tree needs many change to work. By the way I edited this tree and it compiled. However I would have error in runtime. There are something that web pack does in the project which I can't figure out in CRA tree.

quantuminformation commented 7 years ago

Great work, maybe we can get another CRA expert to advise?

Qolzam commented 7 years ago

Perfect. Sure there is supporting for sass in create-react-app. For absolute path, this idea could make it happen. We also could use this idea for node environment variables.

quantuminformation commented 7 years ago

They finds look good.

quantuminformation commented 7 years ago

So I've been using https://github.com/wmonk/create-react-app-typescript with react 16 and material UI next for a custom project. It all works quite nice together. I think create-react-app-typescript would be one of the best way to make the config for this project cleaner and give you better test server out the box.

sevastosm commented 7 years ago

I agree with Nikos, Using create-react-app-typescript is more simple, instead of configuring the from scratch the webpack.

Qolzam commented 6 years ago

Moved on create-react-app merged.