StanfordSpezi / SpeziFirebase

Google Firebase Spezi Modules
https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase/documentation/
MIT License
3 stars 2 forks source link

FirebaseEmulator Module #42

Open Supereg opened 2 weeks ago

Supereg commented 2 weeks ago

Problem

Currently, each Firebase module (e.g., Account, Storage, Firestore) has their own way of passing emulator configuration. This often times makes the configuration section pretty verbose, if you conditionally configure the emulator settings. This could also introduce errors as you have to ensure that you pass the same options in both cases.

This problem was first discussed in https://github.com/StanfordSpezi/SpeziFirebase/pull/39#discussion_r1718807482

Solution

Provide a dedicated FirebaseEmulator module that receive the emulator configurations for all Firebase emulators. This can be configured in a single if statement in the configuration of the SpeziAppDelegate. All Firebase modules can create a dependency to this DefaultInitializable module to retrieve the emulator configuration.

Additional context

We could keep the existing initializers and mark them deprecated or just remove them as part of a breaking change with the upcoming 2.0 release.

Code of Conduct