-
Notifications
You must be signed in to change notification settings - Fork 0
@atlj/diff commentor #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR changes the output of |
This PR changes the output of |
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of module-legacy/java-objcdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java index 4cfa026..65568cc 100644 --- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java +++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java @@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.module.annotations.ReactModule;+// Hi mom! Is this thing on? |
🤓☝️ This PR changes the output of diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java +// Hi mom! Is this thing on?
|
🤓☝️ This PR changes the output of diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java +// Hi mom! Is this thing on? |
🤓☝️ This PR changes the output of Native module Java and Objective C```diff module-legacy java-objc diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java index 4cfa026..65568cc 100644 --- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java +++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java @@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.module.annotations.ReactModule;+// Hi mom! Is this thing on? module-legacy java-swift +// Hi mom! Is this thing on?
|
🤓☝️ This PR changes the output of testdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java |
🤓☝️ This PR changes the output of Native module Java and Objective Cmodule-legacy java-objc
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
diff --git a/package.json b/package.json
index 8a867e6..c3c0477 100644
--- a/package.json
+++ b/package.json
@@ -65,7 +65,7 @@
"prettier": "^2.0.5",
"react": "17.0.2",
"react-native": "0.70.0",
- "react-native-builder-bob": "^0.23.1",
+ "react-native-builder-bob": "^0.20.0",
"release-it": "^15.0.0",
"typescript": "^5.0.2"
},
module-legacy java-swift
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
|
🤓☝️ This PR changes the output of |
🤓☝️ This PR changes the output of Native module Java and Objective C.txtdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
, Native module Java and Swift.txtdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
|
🤓☝️ This PR changes the output of Native module Java and Objective Cdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
Native module Java and Swiftdiff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
|
🤓☝️ This PR changes the output of Java and Objective C Native modulediff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
Java and Swift Native modulediff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
|
🤓☝️ This PR changes the output of Java and Objective C Native modulediff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
Java and Swift Native modulediff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
index 4cfa026..65568cc 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestModule.java
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
+// Hi mom! Is this thing on?
@ReactModule(name = ReactNativeTestModule.NAME)
public class ReactNativeTestModule extends ReactContextBaseJavaModule {
public static final String NAME = "ReactNativeTest";
|
59ac7a1
to
3d58cf5
Compare
🤓☝️ This PR changes the output of Java and Objective C Native modulediff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Swift Native modulediff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Native modulediff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Swift Native modulediff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Turbo module with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 6e85436..e55502d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Turbo module with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 702d817..81f1652 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Turbo modulediff --git a/android/build.gradle b/android/build.gradle
index ef3a4fb..89a4959 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Turbo modulediff --git a/android/build.gradle b/android/build.gradle
index a5f9e58..f46d668 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Swift Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Swift Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Fabric view with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 37019b9..d6526ac 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,31 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -58,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -76,42 +47,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -164,7 +106,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/newarch/ReactNativeTestViewManagerSpec.java b/android/src/newarch/ReactNativeTestViewManagerSpec.java
index 62dea01..ca429b2 100644
--- a/android/src/newarch/ReactNativeTestViewManagerSpec.java
+++ b/android/src/newarch/ReactNativeTestViewManagerSpec.java
@@ -8,15 +8,8 @@ import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface;
-import com.facebook.soloader.SoLoader;
public abstract class ReactNativeTestViewManagerSpec<T extends View> extends SimpleViewManager<T> implements ReactNativeTestViewManagerInterface<T> {
- static {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION);
- }
- }
-
private final ViewManagerDelegate<T> mDelegate;
public ReactNativeTestViewManagerSpec() {
Kotlin and Objective C Fabric view with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 021b500..0f5864e 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,31 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -64,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -82,42 +53,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -172,7 +114,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/newarch/ReactNativeTestViewManagerSpec.kt b/android/src/newarch/ReactNativeTestViewManagerSpec.kt
index 676406a..a940078 100644
--- a/android/src/newarch/ReactNativeTestViewManagerSpec.kt
+++ b/android/src/newarch/ReactNativeTestViewManagerSpec.kt
@@ -7,7 +7,6 @@ import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface
-import com.facebook.soloader.SoLoader
abstract class ReactNativeTestViewManagerSpec<T : View> : SimpleViewManager<T>(), ReactNativeTestViewManagerInterface<T> {
private val mDelegate: ViewManagerDelegate<T>
@@ -19,12 +18,4 @@ abstract class ReactNativeTestViewManagerSpec<T : View> : SimpleViewManager<T>()
override fun getDelegate(): ViewManagerDelegate<T>? {
return mDelegate
}
-
- companion object {
- init {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION)
- }
- }
- }
}
Java and Objective C Fabric viewdiff --git a/android/build.gradle b/android/build.gradle
index 819e9cf..b6d2a41 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,31 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -58,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -76,42 +47,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -161,7 +103,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
index 134b236..5eff257 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
@@ -11,19 +11,12 @@ import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface;
-import com.facebook.soloader.SoLoader;
@ReactModule(name = ReactNativeTestViewManager.NAME)
public class ReactNativeTestViewManager extends SimpleViewManager<ReactNativeTestView> implements ReactNativeTestViewManagerInterface<ReactNativeTestView> {
public static final String NAME = "ReactNativeTestView";
- static {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION);
- }
- }
-
private final ViewManagerDelegate<ReactNativeTestView> mDelegate;
public ReactNativeTestViewManager() {
Kotlin and Objective C Fabric viewdiff --git a/android/build.gradle b/android/build.gradle
index f5b4414..e358a45 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,31 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -64,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -82,42 +53,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -169,7 +111,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
index 1bd84ad..2c409fe 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
@@ -8,7 +8,6 @@ import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate
-import com.facebook.soloader.SoLoader
@ReactModule(name = ReactNativeTestViewManager.NAME)
class ReactNativeTestViewManager : SimpleViewManager<ReactNativeTestView>(),
@@ -38,11 +37,5 @@ class ReactNativeTestViewManager : SimpleViewManager<ReactNativeTestView>(),
companion object {
const val NAME = "ReactNativeTestView"
-
- init {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION)
- }
- }
}
}
|
### Summary This removes the (non-working) support for `aar` targets. Originally, the `aar` support was added with #4 to support AndroidX. However, it's not needed anymore so we are removing the support. ### Test plan 1. Create a new library with `npx create-react-native-library` 2. Add `aar` to targets 3. run `yarn prepack` 4. Make sure an error is printed and the program stops.
93fe8d2
to
60b6d29
Compare
🤓☝️ This PR changes the output of Java and Objective C Native modulediff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Java and Swift Native modulediff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Kotlin and Objective C Native modulediff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Kotlin and Swift Native modulediff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Java and Objective C Turbo module with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 6e85436..e55502d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Turbo module with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 702d817..81f1652 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Turbo modulediff --git a/android/build.gradle b/android/build.gradle
index ef3a4fb..89a4959 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Kotlin and Objective C Turbo modulediff --git a/android/build.gradle b/android/build.gradle
index a5f9e58..f46d668 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
Java and Objective C Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Java and Swift Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 6b640c5..7f78099 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,9 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -36,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Kotlin and Objective C Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Kotlin and Swift Native viewdiff --git a/android/build.gradle b/android/build.gradle
index 04af710..ecbbb03 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,9 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -42,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
diff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Java and Objective C Fabric view with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 37019b9..d6526ac 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,31 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -58,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -76,42 +47,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -164,7 +106,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/newarch/ReactNativeTestViewManagerSpec.java b/android/src/newarch/ReactNativeTestViewManagerSpec.java
index 62dea01..ca429b2 100644
--- a/android/src/newarch/ReactNativeTestViewManagerSpec.java
+++ b/android/src/newarch/ReactNativeTestViewManagerSpec.java
@@ -8,15 +8,8 @@ import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface;
-import com.facebook.soloader.SoLoader;
public abstract class ReactNativeTestViewManagerSpec<T extends View> extends SimpleViewManager<T> implements ReactNativeTestViewManagerInterface<T> {
- static {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION);
- }
- }
-
private final ViewManagerDelegate<T> mDelegate;
public ReactNativeTestViewManagerSpec() {
Kotlin and Objective C Fabric view with backward compatdiff --git a/android/build.gradle b/android/build.gradle
index 021b500..0f5864e 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,31 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -64,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -82,42 +53,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -172,7 +114,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/newarch/ReactNativeTestViewManagerSpec.kt b/android/src/newarch/ReactNativeTestViewManagerSpec.kt
index 676406a..a940078 100644
--- a/android/src/newarch/ReactNativeTestViewManagerSpec.kt
+++ b/android/src/newarch/ReactNativeTestViewManagerSpec.kt
@@ -7,7 +7,6 @@ import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface
-import com.facebook.soloader.SoLoader
abstract class ReactNativeTestViewManagerSpec<T : View> : SimpleViewManager<T>(), ReactNativeTestViewManagerInterface<T> {
private val mDelegate: ViewManagerDelegate<T>
@@ -19,12 +18,4 @@ abstract class ReactNativeTestViewManagerSpec<T : View> : SimpleViewManager<T>()
override fun getDelegate(): ViewManagerDelegate<T>? {
return mDelegate
}
-
- companion object {
- init {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION)
- }
- }
- }
}
Java and Objective C Fabric viewdiff --git a/android/build.gradle b/android/build.gradle
index 819e9cf..b6d2a41 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,31 +15,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -58,11 +33,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -76,42 +47,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -161,7 +103,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
index 134b236..5eff257 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.java
@@ -11,19 +11,12 @@ import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate;
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface;
-import com.facebook.soloader.SoLoader;
@ReactModule(name = ReactNativeTestViewManager.NAME)
public class ReactNativeTestViewManager extends SimpleViewManager<ReactNativeTestView> implements ReactNativeTestViewManagerInterface<ReactNativeTestView> {
public static final String NAME = "ReactNativeTestView";
- static {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION);
- }
- }
-
private final ViewManagerDelegate<ReactNativeTestView> mDelegate;
public ReactNativeTestViewManager() {
Kotlin and Objective C Fabric viewdiff --git a/android/build.gradle b/android/build.gradle
index f5b4414..e358a45 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -21,31 +21,6 @@ def isNewArchitectureEnabled() {
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
-import groovy.json.JsonSlurper
-
-// https://github.com/callstack/react-native-builder-bob/discussions/359
-def registrationCompat = {
- // The new distribution model uses Maven Central https://reactnative.dev/blog/2023/01/12/version-071
- def reactAndroidProject = rootProject.allprojects.find { it.name == 'ReactAndroid' }
- if (reactAndroidProject == null) return false
-
- def reactNativeManifest = file("${reactAndroidProject.projectDir}/../package.json")
- def reactNativeVersion = new JsonSlurper().parseText(reactNativeManifest.text).version as String
- // Fabric was introduced at [email protected], full CMake support were introduced at [email protected]
- // Use Android.mk for compatibility with [email protected]/0.69
- reactNativeVersion.matches('(0.68.*|0.69.*)')
-}()
-
-def codegenViewLibraryName = "ReactNativeTestView"
-def codegenViewModuleName = {
- // Autolink for Fabric uses codegenConfig.name in package.json since [email protected]
- // Use codegenViewLibraryName for compatibility with [email protected]/0.69
- def libraryManifestJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
- registrationCompat ? codegenViewLibraryName : libraryManifestJson.codegenConfig.name
-}()
-
-def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
-
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
@@ -64,11 +39,7 @@ def supportsNamespace() {
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
- if (major == 7 && minor >= 3) {
- return true
- }
-
- return major >= 8
+ return (major == 7 && minor >= 3) || major >= 8
}
android {
@@ -82,42 +53,13 @@ android {
}
}
- ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
- buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null")
-
- if (isNewArchitectureEnabled() && registrationCompat) {
- def reactAndroidProject = project(':ReactAndroid')
- externalNativeBuild {
- ndkBuild {
- arguments "APP_PLATFORM=android-21",
- "APP_STL=c++_shared",
- "NDK_TOOLCHAIN_VERSION=clang",
- "GENERATED_SRC_DIR=$buildDir/generated/source", // for react_codegen_* in this library's codegen/jni
- "PROJECT_BUILD_DIR=${appProject.buildDir}", // for REACT_NDK_EXPORT_DIR in ReactAndroid's Android-prebuilt.mk
- "REACT_ANDROID_DIR=${reactAndroidProject.projectDir}",
- "REACT_ANDROID_BUILD_DIR=${reactAndroidProject.buildDir}",
- "CODEGEN_MODULE_NAME=$codegenViewModuleName"
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
- cppFlags "-std=c++17"
- targets "${codegenViewModuleName}_registration"
- }
- }
- }
- }
- if (isNewArchitectureEnabled() && registrationCompat) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
- ndkBuild {
- path "Android.mk"
- }
- }
}
buildFeatures {
@@ -169,7 +111,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
- libraryName = codegenViewLibraryName
+ libraryName = "ReactNativeTestView"
codegenJavaPackageName = "com.bob.reactnativetest"
}
}
diff --git a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
index 1bd84ad..2c409fe 100644
--- a/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
+++ b/android/src/main/java/com/bob/reactnativetest/ReactNativeTestViewManager.kt
@@ -8,7 +8,6 @@ import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerInterface
import com.facebook.react.viewmanagers.ReactNativeTestViewManagerDelegate
-import com.facebook.soloader.SoLoader
@ReactModule(name = ReactNativeTestViewManager.NAME)
class ReactNativeTestViewManager : SimpleViewManager<ReactNativeTestView>(),
@@ -38,11 +37,5 @@ class ReactNativeTestViewManager : SimpleViewManager<ReactNativeTestView>(),
companion object {
const val NAME = "ReactNativeTestView"
-
- init {
- if (BuildConfig.CODEGEN_MODULE_REGISTRATION != null) {
- SoLoader.loadLibrary(BuildConfig.CODEGEN_MODULE_REGISTRATION)
- }
- }
}
}
|
🤓☝️ This PR changes the output of Java and Objective C Native modulediff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Java and Swift Native modulediff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Kotlin and Objective C Native modulediff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Kotlin and Swift Native modulediff --git a/src/NativeReactNativeTest.ts b/src/NativeReactNativeTest.ts
new file mode 100644
index 0000000..02186fb
--- /dev/null
+++ b/src/NativeReactNativeTest.ts
@@ -0,0 +1,22 @@
+import { NativeModules, Platform } from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+const ReactNativeTest = NativeModules.ReactNativeTest
+ ? NativeModules.ReactNativeTest
+ : new Proxy(
+ {},
+ {
+ get() {
+ throw new Error(LINKING_ERROR);
+ },
+ }
+ );
+
+export function multiply(a: number, b: number): Promise<number> {
+ return ReactNativeTest.multiply(a, b);
+}
diff --git a/src/index.tsx b/src/index.tsx
index 02186fb..4d5bff6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,22 +1,2 @@
-import { NativeModules, Platform } from 'react-native';
+export * from './NativeReactNativeTest';
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-const ReactNativeTest = NativeModules.ReactNativeTest
- ? NativeModules.ReactNativeTest
- : new Proxy(
- {},
- {
- get() {
- throw new Error(LINKING_ERROR);
- },
- }
- );
-
-export function multiply(a: number, b: number): Promise<number> {
- return ReactNativeTest.multiply(a, b);
-}
Java and Objective C Native viewdiff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Java and Swift Native viewdiff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Kotlin and Objective C Native viewdiff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
Kotlin and Swift Native viewdiff --git a/src/ReactNativeTestView.ts b/src/ReactNativeTestView.ts
new file mode 100644
index 0000000..9d66cf4
--- /dev/null
+++ b/src/ReactNativeTestView.ts
@@ -0,0 +1,25 @@
+import {
+ requireNativeComponent,
+ UIManager,
+ Platform,
+ ViewStyle,
+} from 'react-native';
+
+const LINKING_ERROR =
+ `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
+ '- You rebuilt the app after installing the package\n' +
+ '- You are not using Expo Go\n';
+
+type ReactNativeTestProps = {
+ color: string;
+ style: ViewStyle;
+};
+
+const ComponentName = 'ReactNativeTestView';
+
+export const ReactNativeTestView = UIManager.getViewManagerConfig(ComponentName) != null
+ ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
+ : () => {
+ throw new Error(LINKING_ERROR);
+ };
diff --git a/src/index.tsx b/src/index.tsx
index b6c5b72..266fa0e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,26 +1 @@
-import {
- requireNativeComponent,
- UIManager,
- Platform,
- type ViewStyle,
-} from 'react-native';
-
-const LINKING_ERROR =
- `The package '@bob/react-native-test' doesn't seem to be linked. Make sure: \n\n` +
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
- '- You rebuilt the app after installing the package\n' +
- '- You are not using Expo Go\n';
-
-type ReactNativeTestProps = {
- color: string;
- style: ViewStyle;
-};
-
-const ComponentName = 'ReactNativeTestView';
-
-export const ReactNativeTestView =
- UIManager.getViewManagerConfig(ComponentName) != null
- ? requireNativeComponent<ReactNativeTestProps>(ComponentName)
- : () => {
- throw new Error(LINKING_ERROR);
- };
+export * from './ReactNativeTestView';
|
just testing. plz ignore