{"action":"created","issue":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/128","labels_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/128/comments","events_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/128/events","html_url":"https://github.com/shakacode/react_on_rails/issues/128","id":119132710,"number":128,"title":"Create NPM module with the API","user":{"login":"justin808","id":1118459,"avatar_url":"https://avatars.githubusercontent.com/u/1118459?v=3","gravatar_id":"","url":"https://api.github.com/users/justin808","html_url":"https://github.com/justin808","followers_url":"https://api.github.com/users/justin808/followers","following_url":"https://api.github.com/users/justin808/following{/other_user}","gists_url":"https://api.github.com/users/justin808/gists{/gist_id}","starred_url":"https://api.github.com/users/justin808/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin808/subscriptions","organizations_url":"https://api.github.com/users/justin808/orgs","repos_url":"https://api.github.com/users/justin808/repos","events_url":"https://api.github.com/users/justin808/events{/privacy}","received_events_url":"https://api.github.com/users/justin808/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shakacode/react_on_rails/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"justin808","id":1118459,"avatar_url":"https://avatars.githubusercontent.com/u/1118459?v=3","gravatar_id":"","url":"https://api.github.com/users/justin808","html_url":"https://github.com/justin808","followers_url":"https://api.github.com/users/justin808/followers","following_url":"https://api.github.com/users/justin808/following{/other_user}","gists_url":"https://api.github.com/users/justin808/gists{/gist_id}","starred_url":"https://api.github.com/users/justin808/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin808/subscriptions","organizations_url":"https://api.github.com/users/justin808/orgs","repos_url":"https://api.github.com/users/justin808/repos","events_url":"https://api.github.com/users/justin808/events{/privacy}","received_events_url":"https://api.github.com/users/justin808/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/shakacode/react_on_rails/milestones/3","html_url":"https://github.com/shakacode/react_on_rails/milestones/1.2","labels_url":"https://api.github.com/repos/shakacode/react_on_rails/milestones/3/labels","id":1432305,"number":3,"title":"1.2","description":null,"creator":{"login":"justin808","id":1118459,"avatar_url":"https://avatars.githubusercontent.com/u/1118459?v=3","gravatar_id":"","url":"https://api.github.com/users/justin808","html_url":"https://github.com/justin808","followers_url":"https://api.github.com/users/justin808/followers","following_url":"https://api.github.com/users/justin808/following{/other_user}","gists_url":"https://api.github.com/users/justin808/gists{/gist_id}","starred_url":"https://api.github.com/users/justin808/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin808/subscriptions","organizations_url":"https://api.github.com/users/justin808/orgs","repos_url":"https://api.github.com/users/justin808/repos","events_url":"https://api.github.com/users/justin808/events{/privacy}","received_events_url":"https://api.github.com/users/justin808/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-11-27T11:12:43Z","updated_at":"2015-11-27T11:12:43Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-11-27T05:13:45Z","updated_at":"2015-12-01T06:09:44Z","closed_at":null,"body":"I had a detailed discussion with @alexfedoseev.\r\n\r\nASAP, I'm going to do the following:\r\n\r\nIntroduce this API via a node module, react_on_rails:\r\n\r\n```js\r\nimport ReactOnRails from 'react_on_rails';\r\nReactOnRails.register('HelloWorldApp', HelloWorldAppServer);\r\n```\r\n\r\nThis will work for both `serverGlobals.jsx` and `clientGlobals.jsx`.\r\n\r\nWe'll put the registered components on `ReactOnRails.components['componentName']` rather than polluting the global namespace.\r\n\r\n- [ ] Add api `ReactOnRails.register(componentName, component, generator_function = false)`. We can set the fact a component is really a generator_function with the 3rd argument.\r\n- [ ] We'll also make the other ReactOnRails API's available via the node module.\r\n- [ ] We'll use the same repo as the gem as we want a single release script that releases both the gem and\r\n- [ ] startup will check that /client/package.json contains react_on_rails, and that the version number is the same as the gem, and quit if it is not.\r\n- [ ] convert react_on_rails.js to use babel.\r\n- [ ] automatically export ReactOnRails to the global namespace (no explicit export in webpack needed). The entry point of ReactOnRails will be required for the client and server bundles.\r\n- [ ] OPTIONAL -- for backwards compatibility, do we check if the component is declared on the global namespace? Probably.\r\n\r\nCC: @alexfedoseev, @dylangrafmyre, @robwise  \r\n\r\n-----\r\n\r\nExample places this will be used:\r\n\r\nhttps://github.com/shakacode/react_on_rails-generator-results-v1.0.3/pull/111/files#diff-3f5b3fdbb5756c6fb057f19689e92a1aR2\r\n\r\nhttps://github.com/shakacode/react_on_rails-generator-results-v1.0.3/pull/112/files#diff-d012fe328a02dd847c8241e3d58d6a2aR3\r\n\r\n```js\r\nimport ReactOnRails from 'react_on_rails';\r\nimport HelloWorldAppServer from './HelloWorldAppServer';\r\nReactOnRails.register('HelloWorldApp', HelloWorldAppServer);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/comments/160866510","html_url":"https://github.com/shakacode/react_on_rails/issues/128#issuecomment-160866510","issue_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/128","id":160866510,"user":{"login":"yorzi","id":38976,"avatar_url":"https://avatars.githubusercontent.com/u/38976?v=3","gravatar_id":"","url":"https://api.github.com/users/yorzi","html_url":"https://github.com/yorzi","followers_url":"https://api.github.com/users/yorzi/followers","following_url":"https://api.github.com/users/yorzi/following{/other_user}","gists_url":"https://api.github.com/users/yorzi/gists{/gist_id}","starred_url":"https://api.github.com/users/yorzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorzi/subscriptions","organizations_url":"https://api.github.com/users/yorzi/orgs","repos_url":"https://api.github.com/users/yorzi/repos","events_url":"https://api.github.com/users/yorzi/events{/privacy}","received_events_url":"https://api.github.com/users/yorzi/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T06:09:44Z","updated_at":"2015-12-01T06:09:44Z","body":"@justin808 I am not familiar with NPM eco-system, not sure if I can work this out. But I am still interested in learning these things, that'd be great if someone with better experience can guide me to start and work tegother with me on this. "}}