-
Notifications
You must be signed in to change notification settings - Fork 945
Add useFirestoreEmulator #4142
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
Add useFirestoreEmulator #4142
Conversation
Size Analysis ReportAffected ProductsNo changes between base commit (487f8e1) and head commit (769db12). Test Logs
|
@@ -521,6 +521,9 @@ export function updateDoc(reference: DocumentReference<unknown>, data: UpdateDat | |||
// @public | |||
export function updateDoc(reference: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>; | |||
|
|||
// @public | |||
export function useFirestoreEmulator(firestore: FirebaseFirestore_2, host: string, port: number): void; |
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.
Is the _2
intentional?
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.
Yeah, it's because we share the code from firestore-lite and firestore-exp. This should go away once #4140 is merged.
): void { | ||
firestore = cast(firestore, FirebaseFirestore); | ||
|
||
if (firestore._getSettings().host !== DEFAULT_HOST) { |
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.
Out of scope here but I recently realized that this warning shows up if you repeatedly call useEmulator()
with the same arguments. If you feel like fixing it, we could check settings.host !== DEFAULT_HOST && settings.host !== host
or something.
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.
Let me fix that.
@hsubox76 Friendly ping. |
This add
useFirestoreEmulator
to firestore-exp.Note: This is tested by the existing
Firestore.useEmulator
tests as the invokeuseFirestoreEmulator
indirectly.