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

feat: RCTConvert to support UIModalPresentationStyle #43297

Closed

Conversation

vonovak
Copy link
Collaborator

@vonovak vonovak commented Mar 2, 2024

Summary:

Currently, the ability to convert JS values to UIModalPresentationStyle is not present directly on RCTConvert.

In the RN code base itself, there's not a lot of need to do this type of conversion, but in community modules, presenting ViewControllers can be a fairly common scenario and it'd be nice to be able to use this conversion directly from RCTConvert, rather than from RCTModalHostViewManager, as it'd improve its "discoverability" and consistency.

If someone relied on this, then it's technically speaking a breaking change but I'd say it's for the better, and searching #import <React/RCTModalHostViewManager.h> on github doesn't reveal a lot of results.

Changelog:

[IOS] [ADDED] - RCTConvert to support UIModalPresentationStyle

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Test Plan:

Tested using RN Tester

modal_presentation.mp4

@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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 2, 2024
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Hi @vonovak, thanks for the contribution. If we can make it non breaking, it would be better, I left a comment in the file.

@@ -5,16 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

#import <React/RCTConvert.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

We can make it non-breaking by leaving this import here, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cipolleschi yes, that works, I've put it back. 👍

@vonovak vonovak force-pushed the feat/UIModalPresentationStyle-RCTConvert branch from f28cca5 to 589635a Compare March 5, 2024 21:49
@cipolleschi
Copy link
Contributor

To set expectations: I'm going to be on PTO from tomorrow until the 28th of March.
I'll not import this PR myself, so that our internal pinging tool can ping someone else that can champion this PR on my behalf.

Perhaps @dmytrorykun or @sammy-SC can help.

@dmytrorykun
Copy link
Contributor

dmytrorykun commented Mar 7, 2024

@vonovak could you please rebase on the latest main. The CI failures seem unrelated to you changes, and will likely go away.

@vonovak vonovak force-pushed the feat/UIModalPresentationStyle-RCTConvert branch from 589635a to c0a1bd4 Compare March 7, 2024 13:45
@vonovak
Copy link
Collaborator Author

vonovak commented Mar 7, 2024

@vonovak could you please rebase on the latest main. The CI failures seem unrelated to you changes, and will likely go away.

@dmytrorykun CI is now green

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 8, 2024
@facebook-github-bot
Copy link
Contributor

@dmytrorykun merged this pull request in 2d547a3.

@vonovak vonovak deleted the feat/UIModalPresentationStyle-RCTConvert branch March 11, 2024 12:46
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants