{"action":"created","comment":{"url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/comments/235113255","pull_request_review_id":176904596,"id":235113255,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTExMzI1NQ==","diff_hunk":"@@ -0,0 +1,142 @@\n+import { showOpenOrCreateDialog } from \"./components/open-or-create\";\n+import { showAbout } from \"./components/about\";\n+import { codapIframeSrc } from \"./codap-iframe-src\";\n+// CFM is added using script tag.\n+const CloudFileManager = (window as any).CloudFileManager;\n+\n+import \"../styles/index.sass\";\n+\n+const getQueryVariable = name => {\n+  const query = window.location.search.substring(1);\n+  const vars = query.split(\"&\");\n+  for (const variable of vars) {\n+    const pair = variable.split(\"=\");\n+    if (decodeURIComponent(pair[0]) === name) {\n+      return decodeURIComponent(pair[1]);\n+    }\n+  }\n+};\n+const updateQueryStringParameter = (key, value) => {","path":"src/code/index.tsx","position":19,"original_position":19,"commit_id":"e298becf7e2354857ac74a674cd95a93de30a07f","original_commit_id":"ddaf19506b2b3a6662faf056107b413d1ef51807","user":{"login":"dougmartin","id":112938,"node_id":"MDQ6VXNlcjExMjkzOA==","avatar_url":"https://avatars3.githubusercontent.com/u/112938?v=4","gravatar_id":"","url":"https://api.github.com/users/dougmartin","html_url":"https://github.com/dougmartin","followers_url":"https://api.github.com/users/dougmartin/followers","following_url":"https://api.github.com/users/dougmartin/following{/other_user}","gists_url":"https://api.github.com/users/dougmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmartin/subscriptions","organizations_url":"https://api.github.com/users/dougmartin/orgs","repos_url":"https://api.github.com/users/dougmartin/repos","events_url":"https://api.github.com/users/dougmartin/events{/privacy}","received_events_url":"https://api.github.com/users/dougmartin/received_events","type":"User","site_admin":false},"body":"Also can use `stringify` from `query-string` for much of this code.","created_at":"2018-11-20T18:11:16Z","updated_at":"2018-11-20T18:12:11Z","html_url":"https://github.com/concord-consortium/sage-modeler-site/pull/5#discussion_r235113255","pull_request_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/comments/235113255"},"html":{"href":"https://github.com/concord-consortium/sage-modeler-site/pull/5#discussion_r235113255"},"pull_request":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5","id":232411393,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDExMzkz","html_url":"https://github.com/concord-consortium/sage-modeler-site/pull/5","diff_url":"https://github.com/concord-consortium/sage-modeler-site/pull/5.diff","patch_url":"https://github.com/concord-consortium/sage-modeler-site/pull/5.patch","issue_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/5","number":5,"state":"open","locked":false,"title":"Simplify site setup, remove one one level of nested iframes","user":{"login":"pjanik","id":767857,"node_id":"MDQ6VXNlcjc2Nzg1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/767857?v=4","gravatar_id":"","url":"https://api.github.com/users/pjanik","html_url":"https://github.com/pjanik","followers_url":"https://api.github.com/users/pjanik/followers","following_url":"https://api.github.com/users/pjanik/following{/other_user}","gists_url":"https://api.github.com/users/pjanik/gists{/gist_id}","starred_url":"https://api.github.com/users/pjanik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjanik/subscriptions","organizations_url":"https://api.github.com/users/pjanik/orgs","repos_url":"https://api.github.com/users/pjanik/repos","events_url":"https://api.github.com/users/pjanik/events{/privacy}","received_events_url":"https://api.github.com/users/pjanik/received_events","type":"User","site_admin":false},"body":"[#162085672]\r\n[#162095299]\r\n\r\nThis PR removes app.html, app.tsx entry point, and all the related code. It means one level of iframes less and no need to pump post message events between CFM and CODAP. \r\n\r\nCODAP is embedded directly now. Its URL is generated by codap-iframe-src helper, pretty similar to the old React component.\r\n\r\n`index.ts` code can now be linted, type-checked, we can import modules and use them in a civilized way. I'll be able to reuse query-parameter helpers and use i18n system to translate CFM menu labels, when i18n module is available.\r\n\r\nWe can still render UI. There are two ways to do it. Through CFM: e.g. `open-or-create.tsx`. Another one is just using ReactDOM: `about.tsx`. Its helper function is pretty trivial. \r\n\r\nIf we ever need more UI, and some more complicated interactions going back and forth between index.ts entry point and components, we can simply create some top-level component with the React state. And/or render things using React Portals. There are many options, I don't think that the current approach is more limiting than previous.\r\n\r\nIs there anything I'm missing? I guess I might not understand some interactions and messages going back and forth between CFM and CODAP. I hope they still work.\r\n","created_at":"2018-11-20T18:04:14Z","updated_at":"2018-11-20T18:12:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db04d4cbef8c89afd72d589ede869c5e565b7beb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5/commits","review_comments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5/comments","review_comment_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/5/comments","statuses_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/statuses/e298becf7e2354857ac74a674cd95a93de30a07f","head":{"label":"concord-consortium:162095299-less-iframes","ref":"162095299-less-iframes","sha":"e298becf7e2354857ac74a674cd95a93de30a07f","user":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":155418220,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU0MTgyMjA=","name":"sage-modeler-site","full_name":"concord-consortium/sage-modeler-site","private":false,"owner":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/concord-consortium/sage-modeler-site","description":null,"fork":false,"url":"https://api.github.com/repos/concord-consortium/sage-modeler-site","forks_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/forks","keys_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/teams","hooks_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/events","assignees_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/tags","blobs_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/subscription","commits_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/merges","archive_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/downloads","issues_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/releases{/id}","deployments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/deployments","created_at":"2018-10-30T16:19:43Z","updated_at":"2018-11-20T16:53:26Z","pushed_at":"2018-11-20T18:09:56Z","git_url":"git://github.com/concord-consortium/sage-modeler-site.git","ssh_url":"git@github.com:concord-consortium/sage-modeler-site.git","clone_url":"https://github.com/concord-consortium/sage-modeler-site.git","svn_url":"https://github.com/concord-consortium/sage-modeler-site","homepage":null,"size":189,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"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":0,"default_branch":"master"}},"base":{"label":"concord-consortium:master","ref":"master","sha":"74ea022347a05dd5358f495c1c6f844f133b4ff6","user":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":155418220,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU0MTgyMjA=","name":"sage-modeler-site","full_name":"concord-consortium/sage-modeler-site","private":false,"owner":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/concord-consortium/sage-modeler-site","description":null,"fork":false,"url":"https://api.github.com/repos/concord-consortium/sage-modeler-site","forks_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/forks","keys_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/teams","hooks_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/events","assignees_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/tags","blobs_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/subscription","commits_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/merges","archive_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/downloads","issues_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/releases{/id}","deployments_url":"https://api.github.com/repos/concord-consortium/sage-modeler-site/deployments","created_at":"2018-10-30T16:19:43Z","updated_at":"2018-11-20T16:53:26Z","pushed_at":"2018-11-20T18:09:56Z","git_url":"git://github.com/concord-consortium/sage-modeler-site.git","ssh_url":"git@github.com:concord-consortium/sage-modeler-site.git","clone_url":"https://github.com/concord-consortium/sage-modeler-site.git","svn_url":"https://github.com/concord-consortium/sage-modeler-site","homepage":null,"size":189,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5"},"html":{"href":"https://github.com/concord-consortium/sage-modeler-site/pull/5"},"issue":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/5"},"comments":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/concord-consortium/sage-modeler-site/statuses/e298becf7e2354857ac74a674cd95a93de30a07f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dougmartin"}}