{"action":"created","issue":{"url":"https://api.github.com/repos/jsstyles/jss-nested/issues/7","labels_url":"https://api.github.com/repos/jsstyles/jss-nested/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/jsstyles/jss-nested/issues/7/comments","events_url":"https://api.github.com/repos/jsstyles/jss-nested/issues/7/events","html_url":"https://github.com/jsstyles/jss-nested/pull/7","id":101403286,"number":7,"title":"Prevent mutation of the original style","user":{"login":"mpal9000","id":2001232,"avatar_url":"https://avatars.githubusercontent.com/u/2001232?v=3","gravatar_id":"","url":"https://api.github.com/users/mpal9000","html_url":"https://github.com/mpal9000","followers_url":"https://api.github.com/users/mpal9000/followers","following_url":"https://api.github.com/users/mpal9000/following{/other_user}","gists_url":"https://api.github.com/users/mpal9000/gists{/gist_id}","starred_url":"https://api.github.com/users/mpal9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpal9000/subscriptions","organizations_url":"https://api.github.com/users/mpal9000/orgs","repos_url":"https://api.github.com/users/mpal9000/repos","events_url":"https://api.github.com/users/mpal9000/events{/privacy}","received_events_url":"https://api.github.com/users/mpal9000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-08-17T11:45:13Z","updated_at":"2015-08-18T08:40:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jsstyles/jss-nested/pulls/7","html_url":"https://github.com/jsstyles/jss-nested/pull/7","diff_url":"https://github.com/jsstyles/jss-nested/pull/7.diff","patch_url":"https://github.com/jsstyles/jss-nested/pull/7.patch"},"body":"An example use case is when rendering server side, the first time after a server restart, a `:focus` selector will be rendered correctly. But the second time the pseudo selector will be missing from the original style object and the rule child won't be added.\r\n\r\nThe `hasOwnProperty` is not related, but I didn't want to make another pull request."},"comment":{"url":"https://api.github.com/repos/jsstyles/jss-nested/issues/comments/132121133","html_url":"https://github.com/jsstyles/jss-nested/pull/7#issuecomment-132121133","issue_url":"https://api.github.com/repos/jsstyles/jss-nested/issues/7","id":132121133,"user":{"login":"mpal9000","id":2001232,"avatar_url":"https://avatars.githubusercontent.com/u/2001232?v=3","gravatar_id":"","url":"https://api.github.com/users/mpal9000","html_url":"https://github.com/mpal9000","followers_url":"https://api.github.com/users/mpal9000/followers","following_url":"https://api.github.com/users/mpal9000/following{/other_user}","gists_url":"https://api.github.com/users/mpal9000/gists{/gist_id}","starred_url":"https://api.github.com/users/mpal9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpal9000/subscriptions","organizations_url":"https://api.github.com/users/mpal9000/orgs","repos_url":"https://api.github.com/users/mpal9000/repos","events_url":"https://api.github.com/users/mpal9000/events{/privacy}","received_events_url":"https://api.github.com/users/mpal9000/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T08:40:26Z","updated_at":"2015-08-18T08:40:26Z","body":"Cloning in core vs. in plugins -> in core, because I think most users are including at least one plugin. eg. pseudo selectors are a basic need and they can't work without the \"nested\" plugin (not related to this discussion, but maybe they need a separate plugin or move them to the core).\r\n\r\nNonetheless I think this is not the correct way to solve this common problem. For me one way to solve it, is following a non mutating strategy in the code (core & plugins), as I said above. Another way is to introduce some new methods in `Rule` and `StyleSheet`, which will update the styles in the correct non mutating way and take that responsibility from the user. The user will have to call these new methods and won't interact with the style objects directly. I prefer the first one."}}