-
Notifications
You must be signed in to change notification settings - Fork 645
ADR: Parallel drafts track & plan for deprecated components #1722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2aeacf3
3e7a92e
287c236
a5b65fa
10b76ca
7fe1927
bbc285c
5d3eef8
37419da
f71c2a8
8c5b1e4
fdfff6b
14f420b
f1396e2
3c6fdca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # ADR 5: Migration plan for deprecated components | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed | ||
|
|
||
| ## Context | ||
|
|
||
| As we work on maturity of our components, we will sometimes need to deprecate components that are replaced with new components. | ||
|
|
||
| ## Here are the 3 proposed stages: | ||
|
|
||
| ### Stage 1 | ||
|
|
||
| Start new component outside the main bundle. Folks who want to try it, need to explicitly import it from the `drafts` bundle. | ||
|
|
||
| `import { ActionMenu} from '@primer/react/drafts'` | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The contract with consumers is - you are opting into a rewrite of the old component that might not cover all the cases of the old component yet. If you are using both the old and new version of the component in different pages, you are paying some additional bundlesize cost. | ||
|
|
||
| Note: If it is a 1:1 replacement, it's useful to keep the component name the same for consumers. Internally, we would want to call the filename `ActionMenu2.tsx` and call it `ActionMenu2 v2` in the docs. | ||
|
||
|
|
||
| ### Stage 2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Non-blocking] We may want to consider a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that separate from
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand the question 😅 |
||
|
|
||
| After we have the confidence that this component is better than the old version of it, we swap the components and move the old component out of the main bundle. | ||
siddharthkp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| This is a breaking change! It’s recommended that you start using the new component, but if you’d like to push that effort to the future, we give you an easy way out - | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| `import { ActionMenu } from '@primer/react/deprecated'` | ||
|
|
||
| The deprecated component does not accept new features requests. | ||
|
|
||
| Reason: Because we have a single bundle for all components, you can not pick the components you want to upgrade. This can results in additional unrelated work. | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Stage 3 | ||
|
|
||
| After 3 months of living in the `deprecated` bundle, a component is retired/deleted from the codebase. | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| At this point, consumers are expected to plan migration work. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some additional notes for this section:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a long list for "deprecating a component" 😅 Should we add that to the contribution docs instead of ADR?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yup, makes sense to me 👍 |
||
|
|
||
| ## Relevant components: | ||
|
||
|
|
||
| Deprecated in favor of Box, ready for stage 2: | ||
|
|
||
| 1. BorderBox | ||
| 2. Flex | ||
| 3. Grid | ||
| 4. Position | ||
|
|
||
| Replaced with newer components | ||
|
|
||
| 5. Dialog - replaced with Dialog2, ready for stage 2 | ||
| 6. Dialog2 - ready for Stage 2 with rename, already in main bundle | ||
| 7. Dropdown - replaced with DropdownMenu, ready for stage 2 | ||
| 8. SelectMenu - replaced with SelectPanel?, ready for stage 2 | ||
| 9. SelectPanel - unclear if it should be renamed, already in main bundle | ||
|
||
|
|
||
| Future deprecations, replaced with newer components | ||
|
|
||
| 10. ActionList - replaced with ActionList2, need to plan for stage 2 | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 11. ActionList v2 - in drafts bundle, need to plan for stage 2 | ||
| 12. ActionMenu - replaced with ActionList2, need to plan for stage 2 | ||
| 13. ActionList v2 - in drafts bundle, need to plan for stage 2 | ||
| 14. Button - replaced with NewButton, need to plan for stage 2 | ||
siddharthkp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 15. NewButton - in drafts bundle, need to plan for stage 2 with rename | ||
Uh oh!
There was an error while loading. Please reload this page.