-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Component library adding global index and other housekeeping #16441
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
@@ -4,7 +4,7 @@ | |||
* Reads all the icon svg files in app/images/icons | |||
* and returns an object of icon name key value pairs | |||
* stored in the environment variable ICON_NAMES | |||
* Used with the Icon component in ./ui/component-library/icon | |||
* Used with the Icon component in ./ui/components/component-library/icon/icon.js |
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.
Corrects path
/** | ||
* Addition style properties to apply to the button. | ||
*/ | ||
style: PropTypes.object, |
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.
Missed from ButtonBase housekeeping
f4c9c20
to
9c6daaf
Compare
9c6daaf
to
1f4c26b
Compare
Builds ready [1f4c26b]
Page Load Metrics (2378 ± 161 ms)
Bundle size diffs
highlights:storybook
|
export { Button } from './button'; | ||
export { ButtonBase } from './button-base'; | ||
export { ButtonIcon } from './button-icon'; | ||
export { ButtonLink } from './button-link'; | ||
export { ButtonPrimary } from './button-primary'; | ||
export { ButtonSecondary } from './button-secondary'; |
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.
Similar to what you did with TextFieldBase, it would be nice to export the constants as well.
export { Button } from './button'; | |
export { ButtonBase } from './button-base'; | |
export { ButtonIcon } from './button-icon'; | |
export { ButtonLink } from './button-link'; | |
export { ButtonPrimary } from './button-primary'; | |
export { ButtonSecondary } from './button-secondary'; | |
export { Button, BUTTON_TYPES } from './button'; | |
export { ButtonBase, BUTTON_BASE_SIZES } from './button-base'; | |
export { ButtonIcon, BUTTON_ICON_SIZES } from './button-icon'; | |
export { ButtonLink, BUTTON_LINK_SIZES } from './button-link'; | |
export { ButtonPrimary, BUTTON_PRIMARY_SIZES } from './button-primary'; | |
export { ButtonSecondary, BUTTON_SECONDARY_SIZES } from './button-secondary'; |
Looks like will need to actually add export of BUTTON_LINK_SIZES, BUTTON_PRIMARY_SIZES, and BUTTON_SECONDARY_SIZES to the index file of their folder.
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.
Yeah, I can add any that are already exported from the index. Then we could add all the missing consts as apart of another housekeeping round? Otherwise this PR will just need to be constantly updated and waiting on others?
Explanation
What is the current state of things and why does it need to change?
Currently to import a component from the
component-library/
you have to import it from it's folder. This means for every component there is a new line of code.What is the solution your changes offer and how does it work?
index.js
file and exports all of the components that currently exists from it.ui/pages/
directory e.gui/pages/page-name/page-name.js
folderbutton-base.js
Screenshots/Screencaps
Before
After
Manual Testing Steps
ui/components/app/account-list-item/account-list-item.js
import { AvatarAccount } from '../../component-library'
yarn storybook
AccountListItem
in the search barPre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.