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: Add visionOS Support #1803

Merged
merged 17 commits into from
Mar 12, 2024
Merged

feat: Add visionOS Support #1803

merged 17 commits into from
Mar 12, 2024

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Jan 29, 2024

Description

Add support to run visionOS apps with react-native-test-app, using @callstack/react-native-visionos. If one would like to override that and use a different fork (like react-native-macos, they can do so via the reactNativePath key of app.json.

Some caveats:

  • Separated setting @callstack/react-native-visionos as the default to commit a84c986 . I thought that was a good encapsulation of all the places we hardcode platform package names.
  • We use the iOS jsbundle for visonOS. That's how both @callstack/react-native-visionos and react-native-macos have set up their visionOS support.
  • I disabled booting and running tests on a visionOS simulator with c083feb. That passed for me locally, but fails in CI.
  • Some of the more "Extended" features like setting a custom app icon are not tested. visionOS in particular does use a different format App Icon, so I'm not sure that will work.

Platforms affected

  • Android
  • iOS
  • macOS
  • visionOS
  • Windows

Test plan

App launches. The new CI jobs (to be added) for visionOS should pass.
image

ios/test_app.rb Outdated Show resolved Hide resolved
ios/test_app.rb Outdated Show resolved Hide resolved
scripts/init.js Outdated Show resolved Hide resolved
scripts/init.js Outdated Show resolved Hide resolved
@Saadnajmi Saadnajmi force-pushed the visionos branch 2 times, most recently from 67f7bea to 63f29f1 Compare February 16, 2024 19:55
@Saadnajmi Saadnajmi marked this pull request as ready for review February 19, 2024 14:42
@Saadnajmi Saadnajmi force-pushed the visionos branch 3 times, most recently from 71d66cc to 22d8607 Compare March 3, 2024 22:42
@Saadnajmi Saadnajmi marked this pull request as draft March 3, 2024 22:42
@Saadnajmi Saadnajmi force-pushed the visionos branch 2 times, most recently from e6a3634 to c11f75d Compare March 8, 2024 23:07
@Saadnajmi Saadnajmi marked this pull request as ready for review March 8, 2024 23:38
Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

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

Great job! I'll try running this next week or so. For now, I've left some comments.

.github/labeler.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
example/visionos/Podfile Show resolved Hide resolved
example/visionos/Podfile Outdated Show resolved Hide resolved
scripts/xcodebuild.sh Outdated Show resolved Hide resolved
Comment on lines +43 to +45
192F052624AD3CC500A48456 /* ReactTestApp.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.release.xcconfig; sourceTree = "<group>"; };
192F052724AD3CC500A48456 /* ReactTestApp.common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.common.xcconfig; sourceTree = "<group>"; };
192F052824AD3CC500A48456 /* ReactTestApp.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.debug.xcconfig; sourceTree = "<group>"; };
Copy link
Member

Choose a reason for hiding this comment

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

Are the .xcconfig files for iOS close enough that we can reuse them?

Suggested change
192F052624AD3CC500A48456 /* ReactTestApp.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.release.xcconfig; sourceTree = "<group>"; };
192F052724AD3CC500A48456 /* ReactTestApp.common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.common.xcconfig; sourceTree = "<group>"; };
192F052824AD3CC500A48456 /* ReactTestApp.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReactTestApp.debug.xcconfig; sourceTree = "<group>"; };
192F052624AD3CC500A48456 /* ReactTestApp.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ../ReactTestAppShared/ReactTestApp.release.xcconfig; sourceTree = "<group>"; };
192F052724AD3CC500A48456 /* ReactTestApp.common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ../ReactTestAppShared/ReactTestApp.common.xcconfig; sourceTree = "<group>"; };
192F052824AD3CC500A48456 /* ReactTestApp.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ../ReactTestAppShared/ReactTestApp.debug.xcconfig; sourceTree = "<group>"; };

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The only difference is they set iOS deployment target instead of xros deployment target

Copy link
Member

Choose a reason for hiding this comment

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

Aha, maybe make them inherit the iOS ones and override that one prop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we want to do the same for macOS? The differences are minor
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made an attempt: #1896
Happy to mess with naming now that there's an extra platform suffix.

visionos/ReactTestApp/Assets.xcassets/Contents.json Outdated Show resolved Hide resolved
ReactTestApp-DevSupport.podspec Outdated Show resolved Hide resolved
ios/test_app.rb Outdated Show resolved Hide resolved
Saadnajmi and others added 5 commits March 10, 2024 15:51
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
.github/labeler.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
Saadnajmi and others added 4 commits March 11, 2024 06:38
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Saadnajmi and others added 4 commits March 11, 2024 09:02
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
This reverts commit 09144b4.
Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

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

image

Thanks for all your work! This has been a huge effort! I think this is good to go now. There are a few tiny things I want to address, but I can do that in a separate PR.

@tido64 tido64 merged commit cc2ad04 into microsoft:trunk Mar 12, 2024
30 checks passed
@tido64
Copy link
Member

tido64 commented Mar 12, 2024

Wiki updated:

@Saadnajmi Saadnajmi deleted the visionos branch March 12, 2024 18:16
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.

None yet

3 participants