LunatiqueCoder / luna

Luna - a React Native + Next.js template. Built with TypeScript :heart:
https://luna-gamma.vercel.app/
MIT License
264 stars 17 forks source link

Replace react-app-rewired with CRACO #23

Closed LunatiqueCoder closed 2 years ago

LunatiqueCoder commented 2 years ago

This PR implements CRACO and removes unmaintainted packages. It seems to me that react-native-vector-icons work out of the box with CRACO, so I’m thinking to remove them.

I would love if you could also have a chance to test those changes and see how they work for you.

Fixes(#21)

mikehardy commented 2 years ago

Oh - that migration concern is not just here actually, any person that adopts this template would probably appreciate if the config files for external projects were as close as possible to upstream defaults, as every consumer of the template will have to migrate as well and it can be a real burden

LunatiqueCoder commented 2 years ago

I'm happy there's some CI backing it up with lint + jest etc ! Always room for more of that to give more confidence, a task that at least built web android and ios would be perfect with some assertion of the text on the two screens and the vector icon but setting those sorts of things up - while incredibly useful - is notoriously difficult. It's one of the areas I'm working on right now https://github.com/invertase/jet/commits/%40mikehardy/jet-next 😅

That’s so interesting! 🤔I don’t have much experience in setting up CI with those kind of tasks, especially for React Native. I mainly come from a web background.

One thing maybe worth mentioning is that while refactoring the craco template file makes it much cleaner, for templates it is frequently best to stay as close as possible to the upstream so that differences become really really obvious when they do updates

What I mean specifically is that now imagine Craco goes from vN to vN+1. Now here you have to migrate right? With a very custom template vs their default, how will you know what to change? You will have to think hard about every part of the file. If in the git history here you have their original, then just a tiny diff that makes it work (but otherwise leaves it alone) it is usually much more clear how to migrate to future upstream versions as the diff will only be in tiny areas that hopefully have mentions in the migration guides projects put out when they do semver majors

That’s a good point, I really could not decide. I added back the CRACO template. The tsconfig template should also be updated like react-native-template-typescript, I’ll come back with another PR for this though.

Thanks for your help, Mike! 🚀

mikehardy commented 2 years ago

Still really happy to collaborate, I am learning the web stuff as I'm trying to use it in a work project and this is my school ;-) :nerd_face: