Skip to content

feat(config): inject a Firebase integration strategy (Firebase-free embedding)#1445

Merged
SERDUN merged 1 commit into
developfrom
feat/configurable-firebase-wt1618
Jun 24, 2026
Merged

feat(config): inject a Firebase integration strategy (Firebase-free embedding)#1445
SERDUN merged 1 commit into
developfrom
feat/configurable-firebase-wt1618

Conversation

@SERDUN

@SERDUN SERDUN commented Jun 24, 2026

Copy link
Copy Markdown
Member

Overview

Lets the app run Firebase-free when a host owns the default Firebase app — the theme configurator's realtime preview, which mounts this app in-process — without any feature-flag boolean or scattered conditionals.

Whether Firebase is wired is a single polymorphic choice made by the composition root, expressed as an injected strategy, rather than a flag read in several places.

Changes

  • FirebaseIntegration — a strategy bundling the Firebase-dependent pieces: platform init (app / messaging / local pushes), app-id provider, remote config, analytics. bootstrap takes one (default FirebaseIntegrationEnabled) and consumes it uniformly — no if (firebaseEnabled) branches.
  • FirebaseIntegrationDisabled — the Firebase-free strategy: no platform init, SharedPreferencesAppIdProvider, the local cache as the remote config source, no-op analytics. An embedder calls bootstrap(firebase: const FirebaseIntegrationDisabled())no env override needed.
  • AppAnalyticsRepository is now an interface with FirebaseAppAnalyticsRepository and NoopAppAnalyticsRepository (a plain, recording-nothing observer), so App attaches the observer unconditionally — no Firebase-aware gate in the widget layer.
  • bootstrap registers the analytics repository; main.dart reads it from the registry instead of constructing FirebaseAnalytics.instance directly.

No dart-define, no docs flag entry, no flag test — the choice lives in code at the composition root.

Verification

  • flutter analyze — clean.
  • Full test suite — green (pre-push, ~912 tests).
  • Standalone behaviour is unchanged (default = FirebaseIntegrationEnabled).

@SERDUN SERDUN changed the title feat(config): gate Firebase behind WEBTRIT_APP_FIREBASE_ENABLED feat(config): inject a Firebase integration strategy (Firebase-free embedding) Jun 24, 2026
…mbedding)

Let the app run Firebase-free when a host owns the default Firebase app (the theme
configurator's realtime preview, which mounts this app in-process), without a
feature-flag boolean or scattered conditionals. Whether Firebase is wired is a
single polymorphic choice made by the composition root.

- Add FirebaseIntegration: a strategy bundling the Firebase-dependent pieces
  (platform init, app-id provider, remote config, analytics). bootstrap takes one
  (default FirebaseIntegrationEnabled) and consumes it uniformly, no branching.
- FirebaseIntegrationDisabled is the Firebase-free strategy (no platform init,
  local id provider, local cache as remote config, no-op analytics). An embedder
  passes it to bootstrap(); no env override.
- AppAnalyticsRepository becomes an interface with FirebaseAppAnalyticsRepository
  and NoopAppAnalyticsRepository (a plain, recording-nothing observer), so App
  attaches the observer unconditionally - no Firebase-aware gate in the widget.
- bootstrap registers the analytics repository; main.dart reads it from the
  registry instead of constructing FirebaseAnalytics.instance directly.

Standalone behaviour is unchanged (default = FirebaseIntegrationEnabled).
@SERDUN SERDUN force-pushed the feat/configurable-firebase-wt1618 branch from 01c165d to 5c0a90b Compare June 24, 2026 09:48
@SERDUN SERDUN changed the base branch from fix/WT-1618-exclude-video-from-call-pull to develop June 24, 2026 09:48
@SERDUN SERDUN requested a review from digiboridev June 24, 2026 09:51
@SERDUN SERDUN merged commit 7ff8dc4 into develop Jun 24, 2026
3 checks passed
@SERDUN SERDUN deleted the feat/configurable-firebase-wt1618 branch June 24, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants