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

Add Support for Swift 6 #81

Open
woutergoossens opened this issue Dec 11, 2024 · 10 comments
Open

Add Support for Swift 6 #81

woutergoossens opened this issue Dec 11, 2024 · 10 comments

Comments

@woutergoossens
Copy link

Context πŸ•΅οΈβ€β™€οΈ

Our Design System (fully built in SwiftUI) is a separate Swift Package and is optimized for Swift 6.
We use the PrefireTestsPlugin for preview tests.

What 🌱

When I update our swift-tools-version to 6.0 I receive the following errors:
Screenshot 2024-12-11 at 09 01 43
Screenshot 2024-12-11 at 09 01 32
Screenshot 2024-12-11 at 09 01 25

Proposal πŸŽ‰

Is it possible to update Prefire to Swift 6 and make it compatible with Swift Concurrency?

@woutergoossens
Copy link
Author

woutergoossens commented Dec 12, 2024

Hi @BarredEwe Thanks for the update. But I still get the same issues with I run the preview tests? In the PreviewTests file.. Should I update the stencil file?
Screenshot 2024-12-12 at 08 00 10

@woutergoossens
Copy link
Author

And we get that issue because we have components that are marked with @mainactor

@BarredEwe
Copy link
Owner

@woutergoossens Can you attach an example View with this error?

@woutergoossens
Copy link
Author

woutergoossens commented Dec 12, 2024

Yes, created an example.
You need to enable PrefireExample app to use Swift Language version 6.

If you add this ButtonTestView, it will fail
ButtonTestView.swift.zip
Screenshot 2024-12-12 at 10 15 00

To make the code compile, we can add @mainactor above the static func Contained. But then the preview tests will fail.
Screenshot 2024-12-12 at 10 18 28

@BarredEwe
Copy link
Owner

Thank you very much for your contribution to the project! The example helped to fix these errors. Added the fix to the latest release

@woutergoossens
Copy link
Author

woutergoossens commented Dec 16, 2024

Hi! Updated to the latest release but now I get the following errors with Xcode 16.2 ->
Screenshot 2024-12-16 at 11 28 57

I don't use the PlayBookView, only the PrefireTestsPlugin..

@BarredEwe
Copy link
Owner

Hi! This problem is reproduced only in Xcode 16.2. I had to update and immediately got it fixed!
Done in the latest release.

@woutergoossens
Copy link
Author

Indeed, was only with the Xcode 16.2.. Thanks for the fast update!
Updated and works. Thanks!!

@woutergoossens
Copy link
Author

Screenshot 2024-12-16 at 21 52 21

Only some warnings now regarding deprecation.

@woutergoossens
Copy link
Author

In the PreviewTests also a warning when Swift 6 is enabled..

Screenshot 2024-12-17 at 09 33 11

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

No branches or pull requests

2 participants