Skip to content

Commit b85b1a5

Browse files
authored
feat: add rn 0.82 support (#5)
* chore: upgrade lib to 0.82.2, rename hermes-engine::libhermes to hermes-engine::hermesvm * chore: sync pbxproj * chore: bump lib rn dev deps * chore: set macos-15 ci runner * chore: downgrade runner and xcode version
1 parent d540eac commit b85b1a5

File tree

17 files changed

+1130
-1010
lines changed

17 files changed

+1130
-1010
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ jobs:
102102
103103
- name: Build example for Android
104104
env:
105-
JAVA_OPTS: "-XX:MaxHeapSize=6g"
105+
JAVA_OPTS: '-XX:MaxHeapSize=6g'
106106
run: |
107107
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108108
109109
build-ios:
110-
runs-on: macos-latest
110+
runs-on: macos-14
111111
env:
112-
XCODE_VERSION: 16.2
112+
XCODE_VERSION: 16.1
113113
TURBO_CACHE_DIR: .turbo/ios
114114
steps:
115115
- name: Checkout
@@ -140,6 +140,13 @@ jobs:
140140
with:
141141
xcode-version: ${{ env.XCODE_VERSION }}
142142

143+
- name: Verify iOS platform availability
144+
if: env.turbo_cache_hit != 1
145+
run: |
146+
sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer
147+
xcodebuild -version
148+
xcrun simctl list runtimes
149+
143150
- name: Install cocoapods
144151
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
145152
run: |

android/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ find_package(ReactAndroid REQUIRED CONFIG)
2626
find_package(hermes-engine REQUIRED CONFIG)
2727
string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
2828

29-
target_link_libraries(
30-
${PACKAGE_NAME}
31-
hermes-engine::libhermes
32-
)
33-
3429
target_include_directories(
3530
${PACKAGE_NAME}
3631
PRIVATE
@@ -62,6 +57,7 @@ target_link_libraries(
6257
log
6358
fbjni::fbjni
6459
ReactAndroid::jsi
60+
hermes-engine::hermesvm
6561
)
6662

6763
# Enable Android 16kb native library alignment

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
1111
android:theme="@style/AppTheme"
12+
android:usesCleartextTraffic="true"
1213
android:supportsRtl="true">
1314
<activity
1415
android:name=".MainActivity"

example/android/app/src/main/java/timezonehermesfix/example/MainApplication.kt

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,24 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7-
import com.facebook.react.ReactNativeHost
8-
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
108
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11-
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
149

1510
class MainApplication : Application(), ReactApplication {
1611

17-
override val reactNativeHost: ReactNativeHost =
18-
object : DefaultReactNativeHost(this) {
19-
override fun getPackages(): List<ReactPackage> =
20-
PackageList(this).packages.apply {
21-
// Packages that cannot be autolinked yet can be added manually here, for example:
22-
// add(MyReactNativePackage())
23-
}
24-
25-
override fun getJSMainModuleName(): String = "index"
26-
27-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28-
29-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31-
}
32-
33-
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
12+
override val reactHost: ReactHost by lazy {
13+
getDefaultReactHost(
14+
context = applicationContext,
15+
packageList =
16+
PackageList(this).packages.apply {
17+
// Packages that cannot be autolinked yet can be added manually here, for example:
18+
// add(MyReactNativePackage())
19+
},
20+
)
21+
}
3522

3623
override fun onCreate() {
3724
super.onCreate()
38-
SoLoader.init(this, OpenSourceMergedSoMapping)
39-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40-
// If you opted-in for the New Architecture, we load the native entry point for this app.
41-
load()
42-
}
25+
loadReactNative(this)
4326
}
44-
}
27+
}

example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "35.0.0"
3+
buildToolsVersion = "36.0.0"
44
minSdkVersion = 24
5-
compileSdkVersion = 35
6-
targetSdkVersion = 35
5+
compileSdkVersion = 36
6+
targetSdkVersion = 36
77
ndkVersion = "27.1.12297006"
88
kotlinVersion = "2.0.21"
99
}

example/android/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ newArchEnabled=true
3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.
3939
hermesEnabled=true
40+
41+
# Use this property to enable edge-to-edge display support.
42+
# This allows your app to draw behind system bars for an immersive UI.
43+
# Note: Only works with ReactActivity and should not be used with custom Activity.
44+
edgeToEdgeEnabled=false
1.71 KB
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)