Skip to content

Commit

Permalink
Add @DoNotStrip to JavaScriptModule interfaces
Browse files Browse the repository at this point in the history
Summary: Adding `DoNotStrip` to all the interfaces that extend `JavaScriptModule` to ensure they don't get stripped from release builds (because they have no Java implementors).

Reviewed By: emma0303

Differential Revision: D17534719

fbshipit-source-id: a793764caf17040bf1252be7ec4c72176d6989d4
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Sep 24, 2019
1 parent 990c9ea commit 6464ef0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.ReactApplicationContext;
Expand All @@ -23,6 +24,7 @@
public class DeviceEventManagerModule extends ReactContextBaseJavaModule {
public static final String NAME = "DeviceEventManager";

@DoNotStrip
public interface RCTDeviceEventEmitter extends JavaScriptModule {
void emit(@NonNull String eventName, @Nullable Object data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
*/
package com.facebook.react.modules.core;

import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.WritableArray;

@DoNotStrip
public interface JSTimers extends JavaScriptModule {
void callTimers(WritableArray timerIDs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
package com.facebook.react.modules.core;

import androidx.annotation.Nullable;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.JavaScriptModule;

/** Module that handles global application events. */
@DoNotStrip
public interface RCTNativeAppEventEmitter extends JavaScriptModule {
void emit(String eventName, @Nullable Object data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
package com.facebook.react.uimanager.events;

import androidx.annotation.Nullable;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;

@DoNotStrip
public interface RCTEventEmitter extends JavaScriptModule {
void receiveEvent(int targetTag, String eventName, @Nullable WritableMap event);

Expand Down

0 comments on commit 6464ef0

Please sign in to comment.