-
Notifications
You must be signed in to change notification settings - Fork 435
Enable InternalImportsByDefault
in v2 modules
#2003
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
Conversation
.grpcProtobuf | ||
], | ||
swiftSettings: [._swiftLanguageMode(.v5), .enableUpcomingFeature("ExistentialAny")] | ||
swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] |
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.
This one doesn't have "InternalImportsByDefault"
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.
Yes, it's because there are a bunch of generated files in this module. I will enable it for this one in a follow up PR after I've changed the code generator.
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.
Cool, thanks for clarifying!
Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift
Outdated
Show resolved
Hide resolved
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.
LGTM, thanks Gus!
…tor (#2010) ## Motivation This is a follow-up of #2003. As of 5.9, Swift supports access-level modifiers on imports. In an upcoming Swift 6.x release, the default modifier will become `internal`. ## Modifications This PR adds explicit access-level modifiers to the generated code and a few other modules that use this generated code. ## Result Explicit access level imports present in more places.
…tor (#2010) ## Motivation This is a follow-up of grpc/grpc-swift#2003. As of 5.9, Swift supports access-level modifiers on imports. In an upcoming Swift 6.x release, the default modifier will become `internal`. ## Modifications This PR adds explicit access-level modifiers to the generated code and a few other modules that use this generated code. ## Result Explicit access level imports present in more places.
…tor (#2010) ## Motivation This is a follow-up of grpc/grpc-swift#2003. As of 5.9, Swift supports access-level modifiers on imports. In an upcoming Swift 6.x release, the default modifier will become `internal`. ## Modifications This PR adds explicit access-level modifiers to the generated code and a few other modules that use this generated code. ## Result Explicit access level imports present in more places.
…tor (#2010) ## Motivation This is a follow-up of grpc/grpc-swift#2003. As of 5.9, Swift supports access-level modifiers on imports. In an upcoming Swift 6.x release, the default modifier will become `internal`. ## Modifications This PR adds explicit access-level modifiers to the generated code and a few other modules that use this generated code. ## Result Explicit access level imports present in more places.
Starting with Swift 5.10,
InternalImportsByDefault
is an optional feature flag to make allimport
statements beinternal
by default, instead ofpublic
, which has been the default since the beginning in Swift.With a future language mode, this will become the new default, and all imports will be
internal
unless otherwise specified. The main reason for this change is to minimise dependency creep.This PR enables the feature flag on v2 modules, and adds
public
/package
access modifiers toimport
s where required.Note that sadly,
@usableFromInline
has not been implemented forimport
statements, so in@inlinable
/@usableFromInline
contexts where non-publicly-imported types are used, the only workaround for now is to import the module aspublic
. I've left a comment next to these imports.