File tree Expand file tree Collapse file tree 7 files changed +40
-10
lines changed Expand file tree Collapse file tree 7 files changed +40
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @firebase/auth " : patch
3+ " @firebase/data-connect " : patch
4+ " @firebase/database " : patch
5+ " @firebase/firestore " : patch
6+ " @firebase/functions " : patch
7+ " @firebase/storage " : patch
8+ ---
9+
10+ Updated to only show banner when calling connect* Emulator
Original file line number Diff line number Diff line change @@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types';
1818import { AuthErrorCode } from '../errors' ;
1919import { _assert } from '../util/assert' ;
2020import { _castAuth } from './auth_impl' ;
21- import { deepEqual , isCloudWorkstation , pingServer } from '@firebase/util' ;
21+ import {
22+ deepEqual ,
23+ isCloudWorkstation ,
24+ pingServer ,
25+ updateEmulatorBanner
26+ } from '@firebase/util' ;
2227
2328/**
2429 * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production
@@ -97,13 +102,12 @@ export function connectAuthEmulator(
97102 authInternal . emulatorConfig = emulatorConfig ;
98103 authInternal . settings . appVerificationDisabledForTesting = true ;
99104
100- if ( ! disableWarnings ) {
101- emitEmulatorWarning ( ) ;
102- }
103-
104105 // Workaround to get cookies in Firebase Studio
105106 if ( isCloudWorkstation ( host ) ) {
106107 void pingServer ( `${ protocol } //${ host } ${ portStr } ` ) ;
108+ updateEmulatorBanner ( 'Auth' , true ) ;
109+ } else if ( ! disableWarnings ) {
110+ emitEmulatorWarning ( ) ;
107111 }
108112}
109113
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ import {
2424import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types' ;
2525import { FirebaseAuthInternalName } from '@firebase/auth-interop-types' ;
2626import { Provider } from '@firebase/component' ;
27- import { isCloudWorkstation , pingServer } from '@firebase/util' ;
27+ import {
28+ isCloudWorkstation ,
29+ pingServer ,
30+ updateEmulatorBanner
31+ } from '@firebase/util' ;
2832
2933import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider' ;
3034import { Code , DataConnectError } from '../core/error' ;
@@ -241,6 +245,7 @@ export function connectDataConnectEmulator(
241245 // Workaround to get cookies in Firebase Studio
242246 if ( isCloudWorkstation ( host ) ) {
243247 void pingServer ( `https://${ host } ${ port ? `:${ port } ` : '' } ` ) ;
248+ updateEmulatorBanner ( 'Data Connect' , true ) ;
244249 }
245250 dc . enableEmulator ( { host, port, sslEnabled } ) ;
246251}
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ import {
3131 EmulatorMockTokenOptions ,
3232 getDefaultEmulatorHostnameAndPort ,
3333 isCloudWorkstation ,
34- pingServer
34+ pingServer ,
35+ updateEmulatorBanner
3536} from '@firebase/util' ;
3637
3738import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider' ;
@@ -393,6 +394,7 @@ export function connectDatabaseEmulator(
393394 // Workaround to get cookies in Firebase Studio
394395 if ( isCloudWorkstation ( host ) ) {
395396 void pingServer ( host ) ;
397+ updateEmulatorBanner ( 'Database' , true ) ;
396398 }
397399
398400 // Modify the repo to apply emulator settings
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ import {
2828 EmulatorMockTokenOptions ,
2929 getDefaultEmulatorHostnameAndPort ,
3030 isCloudWorkstation ,
31- pingServer
31+ pingServer ,
32+ updateEmulatorBanner
3233} from '@firebase/util' ;
3334
3435import {
@@ -336,6 +337,7 @@ export function connectFirestoreEmulator(
336337 const newHostSetting = `${ host } :${ port } ` ;
337338 if ( useSsl ) {
338339 void pingServer ( `https://${ newHostSetting } ` ) ;
340+ updateEmulatorBanner ( 'Firestore' , true ) ;
339341 }
340342 if ( settings . host !== DEFAULT_HOST && settings . host !== newHostSetting ) {
341343 logWarn (
Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ import { Provider } from '@firebase/component';
3030import { FirebaseAuthInternalName } from '@firebase/auth-interop-types' ;
3131import { MessagingInternalComponentName } from '@firebase/messaging-interop-types' ;
3232import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types' ;
33- import { isCloudWorkstation , pingServer } from '@firebase/util' ;
33+ import {
34+ isCloudWorkstation ,
35+ pingServer ,
36+ updateEmulatorBanner
37+ } from '@firebase/util' ;
3438
3539export const DEFAULT_REGION = 'us-central1' ;
3640
@@ -182,6 +186,7 @@ export function connectFunctionsEmulator(
182186 // Workaround to get cookies in Firebase Studio
183187 if ( useSsl ) {
184188 void pingServer ( functionsInstance . emulatorOrigin ) ;
189+ updateEmulatorBanner ( 'Functions' , true ) ;
185190 }
186191}
187192
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ import {
4646 createMockUserToken ,
4747 EmulatorMockTokenOptions ,
4848 isCloudWorkstation ,
49- pingServer
49+ pingServer ,
50+ updateEmulatorBanner
5051} from '@firebase/util' ;
5152import { Connection , ConnectionType } from './implementation/connection' ;
5253
@@ -150,6 +151,7 @@ export function connectStorageEmulator(
150151 // Workaround to get cookies in Firebase Studio
151152 if ( useSsl ) {
152153 void pingServer ( `https://${ storage . host } ` ) ;
154+ updateEmulatorBanner ( 'Storage' , true ) ;
153155 }
154156 storage . _isUsingEmulator = true ;
155157 storage . _protocol = useSsl ? 'https' : 'http' ;
You can’t perform that action at this time.
0 commit comments