Component deprecation can be useful when migrating users away from the component and ensure a smooth transition.
When components are deprecated in Bit, they are marked as deprecated in both the component UI and in the CLI, as well as in the component's package.json. Ensuring consumers aware of the deprecation, with the option of also advising a new component ID to use instead.
When you deprecate a component you update it. This requires the component to be authored in your workspace or imported into it in order to process the deprecation.
Run the following to deprecate a component:
New ID is optional, but allows you to direct users to the new component you expect them to use instead. The output should display the following:
The component has been modified. Snap it and export it to its remote scope.
The component's deprecated
status can be seen in the UI (scope and workspace), as well as in the terminal when running bit show
, bit status
, bit install
, etc.
To undeprecate a component that has been deprecated use the following command:
You can also deprecate components in Lanes, to include the deprecation itself for review. To deprecate in a lane, create a new lane and deprecate the component.
The component will only be fully deprecated on the main lane once the lane it is deprecated on is merged.
You can deprecate specific versions or entire ranges of components using the following command:
bit deprecate hello-world --range 1.1.2