Skip to content

Commit

Permalink
enable expo modules
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Sep 10, 2024
1 parent 497b98e commit 3f7d5d2
Show file tree
Hide file tree
Showing 14 changed files with 2,128 additions and 216 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@ InjectedJSBundle.js.LICENSE.txt
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo
dist/
web-build/
7 changes: 6 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
}

/**
* Set this to true to create two separate APKs instead of one:
Expand Down
17 changes: 13 additions & 4 deletions android/app/src/main/java/me/rainbow/MainApplication.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package me.rainbow
import android.content.res.Configuration
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper

import android.app.Application
import android.content.Context
Expand All @@ -24,7 +27,7 @@ import me.rainbow.NativeModules.SystemNavigationBar.SystemNavigationBarPackage
import me.rainbow.NativeModules.NavbarHeight.NavbarHeightPackage

class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) {
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(this, object : DefaultReactNativeHost(this) {
override fun getUseDeveloperSupport(): Boolean {
return BuildConfig.DEBUG
}
Expand All @@ -47,14 +50,14 @@ class MainApplication : Application(), ReactApplication {
}

override fun getJSMainModuleName(): String {
return "index"
return ".expo/.virtual-metro-entry"
}

override val isNewArchEnabled: Boolean
get() = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean
get() = BuildConfig.IS_HERMES_ENABLED
}
})

override fun onCreate() {
super.onCreate()
Expand All @@ -67,12 +70,18 @@ class MainApplication : Application(), ReactApplication {
// Branch logging for debugging
RNBranchModule.enableLogging()
RNBranchModule.getAutoInstance(this)
}
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}

companion object {
private val START_MARK = System.currentTimeMillis()
private lateinit var appContext: Context

fun getAppContext(): Context = appContext
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}
}
3 changes: 3 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ include ':detox'
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')

includeBuild('../node_modules/@react-native/gradle-plugin')

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = function (api) {
},
],
'babel-plugin-styled-components',
'@babel/plugin-transform-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'date-fns',
'graphql-tag',
Expand Down
9 changes: 9 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
platform :ios, '15.0'
source 'https://github.com/CocoaPods/Specs.git'
#use_modular_headers!
Expand Down Expand Up @@ -36,6 +37,14 @@ end

target 'Rainbow' do

use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
# Pods for Rainbow
config = use_native_modules!

Expand Down
109 changes: 97 additions & 12 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,47 @@ PODS:
- CoinbaseWalletSDK/Client (1.1.0)
- CoinbaseWalletSDK/Host (1.1.0):
- CoinbaseWalletSDK/Client
- ComputableLayout (0.7.0):
- DGSwiftUtilities (~> 0.11)
- ContextMenuAuxiliaryPreview (0.4.0):
- DGSwiftUtilities (~> 0.13)
- DGSwiftUtilities (0.28.0)
- DoubleConversion (1.1.6)
- EXConstants (16.0.2):
- ExpoModulesCore
- Expo (51.0.32):
- ExpoModulesCore
- ExpoAsset (10.0.10):
- ExpoModulesCore
- ExpoFileSystem (17.0.1):
- ExpoModulesCore
- ExpoFont (12.0.10):
- ExpoModulesCore
- ExpoKeepAwake (13.0.2):
- ExpoModulesCore
- ExpoModulesCore (1.12.24):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsinspector
- React-NativeModulesApple
- React-RCTAppDelegate
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- FasterImage (1.6.2):
- FasterImage/Nuke (= 1.6.2)
- FasterImage/NukeUI (= 1.6.2)
Expand Down Expand Up @@ -1200,8 +1240,6 @@ PODS:
- Yoga
- react-native-get-random-values (1.5.0):
- React
- react-native-ios-context-menu (1.15.3):
- React-Core
- react-native-mail (4.1.0):
- React
- react-native-menu (1.0.3):
Expand Down Expand Up @@ -1579,6 +1617,15 @@ PODS:
- React-utils (= 0.74.3)
- ReactNativeDarkMode (0.2.2):
- React
- ReactNativeIosContextMenu (2.5.1):
- ContextMenuAuxiliaryPreview (~> 0.3)
- DGSwiftUtilities
- ExpoModulesCore
- ReactNativeIosUtilities
- ReactNativeIosUtilities (4.5.0):
- ComputableLayout (~> 0.7)
- DGSwiftUtilities (~> 0.27)
- ExpoModulesCore
- rn-fetch-blob (0.12.0):
- React-Core
- RNBootSplash (5.5.3):
Expand Down Expand Up @@ -1766,11 +1813,11 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNSentry (5.22.0):
- RNSentry (5.24.1):
- hermes-engine
- React-Core
- React-hermes
- Sentry/HybridSDK (= 8.24.0)
- Sentry/HybridSDK (= 8.29.1)
- RNShare (8.2.1):
- React-Core
- RNSound (0.11.2):
Expand All @@ -1792,7 +1839,7 @@ PODS:
- SDWebImageWebPCoder (0.14.6):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17)
- Sentry/HybridSDK (8.24.0)
- Sentry/HybridSDK (8.29.1)
- Shimmer (1.0.2)
- SocketRocket (0.7.0)
- SRSRadialGradient (1.0.10):
Expand All @@ -1816,6 +1863,13 @@ DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- BVLinearGradient (from `../node_modules/react-native-linear-gradient`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- EXConstants (from `../node_modules/expo-constants/ios`)
- Expo (from `../node_modules/expo`)
- ExpoAsset (from `../node_modules/expo-asset/ios`)
- ExpoFileSystem (from `../node_modules/expo-file-system/ios`)
- ExpoFont (from `../node_modules/expo-font/ios`)
- ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
- "FasterImage (from `../node_modules/@candlefinance/faster-image`)"
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- Firebase
Expand Down Expand Up @@ -1875,7 +1929,6 @@ DEPENDENCIES:
- react-native-cloud-fs (from `../node_modules/react-native-cloud-fs`)
- "react-native-compat (from `../node_modules/@walletconnect/react-native-compat`)"
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- react-native-ios-context-menu (from `../node_modules/react-native-ios-context-menu`)
- react-native-mail (from `../node_modules/react-native-mail`)
- "react-native-menu (from `../node_modules/@react-native-menu/menu`)"
- react-native-minimizer (from `../node_modules/react-native-minimizer`)
Expand Down Expand Up @@ -1921,6 +1974,8 @@ DEPENDENCIES:
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- ReactNativeDarkMode (from `../node_modules/react-native-dark-mode`)
- ReactNativeIosContextMenu (from `../node_modules/react-native-ios-context-menu`)
- ReactNativeIosUtilities (from `../node_modules/react-native-ios-utilities`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- RNBootSplash (from `../node_modules/react-native-bootsplash`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
Expand Down Expand Up @@ -1964,6 +2019,9 @@ SPEC REPOS:
- Branch
- CocoaAsyncSocket
- CoinbaseWalletSDK
- ComputableLayout
- ContextMenuAuxiliaryPreview
- DGSwiftUtilities
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
Expand Down Expand Up @@ -2004,6 +2062,20 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-linear-gradient"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXConstants:
:path: "../node_modules/expo-constants/ios"
Expo:
:path: "../node_modules/expo"
ExpoAsset:
:path: "../node_modules/expo-asset/ios"
ExpoFileSystem:
:path: "../node_modules/expo-file-system/ios"
ExpoFont:
:path: "../node_modules/expo-font/ios"
ExpoKeepAwake:
:path: "../node_modules/expo-keep-awake/ios"
ExpoModulesCore:
:path: "../node_modules/expo-modules-core"
FasterImage:
:path: "../node_modules/@candlefinance/faster-image"
FBLazyVector:
Expand Down Expand Up @@ -2096,8 +2168,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/@walletconnect/react-native-compat"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
react-native-ios-context-menu:
:path: "../node_modules/react-native-ios-context-menu"
react-native-mail:
:path: "../node_modules/react-native-mail"
react-native-menu:
Expand Down Expand Up @@ -2188,6 +2258,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon"
ReactNativeDarkMode:
:path: "../node_modules/react-native-dark-mode"
ReactNativeIosContextMenu:
:path: "../node_modules/react-native-ios-context-menu"
ReactNativeIosUtilities:
:path: "../node_modules/react-native-ios-utilities"
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNBootSplash:
Expand Down Expand Up @@ -2268,7 +2342,17 @@ SPEC CHECKSUMS:
BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
CoinbaseWalletSDK: bd6aa4f5a6460d4279e09e115969868e134126fb
ComputableLayout: c50faffac4ed9f8f05b0ce5e6f3a60df1f6042c8
ContextMenuAuxiliaryPreview: 484e47f66bcb9ffe485b5e7e34cc968ff3218a9f
DGSwiftUtilities: 1f2722e8b2442dc11c17b66818f62b93780e95fd
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
EXConstants: 409690fbfd5afea964e5e9d6c4eb2c2b59222c59
Expo: 33132a667698a3259a4e6c0af1b4936388e5fa33
ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875
ExpoFileSystem: 80bfe850b1f9922c16905822ecbf97acd711dc51
ExpoFont: 00756e6c796d8f7ee8d211e29c8b619e75cbf238
ExpoKeepAwake: 3b8815d9dd1d419ee474df004021c69fdd316d08
ExpoModulesCore: f30a203ff1863bab3dd9f4421e7fc1564797f18a
FasterImage: af05a76f042ca3654c962b658fdb01cb4d31caee
FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
Expand Down Expand Up @@ -2336,7 +2420,6 @@ SPEC CHECKSUMS:
react-native-cloud-fs: c90379f513b8d7ad5cfed610ccf50f27d837016e
react-native-compat: 408a4b320fa4426f2c25ab74ed5764be6b3eb5aa
react-native-get-random-values: 1404bd5cc0ab0e287f75ee1c489555688fc65f89
react-native-ios-context-menu: e529171ba760a1af7f2ef0729f5a7f4d226171c5
react-native-mail: a864fb211feaa5845c6c478a3266de725afdce89
react-native-menu: 2e368669c7375dd1049ef3c7b2cab190ebe45d9e
react-native-minimizer: b94809a769ac3825b46fd081d4f0ae2560791536
Expand Down Expand Up @@ -2382,6 +2465,8 @@ SPEC CHECKSUMS:
React-utils: a06061b3887c702235d2dac92dacbd93e1ea079e
ReactCommon: f00e436b3925a7ae44dfa294b43ef360fbd8ccc4
ReactNativeDarkMode: 0178ffca3b10f6a7c9f49d6f9810232b328fa949
ReactNativeIosContextMenu: e5f972174bd78ab3a552bd6ee4745762ffaa42b3
ReactNativeIosUtilities: 8ea45df073a05d24b9fd75e4ec5fe1de19051466
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNBootSplash: e025d4ee98d942ee6c8b495a6fe66339a6b5f6dd
RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c
Expand All @@ -2406,7 +2491,7 @@ SPEC CHECKSUMS:
RNReanimated: 45553a3ae29a75a76269595f8554d07d4090e392
RNRudderSdk: 805d4b7064714f3295bf5f152d3812cc67f67a93
RNScreens: aa943ad421c3ced3ef5a47ede02b0cbfc43a012e
RNSentry: 7ae2a06a5563de39ec09dcb1e751ac0c67f1883c
RNSentry: e9aa15bb2f3e18c822c002eea13bbd3b222ab493
RNShare: eaee3dd5a06dad397c7d3b14762007035c5de405
RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852
RNSVG: 5da7a24f31968ec74f0b091e3440080f347e279b
Expand All @@ -2416,7 +2501,7 @@ SPEC CHECKSUMS:
RudderKit: f272f9872183946452ac94cd7bb2244a71e6ca8f
SDWebImage: 2d6d229046fea284d62e36bfb8ebe8287dfc5b10
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
Sentry: 2f6baed15a3f8056b875fc903dc3dcb2903117f4
Sentry: c446963245407030e17f1b926a83c6337dc99f4e
Shimmer: c5374be1c2b0c9e292fb05b339a513cf291cac86
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
SRSRadialGradient: e5a34825dff88c9cf773b58bf39ed6a02e59a084
Expand All @@ -2427,6 +2512,6 @@ SPEC CHECKSUMS:
VisionCamera: 2af28201c3de77245f8c58b7a5274d5979df70df
Yoga: 04f1db30bb810187397fa4c37dd1868a27af229c

PODFILE CHECKSUM: 0839e4141c8f26133bf9a961f5ded1ea3127af54
PODFILE CHECKSUM: bd6e30a2fd266823d92c74c348a321b9a31a9185

COCOAPODS: 1.14.3
1 change: 1 addition & 0 deletions ios/Rainbow-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

#import "React/RCTBridgeModule.h"
#import <Expo/Expo.h>
#import "React/RCTView.h"

#import <SDWebImage/SDWebImage.h>
Expand Down
Loading

0 comments on commit 3f7d5d2

Please sign in to comment.