Skip to content

Commit f01f6aa

Browse files
committed
1) 6.0.0.
2) ./android/build.gradle - buildToolsVersion / implementation. 3) CommonPackage.java - createJSModules() removed. 4) strings.js - logic simplified. 5) react-native-localization - latest.
1 parent a2945d8 commit f01f6aa

File tree

5 files changed

+18
-30
lines changed

5 files changed

+18
-30
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
Install with:
99

1010
npm i --save react-native-common-utils
11-
12-
react-native link react-native-localization
13-
14-
[react-native-localization](https://www.npmjs.com/package/react-native-localization) is a package my code depends on and it needs linking.
1511

16-
My code uses `@autobind` so please don't forget to modify your `.babelrc` according to the version of Babel you're using.
12+
My code uses `@autobind` so please don't forget to modify your Babel config accordingly.
13+
14+
**For RN < 0.60**:
15+
My code depends on [react-native-localization](https://www.npmjs.com/package/react-native-localization) which needs linking:
16+
17+
react-native link react-native-localization
1718

18-
If you want to use the [native modules](#nativemodules) defined in the package, use the following command:
19+
You also need to execute
1920

2021
react-native link react-native-common-utils
22+
, if you want to use the [native modules](#nativemodules) defined in my package.
2123

2224
## <a name="packagecontents"></a>[Package contents<i class="icon-up"></i>](#cpackagecontents)
2325

@@ -462,7 +464,8 @@ Font sizes are calculated as `baseFontSize + numberOfSteps * step`. `font` conta
462464

463465
Version number|Changes
464466
-|-
465-
v5.1.0|1.&nbsp;An iOS-only bug fixed in `ApplicationSession.manage()` .<br>2.&nbsp;State changes can be optionally logged to the console. An argument controlling this behaviour is added to `ApplicationSession._setSessionType()`.
467+
v6.0.0|1.&nbsp;The latest version of [react-native-localization](https://www.npmjs.com/package/react-native-localization) is specified in `package.json`.<br>2.&nbsp;**Backwards-incompatible change** in `strings.js`: `strings.formatString()` is no longer available if a sub-object name was specified. `strings.all.formatString()` has to be used instead.
468+
v5.1.0|1.&nbsp;An iOS-only bug fixed in `ApplicationSession.manage()`.<br>2.&nbsp;State changes can be optionally logged to the console. An argument`ApplicationSession._setSessionType()`
466469
v5.0.0|**Backwards-incompatible change**: `styles.screen` is superseded by `styles.screen.container`.
467470
v4.1.0|1.&nbsp;`ApplicationSession` added.<br>2.&nbsp;`styles.screen` added.
468471
v4.0.0|**Backwards-incompatible change**: `babel-plugin-transform-decorators-legacy` is removed from dependencies to allow for Babel 7 usage. End user instructions are given through the postinstall event.

android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
65

76
defaultConfig {
87
minSdkVersion 16
@@ -20,5 +19,5 @@ android {
2019
}
2120

2221
dependencies {
23-
compile "com.facebook.react:react-native:+"
22+
implementation "com.facebook.react:react-native:+"
2423
}

android/src/main/java/ru/rshalimov/reactnative/common/CommonPackage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ public List <NativeModule> createNativeModules(
5858
}
5959
}
6060

61-
@Override
62-
public List <Class <? extends JavaScriptModule>> createJSModules() {
63-
return Collections.emptyList();
64-
}
65-
6661
@Override
6762
public List <ViewManager> createViewManagers(
6863
ReactApplicationContext reactContext)

js/strings.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
import LocalizedStrings from "react-native-localization";
22
export { LocalizedStrings };
33

4-
export default function () {
5-
const object = arguments[0];
6-
const prototype = arguments.length < 3 ? undefined : arguments[1].prototype;
7-
const className = arguments.length == 1 ? null : arguments[arguments.length - 1];
8-
9-
const all = {...object};
10-
11-
if (prototype) {
12-
Object.getOwnPropertyNames(prototype).forEach(methodName => methodName ==
13-
"constructor" || (all[methodName] = object[methodName].bind(object)));
14-
}
15-
16-
return className ? Object.assign({...object[className]}, {all}) : all;
17-
}
4+
export default (object, name) => name ? {
5+
all: object,
6+
...object[name]
7+
} : object
8+
;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-common-utils",
3-
"version": "5.2.0",
3+
"version": "6.0.0",
44
"description": "A collection of useful classes for RN projects.",
55
"main": "index.js",
66
"scripts": {
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"core-decorators": "latest",
1212
"react-native-extended-stylesheet": "latest",
13-
"react-native-localization": "0.2.1",
13+
"react-native-localization": "latest",
1414
"simple-common-utils": "latest"
1515
},
1616
"repository": {

0 commit comments

Comments
 (0)