cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

Add warning when multiple JSS versions are bundled #658

Closed kof closed 6 years ago

kof commented 6 years ago

We should warn the user when multiple JSS versions are detected in case user is unaware. This is easy in utils/moduleId

kof commented 6 years ago

cc @oliviertassinari

oliviertassinari commented 6 years ago

My motivation for such warning would be the following: JSS is a large dependency, you don't want to have two version bundled in our assets. Like you would not want two version of React, effectively, it's not possible.

Also, maybe we can save some bytes in production by not supporting it.

kof commented 6 years ago

So you are for deprecating support of multiple versions instead of warning? I would validate first regarding react and some others, I think it was an old issue and was fixed.

oliviertassinari commented 6 years ago

@kof I'm in favor of not supporting multiple versions. Adding a warning so people understand what's going on in development. Saving kB by removing all the code that makes it work in production.

kof commented 6 years ago

Btw. it should be also server side and build time, otheriwse it is possible to get different class names (module ids) from ssr/build and client.

kof commented 6 years ago

tbc in https://github.com/cssinjs/jss/issues/677