Skip to content

Migrate ReactNativeHost from Java to Kotlin (#56848)#56848

Open
cortinico wants to merge 2 commits into
facebook:mainfrom
cortinico:export-D105013283
Open

Migrate ReactNativeHost from Java to Kotlin (#56848)#56848
cortinico wants to merge 2 commits into
facebook:mainfrom
cortinico:export-D105013283

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

@cortinico cortinico commented May 15, 2026

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: D105013283

Summary:
Mechanical migration of the deprecated `NativeViewHierarchyManager` stub class from Java to Kotlin. All methods remain empty stubs — no behavioral changes.

Key migration decisions:
- Class marked `open` to preserve subclassability from Java/Kotlin
- All non-final public/protected methods marked `open` to match Java virtual-by-default
- `resolveView` and `resolveViewManager` remain `final` (matching the Java original)
- `Nullable` return types converted to Kotlin nullable types (`?`)
- `synchronized` methods use `Synchronized` annotation
- Static initializer converted to companion object `init` block

Changelog:
[Internal]

Differential Revision: D104999732
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 15, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 15, 2026

@cortinico has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105013283.

@cortinico cortinico force-pushed the export-D105013283 branch from a4fedf9 to 62629b3 Compare May 20, 2026 10:34
Summary:
Pull Request resolved: facebook#56848

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: D105013283
@cortinico cortinico force-pushed the export-D105013283 branch from 62629b3 to 45eecf3 Compare May 20, 2026 10:40
@meta-codesync meta-codesync Bot changed the title Migrate ReactNativeHost from Java to Kotlin Migrate ReactNativeHost from Java to Kotlin (#56848) May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant