Skip to content

Commit d49daa0

Browse files
authored
Avoid "private" getter _databaseId, since it breaks the minified build. (#197)
Avoid "private" getter _databaseId, since it breaks the minified build. This should work fine, but there seems to be an issue with our minification process where usages of _databaseId get minified but the actual property does not, causing runtime errors. :-( I've opened #194 and #195 to track the underlying causes.
1 parent 73a586c commit d49daa0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/firestore/src/api/database.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class FirestoreConfig {
178178
* The root reference to the database.
179179
*/
180180
export class Firestore implements firestore.Firestore, FirebaseService {
181-
private _config: FirestoreConfig;
181+
private readonly _config: FirestoreConfig;
182+
public readonly _databaseId: DatabaseId;
182183

183184
// The firestore client instance. This will be available as soon as
184185
// configureClient is called, but any calls against it will block until
@@ -189,10 +190,6 @@ export class Firestore implements firestore.Firestore, FirebaseService {
189190
private _firestoreClient: FirestoreClient | undefined;
190191
public _dataConverter: UserDataConverter;
191192

192-
public get _databaseId(): DatabaseId {
193-
return this._config.databaseId;
194-
}
195-
196193
constructor(databaseIdOrApp: FirestoreDatabase | FirebaseApp) {
197194
const config = new FirestoreConfig();
198195
if (typeof (databaseIdOrApp as FirebaseApp).options === 'object') {
@@ -220,6 +217,7 @@ export class Firestore implements firestore.Firestore, FirebaseService {
220217

221218
config.settings = new FirestoreSettings({});
222219
this._config = config;
220+
this._databaseId = config.databaseId;
223221
}
224222

225223
settings(settingsLiteral: firestore.Settings): void {

0 commit comments

Comments
 (0)