{"action":"created","issue":{"url":"https://api.github.com/repos/xwp/pwa-wp/issues/14","repository_url":"https://api.github.com/repos/xwp/pwa-wp","labels_url":"https://api.github.com/repos/xwp/pwa-wp/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/xwp/pwa-wp/issues/14/comments","events_url":"https://api.github.com/repos/xwp/pwa-wp/issues/14/events","html_url":"https://github.com/xwp/pwa-wp/pull/14","id":334443870,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NDE0NzAz","number":14,"title":"[WIP] Prototype for Service Workers API","user":{"login":"miina","id":3294597,"node_id":"MDQ6VXNlcjMyOTQ1OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/3294597?v=4","gravatar_id":"","url":"https://api.github.com/users/miina","html_url":"https://github.com/miina","followers_url":"https://api.github.com/users/miina/followers","following_url":"https://api.github.com/users/miina/following{/other_user}","gists_url":"https://api.github.com/users/miina/gists{/gist_id}","starred_url":"https://api.github.com/users/miina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miina/subscriptions","organizations_url":"https://api.github.com/users/miina/orgs","repos_url":"https://api.github.com/users/miina/repos","events_url":"https://api.github.com/users/miina/events{/privacy}","received_events_url":"https://api.github.com/users/miina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-21T11:03:18Z","updated_at":"2018-06-28T18:31:30Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/xwp/pwa-wp/pulls/14","html_url":"https://github.com/xwp/pwa-wp/pull/14","diff_url":"https://github.com/xwp/pwa-wp/pull/14.diff","patch_url":"https://github.com/xwp/pwa-wp/pull/14.patch"},"body":"Fixes #7.\r\n\r\n~~Currently mainly just a skeleton for registering service workers, however, it is functional.~~\r\nFor example you could add `test.js` to your plugin root directory and then call `wp_register_service_worker( 'test', '/wp-content/path-to-your-file/test.js' );` -- it should work.\r\n\r\nUpdated description:\r\n- Allows registering static SW scripts via `wp_register_service_worker( $handle, $path, $deps = array(), $scopes = array() )` where:\r\n  - Handle is a unique identifier for the script;\r\n  - Path should be relative path to the script, has to be within WP_CONTENT directory;\r\n  - Deps -- array of SW script dependencies;\r\n  - Scopes: Array of scopes;\r\n\r\n- Concatenates the scripts dynamically based on scopes, the following URL is used for registering:\r\n `/?wp_service_workers=$scope` and registers service worker per each scope. Default scope is the relative site URL;\r\n- The content of SW scripts is received from the absolute path by using `$wp_filesystem->get_contents()` and not via HTTP request meaning that the content has to be static."},"comment":{"url":"https://api.github.com/repos/xwp/pwa-wp/issues/comments/401130776","html_url":"https://github.com/xwp/pwa-wp/pull/14#issuecomment-401130776","issue_url":"https://api.github.com/repos/xwp/pwa-wp/issues/14","id":401130776,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTEzMDc3Ng==","user":{"login":"westonruter","id":134745,"node_id":"MDQ6VXNlcjEzNDc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T18:31:30Z","updated_at":"2018-06-28T18:31:30Z","author_association":"MEMBER","body":"@miina that's a good idea: `$source` could either be a `callable` or a `string`. "}}
{"actor":{"display_login":"westonruter"}}