Skip to content

Commit 5ad5fd2

Browse files
authored
update: Updated deprecated dependency for React Native (#666)
## Summary `Datafile Manager` and `Event Processor` packages use `@react-native-community/async-storage` to support datafile and event caching in React Native Mobile Apps. This package is deprecated and moved to `@react-native-async-storage/async-storage`. This PR updates this dependency in both the packages. ## Test plan - Updated all unit tests - Manually tested thoroughly with both iOS and Android React Native Apps
1 parent e760efd commit 5ad5fd2

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- <<: *packagetest
8383
before_install: cd packages/logging
8484
- <<: *packagetest
85-
before_script: npm install "@react-native-community/async-storage"
85+
before_script: npm install "@react-native-async-storage/async-storage"
8686
before_install: cd packages/datafile-manager
8787

8888
- stage: 'Source Clear'

packages/datafile-manager/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88
Changes that have landed but are not yet released.
9+
- Replaced the deprecated `@react-native-community/async-storage` with `@react-native-async-storage/async-storage`.
910

1011
## [0.8.0] - September 1, 2020
1112

packages/datafile-manager/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Platform-specific minimum supported versions:
1616
npm i @optimizely/js-sdk-datafile-manager
1717
```
1818

19-
For React Native, installation of peer dependency `@react-native-community/async-storage` is also required:
19+
For React Native, installation of peer dependency `@react-native-async-storage/async-storage` is also required:
2020
```sh
21-
npm i @react-native-community/async-storage
21+
npm i @react-native-async-storage/async-storage
2222
```
2323

2424
## Usage

packages/datafile-manager/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/datafile-manager/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
"prettier": "^1.19.1",
4646
"ts-jest": "^24.0.0",
4747
"typescript": "3.3.3333",
48-
"@react-native-community/async-storage": "^1.2.0"
48+
"@react-native-async-storage/async-storage": "^1.2.0"
4949
},
5050
"dependencies": {
5151
"@optimizely/js-sdk-logging": "^0.1.0",
5252
"@optimizely/js-sdk-utils": "^0.4.0",
5353
"decompress-response": "^4.2.1"
5454
},
5555
"peerDependencies": {
56-
"@react-native-community/async-storage": "^1.2.0"
56+
"@react-native-async-storage/async-storage": "^1.2.0"
5757
},
5858
"scripts": {
5959
"lint": "tsc --noEmit && eslint --fix 'src/**/*.ts' '__test__/**/*.ts'",

packages/datafile-manager/src/reactNativeAsyncStorageCache.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
17-
import AsyncStorage from '@react-native-community/async-storage';
18-
16+
import AsyncStorage from '@react-native-async-storage/async-storage';
1917
import PersistentKeyValueCache from './persistentKeyValueCache';
2018

2119
export default class ReactNativeAsyncStorageCache implements PersistentKeyValueCache {

packages/event-processor/CHANGELOG.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88
Changes that have landed but are not yet released.
9+
- Replaced the deprecated `@react-native-community/async-storage` with `@react-native-async-storage/async-storage`.
910

1011
## [0.8.0] - November 10th, 2020
1112

packages/event-processor/__tests__/reactNativeEventsStore.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// <reference types="jest" />
1717

1818
import { ReactNativeEventsStore } from '../src/reactNativeEventsStore'
19-
import AsyncStorage from '../__mocks__/@react-native-community/async-storage'
19+
import AsyncStorage from '../__mocks__/@react-native-async-storage/async-storage'
2020

2121
const STORE_KEY = 'test-store'
2222

0 commit comments

Comments
 (0)