Skip to content

Commit 31be910

Browse files
AmitM30Amit Mangal
and
Amit Mangal
authored
React 0.66.0 - Type Definitions (#76)
* React 0.66.0 - Type Definitions Co-authored-by: Amit Mangal <[email protected]>
1 parent 585fd72 commit 31be910

Some content is hidden

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

57 files changed

+16411
-538
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ out/
175175

176176
# Local configuration file (sdk path, etc)
177177
local.properties
178+
*.hprof
178179

179180
# Proguard folder generated by Eclipse
180181
proguard/

README.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ The project has been setup based off [RN Getting Started](https://facebook.githu
88

99
___
1010

11-
### Supports React Native 0.64.1, React Native Navigation v7, Flipper and Hermes
11+
### Supports React 17, React Native 0.66.0, React Native Navigation v7, Flipper and Hermes
12+
13+
Update (Nov 2021):
14+
- Added Types (actions, reducers, store, components and more).
15+
- Core API service using fetch
16+
- Support for M1
1217

1318
| Updates | RNN | RN | React | Comments |
1419
|---|---|---|---|---|
20+
| Nov '21 | 7.23.1 | 0.66.0 | 17.0.2 | Type definitions
1521
| May '21 | 7.14.0 | 0.64.1 | 17.0.1 | Update RN RNN, Hermes Support
1622
| Oct '20 | 7.1.0 | 0.63.3 | 16.13.1 | Support for Flipper
1723
| Apr '20 | 3.7.0 | 0.61.5 | 16.9.0 | Support for RN > 0.60, Android X
@@ -34,6 +40,8 @@ Jumpstart building robust apps using React Native and TypeScript with most commo
3440
- **widgets**: Any component providing a complete functionality. E.g. carousels component, banner component, etc.
3541
- Typography
3642
- Base Typography setup - Color, Font, LAYOUT, CTA, FONTS, TEXT, TEXT_INPUT
43+
- Type Definitions
44+
- Type definitons for actions, reducers, store, components and more.
3745
- Code Lint
3846
- [Airbnb's JS](https://github.com/airbnb/javascript) Linting
3947

@@ -53,6 +61,7 @@ Jumpstart building robust apps using React Native and TypeScript with most commo
5361
- [Project Structure](#project-structure)
5462
- [Getting Started](#getting-started)
5563
- [Cheat Sheet](#cheat-sheet)
64+
- [M1 support](#m1-support)
5665
- [Single Screen vs Tabbed Based Navigation](#single-screen-vs-tabbed-based-navigation)
5766
- [Renaming the App](#renaming-the-app)
5867
- [iOS Launch Screen](#ios-launch-screen)
@@ -64,8 +73,8 @@ Jumpstart building robust apps using React Native and TypeScript with most commo
6473

6574
```
6675
/
67-
├── android Android Native code
68-
├── ios iOS Native Code
76+
├── android Android Native code
77+
├── ios iOS Native Code
6978
├── shared
7079
│ ├── redux Applications Logic
7180
│ │ ├── constants
@@ -75,16 +84,22 @@ Jumpstart building robust apps using React Native and TypeScript with most commo
7584
│ │ ├── store
7685
│ │ └── thunk
7786
│ └── utilities
87+
│ ├── services
88+
│ │ ├── core Core Services - API (fetch/axios), storage
89+
│ │ │ ├── API
90+
│ │ │ └── Storage
91+
│ │ ├── home
92+
│ │ └── search
7893
├── src
7994
│ ├── config Global Configuration
80-
│ ├── constants Screens, Localization
95+
│ ├── constants Screen names and ids, Localization
8196
│ ├── navigators Router, Navigation
8297
│ ├── view UI compoments
83-
│ │ ├── elements Custom elements
98+
│ │ ├── elements Custom elements
8499
│ │ ├── assets
85100
│ │ ├── screens
86-
│ │ ├── styles Typography
87-
│ │ └── widgets Custom components
101+
│ │ ├── styles Typography
102+
│ │ └── widgets Custom components
88103
│ └── utilities
89104
├── __tests__ Unit Tests
90105
│ ├── presentation
@@ -109,7 +124,7 @@ Presentation layer for the app - screens, styles, images, icons etc.
109124

110125
### Getting Started
111126

112-
Make sure node version installed is `>=10.x.x`. Then install using yarn (or npm):
127+
Make sure node version installed is `>=12.x.x`. Then install using yarn (or npm):
113128
```
114129
yarn install
115130
```
@@ -181,6 +196,22 @@ Change the 3 images here to set the new launch screen for iOS.
181196

182197
Change the images the `drawable-*` folders to set the new launch screen for Android.
183198

199+
#### M1 support
200+
Some additional steps may be required for project to work on M1.
201+
202+
- Disable Rosetta in Terminal
203+
- Install ffi
204+
```
205+
sudo arch -x86_64 gem install ffi
206+
```
207+
- Re-install dependencies
208+
```
209+
arch -x86_64 pod install
210+
```
211+
Now try and run CocoaPods.
212+
213+
P.S.: Thanks to samanthadotcom#7043 (discord)
214+
184215
#### Single Screen vs Tabbed Based Navigation
185216

186217
The application launches with a splash screen, and then moves to a tabbed based navigation. Splash screen is a good place to fetch data / build application launch logic like getting user token from API or Async Store, load persist state etc.

android/app/build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ def jscFlavor = 'org.webkit:android-jsc:+'
123123
*/
124124
def enableHermes = project.ext.react.get("enableHermes", false);
125125

126+
/**
127+
* Architectures to build native code for in debug.
128+
*/
129+
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
130+
126131
android {
127132
ndkVersion rootProject.ext.ndkVersion
128133
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -158,6 +163,11 @@ android {
158163
buildTypes {
159164
debug {
160165
signingConfig signingConfigs.debug
166+
if (nativeArchitectures) {
167+
ndk {
168+
abiFilters nativeArchitectures.split(',')
169+
}
170+
}
161171
}
162172
release {
163173
// Caution! In production, you need to generate your own keystore file.
@@ -217,7 +227,7 @@ dependencies {
217227
// Run this once to be able to run the application with BUCK
218228
// puts all compile dependencies into folder libs for BUCK to use
219229
task copyDownloadableDepsToLibs(type: Copy) {
220-
from configurations.compile
230+
from configurations.implementation
221231
into 'libs'
222232
}
223233

android/build.gradle

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

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.2"
5+
buildToolsVersion = "30.0.2"
66
minSdkVersion = 21
7-
compileSdkVersion = 29
8-
targetSdkVersion = 29
7+
compileSdkVersion = 30
8+
targetSdkVersion = 30
99
kotlinVersion = "1.3.72"
1010
RNNKotlinVersion = kotlinVersion
1111
supportLibVersion = "28.0.0"
12-
ndkVersion = "20.1.5948944"
12+
ndkVersion = "21.4.7075529"
1313
}
1414
repositories {
1515
google()
@@ -19,7 +19,7 @@ buildscript {
1919
}
2020
dependencies {
2121
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
22-
classpath("com.android.tools.build:gradle:4.1.0")
22+
classpath("com.android.tools.build:gradle:4.2.2")
2323

2424
// NOTE: Do not place your application dependencies here; they belong
2525
// in the individual module build.gradle files
@@ -28,9 +28,9 @@ buildscript {
2828

2929
allprojects {
3030
repositories {
31-
google()
3231
mavenCentral()
3332
mavenLocal()
33+
google()
3434
jcenter()
3535
maven {
3636
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ android.useAndroidX=true
2626
android.enableJetifier=true
2727

2828
# Version of flipper SDK to use with React Native
29-
FLIPPER_VERSION=0.75.1
29+
FLIPPER_VERSION=0.99.0

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip

ios/FridayApp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,12 @@
473473
);
474474
inputPaths = (
475475
"${PODS_ROOT}/Target Support Files/Pods-FridayApp/Pods-FridayApp-frameworks.sh",
476-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
476+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
477+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
477478
);
478479
name = "[CP] Embed Pods Frameworks";
479480
outputPaths = (
481+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
480482
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
481483
);
482484
runOnlyForDeploymentPostprocessing = 0;
@@ -509,10 +511,12 @@
509511
);
510512
inputPaths = (
511513
"${PODS_ROOT}/Target Support Files/Pods-FridayApp-FridayAppTests/Pods-FridayApp-FridayAppTests-frameworks.sh",
512-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
514+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
515+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
513516
);
514517
name = "[CP] Embed Pods Frameworks";
515518
outputPaths = (
519+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
516520
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
517521
);
518522
runOnlyForDeploymentPostprocessing = 0;

ios/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ target 'FridayApp' do
2424

2525
post_install do |installer|
2626
react_native_post_install(installer)
27+
__apply_Xcode_12_5_M1_post_install_workaround(installer)
2728
end
2829
end
2930

0 commit comments

Comments
 (0)