{"action":"closed","number":6721,"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721","id":190071842,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwMDcxODQy","html_url":"https://github.com/mapbox/mapbox-gl-js/pull/6721","diff_url":"https://github.com/mapbox/mapbox-gl-js/pull/6721.diff","patch_url":"https://github.com/mapbox/mapbox-gl-js/pull/6721.patch","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/6721","number":6721,"state":"closed","locked":false,"title":"Fallback resource timing in web workers","user":{"login":"sbma44","id":31717,"node_id":"MDQ6VXNlcjMxNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/31717?v=4","gravatar_id":"","url":"https://api.github.com/users/sbma44","html_url":"https://github.com/sbma44","followers_url":"https://api.github.com/users/sbma44/followers","following_url":"https://api.github.com/users/sbma44/following{/other_user}","gists_url":"https://api.github.com/users/sbma44/gists{/gist_id}","starred_url":"https://api.github.com/users/sbma44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbma44/subscriptions","organizations_url":"https://api.github.com/users/sbma44/orgs","repos_url":"https://api.github.com/users/sbma44/repos","events_url":"https://api.github.com/users/sbma44/events{/privacy}","received_events_url":"https://api.github.com/users/sbma44/received_events","type":"User","site_admin":false},"body":"This PR adds a fallback method to `collectResourceTiming: true` for browsers that don't implement the `performance.getEntries()` method properly in web workers. It provides as much data as can be collected now, and should return full data when these browsers correct their implementations.\r\n\r\nThe availability of the `performance` API in web workers remains unpleasantly murky. Despite tickets like https://bugzilla.mozilla.org/show_bug.cgi?id=1425458 and [badges declaring web worker availability](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries) bugs remain in major browsers. Specifically, it appears that in both Firefox and Safari `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType` return empty arrays in web workers regardless of whether the worker has made network requests. \r\n\r\n`performance.mark`, `performance.measure` and subsequent use of `performance.getEntries*` _do_ work, however. This is an inferior solution, as `PerformanceMeasure` objects compare unfavorably to `PerformanceResourceTiming` objects:\r\n- no DNS, TLS or connection timing data\r\n- no division between request and response\r\n- no data on payload size\r\n\r\nStill, the basic timing data that can be collected is better than nothing.\r\n\r\nThis change does not alter any codepaths when `collectResourceTiming` is false. When it is true, a check on array length and an invocation of `performance.mark()` are added to the status quo codepath. Obviously there's a bit more code for the fallback case, but it's pretty slight.\r\n\r\n## Launch Checklist\r\n\r\n<!-- Thanks for the PR! Feel free to add or remove items from the checklist. -->\r\n\r\n - [x] briefly describe the changes in this PR\r\n - [x] write tests for all new functionality\r\n - [ ] ~~document any changes to public APIs~~ n/a\r\n - [ ] post benchmark scores\r\n - [x] ~~manually test the debug page~~ tested on my instrumentile integration test page instead (GL JS debug page doesn't collect resource timing)\r\n","created_at":"2018-05-23T18:52:56Z","updated_at":"2018-06-04T16:18:08Z","closed_at":"2018-06-04T16:18:08Z","merged_at":"2018-06-04T16:18:08Z","merge_commit_sha":"0faffa8f236f2b38b4e72f710251e3d6ceda5c2d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721/commits","review_comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721/comments","review_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/6721/comments","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/statuses/179214d4ea031b2e61ac72a7b64a90a48e7ab02e","head":{"label":"mapbox:fallback-resource-timing-in-web-workers","ref":"fallback-resource-timing-in-web-workers","sha":"179214d4ea031b2e61ac72a7b64a90a48e7ab02e","user":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":8629417,"node_id":"MDEwOlJlcG9zaXRvcnk4NjI5NDE3","name":"mapbox-gl-js","full_name":"mapbox/mapbox-gl-js","owner":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-js","description":"Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-js","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/deployments","created_at":"2013-03-07T14:45:24Z","updated_at":"2018-06-04T13:09:31Z","pushed_at":"2018-06-04T16:18:08Z","git_url":"git://github.com/mapbox/mapbox-gl-js.git","ssh_url":"git@github.com:mapbox/mapbox-gl-js.git","clone_url":"https://github.com/mapbox/mapbox-gl-js.git","svn_url":"https://github.com/mapbox/mapbox-gl-js","homepage":"https://www.mapbox.com/maps","size":122005,"stargazers_count":3017,"watchers_count":3017,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":744,"mirror_url":null,"archived":false,"open_issues_count":551,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":744,"open_issues":551,"watchers":3017,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"45b0be007cd5df6837e5381e067b9c2a42b78501","user":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":8629417,"node_id":"MDEwOlJlcG9zaXRvcnk4NjI5NDE3","name":"mapbox-gl-js","full_name":"mapbox/mapbox-gl-js","owner":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-js","description":"Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-js","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/deployments","created_at":"2013-03-07T14:45:24Z","updated_at":"2018-06-04T13:09:31Z","pushed_at":"2018-06-04T16:18:08Z","git_url":"git://github.com/mapbox/mapbox-gl-js.git","ssh_url":"git@github.com:mapbox/mapbox-gl-js.git","clone_url":"https://github.com/mapbox/mapbox-gl-js.git","svn_url":"https://github.com/mapbox/mapbox-gl-js","homepage":"https://www.mapbox.com/maps","size":122005,"stargazers_count":3017,"watchers_count":3017,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":744,"mirror_url":null,"archived":false,"open_issues_count":551,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":744,"open_issues":551,"watchers":3017,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721"},"html":{"href":"https://github.com/mapbox/mapbox-gl-js/pull/6721"},"issue":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/6721"},"comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/6721/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6721/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-js/statuses/179214d4ea031b2e61ac72a7b64a90a48e7ab02e"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"jfirebaugh","id":98601,"node_id":"MDQ6VXNlcjk4NjAx","avatar_url":"https://avatars2.githubusercontent.com/u/98601?v=4","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"comments":2,"review_comments":9,"maintainer_can_modify":false,"commits":1,"additions":180,"deletions":15,"changed_files":5}}
{"actor":{"display_login":"jfirebaugh"}}