ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.25k stars 429 forks source link

Interest in moving to RNPM plugin?? #186

Open jtag05 opened 6 years ago

jtag05 commented 6 years ago

I was wondering if there is any interest in moving from a full blown fork of react-native to a plugin approach like react-native-windows adopted. My current project requirements make utilizing this library rather difficult as it stands. While I'm sure I can finagle a solution to my issues, wrestling with the fork approach has piqued my interest in maybe trying my hand at adopting this package into an rnpm plugin. Any feedback would be much appreciated.

ericvicenti commented 6 years ago

One thing to note, its rumored that Apple will soon make it much easier to run iOS apps on macOS. We might want to wait for the 2018 WWDC cycle to see what they introduce, because it might make our lives a lot easier.

ptmt commented 6 years ago

Yes, this is my intention. The future of this project has 3 possible ways, there is a project with implementing cross-platform React Native based on Qt, there is the Microsoft team working on new modular architecture for React Native, and there is Apple supposedly working on "rescuing the market of desktop macOS apps". We might finally have a superset of UIKit and AppKit or something like this. Meantime I almost finished latest merging and it's been really exhausting, so it's not probably the right way how to do it. Even if Apple doesn't show anything, I'll spend some time on the new architecture.

Kudo commented 6 years ago

Updated rumor https://daringfireball.net/2018/04/scuttlebutt_regarding_ui_project. Declarative UI ! hope it's not only human readable storyboard & xib.

BTW, I was previously working on a new solution to port React Native into macOS. As current react-native-macos's model is fork and modify code directly, and React Native upstream is actively development. It would be a disaster to follow upstream.

I was proposing a layer called RCTXUIKit which is somewhat Chameleon did. I tried to use ObjC category or inheritance to make AppKit's interface compatible with UIKit. From React Native perspective,

  1. Only to import RCTXUIKit.h for most of code.
  2. Adding macOS support into React.xcodeproj, pretty like tvOS did.

This model should be maintainable with upstream, more than that I also hope if it could be merged into upstream. My current status is in early stage which still in fixing build break. I have no experience for macOS development still not sure if this model will works. Do you have any thought for this proposal?

ptmt commented 6 years ago

Declarative UI ! hope it's not only human readable storyboard & xib.

Read that too, very exciting news! I'm constantly playing with different libraries and languages, trying to understand that could be the future of desktop cross-platform UI framework. Really keen to learn what Apple's answer.

I was proposing a layer called RCTXUIKit which is somewhat Chameleon did.

There are certainly ways to improve this, discussions around it distributed across several threads and pull requests here. I've been waiting for "Marzipan" to decide on this, but we didn't get it last year ("UXKit") and we may not get it this year too. And of course hoping that it will solve all problems is too naive. The approach with RCTXUIKit will require changes in react-native codebase, which is not something we could afford right now, unless I'm missing something.

Adding macOS support into React.xcodeproj, pretty like tvOS did.

I'm a bit pessimistic about this, so looking into ways not to touch react-native codebase at all. I don't want to introduce any new complexity to their codebase, since it's already quite a monolith-like project. But I'm not the one who decides on the future of macOS fork, it's open source, plus there are multiple teams and multiple projects around this, someone will solve that problem. I will welcome any effort and any attempt, e.g. we can move this repo to a dedicated organisation namespace, I can give to everyone who's interested necessary permissions if you want.

keplersj commented 6 years ago

You all might be interested in this post-WWDC experiment done with React Native and UIKit for Mac (Marzipan): notjosh/Marzipants, and this GitHub issue: facebook/react-native#19559.

Kudo commented 6 years ago

Awesome @keplersj ! It's so surprising that the POC works without patching much code.