{"action":"closed","number":3865,"pull_request":{"url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865","id":139058094,"html_url":"https://github.com/devtools-html/debugger.html/pull/3865","diff_url":"https://github.com/devtools-html/debugger.html/pull/3865.diff","patch_url":"https://github.com/devtools-html/debugger.html/pull/3865.patch","issue_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/3865","number":3865,"state":"closed","locked":false,"title":"Update Expressions Reducer","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars1.githubusercontent.com/u/254562?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"body":"### Summary of Changes\n\nHistorically, we've used makeRecord to instantiate immutable records w/ a flow type.\n\n```js\ntype ExpressionState = {\n  expressions: List<Expression>\n};\n\nexport const State = makeRecord(\n  ({\n    expressions: List(restoreExpressions())\n  }: ExpressionState)\n);\n```\n\nThe benefits of this approach is that we have a state record, which is shallow typed. It accepts Record fields like `setIn`. It does not provide type checking beyond that.\n\nI'm thinking about using a Record Class, to encapsulate the immutable behavior and provide a typed interface. It's pretty verbose, but the benefit is that we can get deeper type checking \n\ne.g.: `state.expressions` or `state.setExpressions().expressions`\n\n```js\ntype State = {|\n  expressions: List<Expression>,\n  setExpressions: (List<Expression>) => State\n|};\n\nclass StateClass extends Record({\n  expressions: List()\n}) {\n  get expressions(): List<Expression> {\n    return this.expressions;\n  }\n\n  setExpressions(expressions: List<Expression>): State {\n    return this.set(\"expressions\", expressions);\n  }\n}\n\nfunction initialState(): State {\n  return new StateClass({\n    expressions: List(restoreExpressions())\n  });\n}\n```\n\nI'm curious what others think. Am I going down an unnecessary rabbit hole?\n","created_at":"2017-09-03T19:07:32Z","updated_at":"2017-09-05T18:47:55Z","closed_at":"2017-09-05T18:47:55Z","merged_at":null,"merge_commit_sha":"54105f6b10d6b24412c3dbfa54d97e815d975cab","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865/commits","review_comments_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865/comments","review_comment_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/3865/comments","statuses_url":"https://api.github.com/repos/devtools-html/debugger.html/statuses/7e547dc2658bc130a11a0e4086c7951a69ef7eea","head":{"label":"jasonLaster:expressions-reducer","ref":"expressions-reducer","sha":"7e547dc2658bc130a11a0e4086c7951a69ef7eea","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars1.githubusercontent.com/u/254562?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"repo":{"id":55007537,"name":"debugger.html","full_name":"jasonLaster/debugger.html","owner":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars1.githubusercontent.com/u/254562?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonLaster/debugger.html","description":"Experimental something something.","fork":true,"url":"https://api.github.com/repos/jasonLaster/debugger.html","forks_url":"https://api.github.com/repos/jasonLaster/debugger.html/forks","keys_url":"https://api.github.com/repos/jasonLaster/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonLaster/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonLaster/debugger.html/teams","hooks_url":"https://api.github.com/repos/jasonLaster/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/jasonLaster/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/jasonLaster/debugger.html/events","assignees_url":"https://api.github.com/repos/jasonLaster/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/jasonLaster/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/jasonLaster/debugger.html/tags","blobs_url":"https://api.github.com/repos/jasonLaster/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonLaster/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonLaster/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonLaster/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonLaster/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonLaster/debugger.html/languages","stargazers_url":"https://api.github.com/repos/jasonLaster/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/jasonLaster/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/jasonLaster/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/jasonLaster/debugger.html/subscription","commits_url":"https://api.github.com/repos/jasonLaster/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonLaster/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonLaster/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonLaster/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasonLaster/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/jasonLaster/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonLaster/debugger.html/merges","archive_url":"https://api.github.com/repos/jasonLaster/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonLaster/debugger.html/downloads","issues_url":"https://api.github.com/repos/jasonLaster/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/jasonLaster/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonLaster/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonLaster/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonLaster/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/jasonLaster/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/jasonLaster/debugger.html/deployments","created_at":"2016-03-29T20:14:57Z","updated_at":"2017-08-15T00:07:29Z","pushed_at":"2017-09-05T18:34:11Z","git_url":"git://github.com/jasonLaster/debugger.html.git","ssh_url":"git@github.com:jasonLaster/debugger.html.git","clone_url":"https://github.com/jasonLaster/debugger.html.git","svn_url":"https://github.com/jasonLaster/debugger.html","homepage":null,"size":25790,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":7,"default_branch":"master"}},"base":{"label":"devtools-html:master","ref":"master","sha":"a3e5bff53d1c67d02eb3c4f91391f2996169dcf8","user":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars2.githubusercontent.com/u/19979421?v=4","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"repo":{"id":54585418,"name":"debugger.html","full_name":"devtools-html/debugger.html","owner":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars2.githubusercontent.com/u/19979421?v=4","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devtools-html/debugger.html","description":"The Firefox debugger that works anywhere  :boom:","fork":false,"url":"https://api.github.com/repos/devtools-html/debugger.html","forks_url":"https://api.github.com/repos/devtools-html/debugger.html/forks","keys_url":"https://api.github.com/repos/devtools-html/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devtools-html/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devtools-html/debugger.html/teams","hooks_url":"https://api.github.com/repos/devtools-html/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/devtools-html/debugger.html/events","assignees_url":"https://api.github.com/repos/devtools-html/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/devtools-html/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/devtools-html/debugger.html/tags","blobs_url":"https://api.github.com/repos/devtools-html/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devtools-html/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devtools-html/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/devtools-html/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devtools-html/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/devtools-html/debugger.html/languages","stargazers_url":"https://api.github.com/repos/devtools-html/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/devtools-html/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/devtools-html/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/devtools-html/debugger.html/subscription","commits_url":"https://api.github.com/repos/devtools-html/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/devtools-html/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/devtools-html/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/devtools-html/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devtools-html/debugger.html/merges","archive_url":"https://api.github.com/repos/devtools-html/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devtools-html/debugger.html/downloads","issues_url":"https://api.github.com/repos/devtools-html/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/devtools-html/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/devtools-html/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devtools-html/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/devtools-html/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/devtools-html/debugger.html/deployments","created_at":"2016-03-23T18:55:36Z","updated_at":"2017-09-05T13:02:31Z","pushed_at":"2017-09-05T18:46:09Z","git_url":"git://github.com/devtools-html/debugger.html.git","ssh_url":"git@github.com:devtools-html/debugger.html.git","clone_url":"https://github.com/devtools-html/debugger.html.git","svn_url":"https://github.com/devtools-html/debugger.html","homepage":"https://devtools-html.github.io/debugger.html/","size":10793,"stargazers_count":2865,"watchers_count":2865,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":370,"mirror_url":null,"open_issues_count":174,"forks":370,"open_issues":174,"watchers":2865,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865"},"html":{"href":"https://github.com/devtools-html/debugger.html/pull/3865"},"issue":{"href":"https://api.github.com/repos/devtools-html/debugger.html/issues/3865"},"comments":{"href":"https://api.github.com/repos/devtools-html/debugger.html/issues/3865/comments"},"review_comments":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865/comments"},"review_comment":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/3865/commits"},"statuses":{"href":"https://api.github.com/repos/devtools-html/debugger.html/statuses/7e547dc2658bc130a11a0e4086c7951a69ef7eea"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"unstable","merged_by":null,"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":53,"deletions":60,"changed_files":3}}
{"actor":{"display_login":"jasonLaster"}}