Skip to content

Commit 096f281

Browse files
authored
Fix example to work with the specified React Native version (#79)
1 parent d568ed1 commit 096f281

File tree

20 files changed

+3793
-103
lines changed

20 files changed

+3793
-103
lines changed

example/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

example/.flowconfig

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
24

3-
# We fork some components by platform.
4-
.*/*.android.js
5-
6-
# Ignore templates with `@flow` in header
7-
.*/local-cli/generator.*
8-
9-
# Ignore malformed json
10-
.*/node_modules/y18n/test/.*\.json
11-
12-
# Ignore the website subdir
13-
<PROJECT_ROOT>/website/.*
14-
15-
# Ignore BUCK generated dirs
5+
; Ignore "BUCK" generated dirs
166
<PROJECT_ROOT>/\.buckd/
177

18-
# Ignore unexpected extra @providesModule
19-
.*/node_modules/commoner/test/source/widget/share.js
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
2010

21-
# Ignore duplicate module providers
22-
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
2314
.*/Libraries/react-native/React.js
2415
.*/Libraries/react-native/ReactNative.js
25-
.*/node_modules/jest-runtime/build/__tests__/.*
2616

2717
[include]
2818

@@ -34,25 +24,21 @@ flow/
3424
[options]
3525
module.system=haste
3626

37-
esproposal.class_static_fields=enable
38-
esproposal.class_instance_fields=enable
39-
4027
experimental.strict_type_args=true
4128

4229
munge_underscores=true
4330

44-
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
4531
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
4632

4733
suppress_type=$FlowIssue
4834
suppress_type=$FlowFixMe
4935
suppress_type=$FixMe
5036

51-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
37+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5339
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5440

5541
unsafe.enable_getters_and_setters=true
5642

5743
[version]
58-
^0.29.0
44+
^0.37.0

example/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

example/.gitignore

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,33 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25-
# Android/IJ
25+
# Android/IntelliJ
2626
#
27-
*.iml
27+
build/
2828
.idea
2929
.gradle
3030
local.properties
31+
*.iml
3132

3233
# node.js
3334
#
3435
node_modules/
3536
npm-debug.log
37+
yarn-error.log
3638

3739
# BUCK
3840
buck-out/
3941
\.buckd/
4042
android/app/libs
41-
android/keystores/debug.keystore
43+
*.keystore
44+
45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51+
52+
fastlane/report.xml
53+
fastlane/Preview.html
54+
fastlane/screenshots

example/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ and allowing to resize it.
77

88
Be sure to have React Native installed.
99

10-
```
10+
```bash
1111
cd example
12-
npm install
12+
yarn #or npm install
1313
```
1414

1515
### iOS
@@ -28,7 +28,7 @@ react-native run-android
2828

2929
If you want to use this sample app to develop `react-native-image-resizer`, erase the `node_modules/react-native-image-resizer` folder and replace it by the git repository:
3030

31-
```
31+
```bash
3232
rm -rf node_modules/react-native-image-resizer
3333
cd node_modules && git clone git@github.com:bamlab/react-native-image-resizer.git
3434
```

example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ dependencies {
135135
// Run this once to be able to run the application with BUCK
136136
// puts all compile dependencies into folder libs for BUCK to use
137137
task copyDownloadableDepsToLibs(type: Copy) {
138-
from configurations.compile
139-
into 'libs'
138+
from configurations.compile
139+
into 'libs'
140140
}

example/android/app/src/main/java/com/resizerexample/MainApplication.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.facebook.react.ReactNativeHost;
1010
import com.facebook.react.ReactPackage;
1111
import com.facebook.react.shell.MainReactPackage;
12+
import com.facebook.soloader.SoLoader;
1213

1314
import java.util.Arrays;
1415
import java.util.List;
@@ -32,6 +33,12 @@ protected List<ReactPackage> getPackages() {
3233

3334
@Override
3435
public ReactNativeHost getReactNativeHost() {
35-
return mReactNativeHost;
36+
return mReactNativeHost;
37+
}
38+
39+
@Override
40+
public void onCreate() {
41+
super.onCreate();
42+
SoLoader.init(this, /* native exopackage */ false);
3643
}
3744
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<resources>
2-
3-
42
<string name="app_name">ResizerExample</string>
53
</resources>

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rootProject.name = 'ResizerExample'
2-
3-
include ':app'
42
include ':react-native-image-resizer'
53
project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
4+
5+
include ':app'

example/app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "ResizerExample",
3+
"displayName": "ResizerExample"
4+
}

0 commit comments

Comments
 (0)