I just migrated a React Native app to @expo that has been in production for 7 years
So nice so see 186k (!) lines deleted from the project!
This is mostly because of CNG which auto-generates the ios and android folder, so that I could remove them from git
I use @Firebase because I want my backend to be as easy as possible to run and maintain. Having easy one-click-fixable errors like this just makes my heart go🥰
The solution? A somewhat hidden npm feature, that decides which node_modules folder dependencies are placed. This single line in my .npmrc file fixed the issue!
Now my dependencies are placed in their respective project folders, while still referencing my global shared types ✅
The problem? I was getting conflicting dependency versions between my React and RN app. They were both installed in the root node_modules, and other libraries using React referenced the wrong versions. Aka, sub-dependencies were not being hoisted correctly
The setup:
🖥️ admin: React admin website built with @vite_js and @ReactAdmin
📱 app: React Native app built with Expo
⚡️ functions: @Firebase Functions
🏷️ borst-shared: Shared Zod and @typescript types used in admin, app and functions