Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 55b925eb3c6b6d494733e97cc3095bd518f993b9
      
https://github.com/WebKit/WebKit/commit/55b925eb3c6b6d494733e97cc3095bd518f993b9
  Author: Andy Estes <[email protected]>
  Date:   2025-06-25 (Wed, 25 Jun 2025)

  Changed paths:
    M Source/WebKit/Configurations/WebKitSwift.xcconfig
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebKitSwift/GroupActivities/WKGroupSession.swift
    M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift
    M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift
    M Source/WebKit/WebKitSwift/MarketplaceKit/WKMarketplaceKit.swift
    M Source/WebKit/WebKitSwift/Preview/WKPreviewWindowController.swift
    M Source/WebKit/WebKitSwift/RealityKit/WKRKEntity.swift
    M Source/WebKit/WebKitSwift/StageMode/WKStageMode.swift
    M Source/WebKit/WebKitSwift/TextAnimation/WKTextAnimationManagerIOS.swift
    A Source/WebKit/WebKitSwift/WebKitSwift.swift
    M 
Source/WebKit/WebKitSwift/WritingTools/IntelligenceTextEffectViewManager.swift
    M 
Source/WebKit/WebKitSwift/WritingTools/PlatformIntelligenceTextEffectView.swift
    M 
Source/WebKit/WebKitSwift/WritingTools/WKIntelligenceReplacementTextEffectCoordinator.swift
    M 
Source/WebKit/WebKitSwift/WritingTools/WKIntelligenceSmartReplyTextEffectCoordinator.swift

  Log Message:
  -----------
  Protocol conformances in WebKitSwift needlessly use @retroactive
https://bugs.webkit.org/show_bug.cgi?id=294955
rdar://154261967

Reviewed by Richard Robinson.

WebKitSwift vends Objective-C interfaces declared in headers imported by the 
WebKitSwift.h umbrella
header, but implements these interfaces in Swift using @objc @implementation 
extensions. In order
for the Swift compiler to see the Objective-C declarations, WebKitSwift defines 
a clang module
named WebKitSwift that imports WebKitSwift.h, and Swift files containing the 
implementations import
the WebKitSwift clang module. Since the WebKitSwift Swift module is named 
libWebKitSwift,
technically the Objective-C declarations come from a different module than 
their implementations.

This presents a problem when we attempt to conform these types to a protocol 
imported from another
module. Since the Swift compiler thinks both the interface and the protocol are 
from imported
modules, a "extension declares a conformance of imported type 'Foo' to imported 
protocol 'Bar'"
warning is emitted. Previously we have silenced this warning by annotating the 
conformance with
@retroactive, but it turns out this is unnecessary.

Similar to how Swift overlays are implemented in mixed-source frameworks, we 
can convince Swift
that our Objective-C interfaces come from the same module that implements them 
by giving both the
clang and Swift modules the same name (WebKitSwift), and importing the clang 
module via
`@_exported import WebKitSwift`. This allows us to remove the needless 
@retroactive attributes.

* Source/WebKit/Configurations/WebKitSwift.xcconfig:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebKitSwift/GroupActivities/WKGroupSession.swift:
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift:
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift:
* Source/WebKit/WebKitSwift/MarketplaceKit/WKMarketplaceKit.swift:
* Source/WebKit/WebKitSwift/Preview/WKPreviewWindowController.swift:
* Source/WebKit/WebKitSwift/RealityKit/WKRKEntity.swift:
* Source/WebKit/WebKitSwift/StageMode/WKStageMode.swift:
* Source/WebKit/WebKitSwift/TextAnimation/WKTextAnimationManagerIOS.swift:
* Source/WebKit/WebKitSwift/WebKitSwift.swift: Copied from 
Source/WebKit/WebKitSwift/MarketplaceKit/WKMarketplaceKit.swift.
* 
Source/WebKit/WebKitSwift/WritingTools/IntelligenceTextEffectViewManager.swift:
* 
Source/WebKit/WebKitSwift/WritingTools/PlatformIntelligenceTextEffectView.swift:
* 
Source/WebKit/WebKitSwift/WritingTools/WKIntelligenceReplacementTextEffectCoordinator.swift:
* 
Source/WebKit/WebKitSwift/WritingTools/WKIntelligenceSmartReplyTextEffectCoordinator.swift:

Canonical link: https://commits.webkit.org/296629@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to