{"action":"opened","number":1434,"pull_request":{"url":"https://api.github.com/repos/umijs/umi/pulls/1434","id":229319941,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MzE5OTQx","html_url":"https://github.com/umijs/umi/pull/1434","diff_url":"https://github.com/umijs/umi/pull/1434.diff","patch_url":"https://github.com/umijs/umi/pull/1434.patch","issue_url":"https://api.github.com/repos/umijs/umi/issues/1434","number":1434,"state":"open","locked":false,"title":"feat: put registration into event data","user":{"login":"xiaoiver","id":3608471,"node_id":"MDQ6VXNlcjM2MDg0NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/3608471?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaoiver","html_url":"https://github.com/xiaoiver","followers_url":"https://api.github.com/users/xiaoiver/followers","following_url":"https://api.github.com/users/xiaoiver/following{/other_user}","gists_url":"https://api.github.com/users/xiaoiver/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoiver/subscriptions","organizations_url":"https://api.github.com/users/xiaoiver/orgs","repos_url":"https://api.github.com/users/xiaoiver/repos","events_url":"https://api.github.com/users/xiaoiver/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoiver/received_events","type":"User","site_admin":false},"body":"发送 ServiceWorker 更新事件时带上 `registration`，便于接收事件的组件使用。\r\n例如通过这个 [ServiceWorkerRegistration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration) 对象可以取得当前处于 `waiting` 状态的 SW，进行后续弹出更新提示框的动作。\r\n```js\r\nupdated(registration) {\r\n  dispatchServiceWorkerEvent('sw.updated', registration);\r\n}\r\n```\r\n\r\n另外针对 ie11 使用了 [CustomEvent Polyfill](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill)","created_at":"2018-11-08T10:41:02Z","updated_at":"2018-11-08T10:41:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/umijs/umi/pulls/1434/commits","review_comments_url":"https://api.github.com/repos/umijs/umi/pulls/1434/comments","review_comment_url":"https://api.github.com/repos/umijs/umi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/umijs/umi/issues/1434/comments","statuses_url":"https://api.github.com/repos/umijs/umi/statuses/d39f1f576e96d924e7cdde2c6a52e6cbf3cb7344","head":{"label":"xiaoiver:feat-sw-registration","ref":"feat-sw-registration","sha":"d39f1f576e96d924e7cdde2c6a52e6cbf3cb7344","user":{"login":"xiaoiver","id":3608471,"node_id":"MDQ6VXNlcjM2MDg0NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/3608471?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaoiver","html_url":"https://github.com/xiaoiver","followers_url":"https://api.github.com/users/xiaoiver/followers","following_url":"https://api.github.com/users/xiaoiver/following{/other_user}","gists_url":"https://api.github.com/users/xiaoiver/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoiver/subscriptions","organizations_url":"https://api.github.com/users/xiaoiver/orgs","repos_url":"https://api.github.com/users/xiaoiver/repos","events_url":"https://api.github.com/users/xiaoiver/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoiver/received_events","type":"User","site_admin":false},"repo":{"id":155667230,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU2NjcyMzA=","name":"umi","full_name":"xiaoiver/umi","private":false,"owner":{"login":"xiaoiver","id":3608471,"node_id":"MDQ6VXNlcjM2MDg0NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/3608471?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaoiver","html_url":"https://github.com/xiaoiver","followers_url":"https://api.github.com/users/xiaoiver/followers","following_url":"https://api.github.com/users/xiaoiver/following{/other_user}","gists_url":"https://api.github.com/users/xiaoiver/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoiver/subscriptions","organizations_url":"https://api.github.com/users/xiaoiver/orgs","repos_url":"https://api.github.com/users/xiaoiver/repos","events_url":"https://api.github.com/users/xiaoiver/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoiver/received_events","type":"User","site_admin":false},"html_url":"https://github.com/xiaoiver/umi","description":"🌋 Pluggable enterprise-level react application framework.","fork":true,"url":"https://api.github.com/repos/xiaoiver/umi","forks_url":"https://api.github.com/repos/xiaoiver/umi/forks","keys_url":"https://api.github.com/repos/xiaoiver/umi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiaoiver/umi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiaoiver/umi/teams","hooks_url":"https://api.github.com/repos/xiaoiver/umi/hooks","issue_events_url":"https://api.github.com/repos/xiaoiver/umi/issues/events{/number}","events_url":"https://api.github.com/repos/xiaoiver/umi/events","assignees_url":"https://api.github.com/repos/xiaoiver/umi/assignees{/user}","branches_url":"https://api.github.com/repos/xiaoiver/umi/branches{/branch}","tags_url":"https://api.github.com/repos/xiaoiver/umi/tags","blobs_url":"https://api.github.com/repos/xiaoiver/umi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiaoiver/umi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiaoiver/umi/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiaoiver/umi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiaoiver/umi/statuses/{sha}","languages_url":"https://api.github.com/repos/xiaoiver/umi/languages","stargazers_url":"https://api.github.com/repos/xiaoiver/umi/stargazers","contributors_url":"https://api.github.com/repos/xiaoiver/umi/contributors","subscribers_url":"https://api.github.com/repos/xiaoiver/umi/subscribers","subscription_url":"https://api.github.com/repos/xiaoiver/umi/subscription","commits_url":"https://api.github.com/repos/xiaoiver/umi/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiaoiver/umi/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiaoiver/umi/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiaoiver/umi/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiaoiver/umi/contents/{+path}","compare_url":"https://api.github.com/repos/xiaoiver/umi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiaoiver/umi/merges","archive_url":"https://api.github.com/repos/xiaoiver/umi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiaoiver/umi/downloads","issues_url":"https://api.github.com/repos/xiaoiver/umi/issues{/number}","pulls_url":"https://api.github.com/repos/xiaoiver/umi/pulls{/number}","milestones_url":"https://api.github.com/repos/xiaoiver/umi/milestones{/number}","notifications_url":"https://api.github.com/repos/xiaoiver/umi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiaoiver/umi/labels{/name}","releases_url":"https://api.github.com/repos/xiaoiver/umi/releases{/id}","deployments_url":"https://api.github.com/repos/xiaoiver/umi/deployments","created_at":"2018-11-01T05:42:42Z","updated_at":"2018-11-01T05:42:45Z","pushed_at":"2018-11-08T10:37:09Z","git_url":"git://github.com/xiaoiver/umi.git","ssh_url":"git@github.com:xiaoiver/umi.git","clone_url":"https://github.com/xiaoiver/umi.git","svn_url":"https://github.com/xiaoiver/umi","homepage":"https://umijs.org/","size":3358,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"umijs:master","ref":"master","sha":"fe09a2f7a9a251f6c12b7e631c50a6950b5ca7cd","user":{"login":"umijs","id":33895495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/33895495?v=4","gravatar_id":"","url":"https://api.github.com/users/umijs","html_url":"https://github.com/umijs","followers_url":"https://api.github.com/users/umijs/followers","following_url":"https://api.github.com/users/umijs/following{/other_user}","gists_url":"https://api.github.com/users/umijs/gists{/gist_id}","starred_url":"https://api.github.com/users/umijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umijs/subscriptions","organizations_url":"https://api.github.com/users/umijs/orgs","repos_url":"https://api.github.com/users/umijs/repos","events_url":"https://api.github.com/users/umijs/events{/privacy}","received_events_url":"https://api.github.com/users/umijs/received_events","type":"Organization","site_admin":false},"repo":{"id":111667959,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE2Njc5NTk=","name":"umi","full_name":"umijs/umi","private":false,"owner":{"login":"umijs","id":33895495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/33895495?v=4","gravatar_id":"","url":"https://api.github.com/users/umijs","html_url":"https://github.com/umijs","followers_url":"https://api.github.com/users/umijs/followers","following_url":"https://api.github.com/users/umijs/following{/other_user}","gists_url":"https://api.github.com/users/umijs/gists{/gist_id}","starred_url":"https://api.github.com/users/umijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umijs/subscriptions","organizations_url":"https://api.github.com/users/umijs/orgs","repos_url":"https://api.github.com/users/umijs/repos","events_url":"https://api.github.com/users/umijs/events{/privacy}","received_events_url":"https://api.github.com/users/umijs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/umijs/umi","description":"🌋 Pluggable enterprise-level react application framework.","fork":false,"url":"https://api.github.com/repos/umijs/umi","forks_url":"https://api.github.com/repos/umijs/umi/forks","keys_url":"https://api.github.com/repos/umijs/umi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umijs/umi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umijs/umi/teams","hooks_url":"https://api.github.com/repos/umijs/umi/hooks","issue_events_url":"https://api.github.com/repos/umijs/umi/issues/events{/number}","events_url":"https://api.github.com/repos/umijs/umi/events","assignees_url":"https://api.github.com/repos/umijs/umi/assignees{/user}","branches_url":"https://api.github.com/repos/umijs/umi/branches{/branch}","tags_url":"https://api.github.com/repos/umijs/umi/tags","blobs_url":"https://api.github.com/repos/umijs/umi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umijs/umi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umijs/umi/git/refs{/sha}","trees_url":"https://api.github.com/repos/umijs/umi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umijs/umi/statuses/{sha}","languages_url":"https://api.github.com/repos/umijs/umi/languages","stargazers_url":"https://api.github.com/repos/umijs/umi/stargazers","contributors_url":"https://api.github.com/repos/umijs/umi/contributors","subscribers_url":"https://api.github.com/repos/umijs/umi/subscribers","subscription_url":"https://api.github.com/repos/umijs/umi/subscription","commits_url":"https://api.github.com/repos/umijs/umi/commits{/sha}","git_commits_url":"https://api.github.com/repos/umijs/umi/git/commits{/sha}","comments_url":"https://api.github.com/repos/umijs/umi/comments{/number}","issue_comment_url":"https://api.github.com/repos/umijs/umi/issues/comments{/number}","contents_url":"https://api.github.com/repos/umijs/umi/contents/{+path}","compare_url":"https://api.github.com/repos/umijs/umi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umijs/umi/merges","archive_url":"https://api.github.com/repos/umijs/umi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umijs/umi/downloads","issues_url":"https://api.github.com/repos/umijs/umi/issues{/number}","pulls_url":"https://api.github.com/repos/umijs/umi/pulls{/number}","milestones_url":"https://api.github.com/repos/umijs/umi/milestones{/number}","notifications_url":"https://api.github.com/repos/umijs/umi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umijs/umi/labels{/name}","releases_url":"https://api.github.com/repos/umijs/umi/releases{/id}","deployments_url":"https://api.github.com/repos/umijs/umi/deployments","created_at":"2017-11-22T10:09:36Z","updated_at":"2018-11-08T10:01:50Z","pushed_at":"2018-11-08T09:04:34Z","git_url":"git://github.com/umijs/umi.git","ssh_url":"git@github.com:umijs/umi.git","clone_url":"https://github.com/umijs/umi.git","svn_url":"https://github.com/umijs/umi","homepage":"https://umijs.org/","size":3386,"stargazers_count":2724,"watchers_count":2724,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":316,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":316,"open_issues":36,"watchers":2724,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/umijs/umi/pulls/1434"},"html":{"href":"https://github.com/umijs/umi/pull/1434"},"issue":{"href":"https://api.github.com/repos/umijs/umi/issues/1434"},"comments":{"href":"https://api.github.com/repos/umijs/umi/issues/1434/comments"},"review_comments":{"href":"https://api.github.com/repos/umijs/umi/pulls/1434/comments"},"review_comment":{"href":"https://api.github.com/repos/umijs/umi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/umijs/umi/pulls/1434/commits"},"statuses":{"href":"https://api.github.com/repos/umijs/umi/statuses/d39f1f576e96d924e7cdde2c6a52e6cbf3cb7344"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":26,"deletions":6,"changed_files":1}}
{"actor":{"display_login":"xiaoiver"}}