@react-native-firebase/crashlytics 21.7.4 → 21.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/index.js +3 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/__tests__/crashlytics.test.ts +0 -215
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [21.8.0](https://github.com/invertase/react-native-firebase/compare/v21.7.4...v21.8.0) (2025-02-10)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **crashlytics:** internally use modular APIs during initialization ([140507f](https://github.com/invertase/react-native-firebase/commit/140507f4ddc09d004ba6f4f9c83ea1364c536c65))
|
11
|
+
- do not ship unit tests in released packages ([e71dadf](https://github.com/invertase/react-native-firebase/commit/e71dadfc1c0cad2e89c94100913af31ddf7d9c91))
|
12
|
+
|
6
13
|
## [21.7.4](https://github.com/invertase/react-native-firebase/compare/v21.7.3...v21.7.4) (2025-02-08)
|
7
14
|
|
8
15
|
### Bug Fixes
|
package/lib/index.js
CHANGED
@@ -16,12 +16,14 @@
|
|
16
16
|
*
|
17
17
|
*/
|
18
18
|
|
19
|
+
import { getApp } from '@react-native-firebase/app';
|
19
20
|
import {
|
20
21
|
isBoolean,
|
21
22
|
isError,
|
22
23
|
isObject,
|
23
24
|
isString,
|
24
25
|
isOther,
|
26
|
+
MODULAR_DEPRECATION_ARG,
|
25
27
|
} from '@react-native-firebase/app/lib/common';
|
26
28
|
import {
|
27
29
|
createModuleNamespace,
|
@@ -171,5 +173,5 @@ export const firebase = getFirebaseRoot();
|
|
171
173
|
|
172
174
|
// This will throw with 'Default App Not initialized' if the default app is not configured.
|
173
175
|
if (!isOther) {
|
174
|
-
firebase.crashlytics();
|
176
|
+
firebase.crashlytics.call(null, getApp(), MODULAR_DEPRECATION_ARG);
|
175
177
|
}
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '21.
|
2
|
+
module.exports = '21.8.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/crashlytics",
|
3
|
-
"version": "21.
|
3
|
+
"version": "21.8.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. React Native Firebase provides automatic crash reporting for both native and JavaScript errors, including unhandled promise rejections.",
|
6
6
|
"main": "lib/index.js",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"crashlytics"
|
30
30
|
],
|
31
31
|
"peerDependencies": {
|
32
|
-
"@react-native-firebase/app": "21.
|
32
|
+
"@react-native-firebase/app": "21.8.0",
|
33
33
|
"expo": ">=47.0.0"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "14ebd5c2d2e0f284397c331f909e533c47f2ec62"
|
50
50
|
}
|
@@ -1,215 +0,0 @@
|
|
1
|
-
import { describe, expect, it, jest, beforeEach } from '@jest/globals';
|
2
|
-
// @ts-ignore test
|
3
|
-
import FirebaseModule from '../../app/lib/internal/FirebaseModule';
|
4
|
-
import {
|
5
|
-
createCheckV9Deprecation,
|
6
|
-
CheckV9DeprecationFunction,
|
7
|
-
} from '../../app/lib/common/unitTestUtils';
|
8
|
-
import {
|
9
|
-
firebase,
|
10
|
-
getCrashlytics,
|
11
|
-
isCrashlyticsCollectionEnabled,
|
12
|
-
checkForUnsentReports,
|
13
|
-
deleteUnsentReports,
|
14
|
-
didCrashOnPreviousExecution,
|
15
|
-
crash,
|
16
|
-
log,
|
17
|
-
recordError,
|
18
|
-
sendUnsentReports,
|
19
|
-
setUserId,
|
20
|
-
setAttribute,
|
21
|
-
setAttributes,
|
22
|
-
setCrashlyticsCollectionEnabled,
|
23
|
-
} from '../lib';
|
24
|
-
|
25
|
-
describe('Crashlytics', function () {
|
26
|
-
describe('namespace', function () {
|
27
|
-
it('accessible from firebase.app()', function () {
|
28
|
-
const app = firebase.app();
|
29
|
-
expect(app.crashlytics).toBeDefined();
|
30
|
-
expect(app.crashlytics().app).toEqual(app);
|
31
|
-
});
|
32
|
-
});
|
33
|
-
|
34
|
-
describe('modular', function () {
|
35
|
-
it('`getCrashlytics` function is properly exposed to end user', function () {
|
36
|
-
expect(getCrashlytics).toBeDefined();
|
37
|
-
});
|
38
|
-
|
39
|
-
it('`isCrashlyticsCollectionEnabled` function is properly exposed to end user', function () {
|
40
|
-
expect(isCrashlyticsCollectionEnabled).toBeDefined();
|
41
|
-
});
|
42
|
-
|
43
|
-
it('`checkForUnsentReports` function is properly exposed to end user', function () {
|
44
|
-
expect(checkForUnsentReports).toBeDefined();
|
45
|
-
});
|
46
|
-
|
47
|
-
it('`deleteUnsentReports` function is properly exposed to end user', function () {
|
48
|
-
expect(deleteUnsentReports).toBeDefined();
|
49
|
-
});
|
50
|
-
|
51
|
-
it('`didCrashOnPreviousExecution` function is properly exposed to end user', function () {
|
52
|
-
expect(didCrashOnPreviousExecution).toBeDefined();
|
53
|
-
});
|
54
|
-
|
55
|
-
it('`crash` function is properly exposed to end user', function () {
|
56
|
-
expect(crash).toBeDefined();
|
57
|
-
});
|
58
|
-
|
59
|
-
it('`log` function is properly exposed to end user', function () {
|
60
|
-
expect(log).toBeDefined();
|
61
|
-
});
|
62
|
-
|
63
|
-
it('`recordError` function is properly exposed to end user', function () {
|
64
|
-
expect(recordError).toBeDefined();
|
65
|
-
});
|
66
|
-
|
67
|
-
it('`sendUnsentReports` function is properly exposed to end user', function () {
|
68
|
-
expect(sendUnsentReports).toBeDefined();
|
69
|
-
});
|
70
|
-
|
71
|
-
it('`setUserId` function is properly exposed to end user', function () {
|
72
|
-
expect(setUserId).toBeDefined();
|
73
|
-
});
|
74
|
-
|
75
|
-
it('`setAttribute` function is properly exposed to end user', function () {
|
76
|
-
expect(setAttribute).toBeDefined();
|
77
|
-
});
|
78
|
-
|
79
|
-
it('`setAttributes` function is properly exposed to end user', function () {
|
80
|
-
expect(setAttributes).toBeDefined();
|
81
|
-
});
|
82
|
-
|
83
|
-
it('`setCrashlyticsCollectionEnabled` function is properly exposed to end user', function () {
|
84
|
-
expect(setCrashlyticsCollectionEnabled).toBeDefined();
|
85
|
-
});
|
86
|
-
});
|
87
|
-
|
88
|
-
describe('test `console.warn` is called for RNFB v8 API & not called for v9 API', function () {
|
89
|
-
let checkV9Deprecation: CheckV9DeprecationFunction;
|
90
|
-
|
91
|
-
beforeEach(function () {
|
92
|
-
checkV9Deprecation = createCheckV9Deprecation(['crashlytics']);
|
93
|
-
|
94
|
-
// @ts-ignore test
|
95
|
-
jest.spyOn(FirebaseModule.prototype, 'native', 'get').mockImplementation(() => {
|
96
|
-
return new Proxy(
|
97
|
-
{},
|
98
|
-
{
|
99
|
-
get: () => jest.fn(),
|
100
|
-
},
|
101
|
-
);
|
102
|
-
});
|
103
|
-
});
|
104
|
-
|
105
|
-
it('checkForUnsentReports', function () {
|
106
|
-
const crashlytics = getCrashlytics();
|
107
|
-
checkV9Deprecation(
|
108
|
-
() => checkForUnsentReports(crashlytics),
|
109
|
-
() => crashlytics.checkForUnsentReports(),
|
110
|
-
'checkForUnsentReports',
|
111
|
-
);
|
112
|
-
});
|
113
|
-
|
114
|
-
it('crash', function () {
|
115
|
-
const crashlytics = getCrashlytics();
|
116
|
-
checkV9Deprecation(
|
117
|
-
() => crash(crashlytics),
|
118
|
-
() => crashlytics.crash(),
|
119
|
-
'crash',
|
120
|
-
);
|
121
|
-
});
|
122
|
-
|
123
|
-
it('deleteUnsentReports', function () {
|
124
|
-
const crashlytics = getCrashlytics();
|
125
|
-
checkV9Deprecation(
|
126
|
-
() => deleteUnsentReports(crashlytics),
|
127
|
-
() => crashlytics.deleteUnsentReports(),
|
128
|
-
'deleteUnsentReports',
|
129
|
-
);
|
130
|
-
});
|
131
|
-
|
132
|
-
it('didCrashOnPreviousExecution', function () {
|
133
|
-
const crashlytics = getCrashlytics();
|
134
|
-
checkV9Deprecation(
|
135
|
-
() => didCrashOnPreviousExecution(crashlytics),
|
136
|
-
() => crashlytics.didCrashOnPreviousExecution(),
|
137
|
-
'didCrashOnPreviousExecution',
|
138
|
-
);
|
139
|
-
});
|
140
|
-
|
141
|
-
it('log', function () {
|
142
|
-
const crashlytics = getCrashlytics();
|
143
|
-
checkV9Deprecation(
|
144
|
-
() => log(crashlytics, 'message'),
|
145
|
-
() => crashlytics.log('message'),
|
146
|
-
'log',
|
147
|
-
);
|
148
|
-
});
|
149
|
-
|
150
|
-
it('setAttribute', function () {
|
151
|
-
const crashlytics = getCrashlytics();
|
152
|
-
checkV9Deprecation(
|
153
|
-
() => setAttribute(crashlytics, 'name', 'value'),
|
154
|
-
() => crashlytics.setAttribute('name', 'value'),
|
155
|
-
'setAttribute',
|
156
|
-
);
|
157
|
-
});
|
158
|
-
|
159
|
-
it('setAttributes', function () {
|
160
|
-
const crashlytics = getCrashlytics();
|
161
|
-
checkV9Deprecation(
|
162
|
-
() => setAttributes(crashlytics, {}),
|
163
|
-
() => crashlytics.setAttributes({}),
|
164
|
-
'setAttributes',
|
165
|
-
);
|
166
|
-
});
|
167
|
-
|
168
|
-
it('setUserId', function () {
|
169
|
-
const crashlytics = getCrashlytics();
|
170
|
-
checkV9Deprecation(
|
171
|
-
() => setUserId(crashlytics, 'id'),
|
172
|
-
() => crashlytics.setUserId('id'),
|
173
|
-
'setUserId',
|
174
|
-
);
|
175
|
-
});
|
176
|
-
|
177
|
-
it('recordError', function () {
|
178
|
-
const crashlytics = getCrashlytics();
|
179
|
-
checkV9Deprecation(
|
180
|
-
() => recordError(crashlytics, new Error(), 'name'),
|
181
|
-
() => crashlytics.recordError(new Error(), 'name'),
|
182
|
-
'recordError',
|
183
|
-
);
|
184
|
-
});
|
185
|
-
|
186
|
-
it('sendUnsentReports', function () {
|
187
|
-
const crashlytics = getCrashlytics();
|
188
|
-
checkV9Deprecation(
|
189
|
-
() => sendUnsentReports(crashlytics),
|
190
|
-
() => crashlytics.sendUnsentReports(),
|
191
|
-
'sendUnsentReports',
|
192
|
-
);
|
193
|
-
});
|
194
|
-
|
195
|
-
it('setCrashlyticsCollectionEnabled', function () {
|
196
|
-
const crashlytics = getCrashlytics();
|
197
|
-
checkV9Deprecation(
|
198
|
-
() => setCrashlyticsCollectionEnabled(crashlytics, true),
|
199
|
-
() => crashlytics.setCrashlyticsCollectionEnabled(true),
|
200
|
-
'setCrashlyticsCollectionEnabled',
|
201
|
-
);
|
202
|
-
});
|
203
|
-
|
204
|
-
it('isCrashlyticsCollectionEnabled', function () {
|
205
|
-
const crashlytics = getCrashlytics();
|
206
|
-
checkV9Deprecation(
|
207
|
-
// swapped order here because we're deprecating the modular method and keeping the property on Crashlytics instance
|
208
|
-
() => crashlytics.isCrashlyticsCollectionEnabled,
|
209
|
-
() => isCrashlyticsCollectionEnabled(crashlytics),
|
210
|
-
'',
|
211
|
-
'`isCrashlyticsCollectionEnabled()` is deprecated, please use `Crashlytics.isCrashlyticsCollectionEnabled` property instead',
|
212
|
-
);
|
213
|
-
});
|
214
|
-
});
|
215
|
-
});
|