isosphere / yew-bootstrap

Bootstrap 5 Components for the Yew Framework
https://crates.io/crates/yew-bootstrap
MIT License
37 stars 18 forks source link

Explicitly Use Semantic Versioning #23

Closed isosphere closed 1 year ago

isosphere commented 1 year ago

https://github.com/hometown-fork/hometown is a fork of mastodon that stays updated with upstream changes. Our needs for versioning are similar. Here's the section of the hometown readme regarding versioning:

Hometown uses semantic versioning and follows a versioning convention like v1.0.0+2.9.3. The 1.0.0 part is the actual Hometown version number, and then the 2.9.3 after the + sign is what's known in semantic versioning as "build metadata". It just means that a particular release is synchronized with Mastodon version 2.9.3, so for example an upgrade from v1.0.0+2.9.2 to v1.0.0+2.9.3 would upgrade Mastodon but not provide any new Hometown features or fixes.

I like that approach more than ours:

0.x.y Versions that have the same x value target the same version of Yew.

There is currently no indication of which version of Bootstrap is targeted, however, we’ll try to target the previous release pipeline. For example as of this writing the latest boostrap is 5.2.x, so we’ll try to target the latest 5.1.x version.

We might need to include two separate kinds of build metadata: one for bootstrap, and another for yew.

I'm not sure how well this will play with cargo, though.

isosphere commented 1 year ago

Cargo explicitly references https://semver.org/ - build metadata should be legal.

Here's an issue someone had with this in 2016: https://github.com/rust-lang/cargo/issues/2939. All related issues seem to be closed, I think it was an issue, but it's resolved. the semver crate is responsible for processing this.

Something to consider:

Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85, 1.0.0+21AF26D3----117B344092BD.

Hrm. Looks like the standard doesn't want us to rely so much on build metadata.

If we change Yew versions, that's probably going to be a major change for us each time - I don't think our users can mix and match Yew dependencies safely like that - it'll be incompatible without the change, i.e.: breaking change.

Therefore, each Yew change must increment our "MAJOR" version.

Bootstrap may or may not be a major change. That project is old and stable, and has lots of patch releases. Most changes will not be noticed by our end users - especially given that we are saving them from interacting with the underlying bootstrap objects and instead using our Rust abstractions.

isosphere commented 1 year ago

I have studied the semantic versioning document; as a result I don't think we need to specify any build metadata. We just have to be mindful about our public API and when we break it. We're still earlier than 1.0.0 at the moment, so breaking changes should be expected.

I reaffirm my above statement that a Yew version change, as of this writing, will necessarily be a major release for us. This will change when Yew reaches 1.0.0; at that point we'll have to make a judgment call for each update.

I have updated our README.md files to indicate that we will conform to semantic versioning.

I present here my notes on semantic versioning: