{"action":"opened","issue":{"url":"https://api.github.com/repos/blainekasten/coflux/issues/2","repository_url":"https://api.github.com/repos/blainekasten/coflux","labels_url":"https://api.github.com/repos/blainekasten/coflux/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/blainekasten/coflux/issues/2/comments","events_url":"https://api.github.com/repos/blainekasten/coflux/issues/2/events","html_url":"https://github.com/blainekasten/coflux/issues/2","id":149874937,"number":2,"title":"BabelPlugin for masking `_` prop api.","user":{"login":"blainekasten","id":2916023,"avatar_url":"https://avatars.githubusercontent.com/u/2916023?v=3","gravatar_id":"","url":"https://api.github.com/users/blainekasten","html_url":"https://github.com/blainekasten","followers_url":"https://api.github.com/users/blainekasten/followers","following_url":"https://api.github.com/users/blainekasten/following{/other_user}","gists_url":"https://api.github.com/users/blainekasten/gists{/gist_id}","starred_url":"https://api.github.com/users/blainekasten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blainekasten/subscriptions","organizations_url":"https://api.github.com/users/blainekasten/orgs","repos_url":"https://api.github.com/users/blainekasten/repos","events_url":"https://api.github.com/users/blainekasten/events{/privacy}","received_events_url":"https://api.github.com/users/blainekasten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-20T20:21:14Z","updated_at":"2016-04-20T20:21:14Z","closed_at":null,"body":"The idea here is that https://github.com/blainekasten/coflux/tree/master/docs#mapped-props-with-_ is an awkward API that could be auto-generated by a babel transform.\r\n\r\nThe `_` is a perf gain because components sometimes can modify data they aren't rendering. For example a component with a delete all button isn't likely rendering anything based on state, but clicking it will empty an array.\r\n\r\ne.g.,\r\n```js\r\nfunction DeleteAll({actions}) {\r\n  return <button onClick={actions.deleteAll}>Delete All</button>;\r\n}\r\n\r\nwrap(DeleteAll, {\r\n  mapStateToProps() {\r\n    return {\r\n      emailList: 'app.user.emails';\r\n    };\r\n  },\r\n\r\n  actions: {\r\n    deleteAll({emailList}, next) {\r\n      next({emailList: null});\r\n      /*\r\n       * We need to know about emailList so we can modify it\r\n       * But we dont' need to re-render if the list changes,\r\n       * because we aren't rendering it.\r\n       */\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nSo we have this perf optimization (that could change, but for now it works) that a mapped prop prefixed with `_` is marked as **write-only.** Meaning it doesn't read from it, and doesn't care if the value changes.\r\n\r\nWhile this makes sense, it'd be best if we could have a babel transform, that could read the components render function, and determine what props are write-only and autoprefix the keys with `_`."}}