├── .eslintrc.js ├── .gitignore ├── .node-version ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── App.js ├── Gemfile ├── README.md ├── RustModule.js ├── __tests__ └── App-test.js ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── rnrust │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── rnrust │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ └── newarchitecture │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ ├── components │ │ │ └── MainComponentsRegistry.java │ │ │ └── modules │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ ├── jni │ │ ├── CMakeLists.txt │ │ ├── MainApplicationModuleProvider.cpp │ │ ├── MainApplicationModuleProvider.h │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ ├── MainComponentsRegistry.cpp │ │ ├── MainComponentsRegistry.h │ │ └── OnLoad.cpp │ │ └── res │ │ ├── drawable │ │ └── rn_edit_text_material.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── .xcode.env ├── Podfile ├── Podfile.lock ├── RustExampleJSI.h ├── RustExampleJSI.mm ├── rawrust.h ├── rnrust.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── rnrust.xcscheme ├── rnrust.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── rnrust │ ├── AppDelegate.h │ ├── AppDelegate.mm │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── main.m ├── rnrustTests │ ├── Info.plist │ └── rnrustTests.m ├── rust-example.cpp └── rust-example.h ├── metro.config.js ├── package.json ├── rust ├── .gitignore ├── Cargo.toml ├── example │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── main.cpp └── test_lib.h ├── screenshot.png └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | ios/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | 35 | # node.js 36 | # 37 | node_modules/ 38 | npm-debug.log 39 | yarn-error.log 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | !debug.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | **/fastlane/report.xml 55 | **/fastlane/Preview.html 56 | **/fastlane/screenshots 57 | **/fastlane/test_output 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # Ruby / CocoaPods 63 | /ios/Pods/ 64 | /vendor/bundle/ 65 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | SafeAreaView, 4 | ScrollView, 5 | StatusBar, 6 | StyleSheet, 7 | Text, 8 | useColorScheme, 9 | View, 10 | } from 'react-native'; 11 | import RustModule from './RustModule'; 12 | 13 | import {Colors, Header} from 'react-native/Libraries/NewAppScreen'; 14 | 15 | const Section = ({children, title}) => { 16 | const isDarkMode = useColorScheme() === 'dark'; 17 | return ( 18 | 19 | 26 | {title} 27 | 28 | 35 | {children} 36 | 37 | 38 | ); 39 | }; 40 | 41 | const App = () => { 42 | const isDarkMode = useColorScheme() === 'dark'; 43 | 44 | const backgroundStyle = { 45 | backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, 46 | }; 47 | 48 | console.log(global.addInRust(2, 2)); 49 | return ( 50 | 51 | 55 | 58 |
59 | 63 |
64 | 2 + 2 = {RustModule.add(2, 2)} 65 |
66 |
67 | 68 | 69 | ); 70 | }; 71 | 72 | const styles = StyleSheet.create({ 73 | sectionContainer: { 74 | marginTop: 32, 75 | paddingHorizontal: 24, 76 | }, 77 | sectionTitle: { 78 | fontSize: 24, 79 | fontWeight: '600', 80 | }, 81 | sectionDescription: { 82 | marginTop: 8, 83 | fontSize: 18, 84 | fontWeight: '400', 85 | }, 86 | highlight: { 87 | fontWeight: '700', 88 | }, 89 | }); 90 | 91 | export default App; 92 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Rust + React Native 2 | 3 | That is an extremely simple (and incorrect in many ways) PoW on how to connect Rust code and React Native. 4 | 5 | The inspirations were: 6 | 1. https://github.com/Terrahop/react-native-rust-demo 7 | 2. https://github.com/inokawa/react-native-wasm 8 | 3. https://github.com/inokawa/react-native-react-bridge 9 | 10 | First, I wanted to compile Rust to wasm and use it within React Native, but the only reasonable way was to do it inside WebView. 11 | That looked extraordinarily wrong and, from the perspective of security and maintainability, looked like an abysmal choice. 12 | 13 | Hence, I decided to create C bindings in the Rust library. Those bindings are consumed via JSI Module and bridged via JSI to JavaScript. 14 | For now, this works only on iOS and only on the simulator. Adding support for the actual iPhone is not problematic, but adding support for Android requires additional effort. 15 | [react-native-rust-demo](https://github.com/Terrahop/react-native-rust-demo) looked promising, but I wanted to use JSI binding to have fast, synchronous calls and maintain more control over the flow. 16 | 17 | 18 | ## How to run? 19 | RN setup: 20 | ```bash 21 | yarn 22 | cd ios && pod install && cd .. 23 | yarn react-native start 24 | ``` 25 | 26 | Compile library 27 | ```bash 28 | cd rust 29 | rustup target add x86_64-apple-ios-sim 30 | cargo build --target x86_64-apple-ios 31 | cd .. 32 | ``` 33 | 34 | Compile app 35 | ```bash 36 | yarn react-native run-ios 37 | ``` 38 | 39 | 40 | ![Demo](screenshot.png "Title") 41 | -------------------------------------------------------------------------------- /RustModule.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // this is a simple solution. It should be done better with a proper usage of TurboModules 3 | add: global.addInRust, 4 | }; 5 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.rnrust", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.rnrust", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: true, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: "../../node_modules/react-native/react.gradle" 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get("enableHermes", false); 123 | 124 | /** 125 | * Architectures to build native code for. 126 | */ 127 | def reactNativeArchitectures() { 128 | def value = project.getProperties().get("reactNativeArchitectures") 129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 130 | } 131 | 132 | android { 133 | ndkVersion rootProject.ext.ndkVersion 134 | 135 | compileSdkVersion rootProject.ext.compileSdkVersion 136 | 137 | defaultConfig { 138 | applicationId "com.rnrust" 139 | minSdkVersion rootProject.ext.minSdkVersion 140 | targetSdkVersion rootProject.ext.targetSdkVersion 141 | versionCode 1 142 | versionName "1.0" 143 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 144 | 145 | if (isNewArchitectureEnabled()) { 146 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 147 | externalNativeBuild { 148 | cmake { 149 | arguments "-DPROJECT_BUILD_DIR=$buildDir", 150 | "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 151 | "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", 152 | "-DNODE_MODULES_DIR=$rootDir/../node_modules", 153 | "-DANDROID_STL=c++_shared" 154 | } 155 | } 156 | if (!enableSeparateBuildPerCPUArchitecture) { 157 | ndk { 158 | abiFilters (*reactNativeArchitectures()) 159 | } 160 | } 161 | } 162 | } 163 | 164 | if (isNewArchitectureEnabled()) { 165 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 166 | externalNativeBuild { 167 | cmake { 168 | path "$projectDir/src/main/jni/CMakeLists.txt" 169 | } 170 | } 171 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 172 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 173 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 174 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 175 | into("$buildDir/react-ndk/exported") 176 | } 177 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 178 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 179 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 180 | into("$buildDir/react-ndk/exported") 181 | } 182 | afterEvaluate { 183 | // If you wish to add a custom TurboModule or component locally, 184 | // you should uncomment this line. 185 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 186 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 187 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 188 | 189 | // Due to a bug inside AGP, we have to explicitly set a dependency 190 | // between configureCMakeDebug* tasks and the preBuild tasks. 191 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 192 | configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) 193 | configureCMakeDebug.dependsOn(preDebugBuild) 194 | reactNativeArchitectures().each { architecture -> 195 | tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { 196 | dependsOn("preDebugBuild") 197 | } 198 | tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { 199 | dependsOn("preReleaseBuild") 200 | } 201 | } 202 | } 203 | } 204 | 205 | splits { 206 | abi { 207 | reset() 208 | enable enableSeparateBuildPerCPUArchitecture 209 | universalApk false // If true, also generate a universal APK 210 | include (*reactNativeArchitectures()) 211 | } 212 | } 213 | signingConfigs { 214 | debug { 215 | storeFile file('debug.keystore') 216 | storePassword 'android' 217 | keyAlias 'androiddebugkey' 218 | keyPassword 'android' 219 | } 220 | } 221 | buildTypes { 222 | debug { 223 | signingConfig signingConfigs.debug 224 | } 225 | release { 226 | // Caution! In production, you need to generate your own keystore file. 227 | // see https://reactnative.dev/docs/signed-apk-android. 228 | signingConfig signingConfigs.debug 229 | minifyEnabled enableProguardInReleaseBuilds 230 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 231 | } 232 | } 233 | 234 | // applicationVariants are e.g. debug, release 235 | applicationVariants.all { variant -> 236 | variant.outputs.each { output -> 237 | // For each separate APK per architecture, set a unique version code as described here: 238 | // https://developer.android.com/studio/build/configure-apk-splits.html 239 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 240 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 241 | def abi = output.getFilter(OutputFile.ABI) 242 | if (abi != null) { // null for the universal-debug, universal-release variants 243 | output.versionCodeOverride = 244 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 245 | } 246 | 247 | } 248 | } 249 | } 250 | 251 | dependencies { 252 | implementation fileTree(dir: "libs", include: ["*.jar"]) 253 | 254 | //noinspection GradleDynamicVersion 255 | implementation "com.facebook.react:react-native:+" // From node_modules 256 | 257 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 258 | 259 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 260 | exclude group:'com.facebook.fbjni' 261 | } 262 | 263 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 264 | exclude group:'com.facebook.flipper' 265 | exclude group:'com.squareup.okhttp3', module:'okhttp' 266 | } 267 | 268 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 269 | exclude group:'com.facebook.flipper' 270 | } 271 | 272 | if (enableHermes) { 273 | //noinspection GradleDynamicVersion 274 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 275 | exclude group:'com.facebook.fbjni' 276 | } 277 | } else { 278 | implementation jscFlavor 279 | } 280 | } 281 | 282 | if (isNewArchitectureEnabled()) { 283 | // If new architecture is enabled, we let you build RN from source 284 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 285 | // This will be applied to all the imported transtitive dependency. 286 | configurations.all { 287 | resolutionStrategy.dependencySubstitution { 288 | substitute(module("com.facebook.react:react-native")) 289 | .using(project(":ReactAndroid")) 290 | .because("On New Architecture we're building React Native from source") 291 | substitute(module("com.facebook.react:hermes-engine")) 292 | .using(project(":ReactAndroid:hermes-engine")) 293 | .because("On New Architecture we're building Hermes from source") 294 | } 295 | } 296 | } 297 | 298 | // Run this once to be able to run the application with BUCK 299 | // puts all compile dependencies into folder libs for BUCK to use 300 | task copyDownloadableDepsToLibs(type: Copy) { 301 | from configurations.implementation 302 | into 'libs' 303 | } 304 | 305 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 306 | 307 | def isNewArchitectureEnabled() { 308 | // To opt-in for the New Architecture, you can either: 309 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 310 | // - Invoke gradle with `-newArchEnabled=true` 311 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 312 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 313 | } 314 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/rnrust/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.rnrust; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnrust/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.rnrust; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | 7 | public class MainActivity extends ReactActivity { 8 | 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | protected String getMainComponentName() { 15 | return "rnrust"; 16 | } 17 | 18 | /** 19 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 20 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 21 | * (Paper). 22 | */ 23 | @Override 24 | protected ReactActivityDelegate createReactActivityDelegate() { 25 | return new MainActivityDelegate(this, getMainComponentName()); 26 | } 27 | 28 | public static class MainActivityDelegate extends ReactActivityDelegate { 29 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 30 | super(activity, mainComponentName); 31 | } 32 | 33 | @Override 34 | protected ReactRootView createRootView() { 35 | ReactRootView reactRootView = new ReactRootView(getContext()); 36 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 37 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 38 | return reactRootView; 39 | } 40 | 41 | @Override 42 | protected boolean isConcurrentRootEnabled() { 43 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 44 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 45 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnrust/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.rnrust; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.config.ReactFeatureFlags; 11 | import com.facebook.soloader.SoLoader; 12 | import com.rnrust.newarchitecture.MainApplicationReactNativeHost; 13 | import java.lang.reflect.InvocationTargetException; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | // packages.add(new MyReactNativePackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | private final ReactNativeHost mNewArchitectureNativeHost = 41 | new MainApplicationReactNativeHost(this); 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 46 | return mNewArchitectureNativeHost; 47 | } else { 48 | return mReactNativeHost; 49 | } 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | // If you opted-in for the New Architecture, we enable the TurboModule system 56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 57 | SoLoader.init(this, /* native exopackage */ false); 58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 59 | } 60 | 61 | /** 62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 64 | * 65 | * @param context 66 | * @param reactInstanceManager 67 | */ 68 | private static void initializeFlipper( 69 | Context context, ReactInstanceManager reactInstanceManager) { 70 | if (BuildConfig.DEBUG) { 71 | try { 72 | /* 73 | We use reflection here to pick up the class that initializes Flipper, 74 | since Flipper library is not available in release mode 75 | */ 76 | Class aClass = Class.forName("com.rnrust.ReactNativeFlipper"); 77 | aClass 78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 79 | .invoke(null, context, reactInstanceManager); 80 | } catch (ClassNotFoundException e) { 81 | e.printStackTrace(); 82 | } catch (NoSuchMethodException e) { 83 | e.printStackTrace(); 84 | } catch (IllegalAccessException e) { 85 | e.printStackTrace(); 86 | } catch (InvocationTargetException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnrust/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.rnrust.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.FabricJSIModuleProvider; 20 | import com.facebook.react.fabric.ReactNativeConfig; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.rnrust.BuildConfig; 23 | import com.rnrust.newarchitecture.components.MainComponentsRegistry; 24 | import com.rnrust.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | ReactNativeConfig.DEFAULT_CONFIG, 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnrust/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.rnrust.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnrust/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.rnrust.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("rnrust_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | 3 | # Define the library name here. 4 | project(rnrust_appmodules) 5 | 6 | # This file includes all the necessary to let you build your application with the New Architecture. 7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) 8 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace facebook { 7 | namespace react { 8 | 9 | std::shared_ptr MainApplicationModuleProvider( 10 | const std::string &moduleName, 11 | const JavaTurboModule::InitParams ¶ms) { 12 | // Here you can provide your own module provider for TurboModules coming from 13 | // either your application or from external libraries. The approach to follow 14 | // is similar to the following (for a library called `samplelibrary`: 15 | // 16 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 17 | // if (module != nullptr) { 18 | // return module; 19 | // } 20 | // return rncore_ModuleProvider(moduleName, params); 21 | 22 | // Module providers autolinked by RN CLI 23 | auto rncli_module = rncli_ModuleProvider(moduleName, params); 24 | if (rncli_module != nullptr) { 25 | return rncli_module; 26 | } 27 | 28 | return rncore_ModuleProvider(moduleName, params); 29 | } 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string &moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string &name, 26 | const std::shared_ptr &jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string &name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | const std::string &name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/rnrust/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string &name, 25 | const std::shared_ptr &jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string &name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(const std::string &name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace facebook { 10 | namespace react { 11 | 12 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 13 | 14 | std::shared_ptr 15 | MainComponentsRegistry::sharedProviderRegistry() { 16 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 17 | 18 | // Autolinked providers registered by RN CLI 19 | rncli_registerProviders(providerRegistry); 20 | 21 | // Custom Fabric Components go here. You can register custom 22 | // components coming from your App or from 3rd party libraries here. 23 | // 24 | // providerRegistry->add(concreteComponentDescriptorProvider< 25 | // AocViewerComponentDescriptor>()); 26 | return providerRegistry; 27 | } 28 | 29 | jni::local_ref 30 | MainComponentsRegistry::initHybrid( 31 | jni::alias_ref, 32 | ComponentFactory *delegate) { 33 | auto instance = makeCxxInstance(delegate); 34 | 35 | auto buildRegistryFunction = 36 | [](EventDispatcher::Weak const &eventDispatcher, 37 | ContextContainer::Shared const &contextContainer) 38 | -> ComponentDescriptorRegistry::Shared { 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 40 | ->createComponentDescriptorRegistry( 41 | {eventDispatcher, contextContainer}); 42 | 43 | auto mutableRegistry = 44 | std::const_pointer_cast(registry); 45 | 46 | mutableRegistry->setFallbackComponentDescriptor( 47 | std::make_shared( 48 | ComponentDescriptorParameters{ 49 | eventDispatcher, contextContainer, nullptr})); 50 | 51 | return registry; 52 | }; 53 | 54 | delegate->buildRegistryFunction = buildRegistryFunction; 55 | return instance; 56 | } 57 | 58 | void MainComponentsRegistry::registerNatives() { 59 | registerHybrid({ 60 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 61 | }); 62 | } 63 | 64 | } // namespace react 65 | } // namespace facebook 66 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/rnrust/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | rnrust 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "31.0.0" 6 | minSdkVersion = 21 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | 10 | if (System.properties['os.arch'] == "aarch64") { 11 | // For M1 Users we need to use the NDK 24 which added support for aarch64 12 | ndkVersion = "24.0.8215888" 13 | } else { 14 | // Otherwise we default to the side-by-side NDK version from AGP. 15 | ndkVersion = "21.4.7075529" 16 | } 17 | } 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | dependencies { 23 | classpath("com.android.tools.build:gradle:7.2.1") 24 | classpath("com.facebook.react:react-native-gradle-plugin") 25 | classpath("de.undercouch:gradle-download-task:5.0.1") 26 | // NOTE: Do not place your application dependencies here; they belong 27 | // in the individual module build.gradle files 28 | } 29 | } 30 | 31 | allprojects { 32 | repositories { 33 | maven { 34 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 35 | url("$rootDir/../node_modules/react-native/android") 36 | } 37 | maven { 38 | // Android JSC is installed from npm 39 | url("$rootDir/../node_modules/jsc-android/dist") 40 | } 41 | mavenCentral { 42 | // We don't want to fetch react-native from Maven Central as there are 43 | // older versions over there. 44 | content { 45 | excludeGroup "com.facebook.react" 46 | } 47 | } 48 | google() 49 | maven { url 'https://www.jitpack.io' } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rnrust' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } 12 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rnrust", 3 | "displayName": "rnrust" 4 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'rnrust' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # Hermes is now enabled by default. Disable by setting this flag to false. 16 | # Upcoming versions of React Native may rely on get_default_flags(), but 17 | # we make it explicit here to aid in the React Native upgrade process. 18 | :hermes_enabled => true, 19 | :fabric_enabled => flags[:fabric_enabled], 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | :flipper_configuration => FlipperConfiguration.enabled, 25 | # An absolute path to your application root. 26 | :app_path => "#{Pod::Config.instance.installation_root}/.." 27 | ) 28 | 29 | target 'rnrustTests' do 30 | inherit! :complete 31 | # Pods for testing 32 | end 33 | 34 | post_install do |installer| 35 | react_native_post_install( 36 | installer, 37 | # Set `mac_catalyst_enabled` to `true` in order to apply patches 38 | # necessary for Mac Catalyst builds 39 | :mac_catalyst_enabled => false 40 | ) 41 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.70.3) 6 | - FBReactNativeSpec (0.70.3): 7 | - RCT-Folly (= 2021.07.22.00) 8 | - RCTRequired (= 0.70.3) 9 | - RCTTypeSafety (= 0.70.3) 10 | - React-Core (= 0.70.3) 11 | - React-jsi (= 0.70.3) 12 | - ReactCommon/turbomodule/core (= 0.70.3) 13 | - Flipper (0.125.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.2.0.1) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.10): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.1100) 26 | - Flipper-Glog (0.5.0.5) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.125.0): 31 | - FlipperKit/Core (= 0.125.0) 32 | - FlipperKit/Core (0.125.0): 33 | - Flipper (~> 0.125.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - SocketRocket (~> 0.6.0) 39 | - FlipperKit/CppBridge (0.125.0): 40 | - Flipper (~> 0.125.0) 41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0): 42 | - Flipper-Folly (~> 2.6) 43 | - FlipperKit/FBDefines (0.125.0) 44 | - FlipperKit/FKPortForwarding (0.125.0): 45 | - CocoaAsyncSocket (~> 7.6) 46 | - Flipper-PeerTalk (~> 0.0.4) 47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0) 48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0): 49 | - FlipperKit/Core 50 | - FlipperKit/FlipperKitHighlightOverlay 51 | - FlipperKit/FlipperKitLayoutTextSearchable 52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0): 53 | - FlipperKit/Core 54 | - FlipperKit/FlipperKitHighlightOverlay 55 | - FlipperKit/FlipperKitLayoutHelpers 56 | - YogaKit (~> 1.18) 57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0): 58 | - FlipperKit/Core 59 | - FlipperKit/FlipperKitHighlightOverlay 60 | - FlipperKit/FlipperKitLayoutHelpers 61 | - FlipperKit/FlipperKitLayoutIOSDescriptors 62 | - FlipperKit/FlipperKitLayoutTextSearchable 63 | - YogaKit (~> 1.18) 64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0) 65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0): 66 | - FlipperKit/Core 67 | - FlipperKit/FlipperKitReactPlugin (0.125.0): 68 | - FlipperKit/Core 69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0): 70 | - FlipperKit/Core 71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0): 72 | - FlipperKit/Core 73 | - FlipperKit/FlipperKitNetworkPlugin 74 | - fmt (6.2.1) 75 | - glog (0.3.5) 76 | - hermes-engine (0.70.3) 77 | - libevent (2.1.12) 78 | - OpenSSL-Universal (1.1.1100) 79 | - RCT-Folly (2021.07.22.00): 80 | - boost 81 | - DoubleConversion 82 | - fmt (~> 6.2.1) 83 | - glog 84 | - RCT-Folly/Default (= 2021.07.22.00) 85 | - RCT-Folly/Default (2021.07.22.00): 86 | - boost 87 | - DoubleConversion 88 | - fmt (~> 6.2.1) 89 | - glog 90 | - RCT-Folly/Fabric (2021.07.22.00): 91 | - boost 92 | - DoubleConversion 93 | - fmt (~> 6.2.1) 94 | - glog 95 | - RCT-Folly/Futures (2021.07.22.00): 96 | - boost 97 | - DoubleConversion 98 | - fmt (~> 6.2.1) 99 | - glog 100 | - libevent 101 | - RCTRequired (0.70.3) 102 | - RCTTypeSafety (0.70.3): 103 | - FBLazyVector (= 0.70.3) 104 | - RCTRequired (= 0.70.3) 105 | - React-Core (= 0.70.3) 106 | - React (0.70.3): 107 | - React-Core (= 0.70.3) 108 | - React-Core/DevSupport (= 0.70.3) 109 | - React-Core/RCTWebSocket (= 0.70.3) 110 | - React-RCTActionSheet (= 0.70.3) 111 | - React-RCTAnimation (= 0.70.3) 112 | - React-RCTBlob (= 0.70.3) 113 | - React-RCTImage (= 0.70.3) 114 | - React-RCTLinking (= 0.70.3) 115 | - React-RCTNetwork (= 0.70.3) 116 | - React-RCTSettings (= 0.70.3) 117 | - React-RCTText (= 0.70.3) 118 | - React-RCTVibration (= 0.70.3) 119 | - React-bridging (0.70.3): 120 | - RCT-Folly (= 2021.07.22.00) 121 | - React-jsi (= 0.70.3) 122 | - React-callinvoker (0.70.3) 123 | - React-Codegen (0.70.3): 124 | - FBReactNativeSpec (= 0.70.3) 125 | - RCT-Folly (= 2021.07.22.00) 126 | - RCTRequired (= 0.70.3) 127 | - RCTTypeSafety (= 0.70.3) 128 | - React-Core (= 0.70.3) 129 | - React-graphics (= 0.70.3) 130 | - React-jsi (= 0.70.3) 131 | - React-jsiexecutor (= 0.70.3) 132 | - React-rncore (= 0.70.3) 133 | - ReactCommon/turbomodule/core (= 0.70.3) 134 | - React-Core (0.70.3): 135 | - glog 136 | - RCT-Folly (= 2021.07.22.00) 137 | - React-Core/Default (= 0.70.3) 138 | - React-cxxreact (= 0.70.3) 139 | - React-jsi (= 0.70.3) 140 | - React-jsiexecutor (= 0.70.3) 141 | - React-perflogger (= 0.70.3) 142 | - Yoga 143 | - React-Core/CoreModulesHeaders (0.70.3): 144 | - glog 145 | - RCT-Folly (= 2021.07.22.00) 146 | - React-Core/Default 147 | - React-cxxreact (= 0.70.3) 148 | - React-jsi (= 0.70.3) 149 | - React-jsiexecutor (= 0.70.3) 150 | - React-perflogger (= 0.70.3) 151 | - Yoga 152 | - React-Core/Default (0.70.3): 153 | - glog 154 | - RCT-Folly (= 2021.07.22.00) 155 | - React-cxxreact (= 0.70.3) 156 | - React-jsi (= 0.70.3) 157 | - React-jsiexecutor (= 0.70.3) 158 | - React-perflogger (= 0.70.3) 159 | - Yoga 160 | - React-Core/DevSupport (0.70.3): 161 | - glog 162 | - RCT-Folly (= 2021.07.22.00) 163 | - React-Core/Default (= 0.70.3) 164 | - React-Core/RCTWebSocket (= 0.70.3) 165 | - React-cxxreact (= 0.70.3) 166 | - React-jsi (= 0.70.3) 167 | - React-jsiexecutor (= 0.70.3) 168 | - React-jsinspector (= 0.70.3) 169 | - React-perflogger (= 0.70.3) 170 | - Yoga 171 | - React-Core/RCTActionSheetHeaders (0.70.3): 172 | - glog 173 | - RCT-Folly (= 2021.07.22.00) 174 | - React-Core/Default 175 | - React-cxxreact (= 0.70.3) 176 | - React-jsi (= 0.70.3) 177 | - React-jsiexecutor (= 0.70.3) 178 | - React-perflogger (= 0.70.3) 179 | - Yoga 180 | - React-Core/RCTAnimationHeaders (0.70.3): 181 | - glog 182 | - RCT-Folly (= 2021.07.22.00) 183 | - React-Core/Default 184 | - React-cxxreact (= 0.70.3) 185 | - React-jsi (= 0.70.3) 186 | - React-jsiexecutor (= 0.70.3) 187 | - React-perflogger (= 0.70.3) 188 | - Yoga 189 | - React-Core/RCTBlobHeaders (0.70.3): 190 | - glog 191 | - RCT-Folly (= 2021.07.22.00) 192 | - React-Core/Default 193 | - React-cxxreact (= 0.70.3) 194 | - React-jsi (= 0.70.3) 195 | - React-jsiexecutor (= 0.70.3) 196 | - React-perflogger (= 0.70.3) 197 | - Yoga 198 | - React-Core/RCTImageHeaders (0.70.3): 199 | - glog 200 | - RCT-Folly (= 2021.07.22.00) 201 | - React-Core/Default 202 | - React-cxxreact (= 0.70.3) 203 | - React-jsi (= 0.70.3) 204 | - React-jsiexecutor (= 0.70.3) 205 | - React-perflogger (= 0.70.3) 206 | - Yoga 207 | - React-Core/RCTLinkingHeaders (0.70.3): 208 | - glog 209 | - RCT-Folly (= 2021.07.22.00) 210 | - React-Core/Default 211 | - React-cxxreact (= 0.70.3) 212 | - React-jsi (= 0.70.3) 213 | - React-jsiexecutor (= 0.70.3) 214 | - React-perflogger (= 0.70.3) 215 | - Yoga 216 | - React-Core/RCTNetworkHeaders (0.70.3): 217 | - glog 218 | - RCT-Folly (= 2021.07.22.00) 219 | - React-Core/Default 220 | - React-cxxreact (= 0.70.3) 221 | - React-jsi (= 0.70.3) 222 | - React-jsiexecutor (= 0.70.3) 223 | - React-perflogger (= 0.70.3) 224 | - Yoga 225 | - React-Core/RCTSettingsHeaders (0.70.3): 226 | - glog 227 | - RCT-Folly (= 2021.07.22.00) 228 | - React-Core/Default 229 | - React-cxxreact (= 0.70.3) 230 | - React-jsi (= 0.70.3) 231 | - React-jsiexecutor (= 0.70.3) 232 | - React-perflogger (= 0.70.3) 233 | - Yoga 234 | - React-Core/RCTTextHeaders (0.70.3): 235 | - glog 236 | - RCT-Folly (= 2021.07.22.00) 237 | - React-Core/Default 238 | - React-cxxreact (= 0.70.3) 239 | - React-jsi (= 0.70.3) 240 | - React-jsiexecutor (= 0.70.3) 241 | - React-perflogger (= 0.70.3) 242 | - Yoga 243 | - React-Core/RCTVibrationHeaders (0.70.3): 244 | - glog 245 | - RCT-Folly (= 2021.07.22.00) 246 | - React-Core/Default 247 | - React-cxxreact (= 0.70.3) 248 | - React-jsi (= 0.70.3) 249 | - React-jsiexecutor (= 0.70.3) 250 | - React-perflogger (= 0.70.3) 251 | - Yoga 252 | - React-Core/RCTWebSocket (0.70.3): 253 | - glog 254 | - RCT-Folly (= 2021.07.22.00) 255 | - React-Core/Default (= 0.70.3) 256 | - React-cxxreact (= 0.70.3) 257 | - React-jsi (= 0.70.3) 258 | - React-jsiexecutor (= 0.70.3) 259 | - React-perflogger (= 0.70.3) 260 | - Yoga 261 | - React-CoreModules (0.70.3): 262 | - RCT-Folly (= 2021.07.22.00) 263 | - RCTTypeSafety (= 0.70.3) 264 | - React-Codegen (= 0.70.3) 265 | - React-Core/CoreModulesHeaders (= 0.70.3) 266 | - React-jsi (= 0.70.3) 267 | - React-RCTImage (= 0.70.3) 268 | - ReactCommon/turbomodule/core (= 0.70.3) 269 | - React-cxxreact (0.70.3): 270 | - boost (= 1.76.0) 271 | - DoubleConversion 272 | - glog 273 | - RCT-Folly (= 2021.07.22.00) 274 | - React-callinvoker (= 0.70.3) 275 | - React-jsi (= 0.70.3) 276 | - React-jsinspector (= 0.70.3) 277 | - React-logger (= 0.70.3) 278 | - React-perflogger (= 0.70.3) 279 | - React-runtimeexecutor (= 0.70.3) 280 | - React-Fabric (0.70.3): 281 | - RCT-Folly/Fabric (= 2021.07.22.00) 282 | - RCTRequired (= 0.70.3) 283 | - RCTTypeSafety (= 0.70.3) 284 | - React-Fabric/animations (= 0.70.3) 285 | - React-Fabric/attributedstring (= 0.70.3) 286 | - React-Fabric/butter (= 0.70.3) 287 | - React-Fabric/componentregistry (= 0.70.3) 288 | - React-Fabric/componentregistrynative (= 0.70.3) 289 | - React-Fabric/components (= 0.70.3) 290 | - React-Fabric/config (= 0.70.3) 291 | - React-Fabric/core (= 0.70.3) 292 | - React-Fabric/debug_core (= 0.70.3) 293 | - React-Fabric/debug_renderer (= 0.70.3) 294 | - React-Fabric/imagemanager (= 0.70.3) 295 | - React-Fabric/leakchecker (= 0.70.3) 296 | - React-Fabric/mounting (= 0.70.3) 297 | - React-Fabric/runtimescheduler (= 0.70.3) 298 | - React-Fabric/scheduler (= 0.70.3) 299 | - React-Fabric/telemetry (= 0.70.3) 300 | - React-Fabric/templateprocessor (= 0.70.3) 301 | - React-Fabric/textlayoutmanager (= 0.70.3) 302 | - React-Fabric/uimanager (= 0.70.3) 303 | - React-Fabric/utils (= 0.70.3) 304 | - React-graphics (= 0.70.3) 305 | - React-jsi (= 0.70.3) 306 | - React-jsiexecutor (= 0.70.3) 307 | - ReactCommon/turbomodule/core (= 0.70.3) 308 | - React-Fabric/animations (0.70.3): 309 | - RCT-Folly/Fabric (= 2021.07.22.00) 310 | - RCTRequired (= 0.70.3) 311 | - RCTTypeSafety (= 0.70.3) 312 | - React-graphics (= 0.70.3) 313 | - React-jsi (= 0.70.3) 314 | - React-jsiexecutor (= 0.70.3) 315 | - ReactCommon/turbomodule/core (= 0.70.3) 316 | - React-Fabric/attributedstring (0.70.3): 317 | - RCT-Folly/Fabric (= 2021.07.22.00) 318 | - RCTRequired (= 0.70.3) 319 | - RCTTypeSafety (= 0.70.3) 320 | - React-graphics (= 0.70.3) 321 | - React-jsi (= 0.70.3) 322 | - React-jsiexecutor (= 0.70.3) 323 | - ReactCommon/turbomodule/core (= 0.70.3) 324 | - React-Fabric/butter (0.70.3): 325 | - RCT-Folly/Fabric (= 2021.07.22.00) 326 | - RCTRequired (= 0.70.3) 327 | - RCTTypeSafety (= 0.70.3) 328 | - React-graphics (= 0.70.3) 329 | - React-jsi (= 0.70.3) 330 | - React-jsiexecutor (= 0.70.3) 331 | - ReactCommon/turbomodule/core (= 0.70.3) 332 | - React-Fabric/componentregistry (0.70.3): 333 | - RCT-Folly/Fabric (= 2021.07.22.00) 334 | - RCTRequired (= 0.70.3) 335 | - RCTTypeSafety (= 0.70.3) 336 | - React-graphics (= 0.70.3) 337 | - React-jsi (= 0.70.3) 338 | - React-jsiexecutor (= 0.70.3) 339 | - ReactCommon/turbomodule/core (= 0.70.3) 340 | - React-Fabric/componentregistrynative (0.70.3): 341 | - RCT-Folly/Fabric (= 2021.07.22.00) 342 | - RCTRequired (= 0.70.3) 343 | - RCTTypeSafety (= 0.70.3) 344 | - React-graphics (= 0.70.3) 345 | - React-jsi (= 0.70.3) 346 | - React-jsiexecutor (= 0.70.3) 347 | - ReactCommon/turbomodule/core (= 0.70.3) 348 | - React-Fabric/components (0.70.3): 349 | - RCT-Folly/Fabric (= 2021.07.22.00) 350 | - RCTRequired (= 0.70.3) 351 | - RCTTypeSafety (= 0.70.3) 352 | - React-Fabric/components/activityindicator (= 0.70.3) 353 | - React-Fabric/components/image (= 0.70.3) 354 | - React-Fabric/components/inputaccessory (= 0.70.3) 355 | - React-Fabric/components/legacyviewmanagerinterop (= 0.70.3) 356 | - React-Fabric/components/modal (= 0.70.3) 357 | - React-Fabric/components/root (= 0.70.3) 358 | - React-Fabric/components/safeareaview (= 0.70.3) 359 | - React-Fabric/components/scrollview (= 0.70.3) 360 | - React-Fabric/components/slider (= 0.70.3) 361 | - React-Fabric/components/text (= 0.70.3) 362 | - React-Fabric/components/textinput (= 0.70.3) 363 | - React-Fabric/components/unimplementedview (= 0.70.3) 364 | - React-Fabric/components/view (= 0.70.3) 365 | - React-graphics (= 0.70.3) 366 | - React-jsi (= 0.70.3) 367 | - React-jsiexecutor (= 0.70.3) 368 | - ReactCommon/turbomodule/core (= 0.70.3) 369 | - React-Fabric/components/activityindicator (0.70.3): 370 | - RCT-Folly/Fabric (= 2021.07.22.00) 371 | - RCTRequired (= 0.70.3) 372 | - RCTTypeSafety (= 0.70.3) 373 | - React-graphics (= 0.70.3) 374 | - React-jsi (= 0.70.3) 375 | - React-jsiexecutor (= 0.70.3) 376 | - ReactCommon/turbomodule/core (= 0.70.3) 377 | - React-Fabric/components/image (0.70.3): 378 | - RCT-Folly/Fabric (= 2021.07.22.00) 379 | - RCTRequired (= 0.70.3) 380 | - RCTTypeSafety (= 0.70.3) 381 | - React-graphics (= 0.70.3) 382 | - React-jsi (= 0.70.3) 383 | - React-jsiexecutor (= 0.70.3) 384 | - ReactCommon/turbomodule/core (= 0.70.3) 385 | - React-Fabric/components/inputaccessory (0.70.3): 386 | - RCT-Folly/Fabric (= 2021.07.22.00) 387 | - RCTRequired (= 0.70.3) 388 | - RCTTypeSafety (= 0.70.3) 389 | - React-graphics (= 0.70.3) 390 | - React-jsi (= 0.70.3) 391 | - React-jsiexecutor (= 0.70.3) 392 | - ReactCommon/turbomodule/core (= 0.70.3) 393 | - React-Fabric/components/legacyviewmanagerinterop (0.70.3): 394 | - RCT-Folly/Fabric (= 2021.07.22.00) 395 | - RCTRequired (= 0.70.3) 396 | - RCTTypeSafety (= 0.70.3) 397 | - React-graphics (= 0.70.3) 398 | - React-jsi (= 0.70.3) 399 | - React-jsiexecutor (= 0.70.3) 400 | - ReactCommon/turbomodule/core (= 0.70.3) 401 | - React-Fabric/components/modal (0.70.3): 402 | - RCT-Folly/Fabric (= 2021.07.22.00) 403 | - RCTRequired (= 0.70.3) 404 | - RCTTypeSafety (= 0.70.3) 405 | - React-graphics (= 0.70.3) 406 | - React-jsi (= 0.70.3) 407 | - React-jsiexecutor (= 0.70.3) 408 | - ReactCommon/turbomodule/core (= 0.70.3) 409 | - React-Fabric/components/root (0.70.3): 410 | - RCT-Folly/Fabric (= 2021.07.22.00) 411 | - RCTRequired (= 0.70.3) 412 | - RCTTypeSafety (= 0.70.3) 413 | - React-graphics (= 0.70.3) 414 | - React-jsi (= 0.70.3) 415 | - React-jsiexecutor (= 0.70.3) 416 | - ReactCommon/turbomodule/core (= 0.70.3) 417 | - React-Fabric/components/safeareaview (0.70.3): 418 | - RCT-Folly/Fabric (= 2021.07.22.00) 419 | - RCTRequired (= 0.70.3) 420 | - RCTTypeSafety (= 0.70.3) 421 | - React-graphics (= 0.70.3) 422 | - React-jsi (= 0.70.3) 423 | - React-jsiexecutor (= 0.70.3) 424 | - ReactCommon/turbomodule/core (= 0.70.3) 425 | - React-Fabric/components/scrollview (0.70.3): 426 | - RCT-Folly/Fabric (= 2021.07.22.00) 427 | - RCTRequired (= 0.70.3) 428 | - RCTTypeSafety (= 0.70.3) 429 | - React-graphics (= 0.70.3) 430 | - React-jsi (= 0.70.3) 431 | - React-jsiexecutor (= 0.70.3) 432 | - ReactCommon/turbomodule/core (= 0.70.3) 433 | - React-Fabric/components/slider (0.70.3): 434 | - RCT-Folly/Fabric (= 2021.07.22.00) 435 | - RCTRequired (= 0.70.3) 436 | - RCTTypeSafety (= 0.70.3) 437 | - React-graphics (= 0.70.3) 438 | - React-jsi (= 0.70.3) 439 | - React-jsiexecutor (= 0.70.3) 440 | - ReactCommon/turbomodule/core (= 0.70.3) 441 | - React-Fabric/components/text (0.70.3): 442 | - RCT-Folly/Fabric (= 2021.07.22.00) 443 | - RCTRequired (= 0.70.3) 444 | - RCTTypeSafety (= 0.70.3) 445 | - React-graphics (= 0.70.3) 446 | - React-jsi (= 0.70.3) 447 | - React-jsiexecutor (= 0.70.3) 448 | - ReactCommon/turbomodule/core (= 0.70.3) 449 | - React-Fabric/components/textinput (0.70.3): 450 | - RCT-Folly/Fabric (= 2021.07.22.00) 451 | - RCTRequired (= 0.70.3) 452 | - RCTTypeSafety (= 0.70.3) 453 | - React-graphics (= 0.70.3) 454 | - React-jsi (= 0.70.3) 455 | - React-jsiexecutor (= 0.70.3) 456 | - ReactCommon/turbomodule/core (= 0.70.3) 457 | - React-Fabric/components/unimplementedview (0.70.3): 458 | - RCT-Folly/Fabric (= 2021.07.22.00) 459 | - RCTRequired (= 0.70.3) 460 | - RCTTypeSafety (= 0.70.3) 461 | - React-graphics (= 0.70.3) 462 | - React-jsi (= 0.70.3) 463 | - React-jsiexecutor (= 0.70.3) 464 | - ReactCommon/turbomodule/core (= 0.70.3) 465 | - React-Fabric/components/view (0.70.3): 466 | - RCT-Folly/Fabric (= 2021.07.22.00) 467 | - RCTRequired (= 0.70.3) 468 | - RCTTypeSafety (= 0.70.3) 469 | - React-graphics (= 0.70.3) 470 | - React-jsi (= 0.70.3) 471 | - React-jsiexecutor (= 0.70.3) 472 | - ReactCommon/turbomodule/core (= 0.70.3) 473 | - Yoga 474 | - React-Fabric/config (0.70.3): 475 | - RCT-Folly/Fabric (= 2021.07.22.00) 476 | - RCTRequired (= 0.70.3) 477 | - RCTTypeSafety (= 0.70.3) 478 | - React-graphics (= 0.70.3) 479 | - React-jsi (= 0.70.3) 480 | - React-jsiexecutor (= 0.70.3) 481 | - ReactCommon/turbomodule/core (= 0.70.3) 482 | - React-Fabric/core (0.70.3): 483 | - RCT-Folly/Fabric (= 2021.07.22.00) 484 | - RCTRequired (= 0.70.3) 485 | - RCTTypeSafety (= 0.70.3) 486 | - React-graphics (= 0.70.3) 487 | - React-jsi (= 0.70.3) 488 | - React-jsiexecutor (= 0.70.3) 489 | - ReactCommon/turbomodule/core (= 0.70.3) 490 | - React-Fabric/debug_core (0.70.3): 491 | - RCT-Folly/Fabric (= 2021.07.22.00) 492 | - RCTRequired (= 0.70.3) 493 | - RCTTypeSafety (= 0.70.3) 494 | - React-graphics (= 0.70.3) 495 | - React-jsi (= 0.70.3) 496 | - React-jsiexecutor (= 0.70.3) 497 | - ReactCommon/turbomodule/core (= 0.70.3) 498 | - React-Fabric/debug_renderer (0.70.3): 499 | - RCT-Folly/Fabric (= 2021.07.22.00) 500 | - RCTRequired (= 0.70.3) 501 | - RCTTypeSafety (= 0.70.3) 502 | - React-graphics (= 0.70.3) 503 | - React-jsi (= 0.70.3) 504 | - React-jsiexecutor (= 0.70.3) 505 | - ReactCommon/turbomodule/core (= 0.70.3) 506 | - React-Fabric/imagemanager (0.70.3): 507 | - RCT-Folly/Fabric (= 2021.07.22.00) 508 | - RCTRequired (= 0.70.3) 509 | - RCTTypeSafety (= 0.70.3) 510 | - React-graphics (= 0.70.3) 511 | - React-jsi (= 0.70.3) 512 | - React-jsiexecutor (= 0.70.3) 513 | - React-RCTImage (= 0.70.3) 514 | - ReactCommon/turbomodule/core (= 0.70.3) 515 | - React-Fabric/leakchecker (0.70.3): 516 | - RCT-Folly/Fabric (= 2021.07.22.00) 517 | - RCTRequired (= 0.70.3) 518 | - RCTTypeSafety (= 0.70.3) 519 | - React-graphics (= 0.70.3) 520 | - React-jsi (= 0.70.3) 521 | - React-jsiexecutor (= 0.70.3) 522 | - ReactCommon/turbomodule/core (= 0.70.3) 523 | - React-Fabric/mounting (0.70.3): 524 | - RCT-Folly/Fabric (= 2021.07.22.00) 525 | - RCTRequired (= 0.70.3) 526 | - RCTTypeSafety (= 0.70.3) 527 | - React-graphics (= 0.70.3) 528 | - React-jsi (= 0.70.3) 529 | - React-jsiexecutor (= 0.70.3) 530 | - ReactCommon/turbomodule/core (= 0.70.3) 531 | - React-Fabric/runtimescheduler (0.70.3): 532 | - RCT-Folly/Fabric (= 2021.07.22.00) 533 | - RCTRequired (= 0.70.3) 534 | - RCTTypeSafety (= 0.70.3) 535 | - React-graphics (= 0.70.3) 536 | - React-jsi (= 0.70.3) 537 | - React-jsiexecutor (= 0.70.3) 538 | - ReactCommon/turbomodule/core (= 0.70.3) 539 | - React-Fabric/scheduler (0.70.3): 540 | - RCT-Folly/Fabric (= 2021.07.22.00) 541 | - RCTRequired (= 0.70.3) 542 | - RCTTypeSafety (= 0.70.3) 543 | - React-graphics (= 0.70.3) 544 | - React-jsi (= 0.70.3) 545 | - React-jsiexecutor (= 0.70.3) 546 | - ReactCommon/turbomodule/core (= 0.70.3) 547 | - React-Fabric/telemetry (0.70.3): 548 | - RCT-Folly/Fabric (= 2021.07.22.00) 549 | - RCTRequired (= 0.70.3) 550 | - RCTTypeSafety (= 0.70.3) 551 | - React-graphics (= 0.70.3) 552 | - React-jsi (= 0.70.3) 553 | - React-jsiexecutor (= 0.70.3) 554 | - ReactCommon/turbomodule/core (= 0.70.3) 555 | - React-Fabric/templateprocessor (0.70.3): 556 | - RCT-Folly/Fabric (= 2021.07.22.00) 557 | - RCTRequired (= 0.70.3) 558 | - RCTTypeSafety (= 0.70.3) 559 | - React-graphics (= 0.70.3) 560 | - React-jsi (= 0.70.3) 561 | - React-jsiexecutor (= 0.70.3) 562 | - ReactCommon/turbomodule/core (= 0.70.3) 563 | - React-Fabric/textlayoutmanager (0.70.3): 564 | - RCT-Folly/Fabric (= 2021.07.22.00) 565 | - RCTRequired (= 0.70.3) 566 | - RCTTypeSafety (= 0.70.3) 567 | - React-Fabric/uimanager 568 | - React-graphics (= 0.70.3) 569 | - React-jsi (= 0.70.3) 570 | - React-jsiexecutor (= 0.70.3) 571 | - ReactCommon/turbomodule/core (= 0.70.3) 572 | - React-Fabric/uimanager (0.70.3): 573 | - RCT-Folly/Fabric (= 2021.07.22.00) 574 | - RCTRequired (= 0.70.3) 575 | - RCTTypeSafety (= 0.70.3) 576 | - React-graphics (= 0.70.3) 577 | - React-jsi (= 0.70.3) 578 | - React-jsiexecutor (= 0.70.3) 579 | - ReactCommon/turbomodule/core (= 0.70.3) 580 | - React-Fabric/utils (0.70.3): 581 | - RCT-Folly/Fabric (= 2021.07.22.00) 582 | - RCTRequired (= 0.70.3) 583 | - RCTTypeSafety (= 0.70.3) 584 | - React-graphics (= 0.70.3) 585 | - React-jsi (= 0.70.3) 586 | - React-jsiexecutor (= 0.70.3) 587 | - ReactCommon/turbomodule/core (= 0.70.3) 588 | - React-graphics (0.70.3): 589 | - RCT-Folly/Fabric (= 2021.07.22.00) 590 | - React-Core/Default (= 0.70.3) 591 | - React-hermes (0.70.3): 592 | - DoubleConversion 593 | - glog 594 | - hermes-engine 595 | - RCT-Folly (= 2021.07.22.00) 596 | - RCT-Folly/Futures (= 2021.07.22.00) 597 | - React-cxxreact (= 0.70.3) 598 | - React-jsi (= 0.70.3) 599 | - React-jsiexecutor (= 0.70.3) 600 | - React-jsinspector (= 0.70.3) 601 | - React-perflogger (= 0.70.3) 602 | - React-jsi (0.70.3): 603 | - boost (= 1.76.0) 604 | - DoubleConversion 605 | - glog 606 | - RCT-Folly (= 2021.07.22.00) 607 | - React-jsi/Default (= 0.70.3) 608 | - React-jsi/Default (0.70.3): 609 | - boost (= 1.76.0) 610 | - DoubleConversion 611 | - glog 612 | - RCT-Folly (= 2021.07.22.00) 613 | - React-jsi/Fabric (0.70.3): 614 | - boost (= 1.76.0) 615 | - DoubleConversion 616 | - glog 617 | - RCT-Folly (= 2021.07.22.00) 618 | - React-jsiexecutor (0.70.3): 619 | - DoubleConversion 620 | - glog 621 | - RCT-Folly (= 2021.07.22.00) 622 | - React-cxxreact (= 0.70.3) 623 | - React-jsi (= 0.70.3) 624 | - React-perflogger (= 0.70.3) 625 | - React-jsinspector (0.70.3) 626 | - React-logger (0.70.3): 627 | - glog 628 | - React-perflogger (0.70.3) 629 | - React-RCTActionSheet (0.70.3): 630 | - React-Core/RCTActionSheetHeaders (= 0.70.3) 631 | - React-RCTAnimation (0.70.3): 632 | - RCT-Folly (= 2021.07.22.00) 633 | - RCTTypeSafety (= 0.70.3) 634 | - React-Codegen (= 0.70.3) 635 | - React-Core/RCTAnimationHeaders (= 0.70.3) 636 | - React-jsi (= 0.70.3) 637 | - ReactCommon/turbomodule/core (= 0.70.3) 638 | - React-RCTBlob (0.70.3): 639 | - RCT-Folly (= 2021.07.22.00) 640 | - React-Codegen (= 0.70.3) 641 | - React-Core/RCTBlobHeaders (= 0.70.3) 642 | - React-Core/RCTWebSocket (= 0.70.3) 643 | - React-jsi (= 0.70.3) 644 | - React-RCTNetwork (= 0.70.3) 645 | - ReactCommon/turbomodule/core (= 0.70.3) 646 | - React-RCTFabric (0.70.3): 647 | - RCT-Folly/Fabric (= 2021.07.22.00) 648 | - React-Core (= 0.70.3) 649 | - React-Fabric (= 0.70.3) 650 | - React-RCTImage (= 0.70.3) 651 | - React-RCTImage (0.70.3): 652 | - RCT-Folly (= 2021.07.22.00) 653 | - RCTTypeSafety (= 0.70.3) 654 | - React-Codegen (= 0.70.3) 655 | - React-Core/RCTImageHeaders (= 0.70.3) 656 | - React-jsi (= 0.70.3) 657 | - React-RCTNetwork (= 0.70.3) 658 | - ReactCommon/turbomodule/core (= 0.70.3) 659 | - React-RCTLinking (0.70.3): 660 | - React-Codegen (= 0.70.3) 661 | - React-Core/RCTLinkingHeaders (= 0.70.3) 662 | - React-jsi (= 0.70.3) 663 | - ReactCommon/turbomodule/core (= 0.70.3) 664 | - React-RCTNetwork (0.70.3): 665 | - RCT-Folly (= 2021.07.22.00) 666 | - RCTTypeSafety (= 0.70.3) 667 | - React-Codegen (= 0.70.3) 668 | - React-Core/RCTNetworkHeaders (= 0.70.3) 669 | - React-jsi (= 0.70.3) 670 | - ReactCommon/turbomodule/core (= 0.70.3) 671 | - React-RCTSettings (0.70.3): 672 | - RCT-Folly (= 2021.07.22.00) 673 | - RCTTypeSafety (= 0.70.3) 674 | - React-Codegen (= 0.70.3) 675 | - React-Core/RCTSettingsHeaders (= 0.70.3) 676 | - React-jsi (= 0.70.3) 677 | - ReactCommon/turbomodule/core (= 0.70.3) 678 | - React-RCTText (0.70.3): 679 | - React-Core/RCTTextHeaders (= 0.70.3) 680 | - React-RCTVibration (0.70.3): 681 | - RCT-Folly (= 2021.07.22.00) 682 | - React-Codegen (= 0.70.3) 683 | - React-Core/RCTVibrationHeaders (= 0.70.3) 684 | - React-jsi (= 0.70.3) 685 | - ReactCommon/turbomodule/core (= 0.70.3) 686 | - React-rncore (0.70.3) 687 | - React-runtimeexecutor (0.70.3): 688 | - React-jsi (= 0.70.3) 689 | - ReactCommon/turbomodule/core (0.70.3): 690 | - DoubleConversion 691 | - glog 692 | - RCT-Folly (= 2021.07.22.00) 693 | - React-bridging (= 0.70.3) 694 | - React-callinvoker (= 0.70.3) 695 | - React-Core (= 0.70.3) 696 | - React-cxxreact (= 0.70.3) 697 | - React-jsi (= 0.70.3) 698 | - React-logger (= 0.70.3) 699 | - React-perflogger (= 0.70.3) 700 | - SocketRocket (0.6.0) 701 | - Yoga (1.14.0) 702 | - YogaKit (1.18.1): 703 | - Yoga (~> 1.14) 704 | 705 | DEPENDENCIES: 706 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 707 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 708 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 709 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 710 | - Flipper (= 0.125.0) 711 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 712 | - Flipper-DoubleConversion (= 3.2.0.1) 713 | - Flipper-Fmt (= 7.1.7) 714 | - Flipper-Folly (= 2.6.10) 715 | - Flipper-Glog (= 0.5.0.5) 716 | - Flipper-PeerTalk (= 0.0.4) 717 | - Flipper-RSocket (= 1.4.3) 718 | - FlipperKit (= 0.125.0) 719 | - FlipperKit/Core (= 0.125.0) 720 | - FlipperKit/CppBridge (= 0.125.0) 721 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0) 722 | - FlipperKit/FBDefines (= 0.125.0) 723 | - FlipperKit/FKPortForwarding (= 0.125.0) 724 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0) 725 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0) 726 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0) 727 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0) 728 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0) 729 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0) 730 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0) 731 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 732 | - hermes-engine (from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`) 733 | - libevent (~> 2.1.12) 734 | - OpenSSL-Universal (= 1.1.1100) 735 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 736 | - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 737 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 738 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 739 | - React (from `../node_modules/react-native/`) 740 | - React-bridging (from `../node_modules/react-native/ReactCommon`) 741 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 742 | - React-Codegen (from `build/generated/ios`) 743 | - React-Core (from `../node_modules/react-native/`) 744 | - React-Core/DevSupport (from `../node_modules/react-native/`) 745 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 746 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 747 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 748 | - React-Fabric (from `../node_modules/react-native/ReactCommon`) 749 | - React-graphics (from `../node_modules/react-native/ReactCommon/react/renderer/graphics`) 750 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`) 751 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 752 | - React-jsi/Fabric (from `../node_modules/react-native/ReactCommon/jsi`) 753 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 754 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 755 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 756 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 757 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 758 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 759 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 760 | - React-RCTFabric (from `../node_modules/react-native/React`) 761 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 762 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 763 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 764 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 765 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 766 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 767 | - React-rncore (from `../node_modules/react-native/ReactCommon`) 768 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 769 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 770 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 771 | 772 | SPEC REPOS: 773 | trunk: 774 | - CocoaAsyncSocket 775 | - Flipper 776 | - Flipper-Boost-iOSX 777 | - Flipper-DoubleConversion 778 | - Flipper-Fmt 779 | - Flipper-Folly 780 | - Flipper-Glog 781 | - Flipper-PeerTalk 782 | - Flipper-RSocket 783 | - FlipperKit 784 | - fmt 785 | - libevent 786 | - OpenSSL-Universal 787 | - SocketRocket 788 | - YogaKit 789 | 790 | EXTERNAL SOURCES: 791 | boost: 792 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 793 | DoubleConversion: 794 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 795 | FBLazyVector: 796 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 797 | FBReactNativeSpec: 798 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 799 | glog: 800 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 801 | hermes-engine: 802 | :podspec: "../node_modules/react-native/sdks/hermes/hermes-engine.podspec" 803 | RCT-Folly: 804 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 805 | RCTRequired: 806 | :path: "../node_modules/react-native/Libraries/RCTRequired" 807 | RCTTypeSafety: 808 | :path: "../node_modules/react-native/Libraries/TypeSafety" 809 | React: 810 | :path: "../node_modules/react-native/" 811 | React-bridging: 812 | :path: "../node_modules/react-native/ReactCommon" 813 | React-callinvoker: 814 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 815 | React-Codegen: 816 | :path: build/generated/ios 817 | React-Core: 818 | :path: "../node_modules/react-native/" 819 | React-CoreModules: 820 | :path: "../node_modules/react-native/React/CoreModules" 821 | React-cxxreact: 822 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 823 | React-Fabric: 824 | :path: "../node_modules/react-native/ReactCommon" 825 | React-graphics: 826 | :path: "../node_modules/react-native/ReactCommon/react/renderer/graphics" 827 | React-hermes: 828 | :path: "../node_modules/react-native/ReactCommon/hermes" 829 | React-jsi: 830 | :path: "../node_modules/react-native/ReactCommon/jsi" 831 | React-jsiexecutor: 832 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 833 | React-jsinspector: 834 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 835 | React-logger: 836 | :path: "../node_modules/react-native/ReactCommon/logger" 837 | React-perflogger: 838 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 839 | React-RCTActionSheet: 840 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 841 | React-RCTAnimation: 842 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 843 | React-RCTBlob: 844 | :path: "../node_modules/react-native/Libraries/Blob" 845 | React-RCTFabric: 846 | :path: "../node_modules/react-native/React" 847 | React-RCTImage: 848 | :path: "../node_modules/react-native/Libraries/Image" 849 | React-RCTLinking: 850 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 851 | React-RCTNetwork: 852 | :path: "../node_modules/react-native/Libraries/Network" 853 | React-RCTSettings: 854 | :path: "../node_modules/react-native/Libraries/Settings" 855 | React-RCTText: 856 | :path: "../node_modules/react-native/Libraries/Text" 857 | React-RCTVibration: 858 | :path: "../node_modules/react-native/Libraries/Vibration" 859 | React-rncore: 860 | :path: "../node_modules/react-native/ReactCommon" 861 | React-runtimeexecutor: 862 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 863 | ReactCommon: 864 | :path: "../node_modules/react-native/ReactCommon" 865 | Yoga: 866 | :path: "../node_modules/react-native/ReactCommon/yoga" 867 | 868 | SPEC CHECKSUMS: 869 | boost: a7c83b31436843459a1961bfd74b96033dc77234 870 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 871 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 872 | FBLazyVector: 3b313c3fb52b597f7a9b430798e6367d2b9f07e5 873 | FBReactNativeSpec: c0b39268611f0be970be1fb056527ffe1322c3fa 874 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 875 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 876 | Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 877 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 878 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 879 | Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446 880 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 881 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 882 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 883 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 884 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b 885 | hermes-engine: bb344d89a0d14c2c91ad357480a79698bb80e186 886 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 887 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c 888 | RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda 889 | RCTRequired: 5cf7e7d2f12699724b59f90350257a422eaa9492 890 | RCTTypeSafety: 3f3ead9673d1ab8bb1aea85b0894ab3220f8f06e 891 | React: 30a333798d1fcf595e8a4108bbaa0f125a655f4a 892 | React-bridging: 92396c03ab446756ddfb7a8e2baff3bcf19eec7d 893 | React-callinvoker: bb66a41b41fa0b7c5f3cc626693a63c9ea0d6252 894 | React-Codegen: 5d4e760e2c16625f4c4b6cabb083c02ddfb9cd6b 895 | React-Core: a689b4d1bd13e15915a05c9918c2b01df96cd811 896 | React-CoreModules: d262214db6b704b042bc5c0735b06c346a371d7f 897 | React-cxxreact: 81d5bf256313bf96cb925eb0e654103291161a17 898 | React-Fabric: eae2bf0596c0f4938074df28fbd0338ca59a6f64 899 | React-graphics: fe9cb66bca543a35c603a041295b54a42436374c 900 | React-hermes: 1c35cbfbdc7a888c3a1aa05e6d0ca004d92c923c 901 | React-jsi: 7f99dc3055bec9a0eeb4230f8b6ac873514c8421 902 | React-jsiexecutor: 7e2e1772ef7b97168c880eeaf3749d8c145ffd6e 903 | React-jsinspector: 0553c9fe7218e1f127be070bd5a4d2fc19fb8190 904 | React-logger: cffcc09e8aba8a3014be8d18da7f922802e9f19e 905 | React-perflogger: 082b4293f0b3914ff41da35a6c06ac4490fcbcc8 906 | React-RCTActionSheet: 83da3030deb5dea54b398129f56540a44e64d3ae 907 | React-RCTAnimation: bac3a4f4c0436554d9f7fbb1352a0cdcb1fb0f1c 908 | React-RCTBlob: d2c8830ac6b4d55d5624469829fe6d0ef1d534d1 909 | React-RCTFabric: 68456988d831a0a464516afde1f242455c3891eb 910 | React-RCTImage: 26ad032b09f90ae5d2283ec19f0c455c444c8189 911 | React-RCTLinking: 4a8d16586df11fff515a6c52ff51a02c47a20499 912 | React-RCTNetwork: 843fc75a70f0b5760de0bf59468585f41209bcf0 913 | React-RCTSettings: 54e59255f94462951b45f84c3f81aedc27cf8615 914 | React-RCTText: c32e2a60827bd232b2bc95941b9926ccf1c2be4c 915 | React-RCTVibration: b9a58ffdd18446f43d493a4b0ecd603ee86be847 916 | React-rncore: 6b3bb462f9d8b23de012a44c838c610977125f31 917 | React-runtimeexecutor: e9b1f9310158a1e265bcdfdfd8c62d6174b947a2 918 | ReactCommon: 01064177e66d652192c661de899b1076da962fd9 919 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 920 | Yoga: 2ed968a4f060a92834227c036279f2736de0fce3 921 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 922 | 923 | PODFILE CHECKSUM: 6f2cf5111ec8cd48f9094c63b7628a72c9604206 924 | 925 | COCOAPODS: 1.11.3 926 | -------------------------------------------------------------------------------- /ios/RustExampleJSI.h: -------------------------------------------------------------------------------- 1 | #import ; 2 | 3 | @interface RustExampleJsi : NSObject ; 4 | 5 | @property (nonatomic, assign) BOOL setBridgeOnMainQueue; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /ios/RustExampleJSI.mm: -------------------------------------------------------------------------------- 1 | #import "RustExampleJsi.h" 2 | #import 3 | #import 4 | #import 5 | #import "rust-example.h" 6 | 7 | @implementation RustExampleJsi 8 | 9 | @synthesize bridge = _bridge; 10 | @synthesize methodQueue = _methodQueue; 11 | 12 | RCT_EXPORT_MODULE() 13 | 14 | + (BOOL)requiresMainQueueSetup { 15 | 16 | return YES; 17 | } 18 | 19 | - (void)setBridge:(RCTBridge *)bridge { 20 | _bridge = bridge; 21 | _setBridgeOnMainQueue = RCTIsMainQueue(); 22 | [self installLibrary]; 23 | } 24 | 25 | - (void)installLibrary { 26 | 27 | RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge; 28 | 29 | if (cxxBridge.runtime) { 30 | rustExample::install(*(facebook::jsi::Runtime *)cxxBridge.runtime); 31 | } 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ios/rawrust.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_LIB 2 | #define TEST_LIB 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int add(int x, int y); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif /* TEST_LIB */ 15 | -------------------------------------------------------------------------------- /ios/rnrust.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* rnrustTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* rnrustTests.m */; }; 11 | 0C80B921A6F3F58F76C31292 /* libPods-rnrust.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-rnrust.a */; }; 12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 6625D597290599A7007A74F9 /* RustExampleJSI.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6625D596290599A7007A74F9 /* RustExampleJSI.mm */; }; 16 | 6625D59B29059A31007A74F9 /* rust-example.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6625D59929059A31007A74F9 /* rust-example.cpp */; }; 17 | 6625D5AA2905B9AC007A74F9 /* libexample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6625D5A92905B9AC007A74F9 /* libexample.a */; }; 18 | 7699B88040F8A987B510C191 /* libPods-rnrust-rnrustTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rnrust-rnrustTests.a */; }; 19 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 28 | remoteInfo = rnrust; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 00E356EE1AD99517003FC87E /* rnrustTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = rnrustTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 00E356F21AD99517003FC87E /* rnrustTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = rnrustTests.m; sourceTree = ""; }; 36 | 13B07F961A680F5B00A75B9A /* rnrust.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rnrust.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = rnrust/AppDelegate.h; sourceTree = ""; }; 38 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = rnrust/AppDelegate.mm; sourceTree = ""; }; 39 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = rnrust/Images.xcassets; sourceTree = ""; }; 40 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = rnrust/Info.plist; sourceTree = ""; }; 41 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = rnrust/main.m; sourceTree = ""; }; 42 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rnrust-rnrustTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rnrust-rnrustTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 3B4392A12AC88292D35C810B /* Pods-rnrust.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnrust.debug.xcconfig"; path = "Target Support Files/Pods-rnrust/Pods-rnrust.debug.xcconfig"; sourceTree = ""; }; 44 | 5709B34CF0A7D63546082F79 /* Pods-rnrust.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnrust.release.xcconfig"; path = "Target Support Files/Pods-rnrust/Pods-rnrust.release.xcconfig"; sourceTree = ""; }; 45 | 5B7EB9410499542E8C5724F5 /* Pods-rnrust-rnrustTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnrust-rnrustTests.debug.xcconfig"; path = "Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests.debug.xcconfig"; sourceTree = ""; }; 46 | 5DCACB8F33CDC322A6C60F78 /* libPods-rnrust.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rnrust.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 6625D596290599A7007A74F9 /* RustExampleJSI.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RustExampleJSI.mm; sourceTree = ""; }; 48 | 6625D598290599D8007A74F9 /* RustExampleJSI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RustExampleJSI.h; sourceTree = ""; }; 49 | 6625D59929059A31007A74F9 /* rust-example.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "rust-example.cpp"; sourceTree = ""; }; 50 | 6625D59A29059A31007A74F9 /* rust-example.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "rust-example.h"; sourceTree = ""; }; 51 | 6625D59E2905A5F7007A74F9 /* libexample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexample.a; path = ../rust/target/debug/libexample.a; sourceTree = ""; }; 52 | 6625D5A02905A8BF007A74F9 /* libexample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexample.a; path = "../rust/target/aarch64-apple-ios/debug/libexample.a"; sourceTree = ""; }; 53 | 6625D5A22905A90B007A74F9 /* libexample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexample.a; path = "../rust/target/aarch64-apple-ios-sim/debug/libexample.a"; sourceTree = ""; }; 54 | 6625D5A42905AAC2007A74F9 /* libexamplecobined.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexamplecobined.a; path = ../rust/libexamplecobined.a; sourceTree = ""; }; 55 | 6625D5A62905AB3C007A74F9 /* libexample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexample.a; path = ../rust/libexample.a; sourceTree = ""; }; 56 | 6625D5A82905B495007A74F9 /* rawrust.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rawrust.h; sourceTree = ""; }; 57 | 6625D5A92905B9AC007A74F9 /* libexample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexample.a; path = "../rust/target/x86_64-apple-ios/debug/libexample.a"; sourceTree = ""; }; 58 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = rnrust/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 89C6BE57DB24E9ADA2F236DE /* Pods-rnrust-rnrustTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnrust-rnrustTests.release.xcconfig"; path = "Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests.release.xcconfig"; sourceTree = ""; }; 60 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 7699B88040F8A987B510C191 /* libPods-rnrust-rnrustTests.a in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 6625D5AA2905B9AC007A74F9 /* libexample.a in Frameworks */, 77 | 0C80B921A6F3F58F76C31292 /* libPods-rnrust.a in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 00E356EF1AD99517003FC87E /* rnrustTests */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 00E356F21AD99517003FC87E /* rnrustTests.m */, 88 | 00E356F01AD99517003FC87E /* Supporting Files */, 89 | ); 90 | path = rnrustTests; 91 | sourceTree = ""; 92 | }; 93 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 00E356F11AD99517003FC87E /* Info.plist */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | 13B07FAE1A68108700A75B9A /* rnrust */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 105 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 106 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 107 | 13B07FB61A68108700A75B9A /* Info.plist */, 108 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 109 | 13B07FB71A68108700A75B9A /* main.m */, 110 | 6625D596290599A7007A74F9 /* RustExampleJSI.mm */, 111 | 6625D598290599D8007A74F9 /* RustExampleJSI.h */, 112 | 6625D59A29059A31007A74F9 /* rust-example.h */, 113 | 6625D59929059A31007A74F9 /* rust-example.cpp */, 114 | 6625D5A82905B495007A74F9 /* rawrust.h */, 115 | ); 116 | name = rnrust; 117 | sourceTree = ""; 118 | }; 119 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 6625D5A62905AB3C007A74F9 /* libexample.a */, 123 | 6625D5A92905B9AC007A74F9 /* libexample.a */, 124 | 6625D5A42905AAC2007A74F9 /* libexamplecobined.a */, 125 | 6625D59E2905A5F7007A74F9 /* libexample.a */, 126 | 6625D5A02905A8BF007A74F9 /* libexample.a */, 127 | 6625D5A22905A90B007A74F9 /* libexample.a */, 128 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 129 | 5DCACB8F33CDC322A6C60F78 /* libPods-rnrust.a */, 130 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rnrust-rnrustTests.a */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | ); 139 | name = Libraries; 140 | sourceTree = ""; 141 | }; 142 | 83CBB9F61A601CBA00E9B192 = { 143 | isa = PBXGroup; 144 | children = ( 145 | 13B07FAE1A68108700A75B9A /* rnrust */, 146 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 147 | 00E356EF1AD99517003FC87E /* rnrustTests */, 148 | 83CBBA001A601CBA00E9B192 /* Products */, 149 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 150 | BBD78D7AC51CEA395F1C20DB /* Pods */, 151 | ); 152 | indentWidth = 2; 153 | sourceTree = ""; 154 | tabWidth = 2; 155 | usesTabs = 0; 156 | }; 157 | 83CBBA001A601CBA00E9B192 /* Products */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 13B07F961A680F5B00A75B9A /* rnrust.app */, 161 | 00E356EE1AD99517003FC87E /* rnrustTests.xctest */, 162 | ); 163 | name = Products; 164 | sourceTree = ""; 165 | }; 166 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 3B4392A12AC88292D35C810B /* Pods-rnrust.debug.xcconfig */, 170 | 5709B34CF0A7D63546082F79 /* Pods-rnrust.release.xcconfig */, 171 | 5B7EB9410499542E8C5724F5 /* Pods-rnrust-rnrustTests.debug.xcconfig */, 172 | 89C6BE57DB24E9ADA2F236DE /* Pods-rnrust-rnrustTests.release.xcconfig */, 173 | ); 174 | path = Pods; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | 00E356ED1AD99517003FC87E /* rnrustTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rnrustTests" */; 183 | buildPhases = ( 184 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 185 | 00E356EA1AD99517003FC87E /* Sources */, 186 | 00E356EB1AD99517003FC87E /* Frameworks */, 187 | 00E356EC1AD99517003FC87E /* Resources */, 188 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, 189 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 195 | ); 196 | name = rnrustTests; 197 | productName = rnrustTests; 198 | productReference = 00E356EE1AD99517003FC87E /* rnrustTests.xctest */; 199 | productType = "com.apple.product-type.bundle.unit-test"; 200 | }; 201 | 13B07F861A680F5B00A75B9A /* rnrust */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rnrust" */; 204 | buildPhases = ( 205 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 206 | FD10A7F022414F080027D42C /* Start Packager */, 207 | 13B07F871A680F5B00A75B9A /* Sources */, 208 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 209 | 13B07F8E1A680F5B00A75B9A /* Resources */, 210 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 211 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 212 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | ); 218 | name = rnrust; 219 | productName = rnrust; 220 | productReference = 13B07F961A680F5B00A75B9A /* rnrust.app */; 221 | productType = "com.apple.product-type.application"; 222 | }; 223 | /* End PBXNativeTarget section */ 224 | 225 | /* Begin PBXProject section */ 226 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 227 | isa = PBXProject; 228 | attributes = { 229 | LastUpgradeCheck = 1340; 230 | TargetAttributes = { 231 | 00E356ED1AD99517003FC87E = { 232 | CreatedOnToolsVersion = 6.2; 233 | TestTargetID = 13B07F861A680F5B00A75B9A; 234 | }; 235 | 13B07F861A680F5B00A75B9A = { 236 | LastSwiftMigration = 1120; 237 | }; 238 | }; 239 | }; 240 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rnrust" */; 241 | compatibilityVersion = "Xcode 12.0"; 242 | developmentRegion = en; 243 | hasScannedForEncodings = 0; 244 | knownRegions = ( 245 | en, 246 | Base, 247 | ); 248 | mainGroup = 83CBB9F61A601CBA00E9B192; 249 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 250 | projectDirPath = ""; 251 | projectRoot = ""; 252 | targets = ( 253 | 13B07F861A680F5B00A75B9A /* rnrust */, 254 | 00E356ED1AD99517003FC87E /* rnrustTests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 00E356EC1AD99517003FC87E /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 272 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXResourcesBuildPhase section */ 277 | 278 | /* Begin PBXShellScriptBuildPhase section */ 279 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputPaths = ( 285 | "$(SRCROOT)/.xcode.env.local", 286 | "$(SRCROOT)/.xcode.env", 287 | ); 288 | name = "Bundle React Native code and images"; 289 | outputPaths = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | shellPath = /bin/sh; 293 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 294 | }; 295 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputFileListPaths = ( 301 | "${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-frameworks-${CONFIGURATION}-input-files.xcfilelist", 302 | ); 303 | name = "[CP] Embed Pods Frameworks"; 304 | outputFileListPaths = ( 305 | "${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-frameworks-${CONFIGURATION}-output-files.xcfilelist", 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | shellPath = /bin/sh; 309 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-frameworks.sh\"\n"; 310 | showEnvVarsInLog = 0; 311 | }; 312 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 313 | isa = PBXShellScriptBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | inputFileListPaths = ( 318 | ); 319 | inputPaths = ( 320 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 321 | "${PODS_ROOT}/Manifest.lock", 322 | ); 323 | name = "[CP] Check Pods Manifest.lock"; 324 | outputFileListPaths = ( 325 | ); 326 | outputPaths = ( 327 | "$(DERIVED_FILE_DIR)/Pods-rnrust-rnrustTests-checkManifestLockResult.txt", 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | shellPath = /bin/sh; 331 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 332 | showEnvVarsInLog = 0; 333 | }; 334 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 335 | isa = PBXShellScriptBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | ); 339 | inputFileListPaths = ( 340 | ); 341 | inputPaths = ( 342 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 343 | "${PODS_ROOT}/Manifest.lock", 344 | ); 345 | name = "[CP] Check Pods Manifest.lock"; 346 | outputFileListPaths = ( 347 | ); 348 | outputPaths = ( 349 | "$(DERIVED_FILE_DIR)/Pods-rnrust-checkManifestLockResult.txt", 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | shellPath = /bin/sh; 353 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 354 | showEnvVarsInLog = 0; 355 | }; 356 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { 357 | isa = PBXShellScriptBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | ); 361 | inputFileListPaths = ( 362 | "${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 363 | ); 364 | name = "[CP] Embed Pods Frameworks"; 365 | outputFileListPaths = ( 366 | "${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 367 | ); 368 | runOnlyForDeploymentPostprocessing = 0; 369 | shellPath = /bin/sh; 370 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-frameworks.sh\"\n"; 371 | showEnvVarsInLog = 0; 372 | }; 373 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 374 | isa = PBXShellScriptBuildPhase; 375 | buildActionMask = 2147483647; 376 | files = ( 377 | ); 378 | inputFileListPaths = ( 379 | "${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-resources-${CONFIGURATION}-input-files.xcfilelist", 380 | ); 381 | name = "[CP] Copy Pods Resources"; 382 | outputFileListPaths = ( 383 | "${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-resources-${CONFIGURATION}-output-files.xcfilelist", 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | shellPath = /bin/sh; 387 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnrust/Pods-rnrust-resources.sh\"\n"; 388 | showEnvVarsInLog = 0; 389 | }; 390 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 391 | isa = PBXShellScriptBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | ); 395 | inputFileListPaths = ( 396 | "${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-resources-${CONFIGURATION}-input-files.xcfilelist", 397 | ); 398 | name = "[CP] Copy Pods Resources"; 399 | outputFileListPaths = ( 400 | "${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-resources-${CONFIGURATION}-output-files.xcfilelist", 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | shellPath = /bin/sh; 404 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnrust-rnrustTests/Pods-rnrust-rnrustTests-resources.sh\"\n"; 405 | showEnvVarsInLog = 0; 406 | }; 407 | FD10A7F022414F080027D42C /* Start Packager */ = { 408 | isa = PBXShellScriptBuildPhase; 409 | buildActionMask = 2147483647; 410 | files = ( 411 | ); 412 | inputFileListPaths = ( 413 | ); 414 | inputPaths = ( 415 | ); 416 | name = "Start Packager"; 417 | outputFileListPaths = ( 418 | ); 419 | outputPaths = ( 420 | ); 421 | runOnlyForDeploymentPostprocessing = 0; 422 | shellPath = /bin/sh; 423 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 424 | showEnvVarsInLog = 0; 425 | }; 426 | /* End PBXShellScriptBuildPhase section */ 427 | 428 | /* Begin PBXSourcesBuildPhase section */ 429 | 00E356EA1AD99517003FC87E /* Sources */ = { 430 | isa = PBXSourcesBuildPhase; 431 | buildActionMask = 2147483647; 432 | files = ( 433 | 00E356F31AD99517003FC87E /* rnrustTests.m in Sources */, 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | }; 437 | 13B07F871A680F5B00A75B9A /* Sources */ = { 438 | isa = PBXSourcesBuildPhase; 439 | buildActionMask = 2147483647; 440 | files = ( 441 | 6625D59B29059A31007A74F9 /* rust-example.cpp in Sources */, 442 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 443 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 444 | 6625D597290599A7007A74F9 /* RustExampleJSI.mm in Sources */, 445 | ); 446 | runOnlyForDeploymentPostprocessing = 0; 447 | }; 448 | /* End PBXSourcesBuildPhase section */ 449 | 450 | /* Begin PBXTargetDependency section */ 451 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 452 | isa = PBXTargetDependency; 453 | target = 13B07F861A680F5B00A75B9A /* rnrust */; 454 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 455 | }; 456 | /* End PBXTargetDependency section */ 457 | 458 | /* Begin XCBuildConfiguration section */ 459 | 00E356F61AD99517003FC87E /* Debug */ = { 460 | isa = XCBuildConfiguration; 461 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-rnrust-rnrustTests.debug.xcconfig */; 462 | buildSettings = { 463 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 464 | BUNDLE_LOADER = "$(TEST_HOST)"; 465 | GCC_PREPROCESSOR_DEFINITIONS = ( 466 | "DEBUG=1", 467 | "$(inherited)", 468 | ); 469 | INFOPLIST_FILE = rnrustTests/Info.plist; 470 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 471 | LD_RUNPATH_SEARCH_PATHS = ( 472 | "$(inherited)", 473 | "@executable_path/Frameworks", 474 | "@loader_path/Frameworks", 475 | ); 476 | OTHER_LDFLAGS = ( 477 | "-ObjC", 478 | "-lc++", 479 | "$(inherited)", 480 | ); 481 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rnrust.app/rnrust"; 484 | }; 485 | name = Debug; 486 | }; 487 | 00E356F71AD99517003FC87E /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-rnrust-rnrustTests.release.xcconfig */; 490 | buildSettings = { 491 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 492 | BUNDLE_LOADER = "$(TEST_HOST)"; 493 | COPY_PHASE_STRIP = NO; 494 | INFOPLIST_FILE = rnrustTests/Info.plist; 495 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 496 | LD_RUNPATH_SEARCH_PATHS = ( 497 | "$(inherited)", 498 | "@executable_path/Frameworks", 499 | "@loader_path/Frameworks", 500 | ); 501 | OTHER_LDFLAGS = ( 502 | "-ObjC", 503 | "-lc++", 504 | "$(inherited)", 505 | ); 506 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 507 | PRODUCT_NAME = "$(TARGET_NAME)"; 508 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rnrust.app/rnrust"; 509 | }; 510 | name = Release; 511 | }; 512 | 13B07F941A680F5B00A75B9A /* Debug */ = { 513 | isa = XCBuildConfiguration; 514 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-rnrust.debug.xcconfig */; 515 | buildSettings = { 516 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 517 | CLANG_ENABLE_MODULES = YES; 518 | CURRENT_PROJECT_VERSION = 1; 519 | ENABLE_BITCODE = NO; 520 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 521 | INFOPLIST_FILE = rnrust/Info.plist; 522 | LD_RUNPATH_SEARCH_PATHS = ( 523 | "$(inherited)", 524 | "@executable_path/Frameworks", 525 | ); 526 | LIBRARY_SEARCH_PATHS = ( 527 | "", 529 | $, 530 | "$(PROJECT_DIR)/../rust/target/x86_64-apple-ios/debug", 531 | ); 532 | "LIBRARY_SEARCH_PATHS[arch=*]" = ( 533 | "$(inherited)", 534 | "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", 535 | "\"${PODS_CONFIGURATION_BUILD_DIR}/CocoaAsyncSocket\"", 536 | "\"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion\"", 537 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper\"", 538 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper-Boost-iOSX\"", 539 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper-Fmt\"", 540 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper-Folly\"", 541 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper-PeerTalk\"", 542 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Flipper-RSocket\"", 543 | "\"${PODS_CONFIGURATION_BUILD_DIR}/FlipperKit\"", 544 | "\"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly\"", 545 | "\"${PODS_CONFIGURATION_BUILD_DIR}/RCTTypeSafety\"", 546 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen\"", 547 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Core\"", 548 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-CoreModules\"", 549 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric\"", 550 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAnimation\"", 551 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTBlob\"", 552 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric\"", 553 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTImage\"", 554 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTLinking\"", 555 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTNetwork\"", 556 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTSettings\"", 557 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTText\"", 558 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTVibration\"", 559 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-bridging\"", 560 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact\"", 561 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics\"", 562 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"", 563 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsi\"", 564 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsiexecutor\"", 565 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector\"", 566 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-logger\"", 567 | "\"${PODS_CONFIGURATION_BUILD_DIR}/React-perflogger\"", 568 | "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon\"", 569 | "\"${PODS_CONFIGURATION_BUILD_DIR}/SocketRocket\"", 570 | "\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"", 571 | "\"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit\"", 572 | "\"${PODS_CONFIGURATION_BUILD_DIR}/fmt\"", 573 | "\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"", 574 | "\"${PODS_CONFIGURATION_BUILD_DIR}/libevent\"", 575 | /usr/lib/swift, 576 | ); 577 | OTHER_LDFLAGS = ( 578 | "$(inherited)", 579 | "-ObjC", 580 | "-lc++", 581 | ); 582 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 583 | PRODUCT_NAME = rnrust; 584 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 585 | SWIFT_VERSION = 5.0; 586 | VERSIONING_SYSTEM = "apple-generic"; 587 | }; 588 | name = Debug; 589 | }; 590 | 13B07F951A680F5B00A75B9A /* Release */ = { 591 | isa = XCBuildConfiguration; 592 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-rnrust.release.xcconfig */; 593 | buildSettings = { 594 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 595 | CLANG_ENABLE_MODULES = YES; 596 | CURRENT_PROJECT_VERSION = 1; 597 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 598 | INFOPLIST_FILE = rnrust/Info.plist; 599 | LD_RUNPATH_SEARCH_PATHS = ( 600 | "$(inherited)", 601 | "@executable_path/Frameworks", 602 | ); 603 | LIBRARY_SEARCH_PATHS = ( 604 | "", 607 | ); 608 | ONLY_ACTIVE_ARCH = YES; 609 | OTHER_LDFLAGS = ( 610 | "$(inherited)", 611 | "-ObjC", 612 | "-lc++", 613 | ); 614 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 615 | PRODUCT_NAME = rnrust; 616 | SWIFT_VERSION = 5.0; 617 | VERSIONING_SYSTEM = "apple-generic"; 618 | }; 619 | name = Release; 620 | }; 621 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 622 | isa = XCBuildConfiguration; 623 | buildSettings = { 624 | ALWAYS_SEARCH_USER_PATHS = NO; 625 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 626 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 627 | CLANG_CXX_LIBRARY = "libc++"; 628 | CLANG_ENABLE_MODULES = YES; 629 | CLANG_ENABLE_OBJC_ARC = YES; 630 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 631 | CLANG_WARN_BOOL_CONVERSION = YES; 632 | CLANG_WARN_COMMA = YES; 633 | CLANG_WARN_CONSTANT_CONVERSION = YES; 634 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 635 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 636 | CLANG_WARN_EMPTY_BODY = YES; 637 | CLANG_WARN_ENUM_CONVERSION = YES; 638 | CLANG_WARN_INFINITE_RECURSION = YES; 639 | CLANG_WARN_INT_CONVERSION = YES; 640 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 641 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 642 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 643 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 644 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 645 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 646 | CLANG_WARN_STRICT_PROTOTYPES = YES; 647 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 648 | CLANG_WARN_UNREACHABLE_CODE = YES; 649 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 650 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 651 | COPY_PHASE_STRIP = NO; 652 | ENABLE_STRICT_OBJC_MSGSEND = YES; 653 | ENABLE_TESTABILITY = YES; 654 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 655 | GCC_C_LANGUAGE_STANDARD = gnu99; 656 | GCC_DYNAMIC_NO_PIC = NO; 657 | GCC_NO_COMMON_BLOCKS = YES; 658 | GCC_OPTIMIZATION_LEVEL = 0; 659 | GCC_PREPROCESSOR_DEFINITIONS = ( 660 | "DEBUG=1", 661 | "$(inherited)", 662 | ); 663 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 664 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 665 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 666 | GCC_WARN_UNDECLARED_SELECTOR = YES; 667 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 668 | GCC_WARN_UNUSED_FUNCTION = YES; 669 | GCC_WARN_UNUSED_VARIABLE = YES; 670 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 671 | LD_RUNPATH_SEARCH_PATHS = ( 672 | /usr/lib/swift, 673 | "$(inherited)", 674 | ); 675 | LIBRARY_SEARCH_PATHS = ( 676 | "\"$(SDKROOT)/usr/lib/swift\"", 677 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 678 | "\"$(inherited)\"", 679 | ); 680 | MTL_ENABLE_DEBUG_INFO = YES; 681 | ONLY_ACTIVE_ARCH = YES; 682 | OTHER_CPLUSPLUSFLAGS = ( 683 | "$(OTHER_CFLAGS)", 684 | "-DFOLLY_NO_CONFIG", 685 | "-DFOLLY_MOBILE=1", 686 | "-DFOLLY_USE_LIBCPP=1", 687 | ); 688 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 689 | SDKROOT = iphoneos; 690 | }; 691 | name = Debug; 692 | }; 693 | 83CBBA211A601CBA00E9B192 /* Release */ = { 694 | isa = XCBuildConfiguration; 695 | buildSettings = { 696 | ALWAYS_SEARCH_USER_PATHS = NO; 697 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 698 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 699 | CLANG_CXX_LIBRARY = "libc++"; 700 | CLANG_ENABLE_MODULES = YES; 701 | CLANG_ENABLE_OBJC_ARC = YES; 702 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 703 | CLANG_WARN_BOOL_CONVERSION = YES; 704 | CLANG_WARN_COMMA = YES; 705 | CLANG_WARN_CONSTANT_CONVERSION = YES; 706 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 707 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 708 | CLANG_WARN_EMPTY_BODY = YES; 709 | CLANG_WARN_ENUM_CONVERSION = YES; 710 | CLANG_WARN_INFINITE_RECURSION = YES; 711 | CLANG_WARN_INT_CONVERSION = YES; 712 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 713 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 714 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 715 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 716 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 717 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 718 | CLANG_WARN_STRICT_PROTOTYPES = YES; 719 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 720 | CLANG_WARN_UNREACHABLE_CODE = YES; 721 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 722 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 723 | COPY_PHASE_STRIP = YES; 724 | ENABLE_NS_ASSERTIONS = NO; 725 | ENABLE_STRICT_OBJC_MSGSEND = YES; 726 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 727 | GCC_C_LANGUAGE_STANDARD = gnu99; 728 | GCC_NO_COMMON_BLOCKS = YES; 729 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 730 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 731 | GCC_WARN_UNDECLARED_SELECTOR = YES; 732 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 733 | GCC_WARN_UNUSED_FUNCTION = YES; 734 | GCC_WARN_UNUSED_VARIABLE = YES; 735 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 736 | LD_RUNPATH_SEARCH_PATHS = ( 737 | /usr/lib/swift, 738 | "$(inherited)", 739 | ); 740 | LIBRARY_SEARCH_PATHS = ( 741 | "\"$(SDKROOT)/usr/lib/swift\"", 742 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 743 | "\"$(inherited)\"", 744 | ); 745 | MTL_ENABLE_DEBUG_INFO = NO; 746 | OTHER_CPLUSPLUSFLAGS = ( 747 | "$(OTHER_CFLAGS)", 748 | "-DFOLLY_NO_CONFIG", 749 | "-DFOLLY_MOBILE=1", 750 | "-DFOLLY_USE_LIBCPP=1", 751 | ); 752 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 753 | SDKROOT = iphoneos; 754 | VALIDATE_PRODUCT = YES; 755 | }; 756 | name = Release; 757 | }; 758 | /* End XCBuildConfiguration section */ 759 | 760 | /* Begin XCConfigurationList section */ 761 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rnrustTests" */ = { 762 | isa = XCConfigurationList; 763 | buildConfigurations = ( 764 | 00E356F61AD99517003FC87E /* Debug */, 765 | 00E356F71AD99517003FC87E /* Release */, 766 | ); 767 | defaultConfigurationIsVisible = 0; 768 | defaultConfigurationName = Release; 769 | }; 770 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rnrust" */ = { 771 | isa = XCConfigurationList; 772 | buildConfigurations = ( 773 | 13B07F941A680F5B00A75B9A /* Debug */, 774 | 13B07F951A680F5B00A75B9A /* Release */, 775 | ); 776 | defaultConfigurationIsVisible = 0; 777 | defaultConfigurationName = Release; 778 | }; 779 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rnrust" */ = { 780 | isa = XCConfigurationList; 781 | buildConfigurations = ( 782 | 83CBBA201A601CBA00E9B192 /* Debug */, 783 | 83CBBA211A601CBA00E9B192 /* Release */, 784 | ); 785 | defaultConfigurationIsVisible = 0; 786 | defaultConfigurationName = Release; 787 | }; 788 | /* End XCConfigurationList section */ 789 | }; 790 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 791 | } 792 | -------------------------------------------------------------------------------- /ios/rnrust.xcodeproj/xcshareddata/xcschemes/rnrust.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ios/rnrust.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/rnrust.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/rnrust/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /ios/rnrust/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 20 | 21 | @interface AppDelegate () { 22 | RCTTurboModuleManager *_turboModuleManager; 23 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 24 | std::shared_ptr _reactNativeConfig; 25 | facebook::react::ContextContainer::Shared _contextContainer; 26 | } 27 | @end 28 | #endif 29 | 30 | @implementation AppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | RCTAppSetupPrepareApp(application); 35 | 36 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 37 | 38 | #if RCT_NEW_ARCH_ENABLED 39 | _contextContainer = std::make_shared(); 40 | _reactNativeConfig = std::make_shared(); 41 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 42 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 43 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 44 | #endif 45 | 46 | NSDictionary *initProps = [self prepareInitialProps]; 47 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"rnrust", initProps); 48 | 49 | if (@available(iOS 13.0, *)) { 50 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 51 | } else { 52 | rootView.backgroundColor = [UIColor whiteColor]; 53 | } 54 | 55 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 56 | UIViewController *rootViewController = [UIViewController new]; 57 | rootViewController.view = rootView; 58 | self.window.rootViewController = rootViewController; 59 | [self.window makeKeyAndVisible]; 60 | return YES; 61 | } 62 | 63 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 64 | /// 65 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 66 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 67 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 68 | - (BOOL)concurrentRootEnabled 69 | { 70 | // Switch this bool to turn on and off the concurrent root 71 | return true; 72 | } 73 | 74 | - (NSDictionary *)prepareInitialProps 75 | { 76 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 77 | 78 | #ifdef RCT_NEW_ARCH_ENABLED 79 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 80 | #endif 81 | 82 | return initProps; 83 | } 84 | 85 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 86 | { 87 | #if DEBUG 88 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 89 | #else 90 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 91 | #endif 92 | } 93 | 94 | #if RCT_NEW_ARCH_ENABLED 95 | 96 | #pragma mark - RCTCxxBridgeDelegate 97 | 98 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 99 | { 100 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 101 | delegate:self 102 | jsInvoker:bridge.jsCallInvoker]; 103 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 104 | } 105 | 106 | #pragma mark RCTTurboModuleManagerDelegate 107 | 108 | - (Class)getModuleClassFromName:(const char *)name 109 | { 110 | return RCTCoreModulesClassProvider(name); 111 | } 112 | 113 | - (std::shared_ptr)getTurboModule:(const std::string &)name 114 | jsInvoker:(std::shared_ptr)jsInvoker 115 | { 116 | return nullptr; 117 | } 118 | 119 | - (std::shared_ptr)getTurboModule:(const std::string &)name 120 | initParams: 121 | (const facebook::react::ObjCTurboModule::InitParams &)params 122 | { 123 | return nullptr; 124 | } 125 | 126 | - (id)getModuleInstanceFromClass:(Class)moduleClass 127 | { 128 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 129 | } 130 | 131 | #endif 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /ios/rnrust/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ios/rnrust/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/rnrust/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | rnrust 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ios/rnrust/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/rnrust/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ios/rnrustTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/rnrustTests/rnrustTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface rnrustTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation rnrustTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /ios/rust-example.cpp: -------------------------------------------------------------------------------- 1 | #include "rust-example.h" 2 | #include 3 | #include "rawrust.h" 4 | 5 | using namespace facebook::jsi; 6 | using namespace std; 7 | 8 | namespace rustExample { 9 | void install(Runtime & jsiRuntime) { 10 | auto addWrapper = Function::createFromHostFunction( 11 | jsiRuntime, PropNameID::forAscii(jsiRuntime, "addInRust"), 2, 12 | [](Runtime &runtime, const Value &thisValue, const Value *arguments, 13 | size_t count) -> Value { 14 | int x = arguments[0].getNumber(); 15 | int y = arguments[1].getNumber(); 16 | return Value(add(x, y)); 17 | }); 18 | 19 | jsiRuntime.global().setProperty(jsiRuntime, "addInRust", move(addWrapper)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/rust-example.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace facebook::jsi; 4 | 5 | namespace rustExample { 6 | void install(Runtime & jsiRuntime); 7 | } 8 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rnrust", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "react": "18.1.0", 14 | "react-native": "0.70.3" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.12.9", 18 | "@babel/runtime": "^7.12.5", 19 | "@react-native-community/eslint-config": "^2.0.0", 20 | "babel-jest": "^26.6.3", 21 | "eslint": "^7.32.0", 22 | "jest": "^26.6.3", 23 | "metro-react-native-babel-preset": "0.72.3", 24 | "react-test-renderer": "18.1.0" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rust/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | 10 | # These are backup files generated by rustfmt 11 | **/*.rs.bk 12 | 13 | # MSVC Windows builds of rustc generate these, which store debugging information 14 | *.pdb 15 | -------------------------------------------------------------------------------- /rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "example" 4 | ] 5 | -------------------------------------------------------------------------------- /rust/example/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "example" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | crate-type = ["staticlib"] 8 | -------------------------------------------------------------------------------- /rust/example/src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::os::raw::c_int; 2 | 3 | #[no_mangle] 4 | pub extern "C" fn add(a: c_int, b: c_int) -> c_int { 5 | a + b 6 | } 7 | -------------------------------------------------------------------------------- /rust/main.cpp: -------------------------------------------------------------------------------- 1 | #include "test_lib.h" 2 | #include 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | int sum = add(3,5); 7 | std::cout << "Sum = " << sum; 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /rust/test_lib.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_LIB 2 | #define TEST_LIB 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void greetings(); 9 | int add(int x, int y); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif /* TEST_LIB */ 16 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osdnk/react-native-jsi-meets-rust/1a5f0a3f007a74506aeeffd843247efd11a970af/screenshot.png --------------------------------------------------------------------------------