ui-components
ui-components copied to clipboard
Remove some items from peer dependencies
Looking at the current package.json
...
"peerDependencies": {
"@fortawesome/fontawesome-free": "^5.0.0",
"lodash": "^4.0.0",
"moment": "^2.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"styled-components": "^2.0.0"
}
... I think we could probably remove lodash
, moment
and fontawesome
deps from there and add them into dependencies
instead, without the risk of causing clashing errors if this blog post is to be believed: https://nodejs.org/en/blog/npm/peer-dependencies/
It makes sense to keep the React ones, but we could probably weaken the version criteria there and styled-components
also has to stay for now because theming is currently done by the user - see #418.
WDYT @foot @guyfedwards ?
Motivated by the first part of #411.
So I actually wrote a comment about this on @foot's PR for font-awesome but then removed it as I think it is necessary 😄 .
Currently you cannot use ui-components (well, with icons showing) without installing font-awesome itself because you need the assets css/fonts which aren't included in our dist bundle, you would also need some sort of bundler.
The ideal solution here would be to include the svgs in our bundle so that a simple import { xxx } from 'weaveworks-ui-components
would be enough
Lodash/moment/styled I would agree can be removed