feat(config): gate Firebase behind WEBTRIT_APP_FIREBASE_ENABLED#1441
Closed
SERDUN wants to merge 1 commit into
Closed
feat(config): gate Firebase behind WEBTRIT_APP_FIREBASE_ENABLED#1441SERDUN wants to merge 1 commit into
SERDUN wants to merge 1 commit into
Conversation
Add a WEBTRIT_APP_FIREBASE_ENABLED config (default true, runtime-overridable via EnvRegistry) that gates every Firebase touchpoint in bootstrap: Firebase app, messaging and local pushes init, the app-id provider (FirebaseAppIdProvider vs SharedPreferencesAppIdProvider), and Remote Config (falls back to the local shared-preferences cache when off). The analytics repository is now provided lazily and its navigator observer is only attached when the flag is on, so the app never touches FirebaseAnalytics.instance when Firebase is disabled. This lets a host that owns the default Firebase app - the theme configurator's realtime preview - run the embedded app Firebase-free by configuring the flag off, while standalone builds default to true and behave exactly as before.
Member
Author
|
Closing to restart the embedding support under a single, consistent injection model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a
WEBTRIT_APP_FIREBASE_ENABLEDconfig (defaulttrue, runtime-overridable viaEnvRegistry) that lets the app run Firebase-free when a host owns the default Firebase app — specifically the theme configurator's realtime preview, which mounts this app in-process.This is the first of two PRs split out of the embedding work (the second adds host theme / feature-config injection).
Changes
environment_config.dart— newFIREBASE_ENABLEDgetter (override-first, compile-time defaulttrue).bootstrap.dart— gate every Firebase touchpoint behind the flag:FirebaseAppIdProviderwhen on,SharedPreferencesAppIdProviderwhen off.main.dart—AppAnalyticsRepositoryprovided lazily soFirebaseAnalytics.instanceis only touched when the observer is attached.app.dart— analytics navigator observer attached only when the flag is on.dart_define.json/docs/environment.md— document the new flag.test/environment_config_test.dart— covers default-true and false-override.Verification
flutter analyze— clean.flutter test test/environment_config_test.dart— 8/8 pass.trueand behave exactly as before (no overrides applied).