{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/301","labels_url":"https://api.github.com/repos/reactjs/react-rails/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-rails/issues/301/comments","events_url":"https://api.github.com/repos/reactjs/react-rails/issues/301/events","html_url":"https://github.com/reactjs/react-rails/issues/301","id":89464633,"number":301,"title":"Making the helper for server side rendering work with JS created by Webpack","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":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-19T04:41:26Z","updated_at":"2015-06-19T16:33:58Z","closed_at":null,"body":"I want to enable the system of externally packaged js code (via Webpack) work with the server rendering library here: https://github.com/justin808/react-webpack-rails-tutorial\r\n\r\nWhile I can and probably should make a separate project, I was wondering if it might make sense to submit a PR to this project. In a nutshell, the webpack system creates one JS file that the server side rendering would use.\r\n\r\nSo there's just a tiny part of this project that's relevant which is mostly the view helpers.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/comments/113567630","html_url":"https://github.com/reactjs/react-rails/issues/301#issuecomment-113567630","issue_url":"https://api.github.com/repos/reactjs/react-rails/issues/301","id":113567630,"user":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T16:33:58Z","updated_at":"2015-06-19T16:33:58Z","body":"Yeah, I think think this would be good fit! We have a problem with Sprockets in production, too: although sprockets might create a big, compiled file, it's not used by react-rails server rendering (#212 & #288).\r\n\r\nHow about this solution:\r\n\r\n- You could implement `CompiledFileRenderer` (your call on the name :P) which builds on ExecJSRenderer \r\n- `CompiledFileRenderer` accepts a path to file which should be a compiled asset including _everything_ needed for server rendering: React.js, components and any dependencies\r\n\r\nFor Webpack users, they could use this renderer in dev & production, just pointing it at their bundle. For Sprockets users, they could use this in production and point it at the compiled asset. \r\n\r\nOne more consideration: Since Sprockets files often have a big hash in them which we can't predict, the path argument for this renderer should be suitable for `Dir.glob` (or something similar). That way Sprockets users won't have to worry about different hashes on different builds.\r\n\r\nWhat do you think about that? It would be a big win for react-rails I think!"}}