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 a generation option to control use of forward declarations in headers. #9568

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

thomasvl
Copy link
Contributor

@thomasvl thomasvl commented Mar 2, 2022

Swift importing ObjC drops methods/properties if the type is only a forward
declaration since the type is incomplete. Historically the generator has always
use forward declarations to reduce how much will have rebuild when a proto file
does change; but that puts it at odds with Swift. If ObjC Protos end up spanning
Swift modules, the Swift import behavior could become a problem; so this option
provides a control for the behavior. The current behavior is to continue forward
declarations, but eventually the default will be changed.

Generate the WKTs using imports instead of forward decls.

@thomasvl
Copy link
Contributor Author

thomasvl commented Mar 2, 2022

@dmaclach fyi

@dmaclach
Copy link
Contributor

dmaclach commented Mar 2, 2022

Can you add me as a reviewer? I can't seem to do it for some reason...

@thomasvl
Copy link
Contributor Author

thomasvl commented Mar 2, 2022

Can you add me as a reviewer? I can't seem to do it for some reason...

I think this repo/project locks down reviewers.

@fowles fowles requested a review from haberman March 2, 2022 17:43
Copy link
Contributor

@dmaclach dmaclach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval.. all documentation nits I believe.

objectivec/README.md Outdated Show resolved Hide resolved
objectivec/README.md Outdated Show resolved Hide resolved
objectivec/README.md Outdated Show resolved Hide resolved
objectivec/README.md Outdated Show resolved Hide resolved
objectivec/README.md Outdated Show resolved Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_file.cc Outdated Show resolved Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_file.cc Outdated Show resolved Hide resolved
…ders.

Swift importing ObjC drops methods/properties if the type is only a forward
declaration since the type is incomplete. Historically the generator has always
use forward declarations to reduce how much will have rebuild when a proto file
does change; but that puts it at odds with Swift. If ObjC Protos end up spanning
Swift modules, the Swift import behavior could become a problem; so this option
provides a control for the behavior. The current behavior is to continue forward
declarations, but eventually the default will be changed.

Generate the WKTs using imports instead of forward decls.
@thomasvl thomasvl merged commit bb4302e into protocolbuffers:master Mar 3, 2022
@thomasvl thomasvl deleted the use_imports branch March 3, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants