-
Notifications
You must be signed in to change notification settings - Fork 460
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
Split text generation into different files #1240
Conversation
If we split the library code so the text support is optional there also, which should be "SwiftProtobuf"? The full library with the text support or the main library with only the binary support? i.e. - do we add something like "SwiftProtobufCore" or "SwiftProtobufTextSupport"? |
I'm tempted to split it even finer, but I've not looked into how this actually would work in practice:
"TextSupport" is likely to be confusing -- that looks like it only applies to TextFormat, not all text-based formats. |
The naming support for enums (in its current form), has both TextFormat and JSON support. I believe trying to isolate that likely would make things larger in a bunch of cases when both are desired since it currently is optimized for overlapping cases to carry less data. |
I should add for completeness, should binary be optional? There might be some folks that only ever use JSON even though it isn't as good at evolving the schema with time. edit: the generated code might not be different since we still need field numbers for the other formats; it would be more from a runtime library pov. |
@tbkka any more thoughts on the "TextSupport" vs. trying to split TextFormat and JSON, seems like that split would mean supporting both ends up with more bloat. Also, do we isolate binary so it is optional? One of the things I punted on originally was what to do with Any when things are optional, I guess all the conversion apis start failing if support for the needed types wasn't built in (just like if it wasn't registered)? |
This still works for reference if anyone wants to look at picking up this work formally, but closing this PR since it's now somewhat out of date. |
This is a draft towards #18.
If we want to go in this directions, there's still a few things needed to be done: