{"action":"created","comment":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/comments/50642076","id":50642076,"diff_hunk":"@@ -4,6 +4,21 @@ import ColorManipulator from '../utils/color-manipulator';\n import autoPrefix from './auto-prefix';\n import lightBaseTheme from './baseThemes/lightBaseTheme';\n import zIndex from './zIndex';\n+import {autoprefixer, rtl} from './transformers';\n+import compose from 'lodash.flowright';\n+import warning from 'warning';\n+\n+const CALLED_ONCE = Symbol('prepareStyles/calledOnce');\n+\n+const callOnce = (transformer) => (style) => {","path":"src/styles/getMuiTheme.js","position":10,"original_position":10,"commit_id":"dbb7bb59b6d64e19514a39bf74c9d9959ead0125","original_commit_id":"dbb7bb59b6d64e19514a39bf74c9d9959ead0125","user":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"body":"We could, but after thinking about it, I wondered if this is a good idea?\r\n\r\nWhat would happen would be in development it would just return the style, and in production it would continue flipping/autoprefixing with no warning. I think having this check in production makes it more consistent in terms of what you see in the development build.\r\n\r\nWhat do you think?","created_at":"2016-01-24T20:51:41Z","updated_at":"2016-01-24T20:51:41Z","html_url":"https://github.com/callemall/material-ui/pull/2986#discussion_r50642076","pull_request_url":"https://api.github.com/repos/callemall/material-ui/pulls/2986","_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/comments/50642076"},"html":{"href":"https://github.com/callemall/material-ui/pull/2986#discussion_r50642076"},"pull_request":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2986"}}},"pull_request":{"url":"https://api.github.com/repos/callemall/material-ui/pulls/2986","id":56545835,"html_url":"https://github.com/callemall/material-ui/pull/2986","diff_url":"https://github.com/callemall/material-ui/pull/2986.diff","patch_url":"https://github.com/callemall/material-ui/pull/2986.patch","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/2986","number":2986,"state":"open","locked":false,"title":"Implements prepareStyles as composition of functions in muiTheme","user":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"body":"This commit implements the `prepareStyles` function as a composition of functions that can be configured in `muiTheme`. It switches the `./mixin/style-propable.js` implementation to use the `prepareStyles` stored in context.\r\n\r\n@oliviertassinari @alitaheri \r\nThis is an initial implementation of the approach of storing `prepareStyles` in context. I cleaned up the code a bit, however like I said, I don't think we should document this until we've confirmed we're happy and the API is final (I already have some ideas of how to improve it, but it shouldn't have any real immediate benefit). It's also very well possible this will all go away when we adopt a new styling framework.\r\n\r\n**Note**: One minor difference I made is that the `getMuiTheme` function actually checks the computed theme for `isRtl` before composing the functions. If it's false, it doesn't even bother including the `ensureDirections()` (renamed to `rtl()`) method. **Edit:** It now does this for the `autoprefixer()` method based on the `userAgent` property\r\n\r\n~~Right now, the list of transformers can be overridden by adding the following property to the muiTheme.  The following configuration would essentially disable the default behavior of always autoprefixing and calling `rtl()` when `isRtl` is equal to `true`.~~ Removed customizing of transformers in this PR, other approaches have since been implemented.\r\n\r\n**Remaining tasks:**\r\n- [x] Move implementation of \"double call warning\" out of `rtl()` into something that runs before all style transformations are executed. **Done**\r\n- [x] ~~Change `rtl()` implementation to not care is `isRtl`~~ **No longer necessary**\r\n\r\n**Future PR:**\r\n- Convert components not using `./mixins/style-propable.js` to get `prepareStyles()` from context, not from importing it from `./utils/style.js`.\r\n- Deprecate and/or remove `./utils/style.js`\r\n","created_at":"2016-01-20T00:06:16Z","updated_at":"2016-01-24T20:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3322e91b633c9588e7f61a2c82f3bea78999f9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/callemall/material-ui/pulls/2986/commits","review_comments_url":"https://api.github.com/repos/callemall/material-ui/pulls/2986/comments","review_comment_url":"https://api.github.com/repos/callemall/material-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/callemall/material-ui/issues/2986/comments","statuses_url":"https://api.github.com/repos/callemall/material-ui/statuses/dbb7bb59b6d64e19514a39bf74c9d9959ead0125","head":{"label":"newoga:style-refactor-experiment","ref":"style-refactor-experiment","sha":"dbb7bb59b6d64e19514a39bf74c9d9959ead0125","user":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"repo":{"id":47232679,"name":"material-ui","full_name":"newoga/material-ui","owner":{"login":"newoga","id":344018,"avatar_url":"https://avatars.githubusercontent.com/u/344018?v=3","gravatar_id":"","url":"https://api.github.com/users/newoga","html_url":"https://github.com/newoga","followers_url":"https://api.github.com/users/newoga/followers","following_url":"https://api.github.com/users/newoga/following{/other_user}","gists_url":"https://api.github.com/users/newoga/gists{/gist_id}","starred_url":"https://api.github.com/users/newoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newoga/subscriptions","organizations_url":"https://api.github.com/users/newoga/orgs","repos_url":"https://api.github.com/users/newoga/repos","events_url":"https://api.github.com/users/newoga/events{/privacy}","received_events_url":"https://api.github.com/users/newoga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/newoga/material-ui","description":"React Components that Implement Google's Material Design.","fork":true,"url":"https://api.github.com/repos/newoga/material-ui","forks_url":"https://api.github.com/repos/newoga/material-ui/forks","keys_url":"https://api.github.com/repos/newoga/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newoga/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newoga/material-ui/teams","hooks_url":"https://api.github.com/repos/newoga/material-ui/hooks","issue_events_url":"https://api.github.com/repos/newoga/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/newoga/material-ui/events","assignees_url":"https://api.github.com/repos/newoga/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/newoga/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/newoga/material-ui/tags","blobs_url":"https://api.github.com/repos/newoga/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newoga/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newoga/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/newoga/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newoga/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/newoga/material-ui/languages","stargazers_url":"https://api.github.com/repos/newoga/material-ui/stargazers","contributors_url":"https://api.github.com/repos/newoga/material-ui/contributors","subscribers_url":"https://api.github.com/repos/newoga/material-ui/subscribers","subscription_url":"https://api.github.com/repos/newoga/material-ui/subscription","commits_url":"https://api.github.com/repos/newoga/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/newoga/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/newoga/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/newoga/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/newoga/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/newoga/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newoga/material-ui/merges","archive_url":"https://api.github.com/repos/newoga/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newoga/material-ui/downloads","issues_url":"https://api.github.com/repos/newoga/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/newoga/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/newoga/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/newoga/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newoga/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/newoga/material-ui/releases{/id}","deployments_url":"https://api.github.com/repos/newoga/material-ui/deployments","created_at":"2015-12-02T02:48:02Z","updated_at":"2015-12-02T02:48:07Z","pushed_at":"2016-01-24T06:54:33Z","git_url":"git://github.com/newoga/material-ui.git","ssh_url":"git@github.com:newoga/material-ui.git","clone_url":"https://github.com/newoga/material-ui.git","svn_url":"https://github.com/newoga/material-ui","homepage":"http://www.material-ui.com","size":35616,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"callemall:master","ref":"master","sha":"0e58efba6d334343472e040be2f91085e0b58e32","user":{"login":"callemall","id":1262264,"avatar_url":"https://avatars.githubusercontent.com/u/1262264?v=3","gravatar_id":"","url":"https://api.github.com/users/callemall","html_url":"https://github.com/callemall","followers_url":"https://api.github.com/users/callemall/followers","following_url":"https://api.github.com/users/callemall/following{/other_user}","gists_url":"https://api.github.com/users/callemall/gists{/gist_id}","starred_url":"https://api.github.com/users/callemall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callemall/subscriptions","organizations_url":"https://api.github.com/users/callemall/orgs","repos_url":"https://api.github.com/users/callemall/repos","events_url":"https://api.github.com/users/callemall/events{/privacy}","received_events_url":"https://api.github.com/users/callemall/received_events","type":"Organization","site_admin":false},"repo":{"id":23083156,"name":"material-ui","full_name":"callemall/material-ui","owner":{"login":"callemall","id":1262264,"avatar_url":"https://avatars.githubusercontent.com/u/1262264?v=3","gravatar_id":"","url":"https://api.github.com/users/callemall","html_url":"https://github.com/callemall","followers_url":"https://api.github.com/users/callemall/followers","following_url":"https://api.github.com/users/callemall/following{/other_user}","gists_url":"https://api.github.com/users/callemall/gists{/gist_id}","starred_url":"https://api.github.com/users/callemall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callemall/subscriptions","organizations_url":"https://api.github.com/users/callemall/orgs","repos_url":"https://api.github.com/users/callemall/repos","events_url":"https://api.github.com/users/callemall/events{/privacy}","received_events_url":"https://api.github.com/users/callemall/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/callemall/material-ui","description":"React Components that Implement Google's Material Design.","fork":false,"url":"https://api.github.com/repos/callemall/material-ui","forks_url":"https://api.github.com/repos/callemall/material-ui/forks","keys_url":"https://api.github.com/repos/callemall/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/callemall/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/callemall/material-ui/teams","hooks_url":"https://api.github.com/repos/callemall/material-ui/hooks","issue_events_url":"https://api.github.com/repos/callemall/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/callemall/material-ui/events","assignees_url":"https://api.github.com/repos/callemall/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/callemall/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/callemall/material-ui/tags","blobs_url":"https://api.github.com/repos/callemall/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/callemall/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/callemall/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/callemall/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/callemall/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/callemall/material-ui/languages","stargazers_url":"https://api.github.com/repos/callemall/material-ui/stargazers","contributors_url":"https://api.github.com/repos/callemall/material-ui/contributors","subscribers_url":"https://api.github.com/repos/callemall/material-ui/subscribers","subscription_url":"https://api.github.com/repos/callemall/material-ui/subscription","commits_url":"https://api.github.com/repos/callemall/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/callemall/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/callemall/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/callemall/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/callemall/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/callemall/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/callemall/material-ui/merges","archive_url":"https://api.github.com/repos/callemall/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/callemall/material-ui/downloads","issues_url":"https://api.github.com/repos/callemall/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/callemall/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/callemall/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/callemall/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/callemall/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/callemall/material-ui/releases{/id}","deployments_url":"https://api.github.com/repos/callemall/material-ui/deployments","created_at":"2014-08-18T19:11:54Z","updated_at":"2016-01-24T19:27:21Z","pushed_at":"2016-01-24T20:48:20Z","git_url":"git://github.com/callemall/material-ui.git","ssh_url":"git@github.com:callemall/material-ui.git","clone_url":"https://github.com/callemall/material-ui.git","svn_url":"https://github.com/callemall/material-ui","homepage":"http://www.material-ui.com","size":45595,"stargazers_count":13305,"watchers_count":13305,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2188,"mirror_url":null,"open_issues_count":533,"forks":2188,"open_issues":533,"watchers":13305,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2986"},"html":{"href":"https://github.com/callemall/material-ui/pull/2986"},"issue":{"href":"https://api.github.com/repos/callemall/material-ui/issues/2986"},"comments":{"href":"https://api.github.com/repos/callemall/material-ui/issues/2986/comments"},"review_comments":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2986/comments"},"review_comment":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/callemall/material-ui/pulls/2986/commits"},"statuses":{"href":"https://api.github.com/repos/callemall/material-ui/statuses/dbb7bb59b6d64e19514a39bf74c9d9959ead0125"}}}}