Skip to content

Fix typos (RCTCustomRefreshControlProtocol) #36363

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

Closed

Conversation

jiggag
Copy link
Contributor

@jiggag jiggag commented Mar 3, 2023

Summary

Fix typo RCTCustomRefreshContolProtocol > RCTCustomRefreshControlProtocol

Changelog

[INTERNAL] [FIXED] - Fixed typo RCTCustomRefreshControlProtocol

Test Plan

none

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 3, 2023
@analysis-bot
Copy link

analysis-bot commented Mar 3, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,517,043 +0
android hermes armeabi-v7a 7,833,093 +0
android hermes x86 8,997,414 +0
android hermes x86_64 8,852,405 +0
android jsc arm64-v8a 9,141,055 +0
android jsc armeabi-v7a 8,332,938 +0
android jsc x86 9,195,853 +0
android jsc x86_64 9,453,691 +0

Base commit: 6c208c2
Branch: main

@cipolleschi
Copy link
Contributor

Hi @jiggag, thank you for this PR. Unfortunately, we cannot accept this as it is because changing a type that is widely used is a breaking change. If we release a version of React Native with just this change, we will break every project that uses this component.

The proper way to go is:

  1. Create a new protocol with the right name
  2. Make the old protocol (with the wrong name) extend the new one (so they are equivalent) and all the existing code that inherit the old one will begin to conform to the new one
  3. Mark the old protocol as deprecated (e.g.: https://stackoverflow.com/a/7409545)
  4. Go on replacing the internal usages of the old protocol with the new one (as you already did)

Thank you so much for this!

@@ -33,7 +33,7 @@
/**
* Denotes a view which implements custom pull to refresh functionality.
*/
@protocol RCTCustomRefreshContolProtocol
@protocol RCTCustomRefreshControlProtocol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively a breaking change that adds really little value imho:
https://cs.github.com/?scopeName=All+repos&scope=&q=RCTCustomRefreshContolProtocol

I know the typo is not cool, but we can't just rename.
@cipolleschi what's your opinion on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I was late 😅 saw your comment above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said above. I will rename it, but not from one day to another.
I'll let the two protocols live for a couple of versions, so that users can be prompted on updating the naming and then we can remove it in 0.74 or 0.75, for example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cipolleschi I'm not sure if what you suggested is documented or not, but your suggestion above is very informative at least in the context of renaming public APIs.

Provided typo-fix PRs are frequent, I suggest documenting your suggestions above in the Contributing Guide. Glad to open a PR (on react-native-website) for adding those suggestions. Lmk :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Pranav-yadav! That would be amazing, although I don't have a clear idea on where it should go.

Probably in the Contributing section of the Website? 🤔
To contribute to the website, you can work on the website repo. ;)

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cipolleschi
Copy link
Contributor

/rebase

1 similar comment
@cipolleschi
Copy link
Contributor

/rebase

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jiggag jiggag force-pushed the fix-typo-custom-refresh-control-protocol branch from e04030a to a8fee68 Compare March 15, 2023 15:38
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 93c1fbd.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 16, 2023
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Fix typo `RCTCustomRefreshContolProtocol` > `RCTCustomRefreshControlProtocol`

## Changelog

[INTERNAL] [FIXED] - Fixed typo RCTCustomRefreshControlProtocol

Pull Request resolved: facebook#36363

Test Plan: none

Reviewed By: cortinico

Differential Revision: D44024938

Pulled By: cipolleschi

fbshipit-source-id: 1fbc4e75361334586e46e14ee746cbb94d230a92
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. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants