invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.63k stars 2.2k forks source link

[🐛] v20 installs subpackages as deps, regressed from v19 #7995

Open safaiyeh opened 2 weeks ago

safaiyeh commented 2 weeks ago

Issue

In the process of integrating react-native-firebase in a project with a tight dependency security model. When integrating React Native Firebase v19, the dependencies installed were reasonable and you can selectively install the Firebase modules you need for your project.

However, in v20 setting up the project installs all the sub modules react-native-firebase offers.


Project Files

Javascript

Click To Expand

#### `yarn.lock diff`: v20: https://github.com/safaiyeh/react-native-firebase-v20/commit/db3d4f03342c293462b9fa92d1e941aa19d1c30c v19: https://github.com/safaiyeh/react-native-firebase-v19/commit/f979c44d37a4d7f33330c4502b79b584c1767ddd


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 14.6.1 CPU: (10) arm64 Apple M1 Max Memory: 362.72 MB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 20.13.0 path: ~/.nvm/versions/node/v20.13.0/bin/node Yarn: version: 3.6.4 path: /opt/homebrew/bin/yarn npm: version: 10.5.2 path: ~/.nvm/versions/node/v20.13.0/bin/npm Watchman: version: 2024.04.01.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: - DriverKit 23.5 - iOS 17.5 - macOS 14.5 - tvOS 17.5 - visionOS 1.2 - watchOS 10.5 Android SDK: Not Found IDEs: Android Studio: 2024.1 AI-241.15989.150.2411.11948838 Xcode: version: 15.4/15F31d path: /usr/bin/xcodebuild Languages: Java: version: 11.0.22 path: /opt/homebrew/opt/openjdk@11/bin/javac Ruby: version: 2.6.10 path: /Users/jason/.rbenv/shims/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.3.1 wanted: 18.3.1 react-native: installed: 0.75.2 wanted: 0.75.2 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: false ``` - **Platform that you're experiencing the issue on**: - [x] iOS - [x] Android - [x] **iOS** but have not tested behavior on Android - [x] **Android** but have not tested behavior on iOS - [x] Both - **`react-native-firebase` version you're using that has this issue:** - 20.4.0 - **`Firebase` module(s) you're using that has the issue:** - app - **Are you using `TypeScript`?** - `N


russellwheatley commented 1 week ago

Hey @safaiyeh - thanks for reporting this. It is dues to pulling in the firebase dependency for app here which allows macOS beta support https://github.com/invertase/react-native-firebase/blob/main/packages/app/package.json#L60

I'll have to think about what we do as I'm not sure it is advisable to separate the packages as described on the npm page: https://www.npmjs.com/package/@firebase/app

russellwheatley commented 1 week ago

@safaiyeh - Are you developing on macOS platform? Assuming you are not using macOS, you might be able to stop the packages from being installed. It seems it isn't the easiest with yarn however: https://github.com/yarnpkg/yarn/issues/4611

FYI; the additional packages are not RNFB packages, but they are the firebase web packages: https://www.npmjs.com/package/firebase

safaiyeh commented 1 week ago

@russellwheatley That is correct, I'm not developing on macOS - just iOS / Android.

Thanks for the context, looks like there weren't any changes to the build system for RNFB. The root cause is from Firebase itself? I can open a ticket on the Firebase repo as a follow up

russellwheatley commented 1 week ago

This isn't a firebase issue, RNFB app package has firebase web as a dependency for macOS support: https://github.com/invertase/react-native-firebase/blob/main/packages/app/package.json#L60