Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate template to Swift #45

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

okwasniewski
Copy link
Contributor

@okwasniewski okwasniewski commented Aug 22, 2024

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.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

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.

template/ios/HelloWorld/AppDelegate.swift Show resolved Hide resolved
@okwasniewski okwasniewski changed the title feat: migrate to Swift for 0.76 feat: migrate to Swift Aug 22, 2024
@okwasniewski okwasniewski changed the title feat: migrate to Swift feat: migrate template to Swift Aug 22, 2024
@okwasniewski
Copy link
Contributor Author

okwasniewski commented Aug 22, 2024

@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
Contributor Author

@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 facebook/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
Contributor Author

Hey @cipolleschi

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

@cipolleschi
Copy link
Contributor

I think we can merge it! :D

@cipolleschi cipolleschi merged commit 0f4745b into react-native-community:main Sep 25, 2024
@okwasniewski okwasniewski deleted the feat/swift branch September 25, 2024 13:08
Sign up for free to 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