{"action":"created","issue":{"url":"https://api.github.com/repos/callemall/material-ui/issues/2880","repository_url":"https://api.github.com/repos/callemall/material-ui","labels_url":"https://api.github.com/repos/callemall/material-ui/issues/2880/labels{/name}","comments_url":"https://api.github.com/repos/callemall/material-ui/issues/2880/comments","events_url":"https://api.github.com/repos/callemall/material-ui/issues/2880/events","html_url":"https://github.com/callemall/material-ui/issues/2880","id":125909871,"number":2880,"title":"[valueLink] React is deprecating the usage","user":{"login":"oliviertassinari","id":3165635,"avatar_url":"https://avatars.githubusercontent.com/u/3165635?v=3","gravatar_id":"","url":"https://api.github.com/users/oliviertassinari","html_url":"https://github.com/oliviertassinari","followers_url":"https://api.github.com/users/oliviertassinari/followers","following_url":"https://api.github.com/users/oliviertassinari/following{/other_user}","gists_url":"https://api.github.com/users/oliviertassinari/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviertassinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviertassinari/subscriptions","organizations_url":"https://api.github.com/users/oliviertassinari/orgs","repos_url":"https://api.github.com/users/oliviertassinari/repos","events_url":"https://api.github.com/users/oliviertassinari/events{/privacy}","received_events_url":"https://api.github.com/users/oliviertassinari/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/callemall/material-ui/labels/Core","name":"Core","color":"006b75"},{"url":"https://api.github.com/repos/callemall/material-ui/labels/Umbrella","name":"Umbrella","color":"1a1a1a"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/callemall/material-ui/milestones/10","html_url":"https://github.com/callemall/material-ui/milestones/0.15.0%20Release","labels_url":"https://api.github.com/repos/callemall/material-ui/milestones/10/labels","id":1472363,"number":10,"title":"0.15.0 Release","description":"","creator":{"login":"alitaheri","id":8528759,"avatar_url":"https://avatars.githubusercontent.com/u/8528759?v=3","gravatar_id":"","url":"https://api.github.com/users/alitaheri","html_url":"https://github.com/alitaheri","followers_url":"https://api.github.com/users/alitaheri/followers","following_url":"https://api.github.com/users/alitaheri/following{/other_user}","gists_url":"https://api.github.com/users/alitaheri/gists{/gist_id}","starred_url":"https://api.github.com/users/alitaheri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alitaheri/subscriptions","organizations_url":"https://api.github.com/users/alitaheri/orgs","repos_url":"https://api.github.com/users/alitaheri/repos","events_url":"https://api.github.com/users/alitaheri/events{/privacy}","received_events_url":"https://api.github.com/users/alitaheri/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":33,"state":"open","created_at":"2015-12-23T09:11:44Z","updated_at":"2016-03-14T19:49:03Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-01-11T09:59:49Z","updated_at":"2016-03-15T01:36:31Z","closed_at":null,"body":"React has merged a [pull request](https://github.com/facebook/react/pull/5032) deprecating the usage of the `valueLink` for the `input` component.\r\nI think that we should follow this for our component.\r\n\r\nThe first step is to make sure all of our components work in a controlled way without the `valueLink` property. For instance, this is not the case with this [component](https://github.com/callemall/material-ui/blob/master/src/hoc/selectable-enhance.js).\r\n\r\nThe second step is to add a warning for people using the property.\r\n\r\nThe last step is to remove the property logic from our component.\r\n\r\n### The List:\r\n\r\n- [ ] checkbox.jsx\r\n- [ ] date-picker.jsx\r\n- [ ] DropDownMenu.jsx\r\n- [ ] enhanced-textarea.jsx\r\n- [ ] selectable-enhance.jsx\r\n- [ ] menu.jsx\r\n- [ ] tabs.jsx\r\n- [ ] TextField.jsx\r\n- [ ] toggle.jsx\r\n"},"comment":{"url":"https://api.github.com/repos/callemall/material-ui/issues/comments/196600949","html_url":"https://github.com/callemall/material-ui/issues/2880#issuecomment-196600949","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/2880","id":196600949,"user":{"login":"mbrookes","id":357702,"avatar_url":"https://avatars.githubusercontent.com/u/357702?v=3","gravatar_id":"","url":"https://api.github.com/users/mbrookes","html_url":"https://github.com/mbrookes","followers_url":"https://api.github.com/users/mbrookes/followers","following_url":"https://api.github.com/users/mbrookes/following{/other_user}","gists_url":"https://api.github.com/users/mbrookes/gists{/gist_id}","starred_url":"https://api.github.com/users/mbrookes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbrookes/subscriptions","organizations_url":"https://api.github.com/users/mbrookes/orgs","repos_url":"https://api.github.com/users/mbrookes/repos","events_url":"https://api.github.com/users/mbrookes/events{/privacy}","received_events_url":"https://api.github.com/users/mbrookes/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T01:36:30Z","updated_at":"2016-03-15T01:36:30Z","body":"> I could write 20 scripts to automate for people it in the time we've spent discussing it\r\n\r\nLike this? :smile: \r\n\r\n```js\r\nimport fs from 'fs';\r\nimport rrs from 'recursive-readdir-sync';\r\nimport \"babel-polyfill\";\r\n\r\nconst sourceDir = 'material-ui/src/';\r\nconst docsDir = 'material-ui/docs/';\r\nconst testsDir = 'material-ui/test/';\r\nconst excludeFiles = [\r\n  'MuiThemeProvider.jsx',\r\n  'muiThemeable.jsx',\r\n];\r\n\r\nfunction toPascalCase(string) {\r\n  return string.replace(/(?:^|-)(\\w)/g, function (matches, letter) {\r\n    return letter.toUpperCase();\r\n  });\r\n};\r\n\r\nfunction isInArray(array, value) {\r\n  return array.indexOf(value) > -1;\r\n};\r\n\r\nfunction rename(sourceFile, targetFile) {\r\n  fs.renameSync(sourceFile, targetFile, (err) => {\r\n    if (err) throw err;\r\n    console.log('Renamed ' + sourceFile + ' => ' + targetFile);\r\n  });\r\n};\r\n\r\nfunction updateMovedFileRelativePaths(file) {\r\n  let data = fs.readFileSync(file, 'utf-8');\r\n  let newData = data.replace(/(^import .* from \\')\\.(.*)/gm, '$1..$2');\r\n  if (data !== newData) {\r\n    fs.writeFileSync(file, newData, 'utf-8');\r\n    console.log('Rewrote dependency paths for', file);\r\n  }\r\n};\r\n\r\nfunction updateDependantFileRelativePaths(file, sourceImportName, importName) {\r\n  let regex = new RegExp('(^import\\\\s' + importName + '\\\\sfrom.*)' + sourceImportName,'gm');\r\n  let data = fs.readFileSync(file, 'utf-8');\r\n  let newData = data.replace(regex, '$1' + importName);\r\n    if (data !== newData) {\r\n    fs.writeFileSync(file, newData, 'utf-8');\r\n    console.log('Rewrote paths for', file);\r\n  }\r\n};\r\n\r\nfunction updateDependantFileRelativeRawPaths(file, sourceImportName, importName) {\r\n  let regex = new RegExp('(^import\\\\s.*\\\\sfrom\\\\s\\'!raw!material-ui\\\\/lib\\\\/)' + sourceImportName,'gm');\r\n  let data = fs.readFileSync(file, 'utf-8');\r\n  let newData = data.replace(regex, '$1' + importName + '/' + importName);\r\n    if (data !== newData) {\r\n    fs.writeFileSync(file, newData, 'utf-8');\r\n    console.log('Rewrote raw paths for', file);\r\n  }\r\n};\r\n\r\nfs.readdir(sourceDir, (err, items) => {\r\n  if (err) throw err;\r\n\r\n  for (let i = 0; i < items.length; i++) {\r\n    // if the file ends with .jsx, and isn't in the exclude lsit\r\n    if ( (items[i]).endsWith('.jsx') && !isInArray(excludeFiles, items[i]) ) {\r\n      let sourceImportName = items[i].slice(0, -4);\r\n      let targetFileName = toPascalCase(items[i]);\r\n      let targetDirName = targetFileName.slice(0, -4);\r\n      let targetDir = sourceDir + targetDirName + '/';\r\n      let sourceFilePath = sourceDir + items[i];\r\n      let targetFilePath = targetDir + targetFileName;\r\n\r\n      // If the targetDir doesn't already eist\r\n      if (!fs.existsSync(targetDir)) {\r\n\r\n        // Make the targetDir\r\n        fs.mkdirSync(targetDir);\r\n\r\n        // Move the source file\r\n        rename(sourceFilePath, targetFilePath);\r\n        updateMovedFileRelativePaths(targetFilePath)\r\n\r\n        // Create a redirect file\r\n        let redirectContent =\r\n`import ${targetDirName} from '../${targetDirName}';\r\n\r\nexport default ${targetDirName};\r\n`;\r\n        // Source file redirect\r\n        fs.appendFileSync(libFilePath, redirectContent);\r\n\r\n        // Target dir index file\r\n        fs.appendFileSync(targetDir + 'index.js', redirectContent);\r\n\r\n        // Update component dependant paths\r\n        rrs(sourceDir).forEach((file) => {\r\n          updateDependantFileRelativePaths(file, sourceImportName, targetDirName)\r\n        });\r\n\r\n        // Update tests dependant paths\r\n        rrs(testsDir).forEach((file) => {\r\n          updateDependantFileRelativePaths(file, sourceImportName, targetDirName)\r\n        });\r\n\r\n        // Update docs dependant paths\r\n        rrs(docsDir).forEach((file) => {\r\n          updateDependantFileRelativePaths(file, sourceImportName, targetDirName)\r\n          updateDependantFileRelativeRawPaths(file, sourceImportName, targetDirName)\r\n        });\r\n        \r\n        // Otherwise skip file\r\n      } else {\r\n        console.log('Cannot process', items[i], '-', targetDir, 'exists.')\r\n      };\r\n    };\r\n  };\r\n});\r\n```"}}