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

[visionOS] Implement isVision interfaceIdiom #2077

Merged
merged 3 commits into from
Feb 17, 2024

Conversation

Saadnajmi
Copy link
Collaborator

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary:

Cherry pick a couple of changes to introduce the isVision API so that we can write visionOS specific JS. This is a cherry pick of two commits already upstream, plus an extra one to add the method to Platform.macos.js,

Changelog:

[VISIONOS] [ADDED] - Implement isVision interfaceIdiom

Test Plan:

CI should pass

okwasniewski and others added 3 commits February 17, 2024 13:05
Summary:
This PR introduces the `vision` interfaceIdiom to check if the app runs on visionOS.

An update to the documentation should follow this change.

[IOS] [ADDED] - Introduce `vision` interfaceIdiom

Pull Request resolved: facebook#42243

Test Plan: This change has been used in `react-native-visionos` and the interfaceIdiom changes **only** when running in the non-compatibility mode. But it's still useful to have this upstream if at some point React native would compile to visionOS natively

Reviewed By: cortinico

Differential Revision: D52730028

Pulled By: cipolleschi

fbshipit-source-id: 711c5c2c6c7fe05b3ff8da7383b5e63e9e04acfa
Summary:
This PR is a follow up for facebook#42243 it looks like we need to return `false` for the Platform.android.js to make flow happy.

This is the error we were getting in `react-native-visionos` CI/CD:
![CleanShot 2024-01-19 at 13 01 19@2x](https://github.com/facebook/react-native/assets/52801365/218078b3-44d4-4dc0-bee7-f5d2e08eca50)

[INTERNAL] [FIXED] - Add `isVision` interface idiom for Platform.android.js

Pull Request resolved: facebook#42381

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D52905993

Pulled By: NickGerleman

fbshipit-source-id: 125d33b63e9114cb6276b554e426f32e0c406ea8
@Saadnajmi Saadnajmi merged commit 2a774a0 into microsoft:main Feb 17, 2024
16 checks passed
@Saadnajmi Saadnajmi deleted the isVision branch February 17, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants