Commit a4fedf9
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)
Differential Revision: D1050132831 parent 5f6a705 commit a4fedf9
5 files changed
Lines changed: 223 additions & 259 deletions
File tree
- packages/react-native/ReactAndroid
- api
- src/main/java/com/facebook/react
- defaults
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
| |||
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
Lines changed: 0 additions & 251 deletions
This file was deleted.
0 commit comments