Deprecating Components

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.

Deprecate components

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:

$bit
Copiedcopy
See command synopsis

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 foo/bar has been deprecated successfully

The component has been modified. Snap it and export it to its remote scope.

$bit
Copiedcopy

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.

Undeprecating components

To undeprecate a component that has been deprecated use the following command:

$bit
Copiedcopy

Deprecating components in Lanes

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.

$bit
Copiedcopy
See command synopsis

The component will only be fully deprecated on the main lane once the lane it is deprecated on is merged.