{"action":"created","issue":{"url":"https://api.github.com/repos/MoOx/phenomic/issues/343","repository_url":"https://api.github.com/repos/MoOx/phenomic","labels_url":"https://api.github.com/repos/MoOx/phenomic/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/MoOx/phenomic/issues/343/comments","events_url":"https://api.github.com/repos/MoOx/phenomic/issues/343/events","html_url":"https://github.com/MoOx/phenomic/pull/343","id":143064220,"number":343,"title":"Add service worker","user":{"login":"thangngoc89","id":3049054,"avatar_url":"https://avatars.githubusercontent.com/u/3049054?v=3","gravatar_id":"","url":"https://api.github.com/users/thangngoc89","html_url":"https://github.com/thangngoc89","followers_url":"https://api.github.com/users/thangngoc89/followers","following_url":"https://api.github.com/users/thangngoc89/following{/other_user}","gists_url":"https://api.github.com/users/thangngoc89/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngoc89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngoc89/subscriptions","organizations_url":"https://api.github.com/users/thangngoc89/orgs","repos_url":"https://api.github.com/users/thangngoc89/repos","events_url":"https://api.github.com/users/thangngoc89/events{/privacy}","received_events_url":"https://api.github.com/users/thangngoc89/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MoOx/phenomic/labels/PR:%20review%20accepted","name":"PR: review accepted","color":"47B230"},{"url":"https://api.github.com/repos/MoOx/phenomic/labels/status:%20discussion","name":"status: discussion","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-03-23T19:57:29Z","updated_at":"2016-04-15T07:43:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MoOx/phenomic/pulls/343","html_url":"https://github.com/MoOx/phenomic/pull/343","diff_url":"https://github.com/MoOx/phenomic/pull/343.diff","patch_url":"https://github.com/MoOx/phenomic/pull/343.patch"},"body":"# Review needed\r\n\r\nThis is my first time with Service worker. Please review the SW logic carefully :).\r\n\r\nThe PR contains many unrelated files to SW, if you aren't familiar with Phenomic codebase, please take time to review these files \r\n\r\nhttps://github.com/MoOx/phenomic/blob/feat/sw/src/_utils/offline/service-worker/sw.template.js\r\nhttps://github.com/MoOx/phenomic/blob/feat/sw/src/_utils/offline/service-worker/sw-register.template.js\r\n\r\nBy the way, the current behavior of Service worker doesn't different from AppCache. If you have a better sw logic for a static site, please give me a shout\r\n\r\n---\r\nTODO:\r\n\r\n- [x] Add tests\r\n- [x] Merge appcache and service worker into offline section (they share the same pattern, setting)\r\n- [x] Document\r\n\r\n---\r\n\r\nChanges:\r\n\r\n- Initial work for SW. Right now, the default SW template isn't different than the \"stupid\" appcache options but in the future, I want user to be able to provide their own SW template \r\n- Add a deprecated warning when use `appcache` option. **BREAKING CHANGE:** removed alibity to define custom globby pattern. Use offline option to define it\r\n\r\n- Add `offline` option. It accepts: \r\n\r\n  - `boolean`: default = false (enable/disable offline features)\r\n  -  `object` contains these keys:\r\n    - `appcache: boolean = true` (enable/disable appcache)\r\n    - `serviceWorker: boolean = true` (enable/disable serviceWorker)\r\n    - `pattern: string | array = [ \"**\", \"!**/*.html\", \"index.html\" ]` : globby pattern\r\n\r\nClose #153 "},"comment":{"url":"https://api.github.com/repos/MoOx/phenomic/issues/comments/210339147","html_url":"https://github.com/MoOx/phenomic/pull/343#issuecomment-210339147","issue_url":"https://api.github.com/repos/MoOx/phenomic/issues/343","id":210339147,"user":{"login":"thangngoc89","id":3049054,"avatar_url":"https://avatars.githubusercontent.com/u/3049054?v=3","gravatar_id":"","url":"https://api.github.com/users/thangngoc89","html_url":"https://github.com/thangngoc89","followers_url":"https://api.github.com/users/thangngoc89/followers","following_url":"https://api.github.com/users/thangngoc89/following{/other_user}","gists_url":"https://api.github.com/users/thangngoc89/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngoc89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngoc89/subscriptions","organizations_url":"https://api.github.com/users/thangngoc89/orgs","repos_url":"https://api.github.com/users/thangngoc89/repos","events_url":"https://api.github.com/users/thangngoc89/events{/privacy}","received_events_url":"https://api.github.com/users/thangngoc89/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T07:43:54Z","updated_at":"2016-04-15T07:43:54Z","body":"> User need to be able to control.\r\n\r\nSo default to the first entry in the list and provide `entryToInjectScripts` to let people define the entry. Good ?"}}