-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor FXIOS-14485 FXIOS-14472 [Swift 6 Migration] Turn on Swift 6 at the Project Level, as well as Client and ClientTest targets #29
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
base: coderabbit_full_base_refactor_fxios-14485_fxios-14472_swift_6_migration_turn_on_swift_6_at_the_project_level_as_well_as_client_and_clienttest_targets_pr3
Are you sure you want to change the base?
Changes from all commits
d2785f9
deec164
3d59665
822ec78
54d158b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,7 @@ class BrowserWebUIDelegate: NSObject, WKUIDelegate { | |||||||||||||||
| _ webView: WKWebView, | ||||||||||||||||
| runJavaScriptAlertPanelWithMessage message: String, | ||||||||||||||||
| initiatedByFrame frame: WKFrameInfo, | ||||||||||||||||
| completionHandler: @escaping @MainActor @Sendable () -> Void | ||||||||||||||||
| completionHandler: @escaping @MainActor () -> Void | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "BrowserWebUIDelegate.swift" -type fRepository: qodo-benchmark/firefox-ios-combined-coderabbit Length of output: 197 🏁 Script executed: cat -n ./firefox-ios/Client/Frontend/Browser/BrowserViewController/WebEngineIntegration/BrowserWebUIDelegate.swift | head -120Repository: qodo-benchmark/firefox-ios-combined-coderabbit Length of output: 4953 🌐 Web query:
💡 Result: In Xcode 16 / Swift 6, a number of WebKit delegate APIs were re-imported with stricter concurrency annotations. For Fix (sync completionHandler form)Update your implementation to: func webView(
_ webView: WKWebView,
runJavaScriptAlertPanelWithMessage message: String,
initiatedByFrame frame: WKFrameInfo,
completionHandler: `@escaping` `@MainActor` () -> Void
) {
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default) { _ in
Task { `@MainActor` in completionHandler() }
})
present(alert, animated: true)
}If you keep the old Alternative fix (use the async overload)Some SDKs also offer an If you must support older Xcodes tooUse conditional compilation to provide both signatures: `#if` compiler(>=6)
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String,
initiatedByFrame frame: WKFrameInfo,
completionHandler: `@escaping` `@MainActor` () -> Void) { /*...*/ }
`#else`
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String,
initiatedByFrame frame: WKFrameInfo,
completionHandler: `@escaping` () -> Void) { /*...*/ }
`#endif`Sources: Citations:
Add The Suggested change func webView(
_ webView: WKWebView,
runJavaScriptAlertPanelWithMessage message: String,
initiatedByFrame frame: WKFrameInfo,
- completionHandler: `@escaping` `@MainActor` () -> Void
+ completionHandler: `@escaping` `@MainActor` `@Sendable` () -> Void
) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| ) { | ||||||||||||||||
| legacyResponder?.webView?( | ||||||||||||||||
| webView, | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 7872
🏁 Script executed:
Repository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 1696
🏁 Script executed:
Repository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 1681
🏁 Script executed:
Repository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 357
Update contributor PR workflow to support Swift 6.0 toolchain.
The main CI (Xcode 16.2) is properly configured for Swift 6.0, but the contributor PR workflow (
firefox-ios-build-contributor-pr.yml) uses Xcode 13.1, which only supports Swift 5.5. This will cause all external contributor PRs to fail with Swift 6.0 compilation errors. Update the workflow to use Xcode 16.2 or later to match the production build environment.🤖 Prompt for AI Agents