@@ -144,7 +144,6 @@ import { Provider } from '@firebase/component';
144
144
// settings() defaults:
145
145
const DEFAULT_HOST = 'firestore.googleapis.com' ;
146
146
const DEFAULT_SSL = true ;
147
- const DEFAULT_TIMESTAMPS_IN_SNAPSHOTS = true ;
148
147
const DEFAULT_FORCE_LONG_POLLING = false ;
149
148
const DEFAULT_IGNORE_UNDEFINED_PROPERTIES = false ;
150
149
@@ -185,8 +184,6 @@ class FirestoreSettings {
185
184
/** Whether to use SSL when connecting. */
186
185
readonly ssl : boolean ;
187
186
188
- readonly timestampsInSnapshots : boolean ;
189
-
190
187
readonly cacheSizeBytes : number ;
191
188
192
189
readonly experimentalForceLongPolling : boolean ;
@@ -218,7 +215,6 @@ class FirestoreSettings {
218
215
'host' ,
219
216
'ssl' ,
220
217
'credentials' ,
221
- 'timestampsInSnapshots' ,
222
218
'cacheSizeBytes' ,
223
219
'experimentalForceLongPolling' ,
224
220
'ignoreUndefinedProperties'
@@ -232,35 +228,13 @@ class FirestoreSettings {
232
228
) ;
233
229
this . credentials = settings . credentials ;
234
230
235
- validateNamedOptionalType (
236
- 'settings' ,
237
- 'boolean' ,
238
- 'timestampsInSnapshots' ,
239
- settings . timestampsInSnapshots
240
- ) ;
241
-
242
231
validateNamedOptionalType (
243
232
'settings' ,
244
233
'boolean' ,
245
234
'ignoreUndefinedProperties' ,
246
235
settings . ignoreUndefinedProperties
247
236
) ;
248
237
249
- // Nobody should set timestampsInSnapshots anymore, but the error depends on
250
- // whether they set it to true or false...
251
- if ( settings . timestampsInSnapshots === true ) {
252
- logError (
253
- "The setting 'timestampsInSnapshots: true' is no longer required " +
254
- 'and should be removed.'
255
- ) ;
256
- } else if ( settings . timestampsInSnapshots === false ) {
257
- logError (
258
- "Support for 'timestampsInSnapshots: false' will be removed soon. " +
259
- 'You must update your code to handle Timestamp objects.'
260
- ) ;
261
- }
262
- this . timestampsInSnapshots =
263
- settings . timestampsInSnapshots ?? DEFAULT_TIMESTAMPS_IN_SNAPSHOTS ;
264
238
this . ignoreUndefinedProperties =
265
239
settings . ignoreUndefinedProperties ?? DEFAULT_IGNORE_UNDEFINED_PROPERTIES ;
266
240
@@ -300,7 +274,6 @@ class FirestoreSettings {
300
274
return (
301
275
this . host === other . host &&
302
276
this . ssl === other . ssl &&
303
- this . timestampsInSnapshots === other . timestampsInSnapshots &&
304
277
this . credentials === other . credentials &&
305
278
this . cacheSizeBytes === other . cacheSizeBytes &&
306
279
this . experimentalForceLongPolling ===
@@ -712,12 +685,6 @@ export class Firestore implements PublicFirestore, FirebaseService {
712
685
setLogLevel ( level ) ;
713
686
}
714
687
715
- // Note: this is not a property because the minifier can't work correctly with
716
- // the way TypeScript compiler outputs properties.
717
- _areTimestampsInSnapshotsEnabled ( ) : boolean {
718
- return this . _settings . timestampsInSnapshots ;
719
- }
720
-
721
688
// Visible for testing.
722
689
_getSettings ( ) : PublicSettings {
723
690
return this . _settings ;
@@ -1400,7 +1367,6 @@ export class DocumentSnapshot<T = DocumentData>
1400
1367
} else {
1401
1368
const userDataWriter = new UserDataWriter (
1402
1369
this . _firestore . _databaseId ,
1403
- this . _firestore . _areTimestampsInSnapshotsEnabled ( ) ,
1404
1370
options . serverTimestamps || 'none' ,
1405
1371
key =>
1406
1372
new DocumentReference ( key , this . _firestore , /* converter= */ null ) ,
@@ -1426,7 +1392,6 @@ export class DocumentSnapshot<T = DocumentData>
1426
1392
if ( value !== null ) {
1427
1393
const userDataWriter = new UserDataWriter (
1428
1394
this . _firestore . _databaseId ,
1429
- this . _firestore . _areTimestampsInSnapshotsEnabled ( ) ,
1430
1395
options . serverTimestamps || 'none' ,
1431
1396
key => new DocumentReference ( key , this . _firestore , this . _converter ) ,
1432
1397
bytes => new Blob ( bytes )
0 commit comments