Skip to content

Commit

Permalink
chore: update react-native to 0.72.4 (#24044)
Browse files Browse the repository at this point in the history
# Why

close ENG-9814

# How

- update react-native to 0.72.4
- [react-native-lab] cherry pick native changes
- [babel-preset-expo] bump `metro-react-native-babel-preset@0.76.8`
- [android][ios] re-version sdk-49 code
- [dev-menu][dev-launcher] rebuild js bundles

# Test Plan

versioned expo go + sdk 49 project smoke test
  • Loading branch information
Kudo committed Aug 21, 2023
1 parent f88cb2d commit 8b38268
Show file tree
Hide file tree
Showing 78 changed files with 4,376 additions and 4,424 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Mon Jul 24 09:30:52 CST 2023
#Mon Aug 21 19:35:36 CST 2023
reactandroid-abi49_0_0-1.0.0.aar>=
reactandroid-abi49_0_0-1.0.0.pom>=
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>1.0.0</version>
</versions>
<lastUpdated>20230724013051</lastUpdated>
<lastUpdated>20230821113536</lastUpdated>
</versioning>
</metadata>
Expand Up @@ -17,6 +17,7 @@ import abi49_0_0.com.facebook.react.ReactRootView
import abi49_0_0.com.facebook.react.bridge.ReactContext
import abi49_0_0.com.facebook.react.modules.core.PermissionListener
import abi49_0_0.expo.modules.core.interfaces.ReactActivityLifecycleListener
import abi49_0_0.expo.modules.kotlin.Utils
import java.lang.reflect.Field
import java.lang.reflect.Method
import java.lang.reflect.Modifier
Expand Down Expand Up @@ -84,6 +85,9 @@ class ReactActivityDelegateWrapper(
reactDelegate.loadApp(appKey)
rootViewContainer.addView(reactDelegate.reactRootView, ViewGroup.LayoutParams.MATCH_PARENT)
activity.setContentView(rootViewContainer)
reactActivityLifecycleListeners.forEach { listener ->
listener.onContentChanged(activity)
}
return
}

Expand All @@ -92,15 +96,22 @@ class ReactActivityDelegateWrapper(
.firstOrNull()
if (delayLoadAppHandler != null) {
delayLoadAppHandler.whenReady {
Utils.assertMainThread()
invokeDelegateMethod<Unit, String?>("loadApp", arrayOf(String::class.java), arrayOf(appKey))
reactActivityLifecycleListeners.forEach { listener ->
listener.onContentChanged(activity)
}
if (shouldEmitPendingResume) {
onResume()
}
}
return
}

return invokeDelegateMethod("loadApp", arrayOf(String::class.java), arrayOf(appKey))
invokeDelegateMethod<Unit, String?>("loadApp", arrayOf(String::class.java), arrayOf(appKey))
reactActivityLifecycleListeners.forEach { listener ->
listener.onContentChanged(activity)
}
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Expand Up @@ -34,4 +34,9 @@ default boolean onNewIntent(Intent intent) {
default boolean onBackPressed() {
return false;
}

/**
* This method is called when the {@link Activity#setContentView} method is invoked on an Activity.
*/
default void onContentChanged(Activity activity) {}
}
Expand Up @@ -284,7 +284,7 @@ open class FileSystemModule : Module() {

AsyncFunction("copyAsync") { options: RelocatingOptions ->
val fromUri = Uri.parse(slashifyFilePath(options.from))
ensurePermission(fromUri, Permission.WRITE, "Location '$fromUri' isn't movable.")
ensurePermission(fromUri, Permission.READ, "Location '$fromUri' isn't readable.")
val toUri = Uri.parse(slashifyFilePath(options.to))
ensurePermission(toUri, Permission.WRITE)

Expand Down
Expand Up @@ -2,8 +2,6 @@ package abi49_0_0.expo.modules.splashscreen

import android.app.Activity
import android.content.Context
import android.os.Bundle
import android.os.Handler
import abi49_0_0.com.facebook.react.ReactRootView
import abi49_0_0.expo.modules.core.interfaces.ReactActivityLifecycleListener
import expo.modules.splashscreen.singletons.SplashScreen
Expand All @@ -15,19 +13,13 @@ import abi49_0_0.host.exp.expoview.R
/* ktlint-enable no-unused-imports */

class SplashScreenReactActivityLifecycleListener(activityContext: Context) : ReactActivityLifecycleListener {
override fun onCreate(activity: Activity, savedInstanceState: Bundle?) {
// To support backward compatible or SplashScreenImageResizeMode customization
// that calling `SplashScreen.show()` in MainActivity,
// we postpone the in-module call to the end of main loop.
// If MainActivity.onCreate has `SplashScreen.show()`, it will override the call here.
Handler(activity.mainLooper).post {
SplashScreen.show(
activity,
getResizeMode(activity),
ReactRootView::class.java,
getStatusBarTranslucent(activity)
)
}
override fun onContentChanged(activity: Activity) {
SplashScreen.show(
activity,
getResizeMode(activity),
ReactRootView::class.java,
getStatusBarTranslucent(activity)
)
}

private fun getResizeMode(context: Context): SplashScreenImageResizeMode =
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8b38268

Please sign in to comment.