{"action":"opened","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/1379","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/1379/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/1379/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/1379/events","html_url":"https://github.com/zeit/next.js/issues/1379","id":213212449,"number":1379,"title":"Code splitting with one SPA page","user":{"login":"thisbejim","id":10917363,"avatar_url":"https://avatars0.githubusercontent.com/u/10917363?v=3","gravatar_id":"","url":"https://api.github.com/users/thisbejim","html_url":"https://github.com/thisbejim","followers_url":"https://api.github.com/users/thisbejim/followers","following_url":"https://api.github.com/users/thisbejim/following{/other_user}","gists_url":"https://api.github.com/users/thisbejim/gists{/gist_id}","starred_url":"https://api.github.com/users/thisbejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisbejim/subscriptions","organizations_url":"https://api.github.com/users/thisbejim/orgs","repos_url":"https://api.github.com/users/thisbejim/repos","events_url":"https://api.github.com/users/thisbejim/events{/privacy}","received_events_url":"https://api.github.com/users/thisbejim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-10T00:58:20Z","updated_at":"2017-03-10T00:58:20Z","closed_at":null,"body":"Because an application re-renders when changing a page it seems like it is not possible to have a persistent navbar that doesn't flicker (frame rate doesn't catch first flicker):\r\n\r\n![mar-10-2017 10-52-39](https://cloud.githubusercontent.com/assets/10917363/23776990/c237487c-0585-11e7-845e-bd8b08e5ba52.gif)\r\n\r\nIf you go by this [comment here](https://github.com/zeit/next.js/issues/88#issuecomment-271749681) it seems like the best solution for a SPA is to have only one page (index.js) and just change the route query and use that to render whatever sub components/pages you'd like, as demonstrated in [nextgram](https://github.com/arunoda/nextgram) and [react-overdrive](https://github.com/berzniz/react-overdrive). This means you can just mount the navbar once, which is great!\r\n\r\nMy only concern is that by going the one index page route you lose the automatic code splitting that comes with next - how might you address that in next's current state? I can see there are some conversations about [supporting `import`](https://github.com/zeit/next.js/issues/728) in the future but what can we do today?\r\n\r\n"}}
{"actor":{"display_login":"thisbejim"}}