react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

feat: add react-native-macos support

Open shirakaba opened this issue 1 year ago • 26 comments

Summary

~~Adds react-native-macos support and integrates react-native-test-app.~~

~~Downside: downgrades react-native from ^0.74.2 to ~0.73.9 in order to keep all React Native versions on the same minor (which reduces the chance of duplicated dependencies like Metro).~~

Update:

  • Adds react-native-macos support
  • Adds a new example folder, example-macos, based on react-native-test-app. This is a compromise to allow us to continue to develop Fabric on react-native v0.74 whilst still having access to react-native-macos which is limited to v0.73 for now. Mixing them in the same folder would result in clashes of tooling like the CLI and Metro, as discussed below.

Test Plan

I've ported the existing iOS sample app to macOS so we can test it manually. Not sure whether this repo has automated tests.

Status

PR now ready for review as the following tasks have been completed.

See now-complete checklist of tasks
  • [x] Get the macOS example app to build.
    • It's complaining about /Users/jamie/Documents/git/react-native-safe-area-context/example/macos/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:172:1 Property with 'retain (or strong)' attribute must be of object type. It sounds like this issue, but I've not been able to figure out how to fix it.
    • It's also complaining about _providerView and _bridge being unavailable. Perhaps due to the same root cause.
    • Would be nice if the Pods project would stop targeting macOS 10.6. It's specified in the generated example/macos/Pods/Pods.xcodeproj/project.pbxproj, but I'm not sure how to configure that declaratively.
  • [x] Check whether all the other platforms are working.
image image

In future

Once [email protected] is available, it would be nice to use a single example directory again and use React Native Test App to manage all the platforms.

shirakaba avatar Jul 23 '24 14:07 shirakaba