Packages in the Core repository try to adhere to a one full major version deprecation cycle.
For example, if something is deprecated in version
, then it should not be removed until version . However, if someone was deprecated with a major version release, that thing can be safely removed in the next major version release. For example, deprecating an item in the release, it can be safely removed when is released.Whenever an item in the library is deprecated, the deprecation notes will include information on how to transition away from the item being deprecated. Eventually these notes become the migration guide when the deprecation becomes a decommission in a major version release.
The information is sourced from the JSDoc
and tags. The deprecation text should include some basic description of why the change and a and code sample block.For situations where we don't have something to migrate to, we should be very careful to validate with the UI Foundations team that deprecating is the right strategy.
There are times when a component needs to be drastically changed, but we don't want to introduce breaking changes just yet. An example of this has been
in the library.For situations like this, we recommend prefixing the "new" component that is being built with the
prefix, e.g. . This allows continued development of similar new components while avoiding the necessity to do a breaking version change in the library.The old component that is being superseded should be marked as
, with a migration guide to use the new, component.During the next major version release we would delete the deprecated component and drop
from the new component.The
tag includes the message that goes along with the deprecation, along with a simple and example code block.The
tag should list the current version of the library when the deprecation occurs. This will allow us to more easily adhere to the two version deprecation lifecycle.To deprecate a component, the component export should be annotated with a JSDoc comment including the
and tags.e.g. if we are deprecating the
component, it would look like so:To deprecate a prop on a component, the types should be updated to be annotated with a JSDOC comment included the
tag and the tags.It is not currently possible to deprecate individual parts of a union type using inline JSDoc comments.
In this case, while the comment is attached to 'sm', it will not enforce any deprecation warnings or alter behavior for string literals. The only viable approach is to include a general deprecation note on the entire union type rather than on individual values.
Depending on the impact of false postives, we may opt to not deprecate with
and instead manually add the deprecation to the list.Core-React's
re-export requires specific locations of JSDocs comments. It also requires on the subcomponents themself, and duplicating subcomponent notes.Finally we need to make sure the typedoc can import them.