From 64b45b32ad598bf963bde138ebfcf1207bec679f Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Tue, 6 May 2025 21:22:20 +0300 Subject: [PATCH 01/40] Upgrade to react native 0.76.9 Some errors in native code that I did not want to commit fixes just yet docuilib has issues (hopefully will be solved in 0.77.2 --- .gitignore | 12 +- Gemfile | 9 +- android/app/build.gradle | 18 +- android/app/src/main/AndroidManifest.xml | 3 +- .../main/java/com/rnuilib/MainApplication.kt | 7 +- .../MainApplicationReactNativeHost.java | 54 - .../res/drawable/rn_edit_text_material.xml | 3 +- android/build.gradle | 8 +- android/gradle.properties | 1 - .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 21 +- demo/package.json | 2 +- docs/getting-started/setup.md | 4 +- docuilib/package.json | 3 +- .../version-7.0.0/getting-started/setup.md | 4 +- docuilib/yarn.lock | 651 +++- expoDemo/package.json | 18 +- ios/Podfile | 19 +- ios/rnuilib-tvOS/Info.plist | 2 +- ios/rnuilib.xcodeproj/project.pbxproj | 41 +- ios/rnuilib/AppDelegate.mm | 4 +- ios/rnuilib/Info.plist | 2 +- lib/android/build.gradle | 10 +- metro.config.js | 2 +- package.json | 38 +- webDemo/package.json | 19 +- yarn.lock | 2982 ++++++++--------- 27 files changed, 2212 insertions(+), 1727 deletions(-) diff --git a/.gitignore b/.gitignore index 18047ea2a1..637d4c4b71 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ DerivedData *.ipa *.xcuserstate project.xcworkspace -ios/.xcode.env.local +**/.xcode.env.local # Android/IntelliJ # @@ -43,11 +43,17 @@ expoDemo/android/gradlew.bat node_modules/ npm-debug.log -# yarn +# Yarn +.yarn/* yarn-error.log **/.yarn/cache **/.yarn/install-state.gz **/.yarn/yarn.build.json +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions .vscode @@ -74,7 +80,7 @@ docs/components/** !scripts/build # Ruby / CocoaPods -/ios/Pods/ +**/Pods/ /vendor/bundle/ /ios/Podfile.lock expoDemo/ios/Pods diff --git a/Gemfile b/Gemfile index 946cd4fd03..24519fda7e 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,9 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper -# bound in the template on Cocoapods with next React Native release. -gem 'cocoapods', '>= 1.13', '< 1.15' -gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' +gem 'concurrent-ruby', '< 1.3.4' diff --git a/android/app/build.gradle b/android/app/build.gradle index b16e3ae4c0..d249ea14f3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,14 +13,16 @@ apply plugin: "com.facebook.react" */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' + // The root of your project, i.e. where "package.json" lives. Default is '../..' root = file("../../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native +// The folder where the react-native NPM package is. Default is ../../node_modules/react-native reactNativeDir = file("../../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") + /* Variants */ // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. @@ -51,6 +53,8 @@ react { // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ autolinkLibrariesWithApp() } @@ -122,7 +126,6 @@ android { dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration:0.73.9") implementation project(':react-native-navigation') implementation 'com.facebook.fresco:fresco:2.5.0' @@ -135,4 +138,3 @@ dependencies { } } -// apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4122f36a59..e1892528b8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,8 @@ android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:supportsRtl="true"> getJSIModules( - final ReactApplicationContext reactApplicationContext, - final JavaScriptContextHolder jsContext) { - final List specs = new ArrayList<>(); - // Here we provide a new JSIModuleSpec that will be responsible of providing the - // custom Fabric Components. - specs.add( - new JSIModuleSpec() { - @Override - public JSIModuleType getJSIModuleType() { - return JSIModuleType.UIManager; - } - @Override - public JSIModuleProvider getJSIModuleProvider() { - final ComponentFactory componentFactory = new ComponentFactory(); - CoreComponentsRegistry.register(componentFactory); - // Here we register a Components Registry. - // The one that is generated with the template contains no components - // and just provides you the one from React Native core. - MainComponentsRegistry.register(componentFactory); - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); - ViewManagerRegistry viewManagerRegistry = - new ViewManagerRegistry( - reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); - return new FabricJSIModuleProvider( - reactApplicationContext, - componentFactory, - new EmptyReactNativeConfig(), - viewManagerRegistry); - } - }); - return specs; - } - }; - } } \ No newline at end of file diff --git a/android/app/src/main/res/drawable/rn_edit_text_material.xml b/android/app/src/main/res/drawable/rn_edit_text_material.xml index a902b2a3a6..561cc4ed85 100644 --- a/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -14,7 +14,8 @@ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material" android:insetRight="@dimen/abc_edit_text_inset_horizontal_material" android:insetTop="@dimen/abc_edit_text_inset_top_material" - android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> + android:insetBottom="@dimen/abc_edit_text_inset_bottom_material" + >