Keeping development in sync with different server versions

While looking into this issue regarding backward-incompatible changes, I was thinking about how to realize that best. I am not talking about the switching of the types as suggested by @ChristophWurst but the best way to keep the development of the app up.

As the \OCP\DB\Types class was just recently added to the master branch on the server repository I have the problem that I cannot simply use it. There might be old installations that are not yet updated and thus do not know of this class. I do not even know if this will be backported to the versions before 21. Is it going to be backported for any new release also of the old major versions?

I could of course add a test for the version of the NC server or if a class is existing. This would cause trouble as soon as an instance of the class is needed as this would break the dependency injection. Here DI is not the problem but the question is also related in this direction.

Another option would be to have multiple branches for our app development and keep a version per NC server major version. This sounds quite tedious for me. Therefore, I ask what ist the intended use case to cover with such situations?

Thanks
Christian

1 Like

I’m in a similar bind. I’ve curently got a branch for pre-20 and one for 20. I’m reluctant to add another one however. I guess the simplest way is to polyfill the class in the app yourself, and use your own version until you no longer have to support <=20.

In general I agree: It’s tedious to keep up with the breaking changes in server. I wonder if there is a way to outsource part of the server API into a module similar to the vue components on the client. That way everyone can decide on their own when to upgrade. But then we’ll probably run into PHP dependency hell.