Skip to content

feat: migrate template to Swift - #45

Merged
cipolleschi merged 1 commit into
react-native-community:mainfrom
okwasniewski:feat/swift
Sep 25, 2024
Merged

feat: migrate template to Swift#45
cipolleschi merged 1 commit into
react-native-community:mainfrom
okwasniewski:feat/swift

Conversation

@okwasniewski

@okwasniewskiokwasniewski commented Aug 22, 2024

Copy link
Copy Markdown
Contributor

Summary:

This PR removes Objective-C from the template.

Now that the template is decoupled from the core repository we can shift from Objective-C to Swift.

The React_RCTAppDelegate is fully compatible to work with Swift:

One thing to figure out is the upgrade helper, but we had a similar situation while migrating from java to kotlin:

CleanShot 2024-08-22 at 16 32 07@2x

Note: We've been shipping Swift for React Native visionOS for last 3 major releases, so has been tested already.

Changelog:

[IOS] [ADDED] - Migrate from Objective-C to Swift

Test Plan:

Generate project using Swift template.

@cipolleschicipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this, but as I mention in chat, 0.76 will already have a lot of changes for the users. I'd like to be a little more conservative and wait for 0.77 before pushing the template in Swift to them.

WDYT?

Also... have we tried building an app with the template using

  • static framewors
  • dynamic frameworks

They must work without chages required before we can push these changes.

Comment threadtemplate/ios/HelloWorld/AppDelegate.swift
@okwasniewskiokwasniewski changed the title feat: migrate to Swift for 0.76feat: migrate to SwiftAug 22, 2024
@okwasniewskiokwasniewski changed the title feat: migrate to Swiftfeat: migrate template to SwiftAug 22, 2024
@okwasniewski

okwasniewski commented Aug 22, 2024

Copy link
Copy Markdown
ContributorAuthor

@cipolleschi It's your call if you think we can't squeeze Swift template into 0.76 then Im fine with 0.77 👍🏻

I want to start the discussion around this and polish all the edges that might still be missing. I will test out building with static and dynamic frameworks!

@okwasniewski

Copy link
Copy Markdown
ContributorAuthor

@cipolleschi I've just checked and it looks like both:

use_frameworks! :linkage => :dynamic

and

use_frameworks! :linkage => :static

Are building properly!

facebook-github-bot pushed a commit to react/react-native that referenced this pull request Sep 9, 2024
Summary:
This PR exposes the `newArchEnabled` flag and deprecates all of the separate methods to enable new architecture.
As discussed with cipolleschi here: react-native-community/template#45 (comment)
## Changelog:
[IOS] [DEPRECATED] - Deprecate turboModuleEnabled, fabricEnabled, bridgelessEnabled
[IOS] [ADDED] - Add newArchEnabled method to RCTAppDelegate
Pull Request resolved: #46228
Test Plan: Test if switching newArchEnabled flag from AppDelegate works.
Reviewed By: cortinico
Differential Revision: D61849385
Pulled By: cipolleschi
fbshipit-source-id: 8acf718386882679f00d2d5000b4432a523b34ac
@okwasniewski

Copy link
Copy Markdown
ContributorAuthor

Hey @cipolleschi

Is there anything else we need to get this one merged? The main branch is bumped for 0.77

@cipolleschi

Copy link
Copy Markdown
Contributor

I think we can merge it! :D

@cipolleschi
cipolleschi merged commit 0f4745b into react-native-community:mainSep 25, 2024
@okwasniewski
okwasniewski deleted the feat/swift branch September 25, 2024 13:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@okwasniewski@cipolleschi