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 #88

Closed
wants to merge 3 commits into from

Conversation

okwasniewski
Copy link
Contributor

This PR adds visionOS support.

As I still can't get the build to work locally I decided to try to build dawn library on the CI

@okwasniewski okwasniewski mentioned this pull request Aug 26, 2024
@@ -24,6 +24,8 @@ const PLATFORM_MAP: Record<string, string> = {
arm64_iphoneos: "OS64",
arm64_iphonesimulator: "SIMULATORARM64",
x86_64_iphonesimulator: "SIMULATOR64",
arm64_xros: "VISIONOS",
arm64_xrsimulator: "SIMULATOR_VISIONOS",
Copy link
Owner

Choose a reason for hiding this comment

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

there is no x86_64_xrsimulator right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is tricky because there shouldn't be x86 simulator (because x86 macs are not supported for visionOS but I think we might need also to build it for x86 and include it in the slice).

When working with Hermes prebuilt, I encountered some issues when trying to upload the app to the App Store. (facebook/react-native#45911)

However at the moment there is no x86 build option in the ios.toolchain.cmake. Im going to add it and then contribute this back to https://github.com/leetal/ios-cmake

Copy link
Owner

Choose a reason for hiding this comment

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

I am building it now, next should I just try to run the example app on the xrsimulator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhm, its not so simple unfortunately :D We would need to setup visionOS in the example app: https://callstack.github.io/react-native-visionos-docs/docs/getting-started/integrate-into-existing-projects

Or create a new example.

At this point visionOS doesn't support skia so we might need to also disable it for visionOS. Now that I got the build working Im going to try to integrate visionOS into the example and run it there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've integrated visionOS into the example app and it (almost) works, for some reason the RectButton was not working so I swapped it for TouchableOpacity and it works!

Are you okay with keeping visionOS as an additional platform in the example app? (I can assist you with any updates / fixes regarding this platform)

@okwasniewski
Copy link
Contributor Author

Hey @wcandillon,

As I've been able to run the example app on visionOS are you okay with adding visionOS to the example folder? I will then finish the work on this. We can also consider migrating the example to use https://github.com/microsoft/react-native-test-app, which we've been using at Callstack for our test applications in OSS repos.

CleanShot.2024-08-26.at.16.24.41.mp4

@wcandillon
Copy link
Owner

@okwasniewski Sorry that I didn't mention it earlier but today I migrated to a monorepo where the example app is an expo dev-client app. Could that work for you? Let me know.

@wcandillon
Copy link
Owner

If you make a separate PR just for the build and so we have the prebuilt binaries + have them on github actions, I will merge it publish it asap.

@okwasniewski
Copy link
Contributor Author

Expo is unfortunately not supported (yet). If this is going to be a monorepo how about a separate project? I would love to run some visionOS CI to ensure that subsequential releases are not breaking the support as this library is crucial for that platform. Yeah, I can create a separate PR without the example

@wcandillon
Copy link
Owner

wcandillon commented Aug 29, 2024 via email

@wcandillon
Copy link
Owner

I think this is cool :) I just migrated to the monorepo. Could you add an visionpro in apps and with a simple example (e.g the red triangle). I will factorize the examples in its own package to be used in every apps/ And potentially we can even run e2e tests on the vision pro simulator if supported.

Thank you so much for your hardwork. Hope the monorepo stuff is not throwing a wrench into your work.

@okwasniewski
Copy link
Contributor Author

I think this is cool :) I just migrated to the monorepo. Could you add an visionpro in apps and with a simple example (e.g the red triangle). I will factorize the examples in its own package to be used in every apps/ And potentially we can even run e2e tests on the vision pro simulator if supported.

Thank you so much for your hardwork. Hope the monorepo stuff is not throwing a wrench into your work.

No worries, I will add this!

This might need to wait a little as I'm traveling for React Universe Conf next week but I will get back to this as soon as I can 👍🏻

@okwasniewski
Copy link
Contributor Author

Im going to close this one as the visionOS example added after #109 gets merged (as react-native-test-app supports visionOS)

@wcandillon
Copy link
Owner

that's exciting. So react-native-test-app is the way to go I didn't know about this thing

@Saadnajmi
Copy link
Contributor

@wcandillon We've switched a lot of React native libraries to use react-native-test-app as an easy way to keep maintenance and get out of tree platform support. visionOS and macOS for example get added with one file. My PR needs some work still, so I'd appreciate if anyone recognizes the errors I'm running into 😅

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