Hello :wave:. I've been thinking about the challen...
# library-development
m
Hello 👋. I've been thinking about the challenges of maintaining backwards compatibility in libraries and wondered at what points would you use the Deprecation Levels? I've been using
WARNING
by default and then removing the signatures on a major version bump. But why, for example, shouldn't I just mark everything as
HIDDEN
by default? What approaches do you take?
m
• Major version `n`:
WARNING
• Major version
n+1
:
ERROR
• Major version `n+2`: remove symbol
1
You can use
HIDDEN
if you know the symbol is used a lot and you want to maintain binary compatibility. kotlinx.coroutines is doing it here for an example.
j
I would use hidden directly (without warn-error cycle) if there is an overload that is source compatible. Like if you add a new parameter with a default value to a function, you can keep the original function and mark it as hidden.
1
z
See also

https://youtu.be/cCgXtpVPO-o

m
Thanks everyone 🙏. And thanks for the video Márton. That's exactly what I was looking for. Some great advice there.