Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored Aug 14, 2024
2 parents 5bb992e + f978d86 commit 23ac5c1
Show file tree
Hide file tree
Showing 86 changed files with 3,862 additions and 428 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "⚠️ Bug/Issue report - React Native"
about: Please provide as much detail as possible. Issues may be closed if they do
not follow the template.
title: "[\U0001F41B] Bug Report Title - CHANGE ME "
labels: 'Help: Needs Triage, Impact: Bug'
labels: 'Help: Needs Triage, Needs Attention, type: bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Documentation_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "\U0001F4D6 Documentation Feedback"
about: Report an issue with the documentation or suggest an improvement.
title: "[\U0001F4DA] Documentation Issue Title - CHANGE ME "
labels: 'Help: Good First Issue, Type: Docs'
labels: 'Help: Good First Issue, type: documentation'
assignees: ''

---
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: "🚀Feature Request"
about: Make a feature request for React Native Firebase.
title: "\U0001F41B [PACKAGE_NAME_HERE] Your feature request title here"
labels: 'Needs Attention, type: enhancement'
assignees: ''

---

## What feature would you like to see?

Is there a missing a feature that is supported on an underlying SDK? Or is there a feature that you think would be useful to have in React Native Firebase?
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/Other_platforms_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: '⚠️ Other Platforms - Bug/Issue report'
title: "[\U0001F41B] Other Platforms Bug Report Title - CHANGE ME "
labels:
- 'Help: Needs Triage'
- 'Impact: Bug'
- 'Platform: Other'
- 'type: bug'
- 'platform: macOS (Other)'
description: Create an issue specific to 'Other' platforms on React Native Firebase (not Android or iOS).
body:
- type: checkboxes
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/issue-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update labels on issues with OP response

on:
issue_comment:
types: [created]

jobs:
label-op-response:
runs-on: ubuntu-latest
steps:
- name: Check if the comment is from the OP
id: check-op
run: |
OP=${{ github.event.issue.user.login }}
COMMENTER=${{ github.event.comment.user.login }}
if [ "$OP" = "$COMMENTER" ]; then
echo "op_comment=true" >> $GITHUB_ENV
else
echo "op_comment=false" >> $GITHUB_ENV
fi
- name: Add 'Needs Attention' label if OP responded
if: env.op_comment == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Needs Attention'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Remove 'blocked customer-response' label if OP responded
if: env.op_comment == 'true'
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'blocked: customer-response'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/scripts/firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ service cloud.firestore {
}
match /firestore/{document=**} {
allow read, write: if true;
}
}
match /{path=**}/collectionGroup/{documentId} {
allow read, write: if true;
}
}
match /second-database/{document=**} {
// separate rules are not supported so we need to use the same rules for both databases to prove it is querying different databases
allow read, write: if database == "second-rnfb";
}
}
}
}
6 changes: 3 additions & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!
You have 15 days until this gets closed automatically
exempt-issue-labels: 'Keep Open,help: good-first-issue,Workflow: Needs Review'
exempt-pr-labels: 'Keep Open,help: good-first-issue,Workflow: Needs Review'
exempt-issue-labels: 'Keep Open,Help: Good First Issue,Workflow: Needs Review'
exempt-pr-labels: 'Keep Open,Help: Good First Issue,Workflow: Needs Review'
close-issue-reason: not_planned
days-before-stale: 28
days-before-close: 15
stale-issue-label: 'Type: Stale'
stale-issue-label: 'Stale'
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

### Features

- **firestore:** support for `PersistentCacheIndexManager` ([#7910](https://github.com/invertase/react-native-firebase/issues/7910)) ([0b0de45](https://github.com/invertase/react-native-firebase/commit/0b0de45513cd3aab9f7037fd8468a63cf96aa62c))
- **firestore:** support for second database ([#7949](https://github.com/invertase/react-native-firebase/issues/7949)) ([eec08a0](https://github.com/invertase/react-native-firebase/commit/eec08a06f41dd96d13778fbed2afcaaac238fca4))

### Bug Fixes

- **analytics:** update the typing for Item ([#7919](https://github.com/invertase/react-native-firebase/issues/7919)) ([c2c4576](https://github.com/invertase/react-native-firebase/commit/c2c457608c865f6d25e4b9b6689cbc00721de194))
- **database:** fixes modular imports exports ([#7916](https://github.com/invertase/react-native-firebase/issues/7916)) ([7022204](https://github.com/invertase/react-native-firebase/commit/7022204616f6149e3327cbf2ab8a469f537a7b61))

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

### Features
Expand Down
2 changes: 1 addition & 1 deletion docs/crashlytics/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function App() {
try {
if (users) {
// An empty array is truthy, but not actually true.
// Therefore the array was never initialised.
// Therefore the array was never initialized.
setUserCounts(userCounts.push(users.length));
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion docs/database/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ For example:
import database, { firebase } from '@react-native-firebase/database';

// create a secondary app
const secondaryApp = await firebase.initalizeApp(credentials, config);
const secondaryApp = await firebase.initializeApp(credentials, config);

// pass the secondary app instance to the database module
const secondaryDatabase = database(secondaryApp);
Expand Down
2 changes: 1 addition & 1 deletion docs/messaging/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ scenarios, it is first important to establish the various states a device can be
| State | Description |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Foreground** | When the application is open and in view. |
| **Background** | When the application is open, however in the background (minimised). This typically occurs when the user has pressed the "home" button on the device or has switched to another app via the app switcher. |
| **Background** | When the application is open, however in the background (minimized). This typically occurs when the user has pressed the "home" button on the device or has switched to another app via the app switcher. |
| **Quit** | When the device is locked or application is not active or running. The user can quit an app by "swiping it away" via the app switcher UI on the device. |

The user must have opened the app before messages can be received. If the user force quits the app from the device settings, it must be re-opened again before receiving messages.
Expand Down
2 changes: 1 addition & 1 deletion docs/migrating-to-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ How to migrate: If you use device-local notification APIs and user-visible notif
- Module namespace has been renamed to `.remoteConfig()` from `.config()`.
- All Remote Config values can now be accessed synchronously in JS, see `getValue(key: string): ConfigValue` & `getAll(): ConfigValues` below.
- These replace all the original async methods: `getValue`, `getValues`, `getKeysByPrefix`.
- `setDefaultsFromResource` now returns a Promise that resolves when completed, this will reject with code `config/resouce_not_found` if the file could not be found.
- `setDefaultsFromResource` now returns a Promise that resolves when completed, this will reject with code `config/resource_not_found` if the file could not be found.
- `setDefaultsFromResource` now expects a resource file name for Android to match iOS, formerly this required a resource id (something you would not have in RN as this was generated at build time by Android).
- An example for both platforms can be found in the tests.
- `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead.
Expand Down
2 changes: 1 addition & 1 deletion docs/releases/v6.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ The Remote Config API has had a significant API change as originally highlighted
- [BREAKING] Module namespace has been renamed to `.remoteConfig()`, replace all usages of `firebase.config` with the new name.
- [BREAKING] All Remote Config values can now be accessed synchronously in JS, see `getValue(key: string): ConfigValue` & `getAll(): ConfigValues` below
- [BREAKING] These replace all the original async methods: `getValue`, `getValues`, `getKeysByPrefix`
- [BREAKING] `setDefaultsFromResource` now returns a Promise that resolves when completed, this will reject with code `config/resouce_not_found` if the file could not be found
- [BREAKING] `setDefaultsFromResource` now returns a Promise that resolves when completed, this will reject with code `config/resource_not_found` if the file could not be found
- [BREAKING] `setDefaultsFromResource` now expects a resource file name for Android to match iOS, formerly this required a resource id (something you would not have in RN as this was generated at build time by Android)
- And example for both platforms can be found in the tests.
- [BREAKING] `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
"userUrlFormat": "{{host}}/{{user}}"
},
"ignoreChanges": ["**/docs/**", "**/.github/**", "**/e2e/**", "**/tests/**"],
"version": "20.3.0"
"version": "20.4.0"
}
6 changes: 6 additions & 0 deletions packages/analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

### Bug Fixes

- **analytics:** update the typing for Item ([#7919](https://github.com/invertase/react-native-firebase/issues/7919)) ([c2c4576](https://github.com/invertase/react-native-firebase/commit/c2c457608c865f6d25e4b9b6689cbc00721de194))

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/analytics",
"version": "20.3.0",
"version": "20.4.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "React Native Firebase - The analytics module provides out of the box support with Google Analytics for Firebase. Integration with the Android & iOS allows for in-depth analytical insight reporting, such as device information, location, user actions and more.",
"main": "lib/index.js",
Expand All @@ -22,7 +22,7 @@
"analytics"
],
"peerDependencies": {
"@react-native-firebase/app": "20.3.0"
"@react-native-firebase/app": "20.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 4 additions & 0 deletions packages/app-check/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

**Note:** Version bump only for package @react-native-firebase/app-check

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

**Note:** Version bump only for package @react-native-firebase/app-check
Expand Down
4 changes: 2 additions & 2 deletions packages/app-check/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/app-check",
"version": "20.3.0",
"version": "20.4.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "React Native Firebase - App Check",
"main": "lib/index.js",
Expand All @@ -25,7 +25,7 @@
"appCheck"
],
"peerDependencies": {
"@react-native-firebase/app": "20.3.0",
"@react-native-firebase/app": "20.4.0",
"expo": ">=47.0.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/app-distribution/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

**Note:** Version bump only for package @react-native-firebase/app-distribution

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

**Note:** Version bump only for package @react-native-firebase/app-distribution
Expand Down
4 changes: 2 additions & 2 deletions packages/app-distribution/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/app-distribution",
"version": "20.3.0",
"version": "20.4.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "React Native Firebase - App Distribution",
"main": "lib/index.js",
Expand All @@ -22,7 +22,7 @@
"app-distribution"
],
"peerDependencies": {
"@react-native-firebase/app": "20.3.0"
"@react-native-firebase/app": "20.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 6 additions & 0 deletions packages/app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

### Features

- **firestore:** support for second database ([#7949](https://github.com/invertase/react-native-firebase/issues/7949)) ([eec08a0](https://github.com/invertase/react-native-firebase/commit/eec08a06f41dd96d13778fbed2afcaaac238fca4))

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

### Bug Fixes
Expand Down
16 changes: 9 additions & 7 deletions packages/app/lib/internal/registry/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { isString } from '@react-native-firebase/app/lib/common';
import { isString } from '../../common';
import FirebaseApp from '../../FirebaseApp';
import SDK_VERSION from '../../version';
import { DEFAULT_APP_NAME, KNOWN_NAMESPACES } from '../constants';
Expand Down Expand Up @@ -93,19 +93,21 @@ function getOrCreateModuleForApp(app, moduleNamespace) {
);
}

// e.g. firebase.storage(customUrlOrRegion)
function firebaseModuleWithArgs(customUrlOrRegion) {
if (customUrlOrRegion !== undefined) {
// e.g. firebase.storage(customUrlOrRegion), firebase.functions(customUrlOrRegion), firebase.firestore(databaseId), firebase.database(url)
function firebaseModuleWithArgs(customUrlOrRegionOrDatabaseId) {
if (customUrlOrRegionOrDatabaseId !== undefined) {
if (!hasCustomUrlOrRegionSupport) {
// TODO throw Module does not support arguments error
}

if (!isString(customUrlOrRegion)) {
if (!isString(customUrlOrRegionOrDatabaseId)) {
// TODO throw Module first argument must be a string error
}
}

const key = customUrlOrRegion ? `${customUrlOrRegion}:${moduleNamespace}` : moduleNamespace;
const key = customUrlOrRegionOrDatabaseId
? `${customUrlOrRegionOrDatabaseId}:${moduleNamespace}`
: moduleNamespace;

if (!APP_MODULE_INSTANCE[app.name]) {
APP_MODULE_INSTANCE[app.name] = {};
Expand All @@ -115,7 +117,7 @@ function getOrCreateModuleForApp(app, moduleNamespace) {
APP_MODULE_INSTANCE[app.name][key] = new ModuleClass(
app,
NAMESPACE_REGISTRY[moduleNamespace],
customUrlOrRegion,
customUrlOrRegionOrDatabaseId,
);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/app/lib/internal/registry/nativeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ function initialiseNativeModule(module) {
function subscribeToNativeModuleEvent(eventName) {
if (!NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName]) {
RNFBNativeEventEmitter.addListener(eventName, event => {
if (event.appName) {
if (event.appName && event.databaseId) {
// Firestore requires both appName and databaseId to prefix
SharedEventEmitter.emit(`${event.appName}-${event.databaseId}-${eventName}`, event);
} else if (event.appName) {
// native event has an appName property - auto prefix and internally emit
SharedEventEmitter.emit(`${event.appName}-${eventName}`, event);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/app",
"version": "20.3.0",
"version": "20.4.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
"main": "lib/index.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

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

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

### Features
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/auth",
"version": "20.3.0",
"version": "20.4.0",
"author": "Invertase <[email protected]> (http://invertase.io)",
"description": "React Native Firebase - The authentication module provides an easy-to-use API to integrate an authentication workflow into new and existing applications. React Native Firebase provides access to all Firebase authentication methods and identity providers.",
"main": "lib/index.js",
Expand All @@ -27,7 +27,7 @@
"plist": "^3.1.0"
},
"peerDependencies": {
"@react-native-firebase/app": "20.3.0",
"@react-native-firebase/app": "20.4.0",
"expo": ">=47.0.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/crashlytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)

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

## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)

**Note:** Version bump only for package @react-native-firebase/crashlytics
Expand Down
Loading

0 comments on commit 23ac5c1

Please sign in to comment.