Skip to content

Commit 5d99b20

Browse files
React Native 0.60 support (#87)
* chore: ios example * chore: fix lib on ios * chore: fix android build * chore: fix android events * chore: fix lint, tests and flow * chore: disable detox on CI, update README * chore: update .gitignore Co-Authored-By: Michał Pierzchała <[email protected]> * setup autolinking for iOS * use latest CLI to fix autolinking
1 parent ebc7d88 commit 5d99b20

Some content is hidden

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

48 files changed

+2283
-2578
lines changed

.circleci/config.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
rn: react-native-community/react-native@1.1.0
4+
rn: react-native-community/react-native@1.2.1
55

66
jobs:
77
checkout_code:
@@ -51,33 +51,34 @@ workflows:
5151
- analyse:
5252
requires:
5353
- checkout_code
54-
- rn/android_build:
55-
name: build_android_debug
56-
project_path: "example/android"
57-
build_type: debug
58-
requires:
59-
- analyse
60-
- rn/android_build:
61-
name: build_android_release
62-
project_path: "example/android"
63-
build_type: release
64-
requires:
65-
- analyse
66-
- rn/android_test:
67-
detox_configuration: "android.emu.release"
68-
detox_loglevel: "trace"
69-
requires:
70-
- build_android_release
71-
- rn/ios_build_and_test:
72-
project_path: "example/ios/example.xcodeproj"
73-
derived_data_path: "example/ios/build"
74-
device: "iPhone X"
75-
build_configuration: "Release"
76-
scheme: "example"
77-
detox_configuration: "ios.sim.release"
78-
detox_loglevel: "trace"
79-
requires:
80-
- analyse
54+
# Disabled until Detox works correctly with 0.60
55+
# - rn/android_build:
56+
# name: build_android_debug
57+
# project_path: "example/android"
58+
# build_type: debug
59+
# requires:
60+
# - analyse
61+
# - rn/android_build:
62+
# name: build_android_release
63+
# project_path: "example/android"
64+
# build_type: release
65+
# requires:
66+
# - analyse
67+
# - rn/android_test:
68+
# detox_configuration: "android.emu.release"
69+
# detox_loglevel: "trace"
70+
# requires:
71+
# - build_android_release
72+
# - rn/ios_build_and_test:
73+
# project_path: "example/ios/example.xcworkspace"
74+
# derived_data_path: "example/ios/build"
75+
# device: "iPhone X"
76+
# build_configuration: "Release"
77+
# scheme: "example"
78+
# detox_configuration: "ios.sim.release"
79+
# detox_loglevel: "trace"
80+
# requires:
81+
# - analyse
8182
# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
8283
# - publish:
8384
# requires:

.flowconfig

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,37 @@
1111
; Ignore duplicate module providers
1212
; For RN Apps installed via npm, "Libraries" folder is inside
1313
; "node_modules/react-native" but in the source repo it is in the root
14-
.*/Libraries/react-native/React.js
14+
node_modules/react-native/Libraries/react-native/React.js
1515

1616
; Ignore polyfills
17-
.*/Libraries/polyfills/.*
17+
node_modules/react-native/Libraries/polyfills/.*
1818

19-
; Ignore metro
20-
.*/node_modules/metro/.*
19+
; These should not be required directly
20+
; require from fbjs/lib instead: require('fbjs/lib/warning')
21+
node_modules/warning/.*
22+
23+
; Flow doesn't support platforms
24+
.*/Libraries/Utilities/HMRLoadingView.js
25+
26+
[untyped]
27+
.*/node_modules/@react-native-community/cli/.*/.*
2128

2229
[include]
2330

2431
[libs]
2532
node_modules/react-native/Libraries/react-native/react-native-interface.js
2633
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2834

2935
[options]
3036
emoji=true
3137

3238
esproposal.optional_chaining=enable
3339
esproposal.nullish_coalescing=enable
3440

41+
module.file_ext=.js
42+
module.file_ext=.json
43+
module.file_ext=.ios.js
44+
3545
module.system=haste
3646
module.system.haste.use_name_reducers=true
3747
# get basename
@@ -44,28 +54,47 @@ module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
4454
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
4555
module.system.haste.paths.blacklist=.*/__tests__/.*
4656
module.system.haste.paths.blacklist=.*/__mocks__/.*
47-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
4857
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
4962

5063
munge_underscores=true
5164

52-
module.name_mapper='\(@react-native-community/slider\)' -> '<PROJECT_ROOT>/js/Slider.js'
5365
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'
54-
55-
module.file_ext=.js
56-
module.file_ext=.jsx
57-
module.file_ext=.json
58-
module.file_ext=.native.js
66+
module.name_mapper='^\@react-native-community/slider\(.*\)$' -> '<PROJECT_ROOT>/js/Slider.js\1'
5967

6068
suppress_type=$FlowIssue
6169
suppress_type=$FlowFixMe
6270
suppress_type=$FlowFixMeProps
6371
suppress_type=$FlowFixMeState
6472

65-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
66-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
67-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
73+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
74+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
6875
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6976

77+
[lints]
78+
sketchy-null-number=warn
79+
sketchy-null-mixed=warn
80+
sketchy-number=warn
81+
untyped-type-import=warn
82+
nonstrict-import=warn
83+
deprecated-type=warn
84+
unsafe-getters-setters=warn
85+
inexact-spread=warn
86+
unnecessary-invariant=warn
87+
signature-verification-failure=warn
88+
deprecated-utility=error
89+
90+
[strict]
91+
deprecated-type
92+
nonstrict-import
93+
sketchy-null
94+
unclear-type
95+
unsafe-getters-setters
96+
untyped-import
97+
untyped-type-import
98+
7099
[version]
71-
^0.86.0
100+
^0.98.0

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ buck-out/
5454

5555
# Bundle artifact
5656
*.jsbundle
57-
.tmp/
57+
.tmp/
58+
59+
*/ios/Pods

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ or
1414

1515
`npm install @react-native-community/slider --save`
1616

17-
### Mostly automatic installation
17+
### Linking the module (React Native <= 0.59.X)
1818

19-
`react-native link @react-native-community/slider`
19+
<details>
20+
<summary>Automatically link the library</summary>
21+
Run the following commannd in your terminal:
2022

21-
### Manual installation
23+
`react-native link @react-native-community/slider`
24+
</details>
2225

2326
<details>
2427
<summary>Manually link the library on iOS</summary>

android/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ repositories {
3737

3838
dependencies {
3939
//noinspection GradleDynamicVersion
40-
api "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
4140
api 'com.facebook.react:react-native:+'
4241
}

android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import android.content.Context;
1010
import android.os.Build;
11-
import android.support.v7.widget.AppCompatSeekBar;
11+
import androidx.appcompat.widget.AppCompatSeekBar;
1212
import android.util.AttributeSet;
1313
import javax.annotation.Nullable;
1414

android/src/main/java/com/reactnativecommunity/slider/ReactSliderManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected void addEventEmitters(final ThemedReactContext reactContext, final Rea
193193

194194
@Override
195195
public Map getExportedCustomDirectEventTypeConstants() {
196-
return MapBuilder.of(ReactSlidingCompleteEvent.EVENT_NAME, MapBuilder.of("registrationName", "onSlidingComplete"),
197-
ReactSlidingStartEvent.EVENT_NAME, MapBuilder.of("registrationName", "onSlidingStart"));
196+
return MapBuilder.of(ReactSlidingCompleteEvent.EVENT_NAME, MapBuilder.of("registrationName", "onRNCSliderSlidingComplete"),
197+
ReactSlidingStartEvent.EVENT_NAME, MapBuilder.of("registrationName", "onRNCSliderSlidingStart"));
198198
}
199199
}

example/.gitignore

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

0 commit comments

Comments
 (0)