Kotlinify ComponentFactory (#43783)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43783

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55643354

fbshipit-source-id: de6b676ae138f823c0521f1dcc48f3bcb7fd4e04
This commit is contained in:
Fabrizio Cucci
2024-04-03 02:43:36 -07:00
committed by Facebook GitHub Bot
parent 3856a46946
commit 08af9eaa29
3 changed files with 26 additions and 33 deletions
@@ -2488,7 +2488,7 @@ public class com/facebook/react/fabric/BindingImpl : com/facebook/react/fabric/B
public fun unregisterSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;)V
}
public class com/facebook/react/fabric/ComponentFactory {
public final class com/facebook/react/fabric/ComponentFactory {
public fun <init> ()V
}
@@ -1,32 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric;
import androidx.annotation.NonNull;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
@Nullsafe(Nullsafe.Mode.LOCAL)
@DoNotStrip
public class ComponentFactory {
static {
FabricSoLoader.staticInit();
}
@NonNull @DoNotStrip private final HybridData mHybridData;
@DoNotStrip
private static native HybridData initHybrid();
@DoNotStrip
public ComponentFactory() {
mHybridData = initHybrid();
}
}
@@ -0,0 +1,25 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStripAny
@DoNotStripAny
public class ComponentFactory {
@Suppress("NoHungarianNotation") private val mHybridData: HybridData = initHybrid()
private companion object {
init {
FabricSoLoader.staticInit()
}
@JvmStatic private external fun initHybrid(): HybridData
}
}