{"action":"created","issue":{"url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/62","repository_url":"https://api.github.com/repos/4Catalyzer/astroturf","labels_url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/62/comments","events_url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/62/events","html_url":"https://github.com/4Catalyzer/astroturf/issues/62","id":370657801,"node_id":"MDU6SXNzdWUzNzA2NTc4MDE=","number":62,"title":"Using in a shared component library","user":{"login":"danny-andrews-snap","id":37711786,"node_id":"MDQ6VXNlcjM3NzExNzg2","avatar_url":"https://avatars0.githubusercontent.com/u/37711786?v=4","gravatar_id":"","url":"https://api.github.com/users/danny-andrews-snap","html_url":"https://github.com/danny-andrews-snap","followers_url":"https://api.github.com/users/danny-andrews-snap/followers","following_url":"https://api.github.com/users/danny-andrews-snap/following{/other_user}","gists_url":"https://api.github.com/users/danny-andrews-snap/gists{/gist_id}","starred_url":"https://api.github.com/users/danny-andrews-snap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danny-andrews-snap/subscriptions","organizations_url":"https://api.github.com/users/danny-andrews-snap/orgs","repos_url":"https://api.github.com/users/danny-andrews-snap/repos","events_url":"https://api.github.com/users/danny-andrews-snap/events{/privacy}","received_events_url":"https://api.github.com/users/danny-andrews-snap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-16T15:02:12Z","updated_at":"2018-10-16T15:37:39Z","closed_at":null,"author_association":"NONE","body":"A major sticking point for people with zero-runtime CSS-in-JS solutions (e.g. css-modules) has been around code-sharing. The `import styles from './styles.css';` is problematic since its not a standard node module.\r\n\r\nCurrently, I see a few (unideal) options:\r\n1. Pre-compile the styles before publishing the shared component, and distribute the component JS and namespaced CSS separately.\r\n2. Distribute the component as-as, requiring consumers to deal with transforming the CSS Module imports.\r\n\r\nThe benefit of `#1` is that your consumers don't have to use css-loader. The downside is they have to manually import your pre-build css file.\r\n\r\n@ai and I discussed and a good solution might be a babel version of style-loader.  More context: https://twitter.com/lunde_andrews/status/1034116264774516737."},"comment":{"url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/comments/430286434","html_url":"https://github.com/4Catalyzer/astroturf/issues/62#issuecomment-430286434","issue_url":"https://api.github.com/repos/4Catalyzer/astroturf/issues/62","id":430286434,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDI4NjQzNA==","user":{"login":"jquense","id":339286,"node_id":"MDQ6VXNlcjMzOTI4Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/339286?v=4","gravatar_id":"","url":"https://api.github.com/users/jquense","html_url":"https://github.com/jquense","followers_url":"https://api.github.com/users/jquense/followers","following_url":"https://api.github.com/users/jquense/following{/other_user}","gists_url":"https://api.github.com/users/jquense/gists{/gist_id}","starred_url":"https://api.github.com/users/jquense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquense/subscriptions","organizations_url":"https://api.github.com/users/jquense/orgs","repos_url":"https://api.github.com/users/jquense/repos","events_url":"https://api.github.com/users/jquense/events{/privacy}","received_events_url":"https://api.github.com/users/jquense/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T15:37:39Z","updated_at":"2018-10-16T15:37:39Z","author_association":"CONTRIBUTOR","body":"> In this case consumers would have to manually require the css for all the components they are using, no?\r\n\r\nI mean no more so than any other stylesheet based library right? we don't want to auto import and append to the DOM b.c that would remove a consumers ability to extend or consolidate. The only really \"clean\" approach has to assume the user is using webpack, ideally webpack would also provide someone way for libraries to specify configuration, a feature that's not ever gotten added yet :/ "}}
{"actor":{"display_login":"jquense"}}