You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .storybook/guides/deprecation.mdx
+30-23Lines changed: 30 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,36 +26,43 @@ When a component is deprecated, it is no longer recommended for use. Though the
26
26
If you have any questions or concerns about this deprecation, please feel free to contribute to the discussion here or reach out to us directly.
27
27
```
28
28
29
-
### Storybook
30
-
31
-
- Create a new folder with the component name in `.storybook/deprecated`, i.e., `.storybook/deprecated/quickaction`.
32
-
- Copy `*.stories.js` and `metadata/*.yml` into the new folder (directly, not nested inside subfolders).
33
-
- Open up and edit the title of the `*.stories.js` default export to be prefixed with the `Deprecated` category, i.e., `title: "Deprecated/Quick actions"`.
34
-
- Update any local references to point to the package name instead, i.e.,<br/>_Original_:<br/>`import { Template } from "./template";`<br/><br/>_Updated to_:<br/>`import { Template } from "@spectrum-css/quickaction/stories/template.js";`.
35
-
- In the parameters section of the `*.stories.js`, there are 2 important updates to make:
36
-
- Add `chromatic: { disable: true },` to ensure it no longer runs regression tests.
37
-
- Update the `status` type to `deprecated`:
38
-
```json
39
-
parameters: {
40
-
chromatic: { disable: true },
41
-
status: { type: "deprecated" }
42
-
},
43
-
```
44
-
45
-
### Documentation
46
-
47
-
Update the status of the component to `Deprecated` in the `*.yml` file. Add any additional migration notes to the `deprecationNotice` keyword. i.e.,
29
+
### Flagging the component as deprecated
30
+
31
+
Before removing the component from the codebase, we need to flag the component as deprecated and publish those changes to the package registry. This will allow downstream consumers to see that the component is being deprecated and provide them with the deprecation notice and migration path. It will also provide a foundation for removal of the component from the codebase without breaking local references.
32
+
33
+
1. Create a new branch for the deprecation. i.e., `git checkout -b deprecate-quickaction`.
34
+
2. Open up any `*.stories.js` files inside the component's folder:
35
+
a. Edit the title of any exported stories to be prefixed with the `Deprecated` category, i.e., `title: "Deprecated/Quick actions"`.
36
+
b. Update any local references to point to the package name instead, i.e.,<br/>_Original_:<br/>`import { Template } from "./template";`<br/><br/>_Updated to_:<br/>`import { Template } from "@spectrum-css/quickaction/stories/template.js";`.
37
+
c. In the parameters section, there are 2 important updates to make:
38
+
- Add `chromatic: { disable: true },` to ensure it no longer runs regression tests.
39
+
- Update the `status` type to `deprecated`:
40
+
```json
41
+
parameters: {
42
+
chromatic: { disable: true },
43
+
status: { type: "deprecated" }
44
+
},
45
+
```
46
+
3. Update the status of the component to `Deprecated` in the `*.yml` file. Add any additional migration notes to the `deprecationNotice` keyword. i.e.,
48
47
```yaml
49
48
name: Quick actions
50
49
status: Deprecated
51
50
deprecationNotice: Use an <a href="actionbar.html">action bar</a> to allow users to perform actions on either a single or multiple items at the same time, instead.
52
51
```
52
+
4. Commit these changes and open a pull request to the main branch. i.e., `git commit -m "chore(quickaction): prepare for deprecation"`.
53
+
5. Once the pull request is approved, merge the changes into the main branch and publish the update to the package registry.
53
54
54
-
### Codebase
55
+
At this point you can choose to either immediate move on to the next steps or give a preset amount of time for feedback and concerns to be raised. If you choose to wait, make sure to communicate the timeline to the Spectrum Web Components team and downstream consumers.
55
56
56
-
- Delete the package from the components directory.
57
-
- Add the deprecated component's package and last version to the root package.json. i.e., `"@spectrum-css/quickaction": "^3.1.1",`.
58
-
- Reach out to one of the package maintainers to officially deprecate the package in the package registry with the provided deprecation notice from design. Do not try to run the deprecation command unless you know that you have publishing permissions on npm. i.e., `npm deprecate @spectrum-css/[email protected] "This package has been deprecated. Use an action bar to allow users to perform actions on either a single or multiple items at the same time, instead."`.
57
+
### Removal from the monorepo
58
+
59
+
Once the deprecation notice has been communicated and the above steps completed, we can remove the component from the codebase safely without breaking local references.
60
+
61
+
1. Create a new folder with the component name in `.storybook/deprecated`, i.e., `.storybook/deprecated/quickaction`.
62
+
2. Copy `*.stories.js` and `metadata/*.yml` into the new folder (directly, not nested inside subfolders).
63
+
3. Delete the package from the `components` directory.
64
+
4. Add the deprecated component's package and last version to the monorepo's root package.json. i.e., `"@spectrum-css/quickaction": "^3.1.1",`.
65
+
5. Reach out to one of the package maintainers to officially deprecate the package in the package registry with the provided deprecation notice from design. Do not try to run the deprecation command unless you know that you have publishing permissions on npm. i.e., `npm deprecate @spectrum-css/[email protected] "This package has been deprecated. Use an action bar to allow users to perform actions on either a single or multiple items at the same time, instead."`.
0 commit comments