DEV Community

Discussion on: The tiniest CSS-in-JS solution for your open-source React components

 
vndre profile image
Andre

Yes, I know that for this specific library this is no issue. But a bigger app will probably use more packages, then we got the node_modules hell... Also not everyone creates packages with size and zero-deps in mind like you do.

Imagine an node app were my deps are: react-colorful (0 deps, 1kb css), react-slider (8 deps, 100kb css) and tailwindcss (64 deps, 3mb css). If those package creators all use the same method to inject css into the documents' head and react-colorful render happens deep in the tree the chain could be like: 1. tailwind injects code, browsers starts downloading 3mb of a css file... 2. react-slider does the same... 3. react-colorful does the same a little faster. In my fictional case there where only 3 main deps but you can see where a cascade of waiting requests could be created for slower connections or with more package deps...