{"action":"created","issue":{"url":"https://api.github.com/repos/timarney/react-app-rewired/issues/130","repository_url":"https://api.github.com/repos/timarney/react-app-rewired","labels_url":"https://api.github.com/repos/timarney/react-app-rewired/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/timarney/react-app-rewired/issues/130/comments","events_url":"https://api.github.com/repos/timarney/react-app-rewired/issues/130/events","html_url":"https://github.com/timarney/react-app-rewired/issues/130","id":270230950,"number":130,"title":"Validate rewire arguments?","user":{"login":"andriijas","id":33141,"avatar_url":"https://avatars2.githubusercontent.com/u/33141?v=4","gravatar_id":"","url":"https://api.github.com/users/andriijas","html_url":"https://github.com/andriijas","followers_url":"https://api.github.com/users/andriijas/followers","following_url":"https://api.github.com/users/andriijas/following{/other_user}","gists_url":"https://api.github.com/users/andriijas/gists{/gist_id}","starred_url":"https://api.github.com/users/andriijas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andriijas/subscriptions","organizations_url":"https://api.github.com/users/andriijas/orgs","repos_url":"https://api.github.com/users/andriijas/repos","events_url":"https://api.github.com/users/andriijas/events{/privacy}","received_events_url":"https://api.github.com/users/andriijas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-01T08:20:22Z","updated_at":"2017-11-01T14:39:25Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The documentation says rewires should be wrapped with extra function if allowing extra options, like this:\r\n\r\n```\r\nfunction createRewire(options = {}) {\r\n return function (config, env) {}\r\n}\r\n```\r\n\r\nA lot of community rewires adds options add third argument instead:\r\n```\r\nfunction (config, env, options = {}) {}\r\n```\r\n\r\nhttps://github.com/lwd-technology/react-app-rewire-define-plugin/blob/master/index.js\r\nhttps://github.com/osdevisnot/react-app-rewire-contrib/blob/master/packages/react-app-rewire-emotion/index.js\r\n\r\n\r\nIs there any way to validate so that community plugins comply to the new compose API?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/timarney/react-app-rewired/issues/comments/341125361","html_url":"https://github.com/timarney/react-app-rewired/issues/130#issuecomment-341125361","issue_url":"https://api.github.com/repos/timarney/react-app-rewired/issues/130","id":341125361,"user":{"login":"likun7981","id":13427467,"avatar_url":"https://avatars1.githubusercontent.com/u/13427467?v=4","gravatar_id":"","url":"https://api.github.com/users/likun7981","html_url":"https://github.com/likun7981","followers_url":"https://api.github.com/users/likun7981/followers","following_url":"https://api.github.com/users/likun7981/following{/other_user}","gists_url":"https://api.github.com/users/likun7981/gists{/gist_id}","starred_url":"https://api.github.com/users/likun7981/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/likun7981/subscriptions","organizations_url":"https://api.github.com/users/likun7981/orgs","repos_url":"https://api.github.com/users/likun7981/repos","events_url":"https://api.github.com/users/likun7981/events{/privacy}","received_events_url":"https://api.github.com/users/likun7981/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T14:39:25Z","updated_at":"2017-11-01T14:39:25Z","author_association":"COLLABORATOR","body":"There are two ways to add additional parameters.\r\nFor the `required` param, the `rewire` should be wrapped with extra function, if the params is `optional`,  You can refer to `react-app-rewire-less`.\r\n\r\nIn fact `compose` is just a tool to reduce duplicate code, like this\r\n```javascript\r\nconfig = reiwireSomeA(config, env)\r\nconfig = reiwireSomeB(config, env)\r\nconfig = reiwireSomeC(config, env)\r\n```\r\nIf you can not use `compose`, it also can work fine for `react-app-rewired`, so the plugin param is not comply the `compose`, you can use it without `compose`. \r\nWe can not verify their parameters because we can not control the process of rewriting `config`"}}
{"actor":{"display_login":"likun7981"}}