Yarn: Compatibility of Constant-holding classes

Created on 27 Mar 2021  路  6Comments  路  Source: FabricMC/yarn

Now that we've added unpick, we have constant holding classes.

I want to talk about their binary compatibility across renames. Unlike yarn names, the constant-holding classes do not have stable intermediary names; they are more like classes in the api.

We need to determine our policy on these classes to minimize the negative effect of name changes or moves of these classes on the users.

discussion unpick

Most helpful comment

Sure, I guess we will just enforce compileOnly configuration for the constant jar. And I've added a warning in the package javadoc as well.

On a side note, will this NbtType from base api be deprecated and scheduled for removal once we get #2201 in?

All 6 comments

Hmm, should we generate intermediary for the constant classes? Just in case we rename them and binary compatibility may break.

They are binary compatible as they are compile only. They can be renamed and changed just like any yarn name without worry.

What if people try reflection on the field values?

Nothing we can do about that, it will break in dev so seems fine to me. There are loads of things people can do to cause issues, this seems like a none issue to me.

Sure, I guess we will just enforce compileOnly configuration for the constant jar. And I've added a warning in the package javadoc as well.

On a side note, will this NbtType from base api be deprecated and scheduled for removal once we get #2201 in?

So we now have a general grasp on the compatibility of these constant classes. If compatibility problems arise in the future, we will address in separate issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Draylar picture Draylar  路  6Comments

liach picture liach  路  4Comments

enbrain picture enbrain  路  4Comments

ChloeDawn picture ChloeDawn  路  6Comments

copygirl picture copygirl  路  6Comments