Skip to content

Commit

Permalink
fix: Better warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 13, 2025
1 parent 3f6da93 commit 27e1c9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct JHybridObjectRegistry : public jni::JavaClass<JHybridObjectRegistry> {

public:
[[deprecated("HybridObjects should be registered from C++ instead. Either autolink them using `nitro.json`, "
"or add them manually in HybridObjectRegistry.")]]
"or add them manually in the C++ HybridObjectRegistry.")]]
static void registerHybridObjectConstructor(jni::alias_ref<jni::JClass> clazz, std::string hybridObjectName,
jni::alias_ref<JHybridObjectInitializer> constructorFn);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

import com.facebook.proguard.annotations.DoNotStrip;

/**
* @deprecated HybridObjects should be registered from C++ instead. Either autolink them using `nitro.json`, or add them manually in the C++ `HybridObjectRegistry`.
*/
@Keep
@DoNotStrip
@Deprecated(forRemoval = true)
public interface HybridObjectInitializer {
@Keep
@DoNotStrip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class HybridObjectRegistry {
* Registers the given HybridObject in the `HybridObjectRegistry`.
* It will be uniquely identified via it's `hybridObjectName`, and can be initialized from
* JS using `NitroModules.createHybridObject<T>(name)` - which will call the `constructorFn` here.
* @deprecated HybridObjects should be registered from C++ instead. Either autolink them using `nitro.json`, or add them manually in HybridObjectRegistry.
* @deprecated HybridObjects should be registered from C++ instead. Either autolink them using `nitro.json`, or add them manually in the C++ `HybridObjectRegistry`.
*/
@Deprecated(forRemoval = true)
public static native void registerHybridObjectConstructor(String hybridObjectName, HybridObjectInitializer initializer);
Expand Down

0 comments on commit 27e1c9f

Please sign in to comment.