{"action":"created","issue":{"url":"https://api.github.com/repos/sveltejs/sapper/issues/525","repository_url":"https://api.github.com/repos/sveltejs/sapper","labels_url":"https://api.github.com/repos/sveltejs/sapper/issues/525/labels{/name}","comments_url":"https://api.github.com/repos/sveltejs/sapper/issues/525/comments","events_url":"https://api.github.com/repos/sveltejs/sapper/issues/525/events","html_url":"https://github.com/sveltejs/sapper/pull/525","id":386513502,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MjI5MTM1","number":525,"title":"add service-worker-index.html","user":{"login":"nolanlawson","id":283842,"node_id":"MDQ6VXNlcjI4Mzg0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/283842?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-02T00:44:10Z","updated_at":"2018-12-11T15:42:28Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/sveltejs/sapper/pulls/525","html_url":"https://github.com/sveltejs/sapper/pull/525","diff_url":"https://github.com/sveltejs/sapper/pull/525.diff","patch_url":"https://github.com/sveltejs/sapper/pull/525.patch"},"body":"This fixes #422 by outputting a new `/service-worker-index.html` file which can be cached by the service worker and served in offline use cases.\r\n\r\nThe reason I went with `service-worker-index.html` rather than the old `index.html` is that the latter breaks `sapper export`, since the service worker-targeted `index.html` conflicts with the base route. Since `index.html` is kind of an imprecise name for it anyway, I figured renaming to `service-worker-index.html` made the most sense.\r\n\r\nThe only change that users will have to make in order to get this to work is to use the commented code from `sapper-template` defined [here](https://github.com/sveltejs/sapper-template/blob/1234971da512d37a6453cfebbf8e47a023f547be/src/service-worker.js#L51-L59). We'll probably want to update that commented code anyway, since it hasn't worked for about a year.\r\n\r\nI have tested this with `sapper-template` and it works.\r\n\r\nTo test, you just `npm link` this PR to `sapper-template`, then in `sapper-template`, do `npm run build && npm start` and then navigate to the base URL, then put the Dev Tools in offline mode, uncomment the commented-out service worker code, then refresh. At this point, the new page should be served by the service worker using `service-worker-index.html`."},"comment":{"url":"https://api.github.com/repos/sveltejs/sapper/issues/comments/446248414","html_url":"https://github.com/sveltejs/sapper/pull/525#issuecomment-446248414","issue_url":"https://api.github.com/repos/sveltejs/sapper/issues/525","id":446248414,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjI0ODQxNA==","user":{"login":"nolanlawson","id":283842,"node_id":"MDQ6VXNlcjI4Mzg0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/283842?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T15:42:28Z","updated_at":"2018-12-11T15:42:28Z","author_association":"CONTRIBUTOR","body":"Side note: I am now running this in Pinafore unstable, at https://dev.pinafore.social. Been testing manually and so far everything seems to be working as before. :slightly_smiling_face: \r\n\r\nTo be fair, though, Pinafore does not do anything fancy like preloading or server routes."}}
{"actor":{"display_login":"nolanlawson"}}