{"action":"created","comment":{"url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/comments/154527351","pull_request_review_id":80704550,"id":154527351,"diff_hunk":"@@ -7,7 +7,30 @@ window.FBE = window.FBE || {};\n     var events = new TinyEmitter(),\r\n         bp = new Blueprint(),\r\n         selectedItem,\r\n-        entityNamesThatDoNotRotate = /beacon|roboport|lab|heat_pipe|pipe$|furnace|chest|pole|substation|solar|accumulator|centrifuge|wall|rocket_silo|radar|turret|speaker|power_switch|reactor|lamp|land_mine/i\r\n+        entityNamesThatDoNotRotate = /beacon|roboport|lab|heat_pipe|pipe$|furnace|chest|pole|substation|solar|accumulator|centrifuge|wall|rocket_silo|radar|turret|speaker|power_switch|reactor|lamp|land_mine/i,\r","path":"js/viewmodel.js","position":null,"original_position":5,"commit_id":"e44cbb98f041eebc84c5edfeb55f5dd7f402ed5d","original_commit_id":"e44cbb98f041eebc84c5edfeb55f5dd7f402ed5d","user":{"login":"ryepup","id":40441,"avatar_url":"https://avatars3.githubusercontent.com/u/40441?v=4","gravatar_id":"","url":"https://api.github.com/users/ryepup","html_url":"https://github.com/ryepup","followers_url":"https://api.github.com/users/ryepup/followers","following_url":"https://api.github.com/users/ryepup/following{/other_user}","gists_url":"https://api.github.com/users/ryepup/gists{/gist_id}","starred_url":"https://api.github.com/users/ryepup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryepup/subscriptions","organizations_url":"https://api.github.com/users/ryepup/orgs","repos_url":"https://api.github.com/users/ryepup/repos","events_url":"https://api.github.com/users/ryepup/events{/privacy}","received_events_url":"https://api.github.com/users/ryepup/received_events","type":"User","site_admin":false},"body":"This regex is called once at app startup and whenever we load a blueprint. I don't think it's a performance bottleneck.\r\n\r\nProfiling on my aging laptop (i5, chrome, ubunut) it takes 5ms to call `getPlaceableItems`, and of that, 0.16ms is spent in `entityNamesThatDoNotRotate.test`.\r\n\r\nIs that fast enough?","created_at":"2017-12-03T15:39:33Z","updated_at":"2017-12-03T15:39:33Z","html_url":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48#discussion_r154527351","pull_request_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/comments/154527351"},"html":{"href":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48#discussion_r154527351"},"pull_request":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48"}},"in_reply_to_id":154512568},"pull_request":{"url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48","id":156033782,"html_url":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48","diff_url":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48.diff","patch_url":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48.patch","issue_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/48","number":48,"state":"open","locked":false,"title":"Split into view, viewmodel, and factorio-blueprint","user":{"login":"ryepup","id":40441,"avatar_url":"https://avatars3.githubusercontent.com/u/40441?v=4","gravatar_id":"","url":"https://api.github.com/users/ryepup","html_url":"https://github.com/ryepup","followers_url":"https://api.github.com/users/ryepup/followers","following_url":"https://api.github.com/users/ryepup/following{/other_user}","gists_url":"https://api.github.com/users/ryepup/gists{/gist_id}","starred_url":"https://api.github.com/users/ryepup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryepup/subscriptions","organizations_url":"https://api.github.com/users/ryepup/orgs","repos_url":"https://api.github.com/users/ryepup/repos","events_url":"https://api.github.com/users/ryepup/events{/privacy}","received_events_url":"https://api.github.com/users/ryepup/received_events","type":"User","site_admin":false},"body":"Refactored to break apart the logic, and use https://github.com/demipixel/factorio-blueprint/ as the data model.\r\n\r\n* script.js - run app-startup logic, mostly hooking up DOM to view\r\n* view.js - functions for building various UI elements, and reacting to different UI and model events\r\n* viewmodel.js - functions for managing the state of the application, a mix of synchronous calls and event-driven callbacks\r\n\r\nThe view changes the original implementation significantly; I think it's doing more DOM operations, and less CSS positioning.\r\n\r\nA lot of this is pretty clumsy, written in an old-school style to support IE11 without any build process. If #45 goes through then much of this code could be better expressed as a handful of classes.\r\n\r\nThere are still bugs in here, but they seem to match the ones in `master` so I think this refactor is close enough. Several issues will get much easier if this gets merged: #25, #5, #4. We should also get fewer merge conflicts moving forward, since the code isn't all in one place.\r\n\r\nfixes #16\r\nfixes #39\r\nfixes #42\r\nfixes #36","created_at":"2017-12-02T22:05:23Z","updated_at":"2017-12-03T15:39:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e9e25278c0674b8a90f1f9a8e654040a81a0f38","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48/commits","review_comments_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48/comments","review_comment_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/48/comments","statuses_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/statuses/e44cbb98f041eebc84c5edfeb55f5dd7f402ed5d","head":{"label":"ryepup:use-factorio-blueprint","ref":"use-factorio-blueprint","sha":"e44cbb98f041eebc84c5edfeb55f5dd7f402ed5d","user":{"login":"ryepup","id":40441,"avatar_url":"https://avatars3.githubusercontent.com/u/40441?v=4","gravatar_id":"","url":"https://api.github.com/users/ryepup","html_url":"https://github.com/ryepup","followers_url":"https://api.github.com/users/ryepup/followers","following_url":"https://api.github.com/users/ryepup/following{/other_user}","gists_url":"https://api.github.com/users/ryepup/gists{/gist_id}","starred_url":"https://api.github.com/users/ryepup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryepup/subscriptions","organizations_url":"https://api.github.com/users/ryepup/orgs","repos_url":"https://api.github.com/users/ryepup/repos","events_url":"https://api.github.com/users/ryepup/events{/privacy}","received_events_url":"https://api.github.com/users/ryepup/received_events","type":"User","site_admin":false},"repo":{"id":112095276,"name":"factorio_blueprint_editor","full_name":"ryepup/factorio_blueprint_editor","owner":{"login":"ryepup","id":40441,"avatar_url":"https://avatars3.githubusercontent.com/u/40441?v=4","gravatar_id":"","url":"https://api.github.com/users/ryepup","html_url":"https://github.com/ryepup","followers_url":"https://api.github.com/users/ryepup/followers","following_url":"https://api.github.com/users/ryepup/following{/other_user}","gists_url":"https://api.github.com/users/ryepup/gists{/gist_id}","starred_url":"https://api.github.com/users/ryepup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryepup/subscriptions","organizations_url":"https://api.github.com/users/ryepup/orgs","repos_url":"https://api.github.com/users/ryepup/repos","events_url":"https://api.github.com/users/ryepup/events{/privacy}","received_events_url":"https://api.github.com/users/ryepup/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryepup/factorio_blueprint_editor","description":"Online Editor for Elxeno's Factorio Blueprint Editor","fork":true,"url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor","forks_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/forks","keys_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/teams","hooks_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/hooks","issue_events_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/issues/events{/number}","events_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/events","assignees_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/assignees{/user}","branches_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/branches{/branch}","tags_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/tags","blobs_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/statuses/{sha}","languages_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/languages","stargazers_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/stargazers","contributors_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/contributors","subscribers_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/subscribers","subscription_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/subscription","commits_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/contents/{+path}","compare_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/merges","archive_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/downloads","issues_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/issues{/number}","pulls_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/pulls{/number}","milestones_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/milestones{/number}","notifications_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/labels{/name}","releases_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/releases{/id}","deployments_url":"https://api.github.com/repos/ryepup/factorio_blueprint_editor/deployments","created_at":"2017-11-26T15:46:52Z","updated_at":"2017-11-26T15:46:54Z","pushed_at":"2017-12-03T00:52:27Z","git_url":"git://github.com/ryepup/factorio_blueprint_editor.git","ssh_url":"git@github.com:ryepup/factorio_blueprint_editor.git","clone_url":"https://github.com/ryepup/factorio_blueprint_editor.git","svn_url":"https://github.com/ryepup/factorio_blueprint_editor","homepage":null,"size":664,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"camerongillette:master","ref":"master","sha":"7523de921d3e783cdc8ebb84281ae08b74c3d8da","user":{"login":"camerongillette","id":571414,"avatar_url":"https://avatars2.githubusercontent.com/u/571414?v=4","gravatar_id":"","url":"https://api.github.com/users/camerongillette","html_url":"https://github.com/camerongillette","followers_url":"https://api.github.com/users/camerongillette/followers","following_url":"https://api.github.com/users/camerongillette/following{/other_user}","gists_url":"https://api.github.com/users/camerongillette/gists{/gist_id}","starred_url":"https://api.github.com/users/camerongillette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camerongillette/subscriptions","organizations_url":"https://api.github.com/users/camerongillette/orgs","repos_url":"https://api.github.com/users/camerongillette/repos","events_url":"https://api.github.com/users/camerongillette/events{/privacy}","received_events_url":"https://api.github.com/users/camerongillette/received_events","type":"User","site_admin":false},"repo":{"id":111503450,"name":"factorio_blueprint_editor","full_name":"camerongillette/factorio_blueprint_editor","owner":{"login":"camerongillette","id":571414,"avatar_url":"https://avatars2.githubusercontent.com/u/571414?v=4","gravatar_id":"","url":"https://api.github.com/users/camerongillette","html_url":"https://github.com/camerongillette","followers_url":"https://api.github.com/users/camerongillette/followers","following_url":"https://api.github.com/users/camerongillette/following{/other_user}","gists_url":"https://api.github.com/users/camerongillette/gists{/gist_id}","starred_url":"https://api.github.com/users/camerongillette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camerongillette/subscriptions","organizations_url":"https://api.github.com/users/camerongillette/orgs","repos_url":"https://api.github.com/users/camerongillette/repos","events_url":"https://api.github.com/users/camerongillette/events{/privacy}","received_events_url":"https://api.github.com/users/camerongillette/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camerongillette/factorio_blueprint_editor","description":"Online Editor for Elxeno's Factorio Blueprint Editor","fork":false,"url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor","forks_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/forks","keys_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/teams","hooks_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/hooks","issue_events_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/events{/number}","events_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/events","assignees_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/assignees{/user}","branches_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/branches{/branch}","tags_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/tags","blobs_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/statuses/{sha}","languages_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/languages","stargazers_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/stargazers","contributors_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/contributors","subscribers_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/subscribers","subscription_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/subscription","commits_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/contents/{+path}","compare_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/merges","archive_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/downloads","issues_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues{/number}","pulls_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls{/number}","milestones_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/milestones{/number}","notifications_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/labels{/name}","releases_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/releases{/id}","deployments_url":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/deployments","created_at":"2017-11-21T05:26:31Z","updated_at":"2017-12-02T23:27:49Z","pushed_at":"2017-12-03T00:52:28Z","git_url":"git://github.com/camerongillette/factorio_blueprint_editor.git","ssh_url":"git@github.com:camerongillette/factorio_blueprint_editor.git","clone_url":"https://github.com/camerongillette/factorio_blueprint_editor.git","svn_url":"https://github.com/camerongillette/factorio_blueprint_editor","homepage":null,"size":662,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":14,"open_issues":16,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48"},"html":{"href":"https://github.com/camerongillette/factorio_blueprint_editor/pull/48"},"issue":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/48"},"comments":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/camerongillette/factorio_blueprint_editor/statuses/e44cbb98f041eebc84c5edfeb55f5dd7f402ed5d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ryepup"}}