Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add required changes to run Hybrid App #32471

Merged
merged 74 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
595a1b0
add required changes to run hybrid app
staszekscp Dec 5, 2023
75ab2aa
merge main
staszekscp Dec 5, 2023
cd14eca
update comment for appjs prop
staszekscp Dec 5, 2023
a818a6b
move InitialUrlContext
staszekscp Dec 5, 2023
0e228ca
add short explanation to InitialurlContext
staszekscp Dec 5, 2023
3ab29cc
add last lint to async storage patch
staszekscp Dec 5, 2023
7ce5254
remove line from App.js
staszekscp Dec 5, 2023
4da5437
run prettier
staszekscp Dec 5, 2023
d33702c
cleanup
staszekscp Dec 5, 2023
ae2bec1
improve if statement
staszekscp Dec 5, 2023
7796468
rename ReactNativeModule to HybridAppModule
staszekscp Dec 5, 2023
405c29b
update patch for onfido
staszekscp Dec 5, 2023
4865330
add way to go back to Expensify Classic
staszekscp Dec 6, 2023
c75ea56
tweak BootSplash to work with Hybrid App
staszekscp Dec 6, 2023
4dc32d4
switch to lodash filter
staszekscp Dec 6, 2023
0d253f3
Merge branch 'main' into hybrid-app-changes
staszekscp Dec 6, 2023
b53412c
update InitialUrlContext
staszekscp Dec 6, 2023
fd1e644
upgrade async storage and remove patch
staszekscp Dec 7, 2023
d8c311e
merge main
staszekscp Jan 4, 2024
c3de7d1
bump minor of vision camera
staszekscp Jan 8, 2024
a7e9e5a
add patches and fixes for expo
staszekscp Jan 8, 2024
d17163a
one more fix
staszekscp Jan 8, 2024
d21b2fc
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 8, 2024
d9755ab
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 9, 2024
1c1fa26
fix patch
staszekscp Jan 10, 2024
3775816
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 10, 2024
812dd2f
update commend
staszekscp Jan 11, 2024
402e85f
add quick fix for nav
staszekscp Jan 11, 2024
5eb8bd0
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 15, 2024
e2173e1
apply changes to work with rn 73
staszekscp Jan 16, 2024
fcae238
fix nav
staszekscp Jan 16, 2024
6f91c90
fix lint type
staszekscp Jan 16, 2024
f6d681c
fix nav
staszekscp Jan 16, 2024
20cef42
prettier
staszekscp Jan 16, 2024
af0257b
adjustments
staszekscp Jan 16, 2024
a41114b
fix patches
staszekscp Jan 16, 2024
cb27d13
fix cli patch
staszekscp Jan 16, 2024
2e905f7
fix nav for smart scan hybrid
staszekscp Jan 17, 2024
a3c1eab
clean up
staszekscp Jan 18, 2024
ec972f6
remove console.log
staszekscp Jan 18, 2024
2864252
merge main
staszekscp Jan 18, 2024
c564b5c
prettier
staszekscp Jan 18, 2024
cafec68
fiox linter
staszekscp Jan 18, 2024
8d79efb
fix tsc?
staszekscp Jan 18, 2024
b6b4232
one more fix
staszekscp Jan 18, 2024
7a620e8
patch fix
staszekscp Jan 23, 2024
0068fbf
add required changes
staszekscp Jan 23, 2024
5fa274f
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 23, 2024
752e63f
rename patches
staszekscp Jan 24, 2024
55dfa61
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 24, 2024
60a55e1
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 24, 2024
a1f0a7a
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 25, 2024
4a1e9a9
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 29, 2024
b09b724
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 30, 2024
9aaeee5
Merge branch 'main' into hybrid-app-changes
staszekscp Jan 30, 2024
cad6895
test
staszekscp Jan 30, 2024
4c681ef
test
staszekscp Jan 30, 2024
03e2989
test
staszekscp Jan 30, 2024
764750a
merge main
staszekscp Jan 31, 2024
e82fb3f
test
staszekscp Jan 31, 2024
0969d3f
Merge branch 'main' into hybrid-app-changes
staszekscp Feb 1, 2024
279cf98
update patch
staszekscp Feb 1, 2024
76faeb7
Merge branch 'main' into hybrid-app-changes
staszekscp Feb 1, 2024
491242c
Merge branch 'main' into hybrid-app-changes
staszekscp Feb 1, 2024
1b5ff0a
merge main
staszekscp Feb 2, 2024
50777d7
Merge branch 'main' into hybrid-app-changes
staszekscp Feb 5, 2024
61c39c5
update patch name
staszekscp Feb 5, 2024
71d628f
fix
staszekscp Feb 5, 2024
ae20949
fix git statement
staszekscp Feb 5, 2024
b0006f9
update package.json wth fix to markdown
staszekscp Feb 5, 2024
f67424c
merge main
staszekscp Feb 6, 2024
7f6464b
commit podfile.lock
staszekscp Feb 6, 2024
46a7474
commit podfile.lock
staszekscp Feb 6, 2024
55ea149
update podfile.lock
staszekscp Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<!-- If these colors are changed, we must add them to HybridApp also -->
<color name="bootsplash_background">#03D47C</color>
<color name="white">#FFFFFF</color>
<color name="accent">#03D47C</color>
Expand Down
1 change: 1 addition & 0 deletions ios/NewExpensify/RCTBootSplash.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@interface RCTBootSplash : NSObject <RCTBridgeModule>

+ (void)invalidateBootSplash;
+ (void)initWithStoryboard:(NSString * _Nonnull)storyboardName
rootView:(RCTRootView * _Nullable)rootView;

Expand Down
9 changes: 9 additions & 0 deletions ios/NewExpensify/RCTBootSplash.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ - (dispatch_queue_t)methodQueue {
return dispatch_get_main_queue();
}

+ (void)invalidateBootSplash {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you call it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While leaving NewDot - in OldDot we use reference to this file, and we call it in ReactNativeManager's close function. It is used to revert BootSplash to initial state, so it shows up again when NewDot gets opened multiple times.

_resolverQueue = nil;
_rootView = nil;
_nativeHidden = false;
}

+ (void)initWithStoryboard:(NSString * _Nonnull)storyboardName
rootView:(RCTRootView * _Nullable)rootView {
if (rootView == nil || _rootView != nil || RCTRunningInAppExtension())
Expand Down Expand Up @@ -102,6 +108,9 @@ + (void)onContentDidAppear {
block:^(NSTimer * _Nonnull timer) {
[timer invalidate];

if (_rootView == nil)
return;

if (_resolverQueue == nil)
_resolverQueue = [[NSMutableArray alloc] init];

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@kie/mock-github": "^1.0.0",
"@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52",
"@onfido/react-native-sdk": "8.3.0",
"@react-native-async-storage/async-storage": "^1.19.5",
"@react-native-async-storage/async-storage": "1.21.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this change for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was required, because of a native dependency called room in HybridApp

"@react-native-camera-roll/camera-roll": "5.4.0",
"@react-native-clipboard/clipboard": "^1.12.1",
"@react-native-community/geolocation": "^3.0.6",
Expand Down Expand Up @@ -161,7 +161,7 @@
"react-native-tab-view": "^3.5.2",
"react-native-url-polyfill": "^2.0.0",
"react-native-view-shot": "3.8.0",
"react-native-vision-camera": "^2.16.2",
"react-native-vision-camera": "2.16.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this change for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was required, because of some C++ errors during build on android in HybridApp

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: this will be updated to v3 in #28914

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also updates iOS pod. Please commit Podfile.lock

Screenshot 2024-02-02 at 10 29 25 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version bump caused deploy blocker - #36098.
@staszekscp can you please check urgently?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some C++ errors during build on android in HybridApp

Which version fixed this? among 2.16.3, 2.16.4, 2.16.5

And from which version #36098 started happening?

"react-native-web": "^0.19.9",
"react-native-web-linear-gradient": "^1.1.2",
"react-native-webview": "13.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ index 3a1a548..fe030bb 100644

android {
- compileSdkVersion 28
+ compileSdkVersion 30
+ compileSdkVersion 34
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 16
- targetSdkVersion 28
+ targetSdkVersion 30
+ targetSdkVersion 34
versionCode 1
versionName "1.0"
}
15 changes: 15 additions & 0 deletions patches/@react-native-camera-roll+camera-roll+5.4.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
index 3f76132..63dc946 100644
--- a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
+++ b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle
@@ -81,7 +81,9 @@ def findNodeModulePath(baseDir, packageName) {
}

def resolveReactNativeDirectory() {
- def reactNative = file("${findNodeModulePath(rootProject.projectDir, "react-native")}")
+ def projectDir = this.hasProperty('reactNativeProject') ? this.reactNativeProject : rootProject.projectDir
+ def modulePath = file(projectDir);
+ def reactNative = file("${findNodeModulePath(modulePath, 'react-native')}")
if (reactNative.exists()) {
return reactNative
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
index bbfa7f7..ed53872 100644
--- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
+++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
@@ -140,6 +140,7 @@ class ReactNativeModules {
private Logger logger
private String packageName
private File root
+ private File rnRoot
private ArrayList<HashMap<String, String>> reactNativeModules
private ArrayList<String> unstable_reactLegacyComponentNames
private HashMap<String, ArrayList> reactNativeModulesBuildVariants
@@ -147,9 +148,10 @@ class ReactNativeModules {

private static String LOG_PREFIX = ":ReactNative:"

- ReactNativeModules(Logger logger, File root) {
+ ReactNativeModules(Logger logger, File root, File rnRoot) {
this.logger = logger
this.root = root
+ this.rnRoot = rnRoot

def (nativeModules, reactNativeModulesBuildVariants, androidProject, reactNativeVersion) = this.getReactNativeConfig()
this.reactNativeModules = nativeModules
@@ -416,10 +418,10 @@ class ReactNativeModules {
*/
def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
String[] nodeCommand = ["node", "-e", cliResolveScript]
- def cliPath = this.getCommandOutput(nodeCommand, this.root)
+ def cliPath = this.getCommandOutput(nodeCommand, this.rnRoot)

String[] reactNativeConfigCommand = ["node", cliPath, "config"]
- def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.root)
+ def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.rnRoot)

def json
try {
@@ -486,7 +488,13 @@ class ReactNativeModules {
*/
def projectRoot = rootProject.projectDir

-def autoModules = new ReactNativeModules(logger, projectRoot)
+def autoModules
+
+if(this.hasProperty('reactNativeProject')){
+ autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject))
+} else {
+ autoModules = new ReactNativeModules(logger, projectRoot, projectRoot)
+}

def reactNativeVersionRequireNewArchEnabled(autoModules) {
def rnVersion = autoModules.reactNativeVersion
52 changes: 52 additions & 0 deletions patches/@react-native-community+cli-platform-ios+12.3.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
index 82f537c..f5e2cda 100644
--- a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
+++ b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
@@ -12,7 +12,7 @@
require 'pathname'
require 'cocoapods'

-def use_native_modules!(config = nil)
+def updateConfig(config = nil)
if (config.is_a? String)
Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.",
[
@@ -24,7 +24,6 @@ def use_native_modules!(config = nil)
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip
-
if (!config)
json = []

@@ -36,10 +35,30 @@ def use_native_modules!(config = nil)

config = JSON.parse(json.join("\n"))
end
+end
+
+def use_native_modules!(config = nil)
+ if (ENV['REACT_NATIVE_DIR'])
+ Dir.chdir(ENV['REACT_NATIVE_DIR']) do
+ config = updateConfig(config)
+ end
+ else
+ config = updateConfig(config)
+ end

project_root = Pathname.new(config["project"]["ios"]["sourceDir"])

+ if(ENV["PROJECT_ROOT_DIR"])
+ project_root = File.join(Dir.pwd, ENV["PROJECT_ROOT_DIR"])
+
+ end
+
packages = config["dependencies"]
+
+ if (ENV["NO_FLIPPER"])
+ packages = {**packages, "react-native-flipper" => {"platforms" => {"ios" => nil}}}
+ end
+
found_pods = []

packages.each do |package_name, package|
18 changes: 18 additions & 0 deletions patches/@react-native-firebase+analytics+12.9.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/node_modules/@react-native-firebase/analytics/android/build.gradle b/node_modules/@react-native-firebase/analytics/android/build.gradle
index d223ebf..821b730 100644
--- a/node_modules/@react-native-firebase/analytics/android/build.gradle
+++ b/node_modules/@react-native-firebase/analytics/android/build.gradle
@@ -45,6 +45,8 @@ if (coreVersionDetected != coreVersionRequired) {
}
}

+apply plugin: 'com.android.library'
+
project.ext {
set('react-native', [
versions: [
@@ -144,4 +146,3 @@ dependencies {
ReactNative.shared.applyPackageVersion()
ReactNative.shared.applyDefaultExcludes()
ReactNative.module.applyAndroidVersions()
-ReactNative.module.applyReactNativeDependency("api")
25 changes: 25 additions & 0 deletions patches/@react-native-firebase+app+12.9.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/node_modules/@react-native-firebase/app/android/build.gradle b/node_modules/@react-native-firebase/app/android/build.gradle
index 05f629a..7c36693 100644
--- a/node_modules/@react-native-firebase/app/android/build.gradle
+++ b/node_modules/@react-native-firebase/app/android/build.gradle
@@ -18,6 +18,7 @@ buildscript {

plugins {
id "io.invertase.gradle.build" version "1.5"
+ id 'com.android.library'
}

def packageJson = PackageJson.getForProject(project)
@@ -91,6 +92,7 @@ repositories {
}

dependencies {
+ api 'com.facebook.react:react-native:+'
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
implementation "com.google.firebase:firebase-common"
implementation "com.google.android.gms:play-services-auth:${ReactNative.ext.getVersion("play", "play-services-auth")}"
@@ -99,4 +101,3 @@ dependencies {
ReactNative.shared.applyPackageVersion()
ReactNative.shared.applyDefaultExcludes()
ReactNative.module.applyAndroidVersions()
-ReactNative.module.applyReactNativeDependency("api")
17 changes: 17 additions & 0 deletions patches/@react-native-firebase+crashlytics+12.9.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/@react-native-firebase/crashlytics/android/build.gradle b/node_modules/@react-native-firebase/crashlytics/android/build.gradle
index 6b6de57..9b89ae7 100644
--- a/node_modules/@react-native-firebase/crashlytics/android/build.gradle
+++ b/node_modules/@react-native-firebase/crashlytics/android/build.gradle
@@ -18,6 +18,7 @@ buildscript {

plugins {
id "io.invertase.gradle.build" version "1.5"
+ id 'com.android.library'
}

def appProject
@@ -92,4 +93,3 @@ dependencies {
ReactNative.shared.applyPackageVersion()
ReactNative.shared.applyDefaultExcludes()
ReactNative.module.applyAndroidVersions()
-ReactNative.module.applyReactNativeDependency("api")
17 changes: 17 additions & 0 deletions patches/@react-native-firebase+perf+12.9.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/@react-native-firebase/perf/android/build.gradle b/node_modules/@react-native-firebase/perf/android/build.gradle
index b4a9c7b..5835e3d 100644
--- a/node_modules/@react-native-firebase/perf/android/build.gradle
+++ b/node_modules/@react-native-firebase/perf/android/build.gradle
@@ -19,6 +19,7 @@ buildscript {

plugins {
id "io.invertase.gradle.build" version "1.5"
+ id 'com.android.library'
}

def appProject
@@ -129,4 +130,3 @@ dependencies {
ReactNative.shared.applyPackageVersion()
ReactNative.shared.applyDefaultExcludes()
ReactNative.module.applyAndroidVersions()
-ReactNative.module.applyReactNativeDependency("api")
10 changes: 10 additions & 0 deletions patches/expo+50.0.0-preview.7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/node_modules/expo/scripts/autolinking.gradle b/node_modules/expo/scripts/autolinking.gradle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this file. Expo version was updated to 50.0.4

index 60d6ef8..3ed90a4 100644
--- a/node_modules/expo/scripts/autolinking.gradle
+++ b/node_modules/expo/scripts/autolinking.gradle
@@ -1,4 +1,4 @@
// Resolve `expo` > `expo-modules-autolinking` dependency chain
def autolinkingPath = ["node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim()
-apply from: new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle");

+apply from: hasProperty("reactNativeProject") ? file('../../expo-modules-autolinking/scripts/android/autolinking_implementation.gradle') : new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle");
40 changes: 40 additions & 0 deletions patches/expo-modules-autolinking+1.10.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle
index 92f1fd6..ada01ad 100644
--- a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle
+++ b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle
@@ -149,12 +149,13 @@ class ExpoAutolinkingManager {
}

static private String[] convertOptionsToCommandArgs(String command, Map options) {
+ def expoPath = options.searchPaths ? "../react-native/node_modules/expo" : "expo"
String[] args = [
'node',
'--no-warnings',
'--eval',
// Resolve the `expo` > `expo-modules-autolinking` chain from the project root
- 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo\')] }))(process.argv.slice(1))',
+ "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'${expoPath}\')] }))(process.argv.slice(1))",
'--',
command,
'--platform',
diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb
index 5d46f1e..3db7b89 100644
--- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb
+++ b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb
@@ -215,6 +215,7 @@ module Expo
args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" }
platform = autolinking_manager.platform_name.downcase
package_names = autolinking_manager.packages_to_generate.map { |package| "\"#{package.name}\"" }
+ expo_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo" : "expo"

<<~SUPPORT_SCRIPT
#!/usr/bin/env bash
@@ -262,7 +263,7 @@ module Expo

with_node \\
--no-warnings \\
- --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))" \\
+ --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'#{expo_path}/package.json\')] }))(process.argv.slice(1))" \\
generate-modules-provider #{args.join(' ')} \\
--target "#{modules_provider_path}" \\
--platform "apple" \\
16 changes: 16 additions & 0 deletions patches/expo-modules-core+1.11.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/node_modules/expo-modules-core/android/build.gradle b/node_modules/expo-modules-core/android/build.gradle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this file. It's updated to 1.11.8

index 3603ffd..1599a69 100644
--- a/node_modules/expo-modules-core/android/build.gradle
+++ b/node_modules/expo-modules-core/android/build.gradle
@@ -53,9 +53,10 @@ def isExpoModulesCoreTests = {
}.call()

def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":packages:react-native:ReactAndroid") != null
+def FALLBACK_REACT_NATIVE_DIR = hasProperty("reactNativeProject") ? file('../../react-native') : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent
def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE
? findProject(":packages:react-native:ReactAndroid").getProjectDir().parent
- : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent
+ : FALLBACK_REACT_NATIVE_DIR

def reactProperties = new Properties()
file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
17 changes: 17 additions & 0 deletions patches/react-native-reanimated+3.6.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/react-native-reanimated/scripts/reanimated_utils.rb b/node_modules/react-native-reanimated/scripts/reanimated_utils.rb
index af0935f..ccd2a9e 100644
--- a/node_modules/react-native-reanimated/scripts/reanimated_utils.rb
+++ b/node_modules/react-native-reanimated/scripts/reanimated_utils.rb
@@ -17,7 +17,11 @@ def find_config()
:react_native_common_dir => nil,
}

- react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
+ root_project = Pod::Config.instance.installation_root.to_s
+ if(ENV['PROJECT_ROOT_DIR'])
+ root_project = ENV['PROJECT_ROOT_DIR']
+ end
+ react_native_node_modules_dir = File.join(File.dirname(`cd "#{root_project}" && node --print "require.resolve('react-native/package.json')"`), '..')
react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir)

if react_native_json == nil
Loading
Loading