Skip to content

Conversation

@TimJentzsch
Copy link

@TimJentzsch TimJentzsch commented Jan 11, 2026

Objective

Make it easily visible which Bevy version Avian currently supports.

Solution

Add a badge to the README which automatically queries the currently used Bevy version.

This is implemented with the "Dynamic TOML Badge" feature from shields.io.
It's used to query the current Bevy version from the Cargo.toml of Avian 2D (assuming the Bevy version is consistent across 2D and 3D).

Clicking on the Badge links you to the version table in the README.

Note

If the badge is desired, I can of course re-order it or change the labels to match your preference.

Testing

N/A


Showcase

RENDERED
Screenshot of the README with the added Bevy badge

@Jondolf Jondolf added A-Meta Relates to Avian and its maintenance as a project D-Trivial Nice and straightforward! A great choice to get started with Avian labels Jan 11, 2026
@Jondolf
Copy link
Member

Jondolf commented Jan 11, 2026

Huh, this is pretty neat!

My only concern here is that it's not entirely future-proof. It's very possible that we will eventually depend on sub-dependencies like bevy_ecs directly, instead of depending on bevy itself. Or maybe we restructure the crates and the crates/avian2d/Cargo.toml path is no longer valid. While we can just update this badge accordingly, the old badge will still be used for old Avian releases on crates.io (ex: v0.3.0).

It's not a big deal since those badges are kind of unnecessary for old releases anyway (since they reflect the current state, not the old one), but it does maybe look a bit wonky if there's just a fully broken badge on all old releases. Perhaps it's worth it though, I'm not entirely sure yet 🤔

@TimJentzsch
Copy link
Author

Good point, I hadn't thought about that.
One could make the argument that the badges on the crates.io page are misleading anyway, e.g. it will also show a different version of avian than you are currently viewing.
But still, worth to think about!

One way around it might be to hide the badge on crates.io entirely. If I remember correctly, you could use specific HTML comments to exclude parts of the Readme from being rendered...

@TimJentzsch
Copy link
Author

Found it.
So it doesn't work with HTML comments, but with custom CSS for rustdoc which hides elements with a given class.

So it adds a bit of complexity, but should "future-proof" it.
If that complexity is worth it for this little badge, I'll leave for you to decide :)

@Jondolf
Copy link
Member

Jondolf commented Jan 11, 2026

Hmm that's for rustdoc, but in this case we want to hide it from the README shown on crates.io, so it probably wouldn't work there? We don't embed the README into our crate docs, that page is separate

@DaAlbrecht
Copy link

It's not a big deal since those badges are kind of unnecessary for old releases anyway (since they reflect the current state, not the old one), but it does maybe look a bit wonky if there's just a fully broken badge on all old releases. Perhaps it's worth it though, I'm not entirely sure yet 🤔

Im not particularly big on badges (the bevy one is kinda neat since its actually helpful) but you could have them reflect the actual status by pointing to the tag i guess? But would be additional maintenance burden for a pretty small benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Meta Relates to Avian and its maintenance as a project D-Trivial Nice and straightforward! A great choice to get started with Avian

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants