Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated dispatchCommand for INT #44519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arushikesarwani94
Copy link
Contributor

Summary:
D15955444 introduced support for View Manager Commands that are strings.

We need to support ints and Strings to be backwards compatible, but ints will be deprecated.

This was deprecated 5 years ago in D16019254.

While on backwards compatibility of UIManagerModule, this was identified as Deprecated method that we can get rid.

  • dispatchCommand(int reactTag, int String commandId, Nullable ReadableArray commandArgs) ;

  • receiveCommand(NonNull T root, int String commandId, Nullable ReadableArray args)

  • dispatchViewManagerCommand(
    int reactTag, Dynamic String commandId, Nullable ReadableArray commandArgs)

NOTE: This might need more JS changes.

  • In RNLiveMapsView & RNLMARStageView used the String directly in switch casing instead of Enum

  • In fb4A removed all occurrences in ViewManagers.

PENDING:

I believe, post this, we can also get rid of getCommandsMap() Over-ride as well however I see it's introduction dates before adding Strings type, hence leaving that untouched.

Differential Revision: D57150941

Summary:
D15955444 introduced support for View Manager Commands that are strings.

> We need to support ints and Strings to be backwards compatible, but ints will be deprecated.

This was deprecated 5 years ago in D16019254.

While on [backwards compatibility of UIManagerModule](https://docs.google.com/document/d/1PoFDF_Ek2U-u1BOgDCYx-EgvXMMiXsSAcBkamtMq5-M/edit#heading=h.txujclhzs5ov), this was identified as `Deprecated` method that we can get rid.


- dispatchCommand(int reactTag, ~~int~~ String commandId, Nullable ReadableArray commandArgs) ;

- receiveCommand(NonNull T root, ~~int~~ String commandId, Nullable ReadableArray args) 

- dispatchViewManagerCommand(
int reactTag, ~~Dynamic~~ String commandId, Nullable ReadableArray commandArgs)

NOTE: This might need more JS changes.

- In RNLiveMapsView & RNLMARStageView used the String directly in switch casing instead of Enum

- In fb4A removed all occurrences in ViewManagers.

**PENDING:**

I believe, post this, we can also get rid of `getCommandsMap() ` Over-ride as well however I see it's introduction [dates before](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java?lines=303-313) adding Strings type, hence leaving that untouched.

Differential Revision: D57150941
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 10, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57150941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants