-
Notifications
You must be signed in to change notification settings - Fork 59
refactor: initializeApp() with optional params, add multi-app support, service caching, and auto project ID discovery #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
demolaf
wants to merge
18
commits into
next
Choose a base branch
from
feat/rework
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,127
−1,326
Conversation
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
Ehesp
reviewed
Nov 19, 2025
Ehesp
reviewed
Nov 20, 2025
Coverage Report✅ Coverage 54.93% meets 40% threshold Coverage: 54.93% Minimum threshold: 40% |
Lyokone
requested changes
Nov 21, 2025
Contributor
Lyokone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes
…replacing magic strings.
- Splits API handling into HttpClient (low-level HTTP, emulator config, googleapis) and RequestHandler (business logic, transformations, validation). - Improves separation of concerns across App Check, Auth, Firestore, Messaging, and Security Rules.
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.
Changes
1. No App Registry
FirebaseApp.getApp('myApp')works like Node.js2. Services Weren't Cached
Auth(app)created a new instance every time3. Manual Project ID Required
FirebaseAdminApp.initializeApp(projectId, credential)4. No Proper Cleanup
app.close()notifies all services to cleanup5. Manual Emulator Setup
app.useEmulator()manuallyFIREBASE_*_EMULATOR_HOSTenv variables6. No Named Apps
initializeApp(options, name: 'secondary')like Node.jsKey Classes Introduced
ProjectIdProvider- Handles project ID discovery from multiplesources
AppRegistry- Manages app instances by name with lifecycle hooksFirebaseApp- New app class with Node.js-compatible APIFirebaseService- Interface for proper service lifecyclemanagement
AppOptions- Cleaner way to configure appsAppException- Proper error handling for app-level errorsEnvironment- Handles environment detection and emulator configExample Scripts
example/run_with_emulator.sh- Run example against emulatorsexample/run_with_prod.sh- Run example against production