-
Notifications
You must be signed in to change notification settings - Fork 534
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
Move deprecated components to deprecated folder #1881
Changes from all commits
b77717f
406ef24
4ec87cb
8dfc010
ecda708
78b1520
7200501
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,5 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
|
||
Prepare library for `v35` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": major | ||
--- | ||
|
||
Move deprecated components to deprecated folder | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"_comment1": "this is required only for typescript. once this is fixed https://github.com/microsoft/TypeScript/issues/33079 we can remove this hack", | ||
"name": "@primer/react/deprecated", | ||
"types": "../lib-esm/deprecated/index.d.ts", | ||
"main": "../lib-esm/deprecated/index.js", | ||
"type": "module", | ||
"sideEffects": false | ||
} | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,6 +33,7 @@ import { | |||||
} from '@primer/octicons-react' | ||||||
import * as primerComponents from '@primer/react' | ||||||
import * as drafts from '@primer/react/drafts' | ||||||
import * as deprecated from '@primer/react/deprecated' | ||||||
import {Placeholder} from '@primer/react/Placeholder' | ||||||
import React from 'react' | ||||||
import {AnchoredOverlay} from '../../../../src/AnchoredOverlay' | ||||||
|
@@ -51,6 +52,7 @@ export default function resolveScope(metastring) { | |||||
...doctocatComponents, | ||||||
...primerComponents, | ||||||
...(metastring.includes('drafts') ? drafts : {}), | ||||||
...deprecated, | ||||||
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. Out of curiosity, why is deprecated different to drafts in that we aren't checking metadata like the preceding line? 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. I think it needs to be conditional, otherwise deprecated components will override components with the same name and you will always see deprecated components in scope ...
...primerComponents, // has Button, ActionMenu
...
...deprecated // also has Button, ActionMenu 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.
Suggested change
|
||||||
ReactRouterLink, | ||||||
State, | ||||||
CheckIcon, | ||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** This is the place where we keep components that are deprecated. | ||
* We don't recommend using it in production. | ||
* If you already use them, please move to the suggested alternative components | ||
* | ||
* But, they are published on npm and you can import them. | ||
* example: import {FormGroup} from '@primer/react/deprecated | ||
*/ | ||
|
||
export {default as BorderBox} from '../BorderBox' | ||
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. Are we intentionally importing these from 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. Well we don't have all the draft component in a separate folder, so I kept it the same for deprecated |
||
export type {BorderBoxProps} from '../BorderBox' | ||
export {default as Flex} from '../Flex' | ||
export type {FlexProps} from '../Flex' | ||
export {default as Grid} from '../Grid' | ||
export type {GridProps} from '../Grid' | ||
export {default as Position, Absolute, Fixed, Relative, Sticky} from '../Position' | ||
export type {PositionProps, AbsoluteProps, FixedProps, RelativeProps, StickyProps} from '../Position' | ||
export {default as Dropdown} from '../Dropdown' | ||
export type { | ||
DropdownProps, | ||
DropdownCaretProps, | ||
DropdownButtonProps, | ||
DropdownItemProps, | ||
DropdownMenuProps | ||
} from '../Dropdown' | ||
export {default as SelectMenu} from '../SelectMenu' | ||
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. Think you're missing the props for 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. Done! |
||
export type { | ||
SelectMenuProps, | ||
SelectMenuDividerProps, | ||
SelectMenuFilterProps, | ||
SelectMenuFooterProps, | ||
SelectMenuItemProps, | ||
SelectMenuListProps, | ||
SelectMenuModalProps, | ||
SelectMenuTabsProps, | ||
SelectMenuHeaderProps, | ||
SelectMenuTabProps, | ||
SelectMenuTabPanelProps, | ||
SelectMenuLoadingAnimationProps | ||
} from '../SelectMenu' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A TODO for later @pksjce, we'll need to put more specific breaking change release notes for the components that have moved in this PR.