Skip to content

Commit

Permalink
Annotate the experimental image prefetching API as @UnstableReactNati…
Browse files Browse the repository at this point in the history
…veAPI (facebook#48120)

Summary:

This diff annotates the experimental image prefetching API as `UnstableReactNativeAPI` instead of `Deprecated`.

Changelog: [Internal]

Reviewed By: cortinico, philIip

Differential Revision: D66822045
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Dec 5, 2024
1 parent f6f2eae commit 88209e3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,6 @@ public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/brid
public fun dispatchCommand (IILcom/facebook/react/bridge/ReadableArray;)V
public fun dispatchCommand (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun dispatchCommand (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun experimental_prefetchResource (Ljava/lang/String;IILcom/facebook/react/common/mapbuffer/ReadableMapBuffer;)V
public fun getColor (I[Ljava/lang/String;)I
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
public fun getInspectorDataForInstance (ILandroid/view/View;)Lcom/facebook/react/bridge/ReadableMap;
Expand Down Expand Up @@ -2756,7 +2755,6 @@ public class com/facebook/react/fabric/mounting/MountingManager {
public fun attachRootView (ILandroid/view/View;Lcom/facebook/react/uimanager/ThemedReactContext;)V
public fun clearJSResponder ()V
public fun enqueuePendingEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;I)V
public fun experimental_prefetchResource (Lcom/facebook/react/bridge/ReactContext;Ljava/lang/String;IILcom/facebook/react/common/mapbuffer/MapBuffer;)V
public fun getEventEmitter (II)Lcom/facebook/react/fabric/events/EventEmitterWrapper;
public fun getSurfaceManager (I)Lcom/facebook/react/fabric/mounting/SurfaceMountingManager;
public fun getSurfaceManagerEnforced (ILjava/lang/String;)Lcom/facebook/react/fabric/mounting/SurfaceMountingManager;
Expand Down Expand Up @@ -5259,8 +5257,6 @@ public abstract class com/facebook/react/uimanager/ViewManager : com/facebook/re
public fun createView (ILcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;Lcom/facebook/react/touch/JSResponderHandler;)Landroid/view/View;
protected fun createViewInstance (ILcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Landroid/view/View;
protected abstract fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
protected fun experimental_isPrefetchingEnabled ()Z
public fun experimental_prefetchResource (Lcom/facebook/react/bridge/ReactContext;IILcom/facebook/react/common/mapbuffer/MapBuffer;)V
public fun getCommandsMap ()Ljava/util/Map;
protected fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getExportedCustomBubblingEventTypeConstants ()Ljava/util/Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.facebook.react.bridge.UIManagerListener;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.common.mapbuffer.ReadableMapBuffer;
import com.facebook.react.fabric.events.EventEmitterWrapper;
Expand Down Expand Up @@ -882,6 +883,7 @@ public void runGuarded() {
* This method initiates preloading of an image specified by ImageSource. It can later be consumed
* by an ImageView.
*/
@UnstableReactNativeAPI
public void experimental_prefetchResource(
String componentName, int surfaceId, int reactTag, ReadableMapBuffer params) {
mMountingManager.experimental_prefetchResource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.facebook.react.bridge.RetryableMountingLayerException;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.mapbuffer.MapBuffer;
import com.facebook.react.fabric.FabricUIManager;
import com.facebook.react.fabric.events.EventEmitterWrapper;
Expand Down Expand Up @@ -428,16 +429,17 @@ public long measureMapBuffer(
}

/**
* @deprecated THIS PREFETCH METHOD IS EXPERIMENTAL, DO NOT USE IT FOR PRODUCTION CODE. IT WILL
* MOST LIKELY CHANGE OR BE REMOVED IN THE FUTURE.
* THIS PREFETCH METHOD IS EXPERIMENTAL, DO NOT USE IT FOR PRODUCTION CODE. IT WILL MOST LIKELY
* CHANGE OR BE REMOVED IN THE FUTURE.
*
* @param reactContext
* @param componentName
* @param surfaceId {@link int} surface ID
* @param reactTag reactTag that should be set as ID of the view instance
* @param params {@link MapBuffer} prefetch request params defined in C++
*/
@AnyThread
@Deprecated
@UnstableReactNativeAPI
public void experimental_prefetchResource(
ReactContext reactContext,
String componentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.mapbuffer.MapBuffer;
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
import com.facebook.react.touch.JSResponderHandler;
Expand Down Expand Up @@ -491,22 +492,24 @@ public void onSurfaceStopped(int surfaceId) {
}

/**
* @deprecated THIS PREFETCH METHOD IS EXPERIMENTAL, DO NOT USE IT FOR PRODUCTION CODE, MOST
* LIKELY IT WILL CHANGE OR BE REMOVED IN THE FUTURE.
* <p>Subclasses can override this method to implement custom resource prefetching for the
* ViewManager.
* THIS PREFETCH METHOD IS EXPERIMENTAL, DO NOT USE IT FOR PRODUCTION CODE, MOST LIKELY IT WILL
* CHANGE OR BE REMOVED IN THE FUTURE.
*
* <p>Subclasses can override this method to implement custom resource prefetching for the
* ViewManager.
*
* @param reactContext {@link com.facebook.react.bridge.ReactContext} used for the view.
* @param surfaceId {@link int} surface ID
* @param reactTag reactTag that should be set as ID of the view instance
* @param params {@link MapBuffer} prefetch request params defined in C++
*/
@Deprecated
@UnstableReactNativeAPI
public void experimental_prefetchResource(
ReactContext reactContext, int surfaceId, int reactTag, MapBuffer params) {
return;
}

@Deprecated
@UnstableReactNativeAPI
protected boolean experimental_isPrefetchingEnabled() {
return ReactNativeFeatureFlags.enableImagePrefetchingAndroid();
}
Expand Down

0 comments on commit 88209e3

Please sign in to comment.