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

Project Catalyst. Does it truly deprecates this RN fork? #244

Closed fungilation closed 5 years ago

fungilation commented 5 years ago

I wrote about what I see about adapting my iPhone app to iPad and Mac at https://github.com/react-native-community/discussions-and-proposals/issues/131#issuecomment-499181756. Reposting here but discussion should centralize over at @react-native-community:


Ya I'm looking for docs and experience on this. How automatic is such "porting" from iPad to Mac?

Relevant, important links while I was researching this:

I disagree about treating ipadOS support in RN like tvOS. The latter is very different, while ipadOS is for all intents and purposes of app makers, the same as iOS 13. Dimensions window support for Split View and Slide Over on iPad in #16152 link above means afaik, I got what I need to fully convert my iPhone RN app to support the iPad's screen. Add splitView so my 1 column iPhone layout become 2 columns, then it should be ready for the new Catalyst conversion for macOS.

Apple's new HIG docs for iPad apps on Mac says explicitly that splitView on iPad will get automatic conversion to equivalent on macOS.

So this is my own plan for bringing my iPhone app (WonderSwipe) to iPad and Mac. Am I missing anything that needs RN core support to make happen, or am I right that all the pieces are already in place as I've outlined above? RNN provides the splitView, while Xcode 11 provides not just iPad layout but also a new Mac option you simply turn on. Will share hiccups I get along the way.

Anyone else thinking/planning something similar, on iPad/Mac adaptations of your RN apps? What else do you see missing inside RN that's needed for these adaptations?

ptmt commented 5 years ago

I think yes, Catalyst + RN is the future, and this project is effectively dead. Eventually macOS 10.15 will get a good adoption, and community will come with pretty good solutions for all edge cases.

matt-curtis commented 5 years ago

Deprecating this project seems odd to me. To my knowledge, Catalyst is about making it easy to port UIKit-based apps to macOS — it's literally UIKit for Mac. That's not the same as having a React paradigm for native AppKit controls. SwiftUI is close, but that's macOS 10.15+ only and, you know, not Javascript.

ptmt commented 5 years ago

On the one hand you're right — 10.15 is quite a heavy and indeed limiting requirement, and desktop UI is so much more than just UIKit for iPad (Catalyst) now. But on the other hand, let's face it, the core value react-native-macos is (or at least was 3 years ago) the engine itself, the ability to run React Native on macOS, using the same View, Text and other primitives. Which never worked well, due to limitations of AppKit. And the engine always way behind the React Native. But when you need something truly native and unique you always ended up writing a bunch of untrivial Objective-C (NSSplitView, text editors, etc., etc.)

Few UI wrappers around AppKit controls and APIs probably and hopefully can be just npm libraries now, since Catalyst allows to use AppKit from UIKit app.

Anyway, you're right, a word "deprecated" probably too much, there are use cases and React Native big refactoring gives hope that there is a solution to solve current react-native-macos problems. I removed "deprecated" and will add a more detailed note to README later after some experimenting.

LukasBombach commented 5 years ago

There's a PR

https://github.com/facebook/react-native/pull/25427