Commit 62629b3
Migrate ReactNativeHost from Java to Kotlin
Summary:
Mechanical migration of the deprecated `ReactNativeHost` class from Java to Kotlin. All methods retain their exact JVM signatures to preserve API compatibility.
Key migration decisions:
- Class remains `abstract` (implicitly open)
- All non-final, non-abstract methods marked `open` to match Java virtual-by-default
- `getApplication()` remains `final` (no `open`)
- Methods kept as explicit `fun` (not Kotlin properties) to preserve exact JVM getter names like `getJSMainModuleName()`, `getJSBundleFile()`, `getUIManagerProvider()`
- `Nullable` return types converted to Kotlin nullable types (`?`)
- `synchronized` methods use `Synchronized` annotation
- `Nullsafe` annotation removed (redundant in Kotlin)
- Static initializer converted to companion object `init` block
Changelog:
[Android][Changed] - Migrate `ReactNativeHost` from Java to Kotlin (no behavioral changes)
Reviewed By: javache
Differential Revision: D1050132831 parent 7339aed commit 62629b3
4 files changed
Lines changed: 221 additions & 259 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
- defaults
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
Lines changed: 0 additions & 251 deletions
This file was deleted.
0 commit comments