Closed mikehardy closed 2 years ago
While I really liked the absolute modules, I always found them problematic for mobile+web with React Native. :( So removing them for good sounds like a good idea. Thank you, Mike!
I actually have a small follow on question - what are all the package.json files in the sub-directories for? those don't seem necessary or useful?
and the src/react-app-env.d.ts
file ? that seems like it should be in types
if needed?
I'm iterating on this really rapidly now for both the react-native-firebase auth example template and 3 different work projects (all using this one) so this is a period of rapid polishing/cleaning as they all go through their initial phases of development - once the basic scaffolding is up and clean in all of them I'll be really quiet probably :)
I actually have a small follow on question - what are all the package.json files in the sub-directories for? those don't seem necessary or useful?
Feel free to use them however you want or remove them (from Luna as well). Here's why and how I used them:
I was trying to implement absolute modules by following this tutorial: https://medium.com/weekly-webtips/absolute-imports-and-module-path-aliases-are-a-game-changer-1f89ee798fb5
But in order to work for React Native, I had to also pass a package.json
with a name
property that matched the folder's name I wanted to turn into an absolute module.
When I started working with JavaScript, I found using multiple index.js
files a bit confusing. So I used the main
property to point to a file that I explicitly wanted other than index
. Skip this property and it defaults to index
.
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#main
And of course, private: true
so you won't publish by mistake on NPM.
and the
src/react-app-env.d.ts
file ? that seems like it should be intypes
if needed?
That's useful for react-scripts
. Should stay where it is in order to avoid errors. You can head to this blog post for more info: https://www.newline.co/@dmitryrogozhny/how-to-start-new-react-application-with-create-react-app-and-typescript--4298e606#create-react-app-types-declaration-file
I'm iterating on this really rapidly now for both the react-native-firebase auth example template and 3 different work projects (all using this one) so this is a period of rapid polishing/cleaning as they all go through their initial phases of development - once the basic scaffolding is up and clean in all of them I'll be really quiet probably :)
Yeah, I'm already on one of my vacations 🥳 That's why I'm a bit quiet, but I'm definitely keeping an eye on Github when I can. I'm very happy that we're helping each other and I'm really wishing you Happy Holidays in case we don't keep in touch. 🍾
Happy vacation time :-) - and thanks for posting that up, I had no idea what that stuff was but now I have plenty more to learn ;-). Cheers!
If this template is used to init a project, then the app directory itself is moved, the components inside app lose their ability to resolve and lint:types no longer works
If I use directory-relative paths, everything appears fine
Related: https://github.com/invertase/react-native-firebase-authentication-example/pull/3
This was the only change I needed in this template when layering that one on top