microsoft / TypeScript-React-Native-Starter

A starter template for TypeScript and React Native with a detailed README describing how to use the two together.
MIT License
1.91k stars 211 forks source link

Migrate Objective-C code to Swift #21

Closed aaronsky closed 6 years ago

aaronsky commented 6 years ago

This PR takes all Objective-C code in the ios folder and replaces it with a Swift analogue. It also adds some slight tweaks that were keeping the jsbundle from compiling that were addressed in #7 but never merged.

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

HofmannZ commented 6 years ago

Hi @aaronsky,

I really like Swift, but the code you just refactored is not actually from this repository, it's from facebook/react-native. I would suggest you open a PR there ;)

aaronsky commented 6 years ago

I understand that, but I also don't think there's any harm in deviating from that.

HofmannZ commented 6 years ago

Well I assume the purpose of this repository is to help new developers get started with React Native and Typescript. Microsoft created a great guide to do so, if you follow along correctly you should end up with the same files as inside the repository. If you made a mistake you can use this repository as a reference.

The change you prepose will completely change that reference. Where the developer following the guide expects to see Objective-C code there now would be Swift code. This might cause the developer to think that is the cause of the issue and start changing it while there is no need for it.

Also unlike Objective-C, the Swift runtime is not bundled into iOS, therefore this change would also add a couple mb to the bundle size 😬.

DanielRosenwasser commented 6 years ago

I don't want to deviate from the output of the actual instructions listed in the README. If the React Native initialization script migrates to a Swift base project, we can baseline that output. Thanks for the PR though @aaronsky.