RomanIakovlev / timeshape

Java library to find timezone based on geo coordinates
MIT License
151 stars 32 forks source link

Update to proto 4.X #136

Open rafael-andrade-3010 opened 3 months ago

rafael-andrade-3010 commented 3 months ago

Hello! I would like to check with you if you have plans to update this lib to use protoc 4.X, I tried a bit locally but no success.

Thanks in advance

RomanIakovlev commented 2 months ago

Hi! From what I understand, protoc as such has current version of 26.X, while protobuf for Java have current version 4.26.x, or some such. Having said that, when you suggest upgrading to protoc 4.X you probably mean protobuf 4.X, right? Because protoc version range is already in twenties.

I wonder if you have tried bumping the version here? https://github.com/RomanIakovlev/timeshape/blob/70079536dcc3f1a3df3d112b4efb75cd47b285c8/build.sbt#L82

If that doesn't work right away, maybe upgrading the sbt-protoc plugin and "com.thesamet.scalapb" %% "compilerplugin" library in https://github.com/RomanIakovlev/timeshape/blob/master/project/plugins.sbt first would help?

Putting those technicalities aside, I think there's also a question of backwards compatibility here. Increasing the major version from 3 to 4 is a breaking change, so people who still rely on major version 3 of protobuf won't be able to use the new releases of Timeshape if it switches to major version 4. I've just realized the version 3.21.12 that's currently used is quite ancient, so it would definitely make sense to upgrade to 3.25.x, but going directly to major version 4 is probably too early.

Speaking of when we could switch to protobuf major version 4, I would follow this version support guide here: https://protobuf.dev/support/version-support/#java:

That is, I'd upgrade to major version 4 somewhere towards the end of this year, or in early 2025, when the public support ends.

To get support for major version 4 earlier, it will be necessary to build a new artifact, e.g. net.iakovlev:timeshape-pb4:x, or something like that, and publish it in parallel with the standard net.iakovlev:timeshape:x. In all honesty I'm not too keen on doing that myself, because that would complicate the build definition somewhat, and I personally don't have a need for that.

If you need it, the easiest way would probably be for you to (temporarily) fork Timeshape, build that -pb4 version for yourself, and use it until the main version switches to the protobuf major 4 version.