Add size
prop to icon packages
#8139
Labels
epic
Special label used by ZenHub for epic functionality
package: icons
@carbon/icons
package: icons-react
@carbon/icons-react
package: icons-vue
@carbon/icons-vue
package: pictograms
@carbon/pictograms
package: pictograms-react
@carbon/pictograms-react
type: enhancement 💡
We currently have ~1,250 icons in our icon packages. Since our system supports 4 sizes, this ends up with ~5,000 modules (1250 icons * 4 sizes each). Add in a default entry point for each icon and its size, and that becomes ~6250 files that get shipped in a package.
Historically, we've had to invest some time to fix infrastructure issues that have come from trying to satisfy packages that can grow to this size. In addition, it is easy for these packages to deopt and cause consumers to ship megabytes more code than they intend to when using this module.
Moving forward, we are moving from our "component per icon/size" strategy to a "icon with size prop" approach. While this could increase the size of individual icons that support multiple sizes, this would decrease the overall file size of each package and would allow better code re-use for icons that are downsized from 32x32 (which are the majority)
Packages impacted
@carbon/icons
@carbon/icons-react
@carbon/icons-angular
@carbon/icons-vue
Checklist
react-next
to the react builder and include it inicons-react
size
propvanilla-next
to the builders and include it inicons
vue-next
to the builders and include it inicons-vue
carbon-components-react
icon usage to use this new size approachThe text was updated successfully, but these errors were encountered: