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

Mention protobuf #1

Open
jvican opened this issue Oct 29, 2017 · 5 comments
Open

Mention protobuf #1

jvican opened this issue Oct 29, 2017 · 5 comments

Comments

@jvican
Copy link

jvican commented Oct 29, 2017

I see you mention Contraband in the README. I think you should mention Protobuf as the standard solution to evolve bincompat class definitions for procools. Protobuf is more popular than protobuf and has awesome support for scala https://github.com/scalapb/ScalaPB.

@jvican
Copy link
Author

jvican commented Jan 9, 2018

/cc @jatcwang

@jatcwang
Copy link
Owner

@jvican I gave it a quick run but when I add a new field to my protobuf definition, the generated case class's unapply method signature changed thus breaks bin compat.

Do you have an example of a library using this for bin compat reasons? Perhaps I'm missing some configuration

@jvican
Copy link
Author

jvican commented Jan 12, 2018

We use it in Zinc, and protobuf does not break bincompat in any case. It is a superior alternative than contraband, see this discussion sbt/zinc#351.

In protobuf you can even change the name of a field in a message, and it's still bincompat because it's index-based.

@jatcwang
Copy link
Owner

I think I'm missing something here. Class file binary compatibility vs protocol/wire binary compatibility are different things and we are addressing the former in this guide.

Here's my test project: https://github.com/jatcwang/test-scalapb-bincompat

It compiles right now, but if you add a new field to person, the signature of Person.unapply changes, causing compilation error and breaking bin compat. Contraband does not have this problem

@jvican
Copy link
Author

jvican commented Jan 14, 2018

Doh, you're right, I forgot that scalapb was breaking bincompat at the class level. I complained about this several months ago in their gitter channel, but they didn't seem interested in addressing it. It's a pity.

Do you think it would be useful at least to add a section to the readme explaining what are the differences between wire bincompat and Scala bincompat, and how people may want the former rather than the latter (especially in servers and web apps)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants