Skip to content

Commit 43429cb

Browse files
Merge branch 'main' into v8-deprecations
2 parents 5e5072d + 0103e12 commit 43429cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+413
-360
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [21.6.0](https://github.com/invertase/react-native-firebase/compare/v21.5.0...v21.6.0) (2024-11-20)
7+
8+
### Features
9+
10+
- **ios, sdk:** allow FIREBASE_SDK_VERSION override ([8cbe59f](https://github.com/invertase/react-native-firebase/commit/8cbe59fbf771df6ba932832c9d4fd17bf500ea91))
11+
12+
### Bug Fixes
13+
14+
- **analytics:** update superstruct dependency / forward-port to new API ([#8153](https://github.com/invertase/react-native-firebase/issues/8153)) ([6db1fb4](https://github.com/invertase/react-native-firebase/commit/6db1fb471e62e2c7e434719f2616c76349f345be))
15+
616
## [21.5.0](https://github.com/invertase/react-native-firebase/compare/v21.4.1...v21.5.0) (2024-11-16)
717

818
### Features

docs/index.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,32 @@ If you are using the [Expo Tools](https://marketplace.visualstudio.com/items?ite
245245

246246
---
247247

248+
## Other / Web
249+
250+
If you are using the firebase-js-sdk fallback support for [web or "other" platforms](platforms#other-platforms) then you must initialize Firebase dynamically by calling [`initializeApp`](/reference/app#initializeApp).
251+
252+
However, you only want to do this for the web platform. For non-web / native apps the "default" firebase app instance will already be configured by the native google-services.json / GoogleServices-Info.plist files as mentioned above.
253+
254+
At some point during your application's bootstrap processes, initialize firebase like this:
255+
256+
```javascript
257+
import { getApp, initializeApp } from '@react-native-firebase/app';
258+
259+
// web requires dynamic initialization on web prior to using firebase
260+
if (Platform.OS === 'web') {
261+
const firebaseConfig = {
262+
// ... config items pasted from firebase console for your web app here
263+
};
264+
265+
initializeApp(firebaseConfig);
266+
}
267+
268+
// ...now throughout your app, use firebase APIs normally, for example:
269+
const firebaseApp = getApp();
270+
```
271+
272+
---
273+
248274
## Miscellaneous
249275

250276
### Android Enabling Multidex
@@ -267,10 +293,10 @@ React Native Firebase internally sets the versions of the native SDKs which each
267293
is tested against a fixed set of SDK versions (e.g. Firebase SDKs), allowing us to be confident that every feature the
268294
library supports is working as expected.
269295

270-
Sometimes it's required to change these versions to play nicely with other React Native libraries; therefore we allow
296+
Sometimes it's required to change these versions to play nicely with other React Native libraries or to work around temporary build failures; therefore we allow
271297
manually overriding these native SDK versions.
272298

273-
> Using your own SDK versions is generally not recommended as it can lead to breaking changes in your application. Proceed with caution.
299+
> Using your own SDK versions is not recommended and not supported as it can lead to unexpected build failures when new react-native-firebase versions are released that expect to use new SDK versions. Proceed with caution and remove these overrides as soon as possible when no longer needed.
274300
275301
#### Android
276302

@@ -305,11 +331,13 @@ Open your projects `/ios/Podfile` and add any of the globals shown below to the
305331

306332
```ruby
307333
# Override Firebase SDK Version
308-
$FirebaseSDKVersion = '11.4.0'
334+
$FirebaseSDKVersion = '11.5.0'
309335
```
310336

311337
Once changed, reinstall your projects pods via pod install and rebuild your project with `npx react-native run-ios`.
312338

339+
Alternatively, if you cannot edit the Podfile easily (as when using Expo), you may add the environment variable `FIREBASE_SDK_VERSION=11.5.0` (or whatever version you need) to the command line that installs pods. For example `FIREBASE_SDK_VERSION=11.5.0 yarn expo prebuild --clean`
340+
313341
### Increasing Android build memory
314342

315343
As you add more Firebase modules, there is an incredible demand placed on the Android build system, and the default memory

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@
7676
"userUrlFormat": "{{host}}/{{user}}"
7777
},
7878
"ignoreChanges": ["**/docs/**", "**/.github/**", "**/e2e/**", "**/tests/**"],
79-
"version": "21.5.0"
79+
"version": "21.6.0"
8080
}

packages/analytics/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [21.6.0](https://github.com/invertase/react-native-firebase/compare/v21.5.0...v21.6.0) (2024-11-20)
7+
8+
### Bug Fixes
9+
10+
- **analytics:** update superstruct dependency / forward-port to new API ([#8153](https://github.com/invertase/react-native-firebase/issues/8153)) ([6db1fb4](https://github.com/invertase/react-native-firebase/commit/6db1fb471e62e2c7e434719f2616c76349f345be))
11+
612
## [21.5.0](https://github.com/invertase/react-native-firebase/compare/v21.4.1...v21.5.0) (2024-11-16)
713

814
**Note:** Version bump only for package @react-native-firebase/analytics

packages/analytics/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
isString,
2727
isUndefined,
2828
} from '@react-native-firebase/app/lib/common';
29-
import { validateStruct, validateCompound } from '@react-native-firebase/app/lib/common/struct';
3029

3130
import {
3231
createModuleNamespace,
@@ -36,6 +35,7 @@ import {
3635
import { setReactNativeModule } from '@react-native-firebase/app/lib/internal/nativeModule';
3736
import { isBoolean } from '@react-native-firebase/app/lib/common';
3837

38+
import { validateStruct, validateCompound } from './struct';
3939
import fallBackModule from './web/RNFBAnalyticsModule';
4040
import version from './version';
4141
import * as structs from './structs';

packages/app/lib/common/struct.js renamed to packages/analytics/lib/struct.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,20 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { superstruct } from 'superstruct/lib/index';
18-
import { isUndefined } from './validate';
19-
20-
export default superstruct({
21-
types: {
22-
shortDate: value => typeof value === 'string' && !!value.match(/^\d{4}-\d{2}-\d{2}$/),
23-
},
24-
});
17+
import { isUndefined } from '@react-native-firebase/app/lib/common/validate';
18+
import { create } from 'superstruct';
2519

2620
export const validateStruct = (value = {}, struct, prefix = '') => {
2721
try {
28-
return struct(value);
22+
return create(value, struct);
2923
} catch (e) {
30-
const { path, reason } = e;
24+
const { path, message } = e;
25+
3126
const key = path[0];
3227

33-
if (reason === undefined) {
28+
if (message === undefined) {
3429
throw new Error(`${prefix} unknown property '${key}'.`);
3530
}
36-
3731
e.message = `${prefix} ${e.message}`;
3832

3933
throw e;

0 commit comments

Comments
 (0)