| f9204f9f | 19-Jul-2021 |
Kudo Chien <[email protected]> |
[expo-modules][android] propose module-level app or activity customization support (#13457)
# Why
Some modules require additional setup into MainApplication or MainActivity, e.g. expo-splash-scre
[expo-modules][android] propose module-level app or activity customization support (#13457)
# Why
Some modules require additional setup into MainApplication or MainActivity, e.g. expo-splash-screen or react-native-gesture-handler
Traditionally, we used pre-shaped templates or regular expression in config plugin.
This PR propose a way to make MainApplication and MainActivity extensible.
# How
Introducing `ApplicationLifecycleListener` and `ReactActivityLifecycleListener` for expo-modules, an expo-module package could register these two listeners.
For POC, expo-splash-screen in bare-expo is also migrate to the new model.
### Performance impact
Leveraging the auto-linking mechanism, a notable change is that we need expo-modules package list before react-native bootstrap. In theory, the change may take longer time to show splash screen.
My measurement from `MainApplication.onCreate` to `SplashScreenViewController.show`
Before: 74.2ms
After 80.0ms
There is no meaningful impact to launch time.
# Test Plan
bare-expo android app will show splashscreen even removed the `SplashScreen.show` in MainActivity.
show more ...
|