Skip to content

Commit 213b939

Browse files
fix!: remove deprecated API from auth & crashlytics (#8636)
1 parent fe4550f commit 213b939

File tree

6 files changed

+18
-56
lines changed

6 files changed

+18
-56
lines changed

docs/migrating-to-v23.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,25 @@ previous: /migrate-to-v22
55
next: /typescript
66
---
77

8-
⚠️ **REMOVED** ⚠️
8+
# Firebase Crashlytics
9+
10+
Modular API method `isCrashlyticsCollectionEnabled(crashlytics)` has been removed, please use the property on Crashlytics instance
11+
`getCrashlytics().isCrashlyticsCollectionEnabled` instead.
12+
13+
# Firebase Auth
14+
15+
`MultiFactorUser.enrolledFactor` has been removed, please use `MultiFactorUser.enrolledFactors`. See example:
916

10-
# Firebase Dynamic Links has been Removed
17+
```js
18+
const credential = await signInWithEmailAndPassword(getAuth(), 'dummy@example.com', 'password');
19+
const multiFactorUser = credential.user.multiFactor;
20+
// Use below - remove any instances of `multiFactorUser.enrolledFactor`
21+
console.log(multiFactorUser.enrolledFactors);
22+
```
23+
24+
# Firebase Dynamic Links
25+
26+
⚠️ **REMOVED** ⚠️
1127

1228
This package has been deprecated and removed from the React Native Firebase repository.
1329

packages/auth/lib/multiFactor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export class MultiFactorUser {
1414
}
1515
this._user = user;
1616
this.enrolledFactors = user.multiFactor.enrolledFactors;
17-
// @deprecated kept for backwards compatibility, please use enrolledFactors
18-
this.enrolledFactor = user.multiFactor.enrolledFactors;
1917
}
2018

2119
getSession() {

packages/crashlytics/__tests__/crashlytics.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
import {
99
firebase,
1010
getCrashlytics,
11-
isCrashlyticsCollectionEnabled,
1211
checkForUnsentReports,
1312
deleteUnsentReports,
1413
didCrashOnPreviousExecution,
@@ -46,10 +45,6 @@ describe('Crashlytics', function () {
4645
expect(getCrashlytics).toBeDefined();
4746
});
4847

49-
it('`isCrashlyticsCollectionEnabled` function is properly exposed to end user', function () {
50-
expect(isCrashlyticsCollectionEnabled).toBeDefined();
51-
});
52-
5348
it('`checkForUnsentReports` function is properly exposed to end user', function () {
5449
expect(checkForUnsentReports).toBeDefined();
5550
});
@@ -210,16 +205,5 @@ describe('Crashlytics', function () {
210205
'setCrashlyticsCollectionEnabled',
211206
);
212207
});
213-
214-
it('isCrashlyticsCollectionEnabled', function () {
215-
const crashlytics = getCrashlytics();
216-
checkV9Deprecation(
217-
// swapped order here because we're deprecating the modular method and keeping the property on Crashlytics instance
218-
() => crashlytics.isCrashlyticsCollectionEnabled,
219-
() => isCrashlyticsCollectionEnabled(crashlytics),
220-
'',
221-
'`isCrashlyticsCollectionEnabled()` is deprecated, please use `Crashlytics.isCrashlyticsCollectionEnabled` property instead',
222-
);
223-
});
224208
});
225209
});

packages/crashlytics/lib/modular/index.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ type FirebaseCrashlytics = FirebaseCrashlyticsTypes.Module;
1111
*/
1212
export declare function getCrashlytics(): FirebaseCrashlytics;
1313

14-
/**
15-
* Whether Crashlytics reporting is enabled.
16-
*
17-
* #### Example
18-
*
19-
* ```js
20-
* const crashlytics = getCrashlytics();
21-
* const isEnabled = isCrashlyticsCollectionEnabled(crashlytics);
22-
* ```
23-
*/
24-
export declare function isCrashlyticsCollectionEnabled(crashlytics: FirebaseCrashlytics): boolean;
2514
/**
2615
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
2716
* if automatic data collection is disabled.

packages/crashlytics/lib/modular/index.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,6 @@ export function getCrashlytics() {
1919
return getApp().crashlytics();
2020
}
2121

22-
/**
23-
* Whether Crashlytics reporting is enabled.
24-
*
25-
* #### Example
26-
*
27-
* ```js
28-
* const crashlytics = getCrashlytics();
29-
* const isEnabled = isCrashlyticsCollectionEnabled(crashlytics);
30-
* ```
31-
* @param {FirebaseCrashlytics} crashlytics
32-
* @returns {boolean}
33-
*/
34-
export function isCrashlyticsCollectionEnabled(crashlytics) {
35-
// Unique. Deprecating modular method and allow it as a property on Crashlytics instance.
36-
// eslint-disable-next-line no-console
37-
console.warn(
38-
'`isCrashlyticsCollectionEnabled()` is deprecated, please use `Crashlytics.isCrashlyticsCollectionEnabled` property instead',
39-
);
40-
return crashlytics.isCrashlyticsCollectionEnabled;
41-
}
42-
4322
/**
4423
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
4524
* if automatic data collection is disabled.

packages/firestore/lib/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,6 @@ class FirebaseFirestoreModule extends FirebaseModule {
314314
}
315315

316316
if (!isUndefined(settings.host)) {
317-
// eslint-disable-next-line no-console
318-
console.warn(
319-
'host in settings to connect with firestore emulator is deprecated. Use useEmulator instead.',
320-
);
321317
if (!isString(settings.host)) {
322318
return Promise.reject(
323319
new Error("firebase.firestore().settings(*) 'settings.host' must be a string value."),

0 commit comments

Comments
 (0)