facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
229.31k stars 46.96k forks source link

[Compiler Bug]: eslint-plugin-react-compiler versioning strategy breaks semver #31173

Closed lukpsaxo closed 1 month ago

lukpsaxo commented 1 month ago

What kind of issue is this?

Repro steps

semver sorts versions alpha-numerically but the version of each release is 0.0.0-experimental-HASH

So basically it is sorted by the hash... which makes renovate want to downgrade the compiler and ignore new versions.

Can you change it to

0.0.1-experimental-date-HASH

with the 0.0.1 from now on in order to break out from the current bad versioning strategy?

poteto commented 1 month ago

@lukpsaxo you should be pinning babel-plugin-react-compiler to a specific version rather than a ^ which should solve your issue. The fix would not be to modify our versioning strategy, which we've chosen for consistency with regular React experimental releases

lukeapage commented 1 month ago

@poteto thanks for replying.

we do pin. The problem is renovate creates PRs to update all the time and it picks the last release according to semver - which because of the broken format is not the latest release. And i don’t believe it’s a renovate “bug” - it picks the highest alpha numeric value..

poteto commented 1 month ago

@lukeapage looking at the renovate docs, you should be able to configure it such that it either ignores the compiler packages altogether, or pass a regex to only allow a minimum version of >0.0.0?

lukeapage commented 1 month ago

Yes I can disable updates.. but I would like to stay updated with changes ?

if you can’t fix this for some internal reason you can close this and I will live with it - it just seemed a straight forward fix from the outside.

poteto commented 1 month ago

I deleted those extra random tags which were accidentally pushed a while back, so I think this should fix your issue going forward since presumably now any dependency management bot will pick up the correct latest version.

poteto commented 1 month ago

Could you try using this extractversion option? The reason I don't want to change our experimental package names is for consistency, we have the exact same versioning pattern for react. Either way, I think the best course here is to try out the various options provided in renovate to see if you can fix it for your repo instead of changing this upstream which has implications on packages that depend on React experimental releases.

I will close this for now.

lukpsaxo commented 4 weeks ago

Thanks for the suggestion, I tried extractversion, it didn't work but I did come up with a config that does work - hopefully this comment helps someone.

        {
            matchPackagePatterns: ['eslint-plugin-react-compiler'],
            followTag: 'latest',
        },

The followTag makes it ignore the versions published and just pickup the tag value as the latest version.