{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/48","repository_url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles","labels_url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/48/comments","events_url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/48/events","html_url":"https://github.com/Starcounter/StarcounterClientFiles/pull/48","id":299710801,"number":48,"title":"Automate vulcanizing files after each build","user":{"login":"alshakero","id":17054134,"avatar_url":"https://avatars3.githubusercontent.com/u/17054134?v=4","gravatar_id":"","url":"https://api.github.com/users/alshakero","html_url":"https://github.com/alshakero","followers_url":"https://api.github.com/users/alshakero/followers","following_url":"https://api.github.com/users/alshakero/following{/other_user}","gists_url":"https://api.github.com/users/alshakero/gists{/gist_id}","starred_url":"https://api.github.com/users/alshakero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alshakero/subscriptions","organizations_url":"https://api.github.com/users/alshakero/orgs","repos_url":"https://api.github.com/users/alshakero/repos","events_url":"https://api.github.com/users/alshakero/events{/privacy}","received_events_url":"https://api.github.com/users/alshakero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-23T13:26:45Z","updated_at":"2018-02-23T13:59:16Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/pulls/48","html_url":"https://github.com/Starcounter/StarcounterClientFiles/pull/48","diff_url":"https://github.com/Starcounter/StarcounterClientFiles/pull/48.diff","patch_url":"https://github.com/Starcounter/StarcounterClientFiles/pull/48.patch"},"body":"I'm happy with this PR. Nothing has changed when it comes to the way you upgrade packages, bump bower files, etc... All you need to do is to build after the change. So what happens:\r\n\r\n### Build time:\r\n1. All app-shell imports will be vulcanized.\r\n2. `vulcanize` output file list will be converted into a relative URL list, then to a JS array, and will be injected as a constant into `service-worker.js`. \r\n\r\n### Run Time:\r\n1. On `install` event. The service worker will resolve all these relative URLs into absolute ones in accordance with the current domain.\r\n2. When requests come, the SW will check against the resolved-urls-array and return empty string if the URL is found. This isn't a network request! It's super fast.\r\n3. Requests that don't match the array will passthrough.\r\n\r\n### Further development\r\n\r\nThere is still room to cache JS and CSS files and even partials in SW cache. But I didn't go for this because it would have made my code messier and bigger. I wanted you to review this untypical setup first. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/comments/368016140","html_url":"https://github.com/Starcounter/StarcounterClientFiles/pull/48#issuecomment-368016140","issue_url":"https://api.github.com/repos/Starcounter/StarcounterClientFiles/issues/48","id":368016140,"user":{"login":"warpech","id":566463,"avatar_url":"https://avatars0.githubusercontent.com/u/566463?v=4","gravatar_id":"","url":"https://api.github.com/users/warpech","html_url":"https://github.com/warpech","followers_url":"https://api.github.com/users/warpech/followers","following_url":"https://api.github.com/users/warpech/following{/other_user}","gists_url":"https://api.github.com/users/warpech/gists{/gist_id}","starred_url":"https://api.github.com/users/warpech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warpech/subscriptions","organizations_url":"https://api.github.com/users/warpech/orgs","repos_url":"https://api.github.com/users/warpech/repos","events_url":"https://api.github.com/users/warpech/events{/privacy}","received_events_url":"https://api.github.com/users/warpech/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T13:59:16Z","updated_at":"2018-02-23T13:59:16Z","author_association":"OWNER","body":"I am new to service workers. What scope is this using? Will we be able to register more service workers? [Seems not](https://stackoverflow.com/questions/36000127/can-i-have-multiple-service-workers-both-intercept-the-same-fetch-request). \r\n\r\nSo, any future work to support PWA will have to happen in the same service worker that we used to cancel the requests for the vulcanized components?"}}
{"actor":{"display_login":"warpech"}}