Skip to content

Commit df092b2

Browse files
authored
[remote-config] rename namespace to remoteConfig() from config() (#2479)
1 parent bad8998 commit df092b2

Some content is hidden

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

46 files changed

+9806
-9891
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following modules are completed and published to NPM and ready to be consume
2626
| [ML Kit Vision ](/packages/ml-vision) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/ml-vision.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/ml-vision) | [![badge](https://api.rnfirebase.io/coverage/ml-vision/badge)](https://api.rnfirebase.io/coverage/ml-vision/detail) |
2727
| [Performance Monitoring](/packages/perf) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/perf.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/perf) | [![badge](https://api.rnfirebase.io/coverage/perf/badge)](https://api.rnfirebase.io/coverage/perf/detail) |
2828
| [Realtime Database](/packages/database) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/database.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/database) | [![badge](https://api.rnfirebase.io/coverage/database/badge)](https://api.rnfirebase.io/coverage/database/detail) |
29-
| [Remote Config](/packages/config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/config) | [![badge](https://api.rnfirebase.io/coverage/functions/badge)](https://api.rnfirebase.io/coverage/functions/detail) |
29+
| [Remote Config](/packages/remote-config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/remote-config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [![badge](https://api.rnfirebase.io/coverage/remote-config/badge)](https://api.rnfirebase.io/coverage/remote-config/detail) |
3030
| [Utils](/packages/utils) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/utils.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/utils) | [![badge](https://api.rnfirebase.io/coverage/utils/badge)](https://api.rnfirebase.io/coverage/utils/detail) |
3131

3232
---
@@ -313,11 +313,12 @@ The Realtime Database module has had a large re-write, fixing various inconsiste
313313

314314
---
315315

316-
## Remote Config (config)
316+
## Remote Config (remoteConfig)
317317

318318
The Remote Config API has had a significant API change as originally highlighted would happen in the v5.x.x docs:
319319
![image](https://user-images.githubusercontent.com/5347038/58876587-7c62b100-86c6-11e9-81f9-95c26e1485a1.png)
320320

321+
- [BREAKING] Module namespace has been renamed to `.remoteConfig()`, replace all usages of `firebase.config` with the new name.
321322
- [BREAKING] All Remote Config values can now be accessed synchronously in JS, see `getValue(key: string): ConfigValue` & `getAll(): ConfigValues` below
322323
- [BREAKING] These replace all the original async methods: `getValue`, `getValues`, `getKeysByPrefix`
323324
- [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
@@ -326,7 +327,7 @@ The Remote Config API has had a significant API change as originally highlighted
326327
- [BREAKING] `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead
327328
- [BREAKING] `setDefaults` now returns a Promise that resolves when completed
328329
- [NEW] Added a new `fetchAndActivate` method - this fetches the config and activates it without the need to call `activate()` separately
329-
- [NEW] Added the following properties to `firebase.config()`; `lastFetchTime`, `lastFetchStatus` & `isDeveloperModeEnabled`
330+
- [NEW] Added the following properties to `firebase.remoteConfig()`; `lastFetchTime`, `lastFetchStatus` & `isDeveloperModeEnabled`
330331
- [NEW] Added a new `setConfigSettings` method - this allows setting `isDeveloperModeEnabled`, replaces the `enableDeveloperMode` method
331332
- This is a generic settings function to pre-emotively account for an upcoming future change to the native sdks - more settings to be added.
332333
- [NEW] All previous `get*` methods have been removed and replaced with 2 synchronous methods:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The main package that you interface with is `App` (`@react-native-firebase/app`)
6262
| [Notifications](/packages/notifications) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/notifications.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/notifications) | [![badge](https://api.rnfirebase.io/coverage/notifications/badge)](https://api.rnfirebase.io/coverage/notifications/detail) |
6363
| [Performance Monitoring](/packages/perf) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/perf.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/perf) | [![badge](https://api.rnfirebase.io/coverage/perf/badge)](https://api.rnfirebase.io/coverage/perf/detail) |
6464
| [Realtime Database](/packages/database) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/database.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/database) | [![badge](https://api.rnfirebase.io/coverage/database/badge)](https://api.rnfirebase.io/coverage/database/detail) |
65-
| [Remote Config](/packages/config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/config) | [![badge](https://api.rnfirebase.io/coverage/config/badge)](https://api.rnfirebase.io/coverage/config/detail) |
65+
| [Remote Config](/packages/remote-config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/remote-config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [![badge](https://api.rnfirebase.io/coverage/remote-config/badge)](https://api.rnfirebase.io/coverage/remote-config/detail) |
6666
| [Utils](/packages/utils) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/utils.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/utils) | [![badge](https://api.rnfirebase.io/coverage/utils/badge)](https://api.rnfirebase.io/coverage/utils/detail) |
6767

6868
## Other Packages

docs/app/firebase-json.md

Lines changed: 0 additions & 98 deletions
This file was deleted.

docs/config/android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: Manually integrate Remote Config into your Android application.
1414

1515
```groovy
1616
include ':@react-native-firebase_config'
17-
project(':@react-native-firebase_config').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/config/android')
17+
project(':@react-native-firebase_config').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/remote-config/android')
1818
```
1919

2020
#### Add Remote Config to App Gradle Dependencies

docs/config/ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ description: Manually integrate Remote Config into your iOS application.
1818
// ..
1919
target 'app' do
2020
// ..
21-
pod 'RNFBConfig', :path => '../node_modules/@react-native-firebase/config/ios'
21+
pod 'RNFBConfig', :path => '../node_modules/@react-native-firebase/remote-config/ios'
2222
end
2323
```
2424

docs/config/quick-start.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Getting started with Remote Config in React Native Firebase
1010
Install this module with Yarn:
1111

1212
```bash
13-
yarn add @react-native-firebase/config
13+
yarn add @react-native-firebase/remote-config
1414
```
1515

1616
> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
@@ -20,13 +20,13 @@ yarn add @react-native-firebase/config
2020
Import the Performance Monitoring package into your project:
2121

2222
```js
23-
import config from '@react-native-firebase/config';
23+
import remoteConfig from '@react-native-firebase/remote-config';
2424
```
2525

2626
The package also provides access to the firebase instance:
2727

2828
```js
29-
import { firebase } from '@react-native-firebase/config';
29+
import { firebase } from '@react-native-firebase/remote-config';
3030
```
3131

3232
### Fetching, activating and getting values
@@ -35,7 +35,7 @@ Before the values from the Firebase console can be used, they need to be fetched
3535
the `fetchAndActivate` method:
3636

3737
```js
38-
import config from '@react-native-firebase/config';
38+
import remoteConfig from '@react-native-firebase/remote-config';
3939

4040
async function getValues() {
4141
try {
@@ -59,7 +59,7 @@ your application. To prevent any race conditions where values are being requeste
5959
have been fetched and activated, it is recommended you set default values using `setDefaults`:
6060

6161
```js
62-
import config from '@react-native-firebase/config';
62+
import remoteConfig from '@react-native-firebase/remote-config';
6363

6464
async function bootstrap() {
6565
await config().setDefaults({
@@ -74,7 +74,7 @@ Whilst developing, setting the developer mode to `true` allows config to bypass
7474
which are applied in a production application. This can be done with the `setConfigSettings` method:
7575

7676
```js
77-
import config from '@react-native-firebase/config';
77+
import remoteConfig from '@react-native-firebase/remote-config';
7878

7979
async function bootstrap() {
8080
await config().setConfigSettings({

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ for installation instructions on each individual module page.
4343
| <Anchor href="/notifications">Notifications</Anchor> | <Badge type="downloads">@react-native-firebase/notifications</Badge> | <Badge type="coverage">notifications</Badge> |
4444
| <Anchor href="/perf">Performance Monitoring</Anchor> | <Badge type="downloads">@react-native-firebase/perf</Badge> | <Badge type="coverage">perf</Badge> |
4545
| <Anchor href="/database">Realtime Database</Anchor> | <Badge type="downloads">@react-native-firebase/database</Badge> | <Badge type="coverage">database</Badge> |
46-
| <Anchor href="/config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/config</Badge> | <Badge type="coverage">config</Badge> |
46+
| <Anchor href="/config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/remote-config</Badge> | <Badge type="coverage">config</Badge> |
4747
| <Anchor href="/utils">Utils</Anchor> | <Badge type="downloads">@react-native-firebase/utils</Badge> | <Badge type="coverage">utils</Badge> |

docs/sidebar.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@
226226
- text: iOS Setup
227227
to: '/ios'
228228

229-
- module: config
230-
group: Remote Config
229+
- module: remote-config
230+
group: Remote RemoteConfig
231231
children:
232232
- text: Overview
233233
to: '/'

0 commit comments

Comments
 (0)