Skip to content

Migrate ReactNativeHost from Java to Kotlin#56848

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

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

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

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

cortinico and others added 2 commits May 14, 2026 03:11
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
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: D105013283
@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.

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