4

My node.js app uses firebase-admin (https://www.npmjs.com/package/firebase-admin) for Firebase Cloud Messaging only. When updating its dependencies, I noticed that its node_modules grew hugely in size and number of files.

On further investigation, moving from firebase-admin version 5.0.0 to version 5.8.2 results in an increase from around 21 MB / 1,600 files in node_modules to around 121 MB / 125,000 files.

Obviously I could just fix firebase-admin at version 5.0.0, but I'd rather stay up-to-date. Do I have any better alternatives?

davidm_uk
  • 658
  • 6
  • 19
  • 1
    We are aware of this issue, and working towards reducing the installation size. Unfortunately there's no simple alternative at the moment. Stay tuned. – Hiranya Jayathilaka Feb 05 '18 at 21:27
  • Thanks, Hiranya - that's very helpful. For now my workaround has been to fix my firebase-admin version at 5.0.1, as the FCM functionality there is sufficient for my requirements. A lot of the other functionality provided by newer versions of firebase-admin appears to be related to other Firebase features. Maybe firebase-admin could be split up into smaller modules providing different subsets of its functionality in the future? – davidm_uk Feb 05 '18 at 23:31
  • 1
    Since you're only using FCM, one workaround I can propose is to simply delete the `node_modules/grpc` directory, which should save you around 60MB. There was also a `@google-cloud/common-grpc:@0.5.4` release that went out today, which should save another ~30MB if you simply re-install the latest Admin SDK. We would consider splitting up the SDK only as a last resort. There's a smaller, native-JS grpc implementation in the works, which is expected to address this issue in the long run. – Hiranya Jayathilaka Feb 06 '18 at 01:43
  • 1
    The situation today is significantly improved, but using firebase-admin 6.0.0 instead of 5.0.1 still increases the size of my node_modules by a factor of 5. Can I ask the status of the "smaller, native-JS grpc implementation" that you mentioned? – davidm_uk Oct 17 '18 at 10:55

0 Answers0