Skip to content

Commit

Permalink
Remove deprecated measureLayoutRelativeToParent of UIManagerModule (#…
Browse files Browse the repository at this point in the history
…44452)

Summary:
Pull Request resolved: #44452

`measureLayoutRelativeToParent` was deprecated 5 years ago in D16471845 and doesn't have [JS usages](https://fburl.com/code/tgwon7nb)

For the JS exposed UIManager API for measureLayoutRelativeToParent is through [UIImplementation.measureLayoutRelativeToParent()](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java?lines=804-815)

Hence deleting this for 0.75 Release. This will simplify the backwards compatibility of UIManagerModule

Changelog:
[Android][Removed] Delete UIManagerModule.measureLayoutRelativeToParent()

Reviewed By: javache

Differential Revision: D57069921

fbshipit-source-id: 9f871424a39caf3cbeaa5570c7e101a714c11aa6
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed May 8, 2024
1 parent 4290ef5 commit 958f8e2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
18 changes: 0 additions & 18 deletions packages/react-native/React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1384,24 +1384,6 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
RCTMeasureLayout(shadowView, ancestorShadowView, callback);
}

/**
* Returns the computed recursive offset layout in a dictionary form. The
* returned values are relative to the `ancestor` shadow view. Returns `nil`, if
* the `ancestor` shadow view is not actually an `ancestor`. Does not touch
* anything on the main UI thread. Invokes supplied callback with (x, y, width,
* height).
*/
RCT_EXPORT_METHOD(measureLayoutRelativeToParent
: (nonnull NSNumber *)reactTag errorCallback
: (__unused RCTResponseSenderBlock)errorCallback callback
: (RCTResponseSenderBlock)callback)
{
RCTLogWarn(
@"RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450");
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
RCTMeasureLayout(shadowView, shadowView.reactSuperview, callback);
}

/**
* JS sets what *it* considers to be the responder. Later, scroll views can use
* this in order to determine if scrolling is appropriate.
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -5069,7 +5069,6 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
public fun measure (ILcom/facebook/react/bridge/Callback;)V
public fun measureInWindow (ILcom/facebook/react/bridge/Callback;)V
public fun measureLayout (IILcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
public fun measureLayoutRelativeToParent (ILcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
public fun onBatchComplete ()V
public fun onHostDestroy ()V
public fun onHostPause ()V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,22 +525,6 @@ public void measureLayout(
mUIImplementation.measureLayout(tag, ancestorTag, errorCallback, successCallback);
}

/**
* Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.
*
* <p>NB: Unlike {@link #measure}, this will measure relative to the view layout, not the visible
* window which can cause unexpected results when measuring relative to things like ScrollViews
* that can have offset content on the screen.
*
* @deprecated this method will not be available in FabricUIManager class.
*/
@ReactMethod
@Deprecated
public void measureLayoutRelativeToParent(
int tag, Callback errorCallback, Callback successCallback) {
mUIImplementation.measureLayoutRelativeToParent(tag, errorCallback, successCallback);
}

/**
* Find the touch target child native view in the supplied root view hierarchy, given a react
* target location.
Expand Down

0 comments on commit 958f8e2

Please sign in to comment.