Skip to content

Commit 762eb1b

Browse files
committed
Merge branch 'dev-0.16'
2 parents 6cffea8 + 22056e9 commit 762eb1b

Some content is hidden

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

46 files changed

+1605
-1100
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,9 @@ android/keystores/debug.keystore
7979
# generated by bob
8080
lib/
8181

82+
# React Native Codegen
83+
ios/generated
84+
android/generated
85+
8286
# Other
8387
/package.tgz

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.15.1
1+
v20.17.0

android/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ buildscript {
1414
}
1515
}
1616

17+
def reactNativeArchitectures() {
18+
def value = rootProject.getProperties().get("reactNativeArchitectures")
19+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
20+
}
21+
1722
def isNewArchitectureEnabled() {
1823
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
1924
}
@@ -102,8 +107,9 @@ android {
102107
if (isNewArchitectureEnabled()) {
103108
java.srcDirs += [
104109
"src/newarch",
105-
// This is needed to build Kotlin project with NewArch enabled
106-
"${project.buildDir}/generated/source/codegen/java"
110+
// Codegen specs
111+
"generated/java",
112+
"generated/jni"
107113
]
108114
} else {
109115
java.srcDirs += ["src/oldarch"]

babel.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module.exports = {
2-
presets: ['module:@react-native/babel-preset'],
2+
presets: [
3+
['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }],
4+
],
35
};

dr-pogodin-react-native-static-server.podspec

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Pod::Spec.new do |s|
5050
s.source = { :git => "https://github.com/birdofpreyru/react-native-static-server.git", :tag => "#{s.version}" }
5151

5252
s.preserve_paths = 'README.md', 'package.json', 'index.js'
53-
s.source_files = "ios/**/*.{h,m,mm}"
5453

5554
# This requires CMake on the build host, which can be installed via Homebrew (https://brew.sh)
5655
s.script_phase = {
@@ -87,27 +86,29 @@ Pod::Spec.new do |s|
8786
${BUILT_PRODUCTS_DIR}
8887
CMD
8988
}
89+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
9090

9191
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
9292
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
9393
if respond_to?(:install_modules_dependencies, true)
9494
install_modules_dependencies(s)
9595
else
96-
s.dependency "React-Core"
97-
98-
# Don't install the dependencies when we run `pod install` in the old architecture.
99-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
100-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
101-
s.pod_target_xcconfig = {
102-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
103-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
104-
}
105-
s.dependency "React-Codegen"
106-
s.dependency "RCT-Folly"
107-
s.dependency "RCTRequired"
108-
s.dependency "RCTTypeSafety"
109-
s.dependency "ReactCommon/turbomodule/core"
110-
end
96+
s.dependency "React-Core"
97+
98+
# Don't install the dependencies when we run `pod install` in the old architecture.
99+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
100+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
101+
s.pod_target_xcconfig = {
102+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
103+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
104+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
105+
}
106+
s.dependency "React-Codegen"
107+
s.dependency "RCT-Folly"
108+
s.dependency "RCTRequired"
109+
s.dependency "RCTTypeSafety"
110+
s.dependency "ReactCommon/turbomodule/core"
111+
end
111112
end
112113

113114
s.pod_target_xcconfig = {

example/Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7-
# bound in the template on Cocoapods with next React Native release.
8-
gem 'cocoapods', '>= 1.13', '< 1.15'
9-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

example/android/app/build.gradle

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
88
*/
99
react {
1010
/* Folders */
11-
// The root of your project, i.e. where "package.json" lives. Default is '..'
12-
// root = file("../")
13-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
// reactNativeDir = file("../node_modules/react-native")
15-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
// codegenDir = file("../node_modules/@react-native/codegen")
17-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1919

2020
/* Variants */
2121
// The list of variants to that are debuggable. For those we're going to
@@ -49,6 +49,9 @@ react {
4949
//
5050
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5151
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5255
}
5356

5457
/**
@@ -74,9 +77,9 @@ android {
7477
buildToolsVersion rootProject.ext.buildToolsVersion
7578
compileSdk rootProject.ext.compileSdkVersion
7679

77-
namespace "com.reactnativestaticserverexample"
80+
namespace "drpogodin.reactnativestaticserver.example"
7881
defaultConfig {
79-
applicationId "com.reactnativestaticserverexample"
82+
applicationId "drpogodin.reactnativestaticserver.example"
8083
minSdkVersion rootProject.ext.minSdkVersion
8184
targetSdkVersion rootProject.ext.targetSdkVersion
8285
versionCode 1
@@ -121,4 +124,15 @@ dependencies {
121124
}
122125
}
123126

124-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
127+
def isNewArchitectureEnabled() {
128+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
129+
}
130+
131+
if (isNewArchitectureEnabled()) {
132+
// Since our library doesn't invoke codegen automatically we need to do it here.
133+
tasks.register('invokeLibraryCodegen', Exec) {
134+
workingDir "$rootDir/../../"
135+
commandLine "npx", "bob", "build", "--target", "codegen"
136+
}
137+
preBuild.dependsOn invokeLibraryCodegen
138+
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
android:allowBackup="false"
1818
android:theme="@style/AppTheme"
1919
android:usesCleartextTraffic="true"
20-
>
20+
android:supportsRtl="true">
2121
<activity
2222
android:name=".MainActivity"
2323
android:label="@string/app_name"

example/android/app/src/main/java/com/reactnativestaticserverexample/MainActivity.kt renamed to example/android/app/src/main/java/drpogodin/reactnativestaticserver/example/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactnativestaticserverexample
1+
package drpogodin.reactnativestaticserver.example
22

33
import com.facebook.react.ReactActivity
44
import com.facebook.react.ReactActivityDelegate

example/android/app/src/main/java/com/reactnativestaticserverexample/MainApplication.kt renamed to example/android/app/src/main/java/drpogodin/reactnativestaticserver/example/MainApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactnativestaticserverexample
1+
package drpogodin.reactnativestaticserver.example
22

33
import android.app.Application
44
import com.facebook.react.PackageList

0 commit comments

Comments
 (0)