Skip to content
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

ffe-icons: Consider creating a separate package for the SVG assets #24

Closed
wkillerud opened this issue Feb 26, 2018 · 4 comments
Closed
Assignees
Labels
💎 enhancement Suggested improvements to the design system 🚀 ffe FFE related questions

Comments

@wkillerud
Copy link
Contributor

Some consumers would only like the SVGs and use them directly in their app. Today we force these users to download PhantomJS as part of svg-sprite. This is a requirement to generate an SVG sprite of multiple icons at build-time. However, not all consumers want or need this feature.

Proposed solution:

  • Create a new package ffe-icons-assets that only holds the SVGs
  • Release a version of ffe-icons that uses ffe-icons-assets as its source for SVGs. If it is set as a devDependency and the SVG assets are copied and bundled in the same place as before when publishing we can avoid a breaking change.
  • ffe-icons-react carries on, business as usual

This way we support these three use cases:

  • I use React
  • I don't use React and I just need one or two SVGs and don't want or need sprites
  • I don't use React and I need several SVGs and should probably bundle them in a sprite
@wkillerud wkillerud added the 💎 enhancement Suggested improvements to the design system label Feb 26, 2018
@kwltrs
Copy link
Contributor

kwltrs commented Feb 26, 2018

Is there an alternative to svg-sprite? This could solve the dependency to PhantomJS issue.

@wkillerud
Copy link
Contributor Author

Good point.

svgstore looks promising at first glance (blogpost about it here).

@selbekk selbekk added the 🚀 ffe FFE related questions label Mar 6, 2018
@wkillerud wkillerud self-assigned this Mar 8, 2018
@wkillerud
Copy link
Contributor Author

I have a branch with a working build using svgstore, but some of the icons are broken. I'll see if I get the time to work on this later at some point.

@wkillerud
Copy link
Contributor Author

A breaking change was needed for ffe-icons and ffe-icons-react got a new major version as well. There were no changes in the API for the latter, only a new major due to the risk of visual regressions. But no more PhantomJS 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 enhancement Suggested improvements to the design system 🚀 ffe FFE related questions
Projects
None yet
Development

No branches or pull requests

3 participants