Skip to content

Commit ddffbca

Browse files
Examples update - latest versions used (#316)
* Update react and react native to the latest The Example application needs to run on the latest of react, react native and react native windows to ensure the compatibility. This commit updates all of those to 17 and 0.65 for Example. * Update Gradle configs to latest The build tools of Gradle has been updated to 29 with 21 as a minimum. Also this commit updates the Gradle wrapper to 6.5. * Remove redundant includes from Windows Example * Recreate and update the iOS example project The iOS example project is recreated by: * Removing flipper-boost * Removing fmt * Updating the pods * adding required implementation for the latest native Flipper dependency Full recreation was tested using the iOS v14.5 * Point the deps to node_modules of workspace * Add react-native-codegen for iOS example * Fix: Duplicate entry for UI.Xaml The duplicated entry for Microsoft.UI.Xaml was the result of having previous UI.Xaml imported in the project configuration file. The fix is to apply the next version (which was also downloaded for the ibrary package, but was conflicting with the example app dependencies). * Restyle the example app The layout and look of example app has been improved so it's now more readable and easy to navigate between each scenario. The changes are minor: margin for slider has been removed, but whole scenario (single example) has been wrapped into the styled view. * Update Android example in the README * Update Windows example in the README * Update iOS example in the README
1 parent 2b15880 commit ddffbca

26 files changed

+2421
-1556
lines changed
539 KB
Loading
1.06 MB
Loading
2.99 MB
Loading

README.md

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

2323
|iOS|Android|Windows|
2424
|:-:|:-:|:-:|
25-
|![iOS Screenshot](https://i.postimg.cc/dQTYzGD5/Screenshot-2019-03-25-at-11-24-59.png)|![Android Screenshot](https://i.postimg.cc/CKdtbVqc/Screenshot-2019-03-25-at-11-26-54.png)|![Windows Screenshot](example/sliderWindows.JPG)|
25+
|![iOS Screenshot](.github/Examples/Slider-iOS-Example.gif)|![Android Screenshot](.github/Examples/Slider-Android-Example.gif)|![Windows Screenshot](.github/Examples/Slider-Windows-Example.gif)|
2626

2727
## Installation & Usage
2828

example/App.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export default class App extends Component<Props> {
1515
{examples
1616
.filter(e => !e.platform || e.platform === Platform.OS)
1717
.map((e, i) => (
18-
<View key={`slider${i}`}>
19-
<Text>{e.title}</Text>
18+
<View key={`slider${i}`} style={styles.sliderWidget}>
19+
<Text style={styles.instructions}>{e.title}</Text>
2020
{e.render()}
2121
</View>
2222
))}
@@ -44,5 +44,9 @@ const styles = StyleSheet.create({
4444
textAlign: 'center',
4545
color: '#333333',
4646
marginBottom: 5,
47+
fontSize: 20,
48+
},
49+
sliderWidget: {
50+
marginVertical: 30,
4751
},
4852
});

example/SliderExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ const styles = StyleSheet.create({
104104
width: 300,
105105
opacity: 1,
106106
height: 50,
107-
marginTop: 50,
107+
marginTop: 10,
108108
},
109109
text: {
110110
fontSize: 14,
111111
textAlign: 'center',
112112
fontWeight: '500',
113-
margin: 10,
113+
margin: 0,
114114
},
115115
});
116116

example/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
6-
minSdkVersion = 16
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
5+
buildToolsVersion = "29.0.3"
6+
minSdkVersion = 21
7+
compileSdkVersion = 29
8+
targetSdkVersion = 29
99
}
1010
repositories {
1111
google()
1212
jcenter()
1313
}
1414
dependencies {
15-
classpath("com.android.tools.build:gradle:3.4.2")
15+
classpath("com.android.tools.build:gradle:4.1.0")
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

example/ios/Podfile

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,29 @@
1-
platform :ios, '9.0'
2-
$node_modules_path = '../../node_modules'
3-
4-
require_relative "#{$node_modules_path}/@react-native-community/cli-platform-ios/native_modules"
1+
require_relative '../../node_modules/react-native/scripts/react_native_pods'
2+
require_relative '../../node_modules/@react-native-community/cli-platform-ios/native_modules'
53

4+
platform :ios, '11.0'
65

76
target 'example' do
8-
# Pods for example
9-
pod 'FBLazyVector', :path => "#{$node_modules_path}/react-native/Libraries/FBLazyVector"
10-
pod 'FBReactNativeSpec', :path => "#{$node_modules_path}/react-native/Libraries/FBReactNativeSpec"
11-
pod 'RCTRequired', :path => "#{$node_modules_path}/react-native/Libraries/RCTRequired"
12-
pod 'RCTTypeSafety', :path => "#{$node_modules_path}/react-native/Libraries/TypeSafety"
7+
config = use_native_modules!
138

14-
pod 'React', :path => "#{$node_modules_path}/react-native"
15-
pod 'React-CoreModules', :path => "#{$node_modules_path}/react-native/React/CoreModules"
16-
pod 'React-Core/DevSupport', :path => "#{$node_modules_path}/react-native/"
17-
pod 'React-RCTActionSheet', :path => "#{$node_modules_path}/react-native/Libraries/ActionSheetIOS"
18-
pod 'React-RCTAnimation', :path => "#{$node_modules_path}/react-native/Libraries/NativeAnimation"
19-
pod 'React-RCTBlob', :path => "#{$node_modules_path}/react-native/Libraries/Blob"
20-
pod 'React-RCTImage', :path => "#{$node_modules_path}/react-native/Libraries/Image"
21-
pod 'React-RCTLinking', :path => "#{$node_modules_path}/react-native/Libraries/LinkingIOS"
22-
pod 'React-RCTNetwork', :path => "#{$node_modules_path}/react-native/Libraries/Network"
23-
pod 'React-RCTSettings', :path => "#{$node_modules_path}/react-native/Libraries/Settings"
24-
pod 'React-RCTText', :path => "#{$node_modules_path}/react-native/Libraries/Text"
25-
pod 'React-RCTVibration', :path => "#{$node_modules_path}/react-native/Libraries/Vibration"
26-
pod 'React-Core/RCTWebSocket', :path => "#{$node_modules_path}/react-native/"
9+
use_react_native!(
10+
:path => config[:reactNativePath],
11+
# to enable hermes on iOS, change `false` to `true` and then install pods
12+
:hermes_enabled => false
13+
)
2714

28-
pod 'React-cxxreact', :path => "#{$node_modules_path}/react-native/ReactCommon/cxxreact"
29-
pod 'React-jsi', :path => "#{$node_modules_path}/react-native/ReactCommon/jsi"
30-
pod 'React-jsiexecutor', :path => "#{$node_modules_path}/react-native/ReactCommon/jsiexecutor"
31-
pod 'React-jsinspector', :path => "#{$node_modules_path}/react-native/ReactCommon/jsinspector"
32-
pod 'ReactCommon/callinvoker', :path => "#{$node_modules_path}/react-native/ReactCommon"
33-
pod 'ReactCommon/turbomodule/core', :path => "#{$node_modules_path}/react-native/ReactCommon"
34-
pod 'Yoga', :path => "#{$node_modules_path}/react-native/ReactCommon/yoga"
15+
target 'exampleTests' do
16+
inherit! :complete
17+
# Pods for testing
18+
end
3519

36-
pod 'DoubleConversion', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/DoubleConversion.podspec"
37-
pod 'glog', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/glog.podspec"
38-
pod 'Folly', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/Folly.podspec"
20+
# Enables Flipper.
21+
#
22+
# Note that if you have use_frameworks! enabled, Flipper will not work and
23+
# you should disable the next line.
24+
use_flipper!()
3925

40-
use_native_modules!
26+
post_install do |installer|
27+
react_native_post_install(installer)
28+
end
4129
end

0 commit comments

Comments
 (0)