💡 Proposal - Icons Package
See original GitHub issueThe problem
As we expand and scale, we see a rise in requests to add more icons, whether the user is building a feature in Contentful web-app, a separate app or an internal tool, etc.
With the current structure adding more icons will increase the bundle size, and it also increases the overhead on the maintainers to follow up on what goes in and out.
The proposed solution
Moving all icons to a separate new package @contentful/forma-36-icons
where users can import only what they need as svg which will get inline within their bundle
This way we can have a huge icons library without worrying about f36 or consumer’s bundle size as they only get what they ask for.
Adding extra icons would be simpler, and doesn’t require much reviews
Removing icons in the future won’t be necessary, and we could avoid potential breaking changes, and easily support backward compatibility
Usage example
import { search } from '@contentful/forma-36-icons`
import { Icon } from '@contentful/forma-36-react-components`
<Icon color="primary" size="m" icon={search} />
Breaking changes
This change will eventually require forma-36 to remove the current icons from our bundle, and consumers will need to migrate accordingly
Other thoughts
Possibly we could upload these SVG icons to S3
bucket and keep only reference inside the package for faster builds?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (11 by maintainers)
Nice, sounds good. I’d advise against S3 - it’d make the contribution process a lot harder and less-open.
Related to https://github.com/contentful/forma-36/pull/879 and https://github.com/contentful/forma-36/pull/880