{"action":"created","comment":{"url":"https://api.github.com/repos/meetup/ux-capture/pulls/comments/236379130","pull_request_review_id":178440919,"id":236379130,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjM3OTEzMA==","diff_hunk":"@@ -8,35 +9,49 @@ let _onMeasure;\n let _view;\n \n const UXCapture = {\n+\t_clearMarksAndMeasures: () => {\n+\t\twindow.performance.clearMarks();\n+\t\twindow.performance.clearMeasures();\n+\t},\n+\n \t/**\n \t * Sets `onMark` and `onMeasure` callbacks on UXCapture singleton\n+\t * Also resets the view (supposed to be called once per page anyway)\n \t *\n \t * @param {object} config\n \t */\n-\tcreate: (config) => {\n+\tcreate: config => {\n \t\t_onMark = config.onMark || NOOP;\n \t\t_onMeasure = config.onMeasure || NOOP;\n+\t\t_view = null;\n \t},\n \n \t/**\n \t * Creates a new View instance.\n \t *\n \t * @param {object} zoneConfigs\n \t */\n-\tstartView: (zoneConfigs) => {\n-\t\t_view = new View({\n+\tstartView: zoneConfigs => {\n+\t\tconst viewProps = {\n \t\t\tonMark: _onMark,\n \t\t\tonMeasure: _onMeasure,\n \t\t\tzoneConfigs,\n-\t\t});\n+\t\t};\n+\n+\t\t// if we never had views before, it means we are in page view mode\n+\t\tif (_view) {\n+\t\t\t_view = new InteractiveView(viewProps);\n+\t\t} else {\n+\t\t\t_view = new PageView(viewProps);\n+\t\t}\n \t},\n \n \t/**\n \t * Updates current view instance with new zones & marks\n \t *\n \t * @param {object} zoneConfigs\n \t */\n-\tupdateView: (zoneConfigs) => {\n+\tupdateView: zoneConfigs => {","path":"src/UXCapture.js","position":59,"original_position":59,"commit_id":"17647a5af487575d72280b4a1b15526c2332096e","original_commit_id":"17647a5af487575d72280b4a1b15526c2332096e","user":{"login":"sergeychernyshev","id":38076,"node_id":"MDQ6VXNlcjM4MDc2","avatar_url":"https://avatars2.githubusercontent.com/u/38076?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeychernyshev","html_url":"https://github.com/sergeychernyshev","followers_url":"https://api.github.com/users/sergeychernyshev/followers","following_url":"https://api.github.com/users/sergeychernyshev/following{/other_user}","gists_url":"https://api.github.com/users/sergeychernyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeychernyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeychernyshev/subscriptions","organizations_url":"https://api.github.com/users/sergeychernyshev/orgs","repos_url":"https://api.github.com/users/sergeychernyshev/repos","events_url":"https://api.github.com/users/sergeychernyshev/events{/privacy}","received_events_url":"https://api.github.com/users/sergeychernyshev/received_events","type":"User","site_admin":false},"body":"Yes, that's just prettier (not sure if it's part of eslint integration though).\r\n\r\n@sadafie, any reason you want this to be removed? seems like a normal formatting rule to me, at least I got used to it by now ;)","created_at":"2018-11-26T18:44:03Z","updated_at":"2018-11-26T18:55:15Z","html_url":"https://github.com/meetup/ux-capture/pull/16#discussion_r236379130","pull_request_url":"https://api.github.com/repos/meetup/ux-capture/pulls/16","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/comments/236379130"},"html":{"href":"https://github.com/meetup/ux-capture/pull/16#discussion_r236379130"},"pull_request":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/16"}},"in_reply_to_id":236358967},"pull_request":{"url":"https://api.github.com/repos/meetup/ux-capture/pulls/16","id":233620964,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNjIwOTY0","html_url":"https://github.com/meetup/ux-capture/pull/16","diff_url":"https://github.com/meetup/ux-capture/pull/16.diff","patch_url":"https://github.com/meetup/ux-capture/pull/16.patch","issue_url":"https://api.github.com/repos/meetup/ux-capture/issues/16","number":16,"state":"open","locked":false,"title":"WP-823 UXCapture.startTransition() Implementation","user":{"login":"sergeychernyshev","id":38076,"node_id":"MDQ6VXNlcjM4MDc2","avatar_url":"https://avatars2.githubusercontent.com/u/38076?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeychernyshev","html_url":"https://github.com/sergeychernyshev","followers_url":"https://api.github.com/users/sergeychernyshev/followers","following_url":"https://api.github.com/users/sergeychernyshev/following{/other_user}","gists_url":"https://api.github.com/users/sergeychernyshev/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeychernyshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeychernyshev/subscriptions","organizations_url":"https://api.github.com/users/sergeychernyshev/orgs","repos_url":"https://api.github.com/users/sergeychernyshev/repos","events_url":"https://api.github.com/users/sergeychernyshev/events{/privacy}","received_events_url":"https://api.github.com/users/sergeychernyshev/received_events","type":"User","site_admin":false},"body":"Implemented `UXCapture.startTransition()` function used in SPA applications.\r\n\r\nCreated `PageView` and `InteractiveView` classes to represent each type of view separately and to manage startMarkName property differently.\r\n\r\nAlso added private `UXCapture._clearMarksAndMeasures()` method for clearing all pre-exisiting marks and measures. Calling it in `UXCapture.startTransition()`, but can also be useful in tests.\r\n\r\nJIRA: https://meetup.atlassian.net/browse/WP-823\r\n\r\nP.S. our API creates gap between starting new view with `UXCapture.startView()` and starting transition with `UXCapture.startTransition()` - during this time no marks should be fired (as interactive transition start mark hasn't been fired yet and is `null`). This is not great as we don't really control when they fire (e.g. onload events for images, for example). We can also keep view \"un-attached\" until it's started so all marks during this gap time are accounted towards previous view. Thoughts?","created_at":"2018-11-26T16:33:48Z","updated_at":"2018-11-26T18:55:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3cf1725b244a2844cab9d7b9c70c9bc39e23ded","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mmcgahan","id":1885153,"node_id":"MDQ6VXNlcjE4ODUxNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1885153?v=4","gravatar_id":"","url":"https://api.github.com/users/mmcgahan","html_url":"https://github.com/mmcgahan","followers_url":"https://api.github.com/users/mmcgahan/followers","following_url":"https://api.github.com/users/mmcgahan/following{/other_user}","gists_url":"https://api.github.com/users/mmcgahan/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcgahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcgahan/subscriptions","organizations_url":"https://api.github.com/users/mmcgahan/orgs","repos_url":"https://api.github.com/users/mmcgahan/repos","events_url":"https://api.github.com/users/mmcgahan/events{/privacy}","received_events_url":"https://api.github.com/users/mmcgahan/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/meetup/ux-capture/pulls/16/commits","review_comments_url":"https://api.github.com/repos/meetup/ux-capture/pulls/16/comments","review_comment_url":"https://api.github.com/repos/meetup/ux-capture/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meetup/ux-capture/issues/16/comments","statuses_url":"https://api.github.com/repos/meetup/ux-capture/statuses/17647a5af487575d72280b4a1b15526c2332096e","head":{"label":"meetup:WP-823_UXCapture.startTransition","ref":"WP-823_UXCapture.startTransition","sha":"17647a5af487575d72280b4a1b15526c2332096e","user":{"login":"meetup","id":147855,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Nzg1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/147855?v=4","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"repo":{"id":138341788,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzNDE3ODg=","name":"ux-capture","full_name":"meetup/ux-capture","private":false,"owner":{"login":"meetup","id":147855,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Nzg1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/147855?v=4","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/meetup/ux-capture","description":"Browser instrumentation helper that makes it easier to capture UX speed metrics","fork":true,"url":"https://api.github.com/repos/meetup/ux-capture","forks_url":"https://api.github.com/repos/meetup/ux-capture/forks","keys_url":"https://api.github.com/repos/meetup/ux-capture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meetup/ux-capture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meetup/ux-capture/teams","hooks_url":"https://api.github.com/repos/meetup/ux-capture/hooks","issue_events_url":"https://api.github.com/repos/meetup/ux-capture/issues/events{/number}","events_url":"https://api.github.com/repos/meetup/ux-capture/events","assignees_url":"https://api.github.com/repos/meetup/ux-capture/assignees{/user}","branches_url":"https://api.github.com/repos/meetup/ux-capture/branches{/branch}","tags_url":"https://api.github.com/repos/meetup/ux-capture/tags","blobs_url":"https://api.github.com/repos/meetup/ux-capture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meetup/ux-capture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meetup/ux-capture/git/refs{/sha}","trees_url":"https://api.github.com/repos/meetup/ux-capture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meetup/ux-capture/statuses/{sha}","languages_url":"https://api.github.com/repos/meetup/ux-capture/languages","stargazers_url":"https://api.github.com/repos/meetup/ux-capture/stargazers","contributors_url":"https://api.github.com/repos/meetup/ux-capture/contributors","subscribers_url":"https://api.github.com/repos/meetup/ux-capture/subscribers","subscription_url":"https://api.github.com/repos/meetup/ux-capture/subscription","commits_url":"https://api.github.com/repos/meetup/ux-capture/commits{/sha}","git_commits_url":"https://api.github.com/repos/meetup/ux-capture/git/commits{/sha}","comments_url":"https://api.github.com/repos/meetup/ux-capture/comments{/number}","issue_comment_url":"https://api.github.com/repos/meetup/ux-capture/issues/comments{/number}","contents_url":"https://api.github.com/repos/meetup/ux-capture/contents/{+path}","compare_url":"https://api.github.com/repos/meetup/ux-capture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meetup/ux-capture/merges","archive_url":"https://api.github.com/repos/meetup/ux-capture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meetup/ux-capture/downloads","issues_url":"https://api.github.com/repos/meetup/ux-capture/issues{/number}","pulls_url":"https://api.github.com/repos/meetup/ux-capture/pulls{/number}","milestones_url":"https://api.github.com/repos/meetup/ux-capture/milestones{/number}","notifications_url":"https://api.github.com/repos/meetup/ux-capture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meetup/ux-capture/labels{/name}","releases_url":"https://api.github.com/repos/meetup/ux-capture/releases{/id}","deployments_url":"https://api.github.com/repos/meetup/ux-capture/deployments","created_at":"2018-06-22T19:39:45Z","updated_at":"2018-11-21T18:43:16Z","pushed_at":"2018-11-26T16:33:49Z","git_url":"git://github.com/meetup/ux-capture.git","ssh_url":"git@github.com:meetup/ux-capture.git","clone_url":"https://github.com/meetup/ux-capture.git","svn_url":"https://github.com/meetup/ux-capture","homepage":"https://www.npmjs.com/package/ux-capture","size":1434,"stargazers_count":2,"watchers_count":2,"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":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"meetup:master","ref":"master","sha":"1f017369858a2912546cb25bf17ed6696a76cdfa","user":{"login":"meetup","id":147855,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Nzg1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/147855?v=4","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"repo":{"id":138341788,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzNDE3ODg=","name":"ux-capture","full_name":"meetup/ux-capture","private":false,"owner":{"login":"meetup","id":147855,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Nzg1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/147855?v=4","gravatar_id":"","url":"https://api.github.com/users/meetup","html_url":"https://github.com/meetup","followers_url":"https://api.github.com/users/meetup/followers","following_url":"https://api.github.com/users/meetup/following{/other_user}","gists_url":"https://api.github.com/users/meetup/gists{/gist_id}","starred_url":"https://api.github.com/users/meetup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetup/subscriptions","organizations_url":"https://api.github.com/users/meetup/orgs","repos_url":"https://api.github.com/users/meetup/repos","events_url":"https://api.github.com/users/meetup/events{/privacy}","received_events_url":"https://api.github.com/users/meetup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/meetup/ux-capture","description":"Browser instrumentation helper that makes it easier to capture UX speed metrics","fork":true,"url":"https://api.github.com/repos/meetup/ux-capture","forks_url":"https://api.github.com/repos/meetup/ux-capture/forks","keys_url":"https://api.github.com/repos/meetup/ux-capture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meetup/ux-capture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meetup/ux-capture/teams","hooks_url":"https://api.github.com/repos/meetup/ux-capture/hooks","issue_events_url":"https://api.github.com/repos/meetup/ux-capture/issues/events{/number}","events_url":"https://api.github.com/repos/meetup/ux-capture/events","assignees_url":"https://api.github.com/repos/meetup/ux-capture/assignees{/user}","branches_url":"https://api.github.com/repos/meetup/ux-capture/branches{/branch}","tags_url":"https://api.github.com/repos/meetup/ux-capture/tags","blobs_url":"https://api.github.com/repos/meetup/ux-capture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meetup/ux-capture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meetup/ux-capture/git/refs{/sha}","trees_url":"https://api.github.com/repos/meetup/ux-capture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meetup/ux-capture/statuses/{sha}","languages_url":"https://api.github.com/repos/meetup/ux-capture/languages","stargazers_url":"https://api.github.com/repos/meetup/ux-capture/stargazers","contributors_url":"https://api.github.com/repos/meetup/ux-capture/contributors","subscribers_url":"https://api.github.com/repos/meetup/ux-capture/subscribers","subscription_url":"https://api.github.com/repos/meetup/ux-capture/subscription","commits_url":"https://api.github.com/repos/meetup/ux-capture/commits{/sha}","git_commits_url":"https://api.github.com/repos/meetup/ux-capture/git/commits{/sha}","comments_url":"https://api.github.com/repos/meetup/ux-capture/comments{/number}","issue_comment_url":"https://api.github.com/repos/meetup/ux-capture/issues/comments{/number}","contents_url":"https://api.github.com/repos/meetup/ux-capture/contents/{+path}","compare_url":"https://api.github.com/repos/meetup/ux-capture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meetup/ux-capture/merges","archive_url":"https://api.github.com/repos/meetup/ux-capture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meetup/ux-capture/downloads","issues_url":"https://api.github.com/repos/meetup/ux-capture/issues{/number}","pulls_url":"https://api.github.com/repos/meetup/ux-capture/pulls{/number}","milestones_url":"https://api.github.com/repos/meetup/ux-capture/milestones{/number}","notifications_url":"https://api.github.com/repos/meetup/ux-capture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meetup/ux-capture/labels{/name}","releases_url":"https://api.github.com/repos/meetup/ux-capture/releases{/id}","deployments_url":"https://api.github.com/repos/meetup/ux-capture/deployments","created_at":"2018-06-22T19:39:45Z","updated_at":"2018-11-21T18:43:16Z","pushed_at":"2018-11-26T16:33:49Z","git_url":"git://github.com/meetup/ux-capture.git","ssh_url":"git@github.com:meetup/ux-capture.git","clone_url":"https://github.com/meetup/ux-capture.git","svn_url":"https://github.com/meetup/ux-capture","homepage":"https://www.npmjs.com/package/ux-capture","size":1434,"stargazers_count":2,"watchers_count":2,"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":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/16"},"html":{"href":"https://github.com/meetup/ux-capture/pull/16"},"issue":{"href":"https://api.github.com/repos/meetup/ux-capture/issues/16"},"comments":{"href":"https://api.github.com/repos/meetup/ux-capture/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meetup/ux-capture/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/meetup/ux-capture/statuses/17647a5af487575d72280b4a1b15526c2332096e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sergeychernyshev"}}