-
Notifications
You must be signed in to change notification settings - Fork 2.2k
-
UPDATE The reason I'm posting this question is because the moment I tried to add AngularFireFunctions to my app module the compilation completely failed with weird errors even though I hadn't attempted to use it yet and even though I had successfully used other parts of AngularFire. I have been completely stumped by this until I found this post from someone having the exact same issue. I have not tried this fix yet but it appears you can't have a firebase/functions
folder in your project - the default is for the functions
to be at the root - because it confuses AngularFireFunctions.
https://stackoverflow.com/q/59309661/183681
===
I've got a front-end Angular client. I have back-end code like Firebase functions and security rules and associated tests. Should these be in completely separate repos?
I tried to segregate the two. I have a folder called Firebase inside my main repo root at the same level as the SRC folder created by the Angular CLI. This Firebase folder has a package.json inside which has its own back-end dependencies. Everything seemed to be working fine until I tried to add the AngularFireFunctions and then everything blew up. My client wouldn't compile anymore doing ng serve, complaining about something in the Firebase/node_modules folder. I think it has something to do with the client trying to compile/use some admin functionality that is only available on the server. I have no idea why the Angular build process is looking inside the Firebase folder and I don't know how to stop it.
This configuration is kind of complicated with two node_module folders and more than one package.json. And a few tsconfig too. I use Karma for Angular tests but the back end tests seems to require Mocha - couldn't get it working in Karma - so I've got two testing frameworks.
The Firebase docs seems to encourage putting stuff all in one repo. Maybe this is helpful for deployment.
It is helpful to share some code between the front and back end like Typescript type definitions for Function inputs and outputs.
What is the recommended approach here? Should the security rules and functions and their associated tests be in a completely separate repo?
Beta Was this translation helpful? Give feedback.
All reactions
I tried to segregate all the Firebase stuff into a root level folder like firebase\functions
and this causes AngularFireFunctions to not load properly. I'm going to file a bug on this so someone else doesn't waste hours and days on this.
Replies: 1 comment 1 reply
-
I tried to segregate all the Firebase stuff into a root level folder like firebase\functions
and this causes AngularFireFunctions to not load properly. I'm going to file a bug on this so someone else doesn't waste hours and days on this.
Beta Was this translation helpful? Give feedback.
All reactions
-
I would recommend using nx workspaces to handle shared stuff between firebase functions and angular apps. There is a WIP plugin which should suffice for these needs: https://github.com/simondotm/nxfirebase
Beta Was this translation helpful? Give feedback.