Open soumak77 opened 6 years ago
@soumak77 Happy to help with this, have you already started planning or implementing support for v1? Any bigger changes to firebase-mock you'd be expecting? My guess is that mainly implementation and usage of the DeltaSnapshot interface would need to be changed to the new DataSnapshot interface.
I recently switched a project (using auth and triggers, rtdb and triggers, cloud functions, pubsub) to firebase-functions v1 and I was able to migrate the tests and continue using firebase-mock without major incompatibilities.
I'm not sure I completely understand your suggestion for supporting v1 while keeping backwards compatibility:
As support for the old API will be dropped completely end of this year, I'd vote for approach 2) to keep the code base as lean as possible, instead of having to support to ways of interacting with it.
@a-xin I think both function versions can be supported at once without a new major version. We just need to expose a way to create the input parameters used by the functions, similar to how DeltaDocumentSnapshot was created to use for firestore functions prior to v1.
Feel free to work on a PR to add this support.
Firebase SDK for Cloud Functions version 1 was just released and changes the API for all non-HTTP functions. This library needs to be updated to support the new API, while still providing backwards compatibility for the old API.