File tree 7 files changed +40
-10
lines changed
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';
18
18
import { AuthErrorCode } from '../errors' ;
19
19
import { _assert } from '../util/assert' ;
20
20
import { _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' ;
22
27
23
28
/**
24
29
* Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production
@@ -97,13 +102,12 @@ export function connectAuthEmulator(
97
102
authInternal . emulatorConfig = emulatorConfig ;
98
103
authInternal . settings . appVerificationDisabledForTesting = true ;
99
104
100
- if ( ! disableWarnings ) {
101
- emitEmulatorWarning ( ) ;
102
- }
103
-
104
105
// Workaround to get cookies in Firebase Studio
105
106
if ( isCloudWorkstation ( host ) ) {
106
107
void pingServer ( `${ protocol } //${ host } ${ portStr } ` ) ;
108
+ updateEmulatorBanner ( 'Auth' , true ) ;
109
+ } else if ( ! disableWarnings ) {
110
+ emitEmulatorWarning ( ) ;
107
111
}
108
112
}
109
113
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ import {
24
24
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types' ;
25
25
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types' ;
26
26
import { Provider } from '@firebase/component' ;
27
- import { isCloudWorkstation , pingServer } from '@firebase/util' ;
27
+ import {
28
+ isCloudWorkstation ,
29
+ pingServer ,
30
+ updateEmulatorBanner
31
+ } from '@firebase/util' ;
28
32
29
33
import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider' ;
30
34
import { Code , DataConnectError } from '../core/error' ;
@@ -241,6 +245,7 @@ export function connectDataConnectEmulator(
241
245
// Workaround to get cookies in Firebase Studio
242
246
if ( isCloudWorkstation ( host ) ) {
243
247
void pingServer ( `https://${ host } ${ port ? `:${ port } ` : '' } ` ) ;
248
+ updateEmulatorBanner ( 'Data Connect' , true ) ;
244
249
}
245
250
dc . enableEmulator ( { host, port, sslEnabled } ) ;
246
251
}
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ import {
31
31
EmulatorMockTokenOptions ,
32
32
getDefaultEmulatorHostnameAndPort ,
33
33
isCloudWorkstation ,
34
- pingServer
34
+ pingServer ,
35
+ updateEmulatorBanner
35
36
} from '@firebase/util' ;
36
37
37
38
import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider' ;
@@ -393,6 +394,7 @@ export function connectDatabaseEmulator(
393
394
// Workaround to get cookies in Firebase Studio
394
395
if ( isCloudWorkstation ( host ) ) {
395
396
void pingServer ( host ) ;
397
+ updateEmulatorBanner ( 'Database' , true ) ;
396
398
}
397
399
398
400
// Modify the repo to apply emulator settings
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ import {
28
28
EmulatorMockTokenOptions ,
29
29
getDefaultEmulatorHostnameAndPort ,
30
30
isCloudWorkstation ,
31
- pingServer
31
+ pingServer ,
32
+ updateEmulatorBanner
32
33
} from '@firebase/util' ;
33
34
34
35
import {
@@ -336,6 +337,7 @@ export function connectFirestoreEmulator(
336
337
const newHostSetting = `${ host } :${ port } ` ;
337
338
if ( useSsl ) {
338
339
void pingServer ( `https://${ newHostSetting } ` ) ;
340
+ updateEmulatorBanner ( 'Firestore' , true ) ;
339
341
}
340
342
if ( settings . host !== DEFAULT_HOST && settings . host !== newHostSetting ) {
341
343
logWarn (
Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ import { Provider } from '@firebase/component';
30
30
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types' ;
31
31
import { MessagingInternalComponentName } from '@firebase/messaging-interop-types' ;
32
32
import { 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' ;
34
38
35
39
export const DEFAULT_REGION = 'us-central1' ;
36
40
@@ -182,6 +186,7 @@ export function connectFunctionsEmulator(
182
186
// Workaround to get cookies in Firebase Studio
183
187
if ( useSsl ) {
184
188
void pingServer ( functionsInstance . emulatorOrigin ) ;
189
+ updateEmulatorBanner ( 'Functions' , true ) ;
185
190
}
186
191
}
187
192
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ import {
46
46
createMockUserToken ,
47
47
EmulatorMockTokenOptions ,
48
48
isCloudWorkstation ,
49
- pingServer
49
+ pingServer ,
50
+ updateEmulatorBanner
50
51
} from '@firebase/util' ;
51
52
import { Connection , ConnectionType } from './implementation/connection' ;
52
53
@@ -150,6 +151,7 @@ export function connectStorageEmulator(
150
151
// Workaround to get cookies in Firebase Studio
151
152
if ( useSsl ) {
152
153
void pingServer ( `https://${ storage . host } ` ) ;
154
+ updateEmulatorBanner ( 'Storage' , true ) ;
153
155
}
154
156
storage . _isUsingEmulator = true ;
155
157
storage . _protocol = useSsl ? 'https' : 'http' ;
You can’t perform that action at this time.
0 commit comments