{"action":"created","issue":{"url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/12","labels_url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/12/comments","events_url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/12/events","html_url":"https://github.com/devknoll/relay-nested-routes/issues/12","id":102296345,"number":12,"title":"Code-splitting with react-router creates duplicate HTTP requests to /graphql","user":{"login":"JeremyRylan","id":337610,"avatar_url":"https://avatars.githubusercontent.com/u/337610?v=3","gravatar_id":"","url":"https://api.github.com/users/JeremyRylan","html_url":"https://github.com/JeremyRylan","followers_url":"https://api.github.com/users/JeremyRylan/followers","following_url":"https://api.github.com/users/JeremyRylan/following{/other_user}","gists_url":"https://api.github.com/users/JeremyRylan/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyRylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyRylan/subscriptions","organizations_url":"https://api.github.com/users/JeremyRylan/orgs","repos_url":"https://api.github.com/users/JeremyRylan/repos","events_url":"https://api.github.com/users/JeremyRylan/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyRylan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T04:32:18Z","updated_at":"2015-08-21T05:11:33Z","closed_at":null,"body":"React Router now has the ability to do code splitting via Webpack fairly easily (https://github.com/rackt/react-router/tree/master/examples/huge-apps).\r\n\r\nWhen I try using the following code with react-router-relay, I get duplicate HTTP requests to /graphql when I navigate to the `/widget/:id` route.\r\n\r\n```\r\nlet Routes = {\r\n  childRoutes: [\r\n    { name: 'home',\r\n      path: '/',\r\n      component: App,\r\n      queries: HomeQueries\r\n    },\r\n    { name: 'widget',\r\n      path: '/widget/:id',\r\n      queries: WidgetQueries,\r\n      getComponents (cb) {\r\n        require.ensure([], (require) => {\r\n          cb(null, require('./components/Widget'))\r\n        })\r\n      }\r\n    }\r\n  ]\r\n};\r\n\r\nReactDOM.render(\r\n  <Router\r\n    history={new BrowserHistory()}\r\n    createElement={ReactRouterRelay.createElementFunction()}\r\n    routes={Routes}\r\n  />,\r\n  document.getElementById('root')\r\n);\r\n```\r\n\r\nI'm trying to figure out a solution/workaround. I'll update the discussion with my findings."},"comment":{"url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/comments/133288175","html_url":"https://github.com/devknoll/relay-nested-routes/issues/12#issuecomment-133288175","issue_url":"https://api.github.com/repos/devknoll/relay-nested-routes/issues/12","id":133288175,"user":{"login":"JeremyRylan","id":337610,"avatar_url":"https://avatars.githubusercontent.com/u/337610?v=3","gravatar_id":"","url":"https://api.github.com/users/JeremyRylan","html_url":"https://github.com/JeremyRylan","followers_url":"https://api.github.com/users/JeremyRylan/followers","following_url":"https://api.github.com/users/JeremyRylan/following{/other_user}","gists_url":"https://api.github.com/users/JeremyRylan/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyRylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyRylan/subscriptions","organizations_url":"https://api.github.com/users/JeremyRylan/orgs","repos_url":"https://api.github.com/users/JeremyRylan/repos","events_url":"https://api.github.com/users/JeremyRylan/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyRylan/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T05:11:33Z","updated_at":"2015-08-21T05:11:33Z","body":"@taion Sorry, forgot to specify. Yes, this is on the `#next` branch. I don't get the double request if I stick to just do `{ component: require('./components/Widget'); }` instead of the code-splitting setup via the getComponents function."}}