Skip to content

Commit ae139f1

Browse files
committed
Rebase and update
1 parent 40c5a11 commit ae139f1

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

common/api-review/remote-config.api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export function getString(remoteConfig: RemoteConfig, key: string): string;
3939
// @public
4040
export function getValue(remoteConfig: RemoteConfig, key: string): Value;
4141

42+
// @public
43+
export function isSupported(): Promise<boolean>;
44+
4245
// @public
4346
export type LogLevel = 'debug' | 'error' | 'silent';
4447

packages/firebase/compat/index.d.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,10 +2032,13 @@ declare namespace firebase.remoteConfig {
20322032
*/
20332033
export type LogLevel = 'debug' | 'error' | 'silent';
20342034
/**
2035-
* Returns true if current browser context supports
2036-
* initialization of a `RemoteConfig` instance (`firebase.remoteConfig()`).
2035+
* This method provides two different checks:
20372036
*
2038-
* Returns false otherwise.
2037+
* 1. Check if IndexedDB exists in the browser environment.
2038+
* 2. Check if the current browser context allows IndexedDB `open()` calls.
2039+
*
2040+
* It returns a `Promise` which resolves to true if a {@link RemoteConfig} instance
2041+
* can be initialized in this environment, or false if it cannot.
20392042
*/
20402043
export function isSupported(): Promise<boolean>;
20412044
}
@@ -4630,13 +4633,14 @@ declare namespace firebase.auth {
46304633
* instance must be initialized with an API key, otherwise an error will be
46314634
* thrown.
46324635
*/
4633-
class RecaptchaVerifier extends RecaptchaVerifier_Instance { }
4636+
class RecaptchaVerifier extends RecaptchaVerifier_Instance {}
46344637
/**
46354638
* @webonly
46364639
* @hidden
46374640
*/
46384641
class RecaptchaVerifier_Instance
4639-
implements firebase.auth.ApplicationVerifier {
4642+
implements firebase.auth.ApplicationVerifier
4643+
{
46404644
constructor(
46414645
container: any | string,
46424646
parameters?: Object | null,
@@ -7317,7 +7321,7 @@ declare namespace firebase.database {
73177321

73187322
interface ThenableReference
73197323
extends firebase.database.Reference,
7320-
Pick<Promise<Reference>, 'then' | 'catch'> { }
7324+
Pick<Promise<Reference>, 'then' | 'catch'> {}
73217325

73227326
/**
73237327
* Logs debugging information to the console.
@@ -7697,7 +7701,9 @@ declare namespace firebase.storage {
76977701
* resolves with the full updated metadata or rejects if the updated failed,
76987702
* including if the object did not exist.
76997703
*/
7700-
updateMetadata(metadata: firebase.storage.SettableMetadata): Promise<FullMetadata>;
7704+
updateMetadata(
7705+
metadata: firebase.storage.SettableMetadata
7706+
): Promise<FullMetadata>;
77017707
/**
77027708
* List all items (files) and prefixes (folders) under this storage reference.
77037709
*
@@ -9527,7 +9533,7 @@ declare namespace firebase.firestore {
95279533
*/
95289534
export class QueryDocumentSnapshot<
95299535
T = DocumentData
9530-
> extends DocumentSnapshot<T> {
9536+
> extends DocumentSnapshot<T> {
95319537
private constructor();
95329538

95339539
/**

packages/remote-config-compat/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
ComponentType,
2323
InstanceFactoryOptions
2424
} from '@firebase/component';
25-
import { RemoteConfigCompatImpl } from './remoteConfig';
25+
import { RemoteConfigCompatImpl, isSupported } from './remoteConfig';
2626
import { name as packageName, version } from '../package.json';
2727
import { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
2828

@@ -35,6 +35,7 @@ function registerRemoteConfigCompat(
3535
remoteConfigFactory,
3636
ComponentType.PUBLIC
3737
).setMultipleInstances(true)
38+
.setServiceProps({ isSupported })
3839
);
3940

4041
firebaseInstance.registerVersion(packageName, version);

packages/remote-config-compat/src/remoteConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ import {
3434
getBoolean,
3535
getNumber,
3636
getString,
37-
getValue
37+
getValue,
38+
isSupported
3839
} from '@firebase/remote-config';
3940

41+
export { isSupported };
42+
4043
export class RemoteConfigCompatImpl
4144
implements RemoteConfigCompat, _FirebaseService {
4245
constructor(public app: FirebaseApp, readonly _delegate: RemoteConfig) {}

packages/remote-config/src/api2.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ export async function fetchAndActivate(
4141
}
4242

4343
/**
44-
* This is a public static method provided to users that wraps two different checks:
44+
* This method provides two different checks:
4545
*
46-
* 1. check if IndexedDB is supported by the browser environment.
47-
* 2. check if the current browser context is valid for using IndexedDB.
46+
* 1. Check if IndexedDB exists in the browser environment.
47+
* 2. Check if the current browser context allows IndexedDB `open()` calls.
48+
*
49+
* @returns A `Promise` which resolves to true if a {@link RemoteConfig} instance
50+
* can be initialized in this environment, or false if it cannot.
4851
* @public
49-
*
5052
*/
5153
export async function isSupported(): Promise<boolean> {
5254
if (!isIndexedDBAvailable()) {

0 commit comments

Comments
 (0)