halogenium icon indicating copy to clipboard operation
halogenium copied to clipboard

Why is styled-components a peer dependency?

Open kaiyoma opened this issue 5 years ago • 2 comments
trafficstars

I understand why the React packages are peer dependencies, but why styled-components? It's listed as a dev dependency, but that seems wrong. Shouldn't it be a normal dependency?

Same for the React packages. How come they aren't regular dependencies?

kaiyoma avatar Feb 25 '20 03:02 kaiyoma

Ignore the question above about the React dependencies, since I realized that you obviously don't want to ship those with your package.

But it seems like you'd want to ship styled-components since that's a direct dependency that not everyone uses. We don't use styled-components in our project, but now we're forced to add it to our package.json and manage its versions/upgrades in order to use halogenium. This is very unusual and I can't think of any other npm package we use that does this.

kaiyoma avatar Feb 25 '20 15:02 kaiyoma

@kaiyoma Yeah, we have the exact same issue and our app bundle size is increased at least 130 KB after installing this package. (and the huge part of bundle is for styled-components dependency)

@kirillDanshin I think your build setup is not efficient for production and this size of the bundle is not acceptable for just a halogen component. Have you any plans for fixing this?

mnlbox avatar Jul 08 '20 09:07 mnlbox