MDS uses SemVer semantic versioning. The three types of versions are:
MDS uses major versions for breaking changes. Some breaking-change examples include:
padding
, margin
, width
, height
, display
, box-sizing
, position
, left/right/top/bottom
font-size
, font-weight
, line-height
, letter-spacing
@font-face {
src: url('../fonts/0b8e0455ef09.eot');
}
Changing that hard-coded path to:@font-face {
src: url('fonts/0b8e0455ef09.eot');
}
Is a breaking change. Similarly:.selector {
background-image: src('/this/path/file.png’);
}
Changing that hard-coded path to:.selector {
background-image: src('/that/path/file.png’);
}
Is a breaking change.Changes to box-model properties that affect the internal layout within a component may not be breaking changes. For example, this Menu change was deemed non-breaking because spacing adjustments occurred in a positioned element that doesn’t otherwise impact page layout.
Such changes are reviewed on a case-by-case basis. The MDS team may contact the broader engineering and design communities for additional input.
aria
attribute) that destroys text-to-speech, keyboard navigation or other assistive functionality.aria
attribute) that improves accessibility is not a breaking change. That is a new feature.aria
attribute) that is incorrect is not a breaking change. That is fixing a defect.<button>Text</button>
Inserting an inner-wrapper<button><span>Text</span></button>
This is not a breaking change, as long as the first example without the inner wrapper looks visually identical to previous versions of that same markup. Altering an icon’s pictogram significantly while retaining the icon name. For example, an icon named “alert” changing from:
to:
Changing to a different font-family may be a breaking change if the new font has drastically different size characteristics that would cause text wrapping to behave differently.
Minor versions are for non-breaking changes that add features. Some examples include:
aria
attributes to improve accessibility.Patch versions fix defects and optimize existing code. Some examples include:
<label class="mds-form__label" for="">Email</label>
<input id="email" class="mds-form__input">
Corrected to:<label class="mds-form__label" for="email">Email</label>
<input id="email" class="mds-form__input">
Altering use of a constant key within the System’s stylesheets:
Constants.scss
$mds-text-color-primary-default: #1e1e1e;
$mds-color-neutral-12: #1e1e1e;
Button.scss
.mds-button {
color: $mds-color-neutral-12;
}
Changed to:
Button.scss
.mds-button {
color: $mds-text-color-primary-default;
}
Version numbers are assigned prior to a release. To assign a version, the team will review the changes that have been made since the last version and assess those changes against the SemVer rules outlined above. It’s imperative that the team adhere to the rules based solely on the way the codebase has changed in order to assign the correct semantic version. The team should not consider the following when assigning a version:
A frequently asked question from newcomers to SemVer is this:
If even the tiniest backward-incompatible changes to the public API require a major version bump, won’t I end up at version 42.0.0 very rapidly?*
*from SemVer.org’s FAQ
This is a question of responsible development and foresight. Incompatible changes should not be introduced lightly to software that has a lot of dependent code. The upgrade cost (incurred by users of MDS) can be significant. Having to bump major versions to release incompatible changes means you’ll think through the impact of your changes and evaluate the cost/benefit ratio involved.
If a backward-incompatible change is released unintentionally, the MDS team will follow the process outlined on semver.org:
As soon as the team realizes that we’ve released a breaking change as part of a minor release, we will release a new minor version that corrects the problem and restores backward compatibility.
Even under this circumstance, we will not modify versioned releases (i.e. if we release a breaking change in 1.5, we will not simply overwrite version 1.5; we will release a new version 1.6 that fixes the breaking change).
We will document the offending version and inform MDS users of the problem. We will also remove download links to the breaking version and, if possible, remove the broken package from MSNexus NPM and Bower.