Continuing conversation in Kraków w/ @thymikee :
I think React Native Community should head towards embracing Swift.
I don't know CLI/RN core code very much, but I can offer to help out with the Swift / Xcode setup / CocoaPods bits.
Thanks for bringing that up! cc @orta @alloy
As an (non-default) option that seems reasonable to me.
Adding support to rn-cli will need an extra level of integration testing in RN core because Facebook doesn't build React Native itself as a dynamic framework which will have to be officially supported also. That was a lot of the work which lived in cp-rn-fixer because we use a framework build of React Native in the Artsy app.
Facebook doesn't build React Native itself as a dynamic framework which will have to be officially supported also
Hold on, why do it as a dynamic framework, and not statically linked one? Dynamic frameworks have launch time overhead, and so ever since Swift supports static linking, it's been my impression that it's best to do it that way, unless you specifically want a framework, for, say, app extension sharing
I'm just used to writing dynamic framework, static/dynamic doesn't matter here - the framework aspect is what's important 👍
Hey @radex 👋
That sounds great! I do agree with @orta that it should probably not be the default, because it may require the user to have to know more (as RN isn’t Swift) than they already wanted to know about the native bits.
Heya 👋, is this up for grabs? If so, I'd like to take it!
With RN 0.61.0 out the door with official support for use_frameworks! with Cocoapods, looks like the framework issue @orta mentioned is solved.
I'd go for something like react-native init MySwiftApp --use-swift to enable creating a Swift based RN project. Thoughts?
@glenna we prefer to defer such functionality to custom templates: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
@thymikee ahh, gotcha! I'll go in that direction, then.
Here's a template: https://github.com/glenna/react-native-template-swifty for use with 0.61.x ✨
Looks like Swift bridging header will be a part of 0.62 release because of Flipper integration:
cc @alloy @radex
Looks like Swift bridging header will be a part of 0.62 release because of Flipper integration:
Not exactly. The template will be made so that it can consume Swift libraries [such as FlipperKit]; if you want to write Swift you’ll still need to introduce a bridging header, but that should happen automatically anyways when adding Swift source, so I think it should be good?
@glenna : Can you write the steps to create that template project using swift???