Visitar URL original
Add a generation option to control use of forward declarations in headers. by thomasvl · Pull Request #9568 · protocolbuffers/protobuf · GitHub
Skip to content

Add a generation option to control use of forward declarations in headers. - #9568

Merged
thomasvl merged 1 commit into
protocolbuffers:masterfrom
thomasvl:use_imports
Mar 3, 2022
Merged

thomasvl merged 1 commit into
protocolbuffers:masterfrom
thomasvl:use_imports

Conversation

@thomasvl

@thomasvl thomasvl commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

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 commented Mar 2, 2022

Copy link
Copy Markdown
Contributor Author

@dmaclach fyi

@dmaclach

dmaclach commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

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

@thomasvl

thomasvl commented Mar 2, 2022

Copy link
Copy Markdown
Contributor Author

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

@dmaclach dmaclach left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread objectivec/README.md Resolved
Comment thread objectivec/README.md Resolved
Comment thread objectivec/README.md Resolved
Comment thread objectivec/README.md Resolved
Comment thread objectivec/README.md 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