firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.42k stars 1.43k forks source link

[FR]: Switch from _implementation_only to Swift 5.9 internal package imports #13031

Open paulb777 opened 1 month ago

paulb777 commented 1 month ago

Description

Investigate switching from _implentation_only to Swift 5.9 internal package imports

API Proposal

No response

Firebase Product(s)

All

andrewheard commented 3 weeks ago

The AccessLevelOnImport feature being introduced in Swift 6 (SE-0409) works in Swift 5.9 by setting the following on a target in Package.swift:

swiftSettings: [
  .enableExperimentalFeature("AccessLevelOnImport")
]

However, in targets with resources, e.g., resources: [.process("Resources/PrivacyInfo.xcprivacy")], the resource_bundle_accessor.swift generated by SPM does not specify access levels resulting in errors like Ambiguous implicit access level for import of 'Foundation'; it is imported as 'public' elsewhere.

The upcoming feature InternalImportsByDefault doesn't appear to be available in Xcode 15.x but the issues above are resolved in Xcode 16. Let's hold off on using the new access-level modifiers on import declarations until Firebase moves to a minimum of Xcode 16 in the future.