-
Notifications
You must be signed in to change notification settings - Fork 127
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
Remove tvOS platform from react-native repo #111
Comments
A case to remove it from core: The build targets for tvos cause a headache for those of us tooling pbxproj files. Being able to trust that the pbxproj contains build and test targets, rather than alien life-forms, would make manipulating that file and providing tooling around native components for iOS much easier. |
I don't personally use React Native with tvOS, however, there was a recent contribution to the Lean Core NetInfo package by @hufkens. Maybe they could provide a counter point? |
@brunolemos and @holospeed , can you give some detailed comments on your current shipping (or plans to ship) React Native tvOS apps? or just provide more detail? :D |
We are currenly working on an app for Apple TV, Android TV, Tablets and Phones. The app is almost in beta and will be released. So it is possible in my opinion. The fact is that there are not a lot of developers making apps for tvOS in general. |
@hufkens thanks for answering! can you elaborate on your projected monthly active users for that platform? are you doing full pass QA on all platforms in parallel? is a commercial vendor like You.i TV an option for the tvOS platform? (if you're trying to cover TV and STBs, they also provide support for Fire Stick, video game consoles, etc). |
We are building a new platform for a TV provider that would be used by thousands of users cross-platform. The main focus would be Android TV, but we also are building an Apple TV app and the Mobile apps. With react-native we can reuse a lot of code between the mobile apps and the tv apps. We had a lot of issues with the focus engine (both on tvOS and on Android) but these were in most cases related to navigation and stacking screens, (more specifically with react-navigation). We fixed these issues. I've been adding support for tvOS already to several libraries: react-native-netinfo, react-native-screens, react-native-gesture-hander, ... Adding support is not that hard. Most of the times it's copying the main target changing the platform and it should work. Sometimes you'll need to add some compiler flags for API's that are not available on tvOS. |
This is great information, thanks for sharing it! Is maintaining the tvOS build and reviewing related PRs something your team can contribute to moving forward? |
We use React Native for the Vodafone Iceland streaming app on iOS, Android and tvOS. We had a few issues when we were developing the tvOS app, mainly build issues and issues with the focus engine not behaving as we wanted it to (especially with react-navigation). We are a very small team (2 developers) developing tv streaming solutions for tvOS, Android, iOS, Web and STBs, so it is very important for us to be able to reuse as much code as possible. |
Thanks for all the feedback so far! I feel that the ideal solution would be, similarly to other out-of-core platforms like |
I'm gratified to see that there are a few developers and companies who are building RN tvOS apps! 👍 At the time my work was merged, the main issues with tvOS were happening when Facebook would push changes to open source master while running only their own CI, not the open source CI. I don't know if this process is still in place or not. I know podspecs supports tvOS, not sure about carthage. I'll have to think about what Fabric and the other upcoming changes @matthargett mentioned would do from a tvOS perspective. To answer the questions in the original post:
|
How would that work then? Now we have the advantage that almost every library can easily be supported because iOS and tvOS are very similar. Only some API’s are not available on tvOS and some extra features (focus) are added. Also what about Android TV? A lot of the API’s about focus are similar to the tvOS API. Will that then be removed from the core too? Don’t get me wrong. If this is a better way to go forward let’s do so. But I think it would be react-native-tv and not react-native-tvos which will include tvOS and the Android tv API’s. |
Adding |
+1 to what @rdheck said. Multiple targets were an issue for link and CLI from the very beginning since we haven’t designed the system to support multiple targets. It’s doable, but it’s an added complexity that we haven’t had time to support properly yet. |
I'm voting for extract tvOS support to separate repo, something like react-native-tvos |
Why not |
Yeah, @dlowder-salesforce, that would be good step towards decreasing the burden. On the other hand, maybe it's no longer the case, since we are migrating towards CocoaPods. Including @orta and @alloy that work on this feature - would tvOS support be something we can easily handle with CocoaPods? Regarding keeping it in a separate project, while this is technically good and valid approach, the similarity between these two platforms is an interesting opportunity (aka low hanging fruit). Technically, I think we should be able to have a separate project, with its separate I am just not sure about the files that use some APIs that are not supported on tvOS. Right now, I think we overcome this by a bunch of macros. While this approach isn't maintainable from the long term perspective, it allows us to share majority of the codebase, which indeed, is similar between tvOS and iOS. Keeping them entirely separate would increase the effort to keep it up to date. |
I think even in the CocoaPods world, you'd have a similar-ish experience - it makes it easier for users of React Native to use tvOS, but it probably won't affect the core dev maintenance experience |
Whatever the plan is for tvOS, it is probably similar to macOS from Microsoft as they’ve also mentioned it shares a significant amount of code with iOS. Maybe @acoates-ms can connect the right person who works on that platform. |
(I’m still catching up somewhat on the state of Lean Core, the separation of platform support, and how CocoaPods ties in exactly, but I’d be happy to join a meeting with people actively doing this and see how I could contribute.) |
@tom-un would really be the right person to talk about macOS. The main issue with getting macOS to be out of tree, and this presumably applies to tvOS too is that code is so similar that a couple of #ifdefs in the iOS code basically gets you there. To properly have the core not know about macOS or tvOS we'd have to do massive refactoring to create a base set of "apple" files in core (or even in a seperate apple package that the ios package and macOS packages would both depend on), that we can share without having to change the core. Given the scope of that work, we are at least waiting until after fabric to do reevaluate what that work would look like. |
@acoates-ms thanks for the explanation. Is macOS already using the same UIKit APIs that iOS does? I remember seeing macOS/iOS unification demoed at WWDC last year, but thought it was still not released by Apple. |
It's great to have this discussion and I wouldn't mind a separate tvOS package to get it off the core but abandoning the platform completely would be sad imo. I shipped a tvOS app built with React Native for a non profit in Germany with around 1000 users. That's nothing compared to the >500k iOS app but porting the iOS app to the tvOS platform was done in no time and I really admired React Native for that. We're now preparing a launch across Europe and I was a bit sad to see that |
@mxmtsk We also use the We use
Isn't there a way to move |
just PSA: noone is proposing to do that. We are simply trying to figure out the best way to get it maintained while not being an overhead on the main dev cycle for the main repo. |
Ok, given what I just saw about TabBarIOS removal, it seems tvOS is going to be broken unless it gets its own repo. I volunteer to create and maintain that repo. I’d prefer that it be in the react-native-community workspace.... who can give me the required access? |
that's great, thanks @dlowder-salesforce! Btw if anyone wants to help you maintaining it it would be great, given that a few developers here seem to be using it extensively! (are you on the new Discord btw? It would be easier to comm there for the extraction) |
Yep I'm on Discord, we can continue this discussion there. For you sports fans following at home, the new repo will be at https://github.com/react-native-community/react-native-tvos (nothing there yet, so be patient :) ) |
I'm going to close this an invite you all over at https://github.com/react-native-community/react-native-tvos - if you want to help @dlowder-salesforce please feel free to write here or reach out on the repo or DM me directly on twitter and we'll help you out 🤗 |
I'm interested to join the discussion and also contribute. I'm on Discord and Twitter so feel free to contact me. |
@dlowder-salesforce: for the macOS port of react-native (in our ms fork) we wrote a thin UIKit api layer for macOS. This api is in the fork's RCTUIKit.h header. For some types that are semantically very similar between iOS and macOS, like NSColor/UIColor, NSFont/UIFont, etc, we merely made aliases (like The macOS fork, like the tvOS implementation, obviously relies heavily on the iOS RN implementation. For the macOS and tvOS implementation to live outside of the rn repo, we'd either have to duplicate a ton of ObjC code, or refactor code into shared Apple modules with ios, tvos, and macOS implementations dependent on the core Apple pieces. |
Is there a reason that tvOS or macOS can’t have react-native as a git sub-module and reference the shared code from an xcode project? Having out of tree platforms leverage the platform plugin, rather than mixing custom code in a fork, seems like the better approach for reducing maintenance overhead. |
Its not just referencing the code RN, but at least right now adding huge numbers of #ifdef MAC to the ios code which also currently has a bunch of #ifdef tvOS. To do it properly would involve refactoring all those files into applebase and ios files, in the main RN repo. -- Which I think is still the long term goal. But together with facebook we decided not to try to do all that until post fabric. |
Can you please advice what have you done with |
There are few differences still hanging around. ie resolution of WKWebView and focus management |
I have some questions about tvos and ios in react-native apps I am using react-native to build ios apps. Here I found tvOS file in my project. These are the questions
|
I have been trying to leverage the react-native-community/react-native-tvos fork for the past few days in hopes of migrating an existing React Native application that already runs on iOS and Android. However, I am having so many issues just getting the application to build or deploy. First I tried just creating a new project target in the existing workspace, but that proved very difficult. Then I tried initializing a brand new react native project with the default RN commands which failed since I now need to use this fork. Then I tried creating another new project following the instructions in this fork which did let me at least build a tvOS application with the starter code. However, now that I'm trying to move in all my original code, I get constant problems because none of the podfiles for existing extensions have If you are going to drop support, please provide some sort of migration path or suggestions on how someone seeking to migrate an existing app which runs on iOS to tvOS can move forward. I knew that touch gestures would obviously not work, but going by the React Native docs which I understand are out of date with respect to this fork, it should all just "just work". One thought in the react-native-tvos/react-native-tvos#11 discussion is to have a dedicated |
@zero298 besides react-native-reanimated, what are your other third party dependencies? I will be happy to try and help you if I can. |
@zero298 Your problem is indeed in the 3rd party libraries. Some have tvOS support, but forgot to add the correct platforms in the .podspec file. I already tried to fix some of them by submitting a PR. It's a very small change and library maintainers will be happy to merge it. Here's an example: zoontek/react-native-localize#70 |
I realize this issue is already closed but wanted to add our 2 cents. We evaluated
We'd like folks reading this issue to reconsider dropping support for tvOS from core but instead continue merging PRs that
|
@benoitdion -- I do agree that having a fork is not ideal. However, tvOS really is not supported any more in core, even though it may almost work "after a few build and setup hurdles". There is no longer any CI to make sure that tvOS even compiles. The #ifdef TARGET_OS_TV macros can be removed or broken at any time, and the focus guide and menu button improvements from If the core team would like to change their minds and go back to supporting tvOS, that would be great, and I personally would love that.... but I don't think that's likely to happen. See this comment for why I made the tvOS repo a fork and not a module. Right now, I think the big gaps for tvOS are
and those are issues regardless of whether tvOS is supported in core or not. P.S. Once it's ready, I'd love to see your custom solution for focus management! :) |
Introduction
Support for the tvOS platform was contributed primarily by @dlowder-salesforce a few years ago. Due to the SDK similarities between tvOS and iOS, quite a few things became seemingly easy to implement with simple compile-time flags.
Due to a lack of users shipping React Native apps on the tvOS platform, challenging real-world disparities reported by users who have tried porting React Native iOS/Android TV apps to the platform, and the overhead of keeping the build running and working by the Core Team, we think the platform should be removed from the main repo.
The Core of It
As we start to make build system changes to accomodate podspecs, carthage, Fabric, TurboModules, and other upcoming changes, tvOS remains a source of friction.
React Native on tvOS has had two years to build up a user base, but due to underlying limitations of tvOS itself, it seems most people go entirely native on that platform. After several polls on social media, and asking the original contributors, we have been unable to find anyone who is shipping React Native apps on tvOS.
For users who decide to do this, React Native 0.59 is a great release (with Hooks, etc) they can still use. For future releases, we would suggest someone sponsor an out-of-tree tvOS platform plugin, like other platforms (react-native-windows, react-native-linux, react-native-dom, etc) have done very successfully.
Discussion points
The text was updated successfully, but these errors were encountered: