Skip to content

Commit 4ead831

Browse files
Merge main into release
2 parents e96410a + b5df4ae commit 4ead831

File tree

7 files changed

+40
-10
lines changed

7 files changed

+40
-10
lines changed

.changeset/large-windows-mate.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

packages/auth/src/core/auth/emulator.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types';
1818
import { AuthErrorCode } from '../errors';
1919
import { _assert } from '../util/assert';
2020
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';
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

packages/data-connect/src/api/DataConnect.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ import {
2424
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
2525
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
2626
import { Provider } from '@firebase/component';
27-
import { isCloudWorkstation, pingServer } from '@firebase/util';
27+
import {
28+
isCloudWorkstation,
29+
pingServer,
30+
updateEmulatorBanner
31+
} from '@firebase/util';
2832

2933
import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider';
3034
import { 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
}

packages/database/src/api/Database.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import {
3131
EmulatorMockTokenOptions,
3232
getDefaultEmulatorHostnameAndPort,
3333
isCloudWorkstation,
34-
pingServer
34+
pingServer,
35+
updateEmulatorBanner
3536
} from '@firebase/util';
3637

3738
import { 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

packages/firestore/src/lite-api/database.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
EmulatorMockTokenOptions,
2929
getDefaultEmulatorHostnameAndPort,
3030
isCloudWorkstation,
31-
pingServer
31+
pingServer,
32+
updateEmulatorBanner
3233
} from '@firebase/util';
3334

3435
import {
@@ -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(

packages/functions/src/service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ import { Provider } from '@firebase/component';
3030
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
3131
import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
3232
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';
3438

3539
export 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

packages/storage/src/service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ import {
4646
createMockUserToken,
4747
EmulatorMockTokenOptions,
4848
isCloudWorkstation,
49-
pingServer
49+
pingServer,
50+
updateEmulatorBanner
5051
} from '@firebase/util';
5152
import { 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';

0 commit comments

Comments
 (0)