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

Swift 6 support #108

Open
ipodishima opened this issue Nov 26, 2024 · 14 comments
Open

Swift 6 support #108

ipodishima opened this issue Nov 26, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@ipodishima
Copy link

ipodishima commented Nov 26, 2024

Hello!

I'm trying to switch my app to Swift 6 and I'm having a lot of errors with Route Composer.
Is there any plan to support Swift 6?

I don't know how deep this would be to be honest.

Thanks

Edit: Given this is a big part of my app, I'm trying to work on it but it's my first time migrating to this concurrency thing so I might not do it properly, and I have a build error on the example project. It's working fine on my app though!

https://github.com/ekazaev/route-composer/compare/master...ipodishima:route-composer:feature/swift6?expand=1

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

@ipodishima Hi. I am planning to bring swift6 support shortly. But I dont see issues with RouteComposer if you are not wrapping it into @mainactor and concurrency in my Swift6 project. But I can assure it is planned.

@ipodishima
Copy link
Author

@ekazaev Hi!

Yeah I actually had issues where the factory was not letting me create controllers given build was not a main actor.
Anyway, don't know if you saw, but made a lot of changes as a draft in the branch ipodishima/route-composer@master...ipodishima:route-composer:feature/swift6

Warnings are gone on my side

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

I looked at this, Id probably go slightly different route and put main actor to the entire entity, there is no reason to mark individual calls as MainActor, route-composer deals with UIKit exclusively - so there is no way for it to work off the main thread.
But yes, techniclally the task is to drop the MainActor everywhere. Just it did not bite me yet hard enough :)

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

Please check 2.11.0 version

@ipodishima
Copy link
Author

🙈🫣😅

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

@ipodishima There is somethign strange. The example app compiled ad passed the test. But the library doesnt compile in the real project. Trying to understand why. Seems just funky compiler issues that it passed

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

Command SwiftCompile failed with a nonzero exit code It seems I rushed a bit releasing. But XCode reassured me that all good)

@ekazaev
Copy link
Owner

ekazaev commented Nov 27, 2024

@ipodishima I think Ill roll back. It was too easy and create a branch that you can contribute to. Cant spend more time on it right now unfortunately.

@ipodishima
Copy link
Author

I’ll take a look on tomorrow.
On my side everything was working except the project with examples with the same weird error.

As for main actor on protocol I agree. At first, I didn’t know about everything so I wasn’t sure it would be all main thread ahah. So I pulled a thread.

Besides that, thank you for this library, I really like it. Some things are a bit obscure and sometimes complex to use but our navigation improved.

@Savva-Shuliatev
Copy link

In the fork, I attempted to migrate the route-composer to Swift 6. I followed the logical path that the library works only within the UI, which means I could cover all entities and protocols with @mainactor, and at most, handle some aspects with Sendable.
However, the root protocols do not propagate @mainactor to their subsequent protocols, requiring almost every file to be updated.
Ultimately, the production version never transitioned to Swift 6 :)
We're eagerly awaiting the update <3

@ekazaev
Copy link
Owner

ekazaev commented Dec 3, 2024

@ipodishima Thank you very much for the kind words.

I will give it another look shortly. But I am extremely busy this days, but will try to find some time.

@ekazaev
Copy link
Owner

ekazaev commented Dec 3, 2024

@Savva-Shuliatev Hi. What fork are you mentioning?

In the fork, I attempted to migrate the route-composer to Swift 6. I followed the logical path that the library works only within the UI, which means I could cover all entities and protocols with @mainactor, and at most, handle some aspects with Sendable. However, the root protocols do not propagate @mainactor to their subsequent protocols, requiring almost every file to be updated. Ultimately, the production version never transitioned to Swift 6 :) We're eagerly awaiting the update <3

@ekazaev ekazaev self-assigned this Dec 3, 2024
@ekazaev ekazaev added the enhancement New feature or request label Dec 3, 2024
@ekazaev
Copy link
Owner

ekazaev commented Dec 4, 2024

@ipodishima
I started to look at it again and got lost. I took your branch and it is here origin/chore/swift6_support_from_ipodishima - It doesnt compile is I enable Strict concurrency checks.
Meanwhile the approach to @mainactor that I was stinging about is here origin/chore/swift6_support and it doesnt compile because the compiler is crashing.

@ekazaev
Copy link
Owner

ekazaev commented Dec 4, 2024

@ipodishima
I tried to add route-composer as a local package just to check if cocoapods causing compiler issues - but it seems that the compiler is broken. Even attached as a package if I try to compile an independent project - compiler crashes when it comes to the code like:

    @MainActor
    private static var city = StepAssembly(finder: ClassFinder<UISplitViewController, Void>(),
                                           factory: StoryboardFactory(name: "Split"))
        .adding(LoginInterceptor<Void>())
        .using(GeneralAction.replaceRoot())
        .from(GeneralStep.root())
        .assemble()

And I have no idea what to do. There is nothing bad about this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants